From 5263cf00a253891396c442fe5be29762fb8be50d Mon Sep 17 00:00:00 2001 From: EoleDev Date: Tue, 26 Apr 2016 20:42:31 +0200 Subject: Refactoring of comments beginning --- server/core/Identity.php | 1413 ++++++++++++++++++---------------------------- 1 file changed, 535 insertions(+), 878 deletions(-) (limited to 'server/core/Identity.php') diff --git a/server/core/Identity.php b/server/core/Identity.php index 464522a..f6179b0 100755 --- a/server/core/Identity.php +++ b/server/core/Identity.php @@ -7,15 +7,13 @@ * * @author Eole 'eoledev at outlook . fr' * -* @todo Complete the functions and finish the descriptions */ use OpenCloud\Common\Error; - + /** * Identity Class of the back-end application * -* This class allow the communication between the front-end application and -* the library which allow to send requests to an Openstack instance. +* This class implements the management for the identity request * */ class identity implements Core{ @@ -31,8 +29,6 @@ class identity implements Core{ * * @param App $app the main app object * - * @throws [Type] [] - * * @return identity */ public function __construct($app){ @@ -47,11 +43,11 @@ class identity implements Core{ * * @param String $action name of another function of this class * - * @return void + * @return NULL */ public function action($action){ - $this->{$action.""}(); + $this->{$action.""}(); } /** @@ -65,7 +61,7 @@ class identity implements Core{ * @param String $type Required Type of credential : ec2, cert... * @param String $userId Required Id of the user which own the credential * - * @return void + * @return NULL */ private function addCredential(){ @@ -88,22 +84,22 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * List the credentials for a given user. * - * @return void + * @return NULL */ private function listCredentials(){ try{ @@ -114,15 +110,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } @@ -131,7 +127,7 @@ class identity implements Core{ * * @param String $credentialId Required credential id for which it retrieve the details * - * @return void + * @return NULL */ private function showCredential(){ $credentId = $this->app->getPostParam("credentialId"); @@ -149,15 +145,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } @@ -168,7 +164,7 @@ class identity implements Core{ * @param JsonString $blob Required credentials information with this structure for ec2: "{\"access\":\"181920\",\"secret\":\"secretKey\"}" * @param String $type Required Type of credential : ec2, cert... * - * @return void + * @return NULL */ private function updateCredential(){ @@ -194,15 +190,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** @@ -210,7 +206,7 @@ class identity implements Core{ * * @param String $credentialId Required credential id to delete * - * @return void + * @return NULL */ private function deleteCredential(){ @@ -229,16 +225,16 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + }- /** @@ -248,7 +244,7 @@ class identity implements Core{ * @param String $enabled Optional Domain enabled or not : value true or false * @param String $name Required Domain Name * - * @return void + * @return NULL */ private function addDomain(){ @@ -262,13 +258,13 @@ class identity implements Core{ } if(isset($enabled) && isset($description)) - $opt = array('description' => $description, 'enabled' => $enabled, 'name' => $name); + $opt = array('description' => $description, 'enabled' => $enabled, 'name' => $name); elseif(isset($enabled)) - $opt = array('enabled' => $enabled, 'name' => $name); + $opt = array('enabled' => $enabled, 'name' => $name); elseif(isset($description)) - $opt = array('description' => $description, 'name' => $name); + $opt = array('description' => $description, 'name' => $name); else - $opt = array('name' => $name); + $opt = array('name' => $name); try{ @@ -278,22 +274,22 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the different domain's list. * - * @return void + * @return NULL */ private function listDomains(){ @@ -305,15 +301,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } @@ -322,7 +318,7 @@ class identity implements Core{ * * @param String $domainId Required Domain id for which it retrieve the details * - * @return void + * @return NULL */ private function showDomain(){ @@ -341,15 +337,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** @@ -360,7 +356,7 @@ class identity implements Core{ * @param String $enabled Optional Domain enabled or not : value true or false * @param String $name Required Domain Name * - * @return void + * @return NULL */ private function updateDomain(){ @@ -374,17 +370,17 @@ class identity implements Core{ return; } - + try{ $domain = $this->libClass->getDomain($domId); if(isset($name)) - $domain->name = $name; + $domain->name = $name; if(isset($enabled)) - $domain->enabled = $enabled; + $domain->enabled = $enabled; if(isset($description)) - $domain->description = $description; + $domain->description = $description; $domain->update(); @@ -392,15 +388,15 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** @@ -408,7 +404,7 @@ class identity implements Core{ * * @param String $domainId Required Domain id to delete * - * @return void + * @return NULL */ private function deleteDomain(){ @@ -427,23 +423,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the different roles of a given user in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listRolesDomainUser(){ @@ -464,23 +458,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Grant a role to a given user in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function grantRoleDomainUser(){ $domId = $this->app->getPostParam("domainId"); @@ -496,31 +488,29 @@ class identity implements Core{ $domain = $this->libClass->getDomain($domId); $domain->grantUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Verify that a user has a given role in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function checkRoleDomainUser(){ $domId = $this->app->getPostParam("domainId"); @@ -545,23 +535,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a role for a given user in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function revokeRoleDomainUser(){ $domId = $this->app->getPostParam("domainId"); @@ -577,31 +565,29 @@ class identity implements Core{ $domain = $this->libClass->getDomain($domId); $domain->revokeUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the roles of a given group in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listRolesDomainGroup(){ $domId = $this->app->getPostParam("domainId"); @@ -622,23 +608,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a role to a given group in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function grantRoleDomainGroup(){ $domId = $this->app->getPostParam("domainId"); @@ -654,31 +638,29 @@ class identity implements Core{ $domain = $this->libClass->getDomain($domId); $domain->grantGroupRole([ - 'groupId' => $groupId, - 'roleId' => $roleId, + 'groupId' => $groupId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Verify that a role is associated with a given group in a domain. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function checkRoleDomainGroup(){ $domId = $this->app->getPostParam("domainId"); @@ -703,29 +685,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a role for a given group in a domain. * - * A *description*, that can span multiple lines, to go _in-depth_ into the details of this element - * and to provide some background information or textual references. - * - * @param string $myArgument With a *description* of this argument, these may also - * span multiple lines. - * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function revokeRoleDomainGroup(){ $domId = $this->app->getPostParam("domainId"); @@ -741,8 +715,8 @@ class identity implements Core{ $domain = $this->libClass->getDomain($roleId); $domain->revokeGroupRole([ - 'groupId' => $groupId, - 'roleId' => $roleId, + 'groupId' => $groupId, + 'roleId' => $roleId, ]); @@ -750,23 +724,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add an endpoint to the Openstack instance * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addEndpoint(){ $servId = $this->app->getPostParam("serviceId"); @@ -781,34 +753,32 @@ class identity implements Core{ try{ $endpoint = $this->libClass->createEndpoint([ - 'interface' => \OpenStack\Identity\v3\Enum::INTERFACE_INTERNAL, - 'name' => $name, - 'region' => $region, - 'url' => $url, - 'serviceId' => $servId + 'interface' => \OpenStack\Identity\v3\Enum::INTERFACE_INTERNAL, + 'name' => $name, + 'region' => $region, + 'url' => $url, + 'serviceId' => $servId ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the endpoint for the given id * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function getEndpoint(){ @@ -826,24 +796,24 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the list of the different endpoints * - * @return void + * @return NULL */ private function listEndpoints(){ - + try{ $res = $this->libClass->listEndpoints(); @@ -852,64 +822,30 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Update a given endpoint * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function updateEndpoint(){ //Not Implemented Yet - - /*$domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - - //TODO PARAMETERS - try{ - - $endpoint = $this->libClass->getEndpoint('{endpointId}'); - - $endpoint->interface = \OpenStack\Identity\v3\Enum::INTERFACE_PUBLIC; - - $endpoint->update(); - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * Delete a given endpoint * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deleteEndpoint(){ $endId = $this->app->getPostParam("endpointId"); @@ -927,129 +863,48 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addGroup(){ //Not Implemented Yet - - /*$domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * Retrieve the group's list. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listGroups(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * Retrieve the details of a given group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function showGroup(){ //Not Implemented Yet - - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * Update a given group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function updateGroup(){ //Todo Argument Optional @@ -1066,9 +921,9 @@ class identity implements Core{ $group = $this->libClass->getGroup($groupId); if(isset($description)) - $group->description = 'foo'; + $group->description = 'foo'; if(isset($name)) - $group->name = 'bar'; + $group->name = 'bar'; $group->update(); @@ -1076,23 +931,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete the given group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deleteGroup(){ @@ -1112,23 +965,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the users of a given group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listGroupUsers(){ @@ -1148,23 +999,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a user to a group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addGroupUser(){ @@ -1185,23 +1034,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Remove a user from a given group. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function removeGroupUser(){ @@ -1222,23 +1069,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Check if a group contains a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function checkGroupUser(){ @@ -1259,199 +1104,67 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * @todo * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addPolicies(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * @todo * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listPolicies(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * @todo * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function showPolicie(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * @todo * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function updatePolicies(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * @todo * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deletePolicies(){ //Not Implemented Yet - /* - $domId = $this->app->getPostParam("domainId"); - $groupId = $this->app->getPostParam("groupId"); - - if(!isset($domId) || !isset($groupId)){ - - } - try{ - - $this->libClass->listCredentials() - - //TODO parse answer - - }catch(BadResponseError $e){ - $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ - $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ - $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ - $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }*/ } /** * Add a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addProject(){ //Todo Parameters Optional @@ -1465,30 +1178,30 @@ class identity implements Core{ try{ $project = $this->libClass->createProject([ - 'description' => $description, - 'enabled' => true, - 'name' => $name + 'description' => $description, + 'enabled' => true, + 'name' => $name ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the different projects. * - * @return void + * @return NULL */ private function listProjects(){ @@ -1500,23 +1213,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the details of a given project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function showProject(){ @@ -1535,23 +1246,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Update a given project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function updateProject(){ //Todo Parameters Optionnal @@ -1577,23 +1286,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a given project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deleteProject(){ $projId = $this->app->getPostParam("projId"); @@ -1612,23 +1319,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * List the roles of a given user in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listRolesProjectUser(){ @@ -1649,25 +1354,23 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Grant a role to an user in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function grantRoleProjectUser(){ @@ -1684,31 +1387,29 @@ class identity implements Core{ $project = $this->libClass->getProject($projId); $project->grantUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Check if a given user has a role in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function checkRoleProjectUser(){ $projId = $this->app->getPostParam("projetId"); @@ -1724,8 +1425,8 @@ class identity implements Core{ $project = $this->libClass->getProject($projId); $result = $project->checkUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); /*if (true === $result) { @@ -1735,23 +1436,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a role for a given user in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function revokeRoleProjectUser(){ @@ -1768,31 +1467,29 @@ class identity implements Core{ $project = $this->libClass->getProject($projId); $project->revokeUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * List the roles of a group in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listRolesProjectGroup(){ @@ -1803,7 +1500,7 @@ class identity implements Core{ if(!isset($projId) || !isset($groupId)){ } - + try{ $project = $this->libClass->getProject($projId); @@ -1814,23 +1511,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a role to a group in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function grantRoleProjectGroup(){ @@ -1841,37 +1536,35 @@ class identity implements Core{ if(!isset($projId) || !isset($userId) || !isset($roleId)){ } - + try{ $project = $this->libClass->getProject($projId); $project->grantUserRole([ - 'userId' => $userId, - 'roleId' => $roleId, + 'userId' => $userId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Check if a group has a given role in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function checkRoleProjectGroup(){ @@ -1888,8 +1581,8 @@ class identity implements Core{ $project = $this->libClass->getProject($projId); $result = $project->checkGroupRole([ - 'groupId' => $groupId, - 'roleId' => $roleId, + 'groupId' => $groupId, + 'roleId' => $roleId, ]); /*if (true === $result) { @@ -1898,23 +1591,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a role for a group in a project. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function revokeRoleProjectGroup(){ @@ -1931,31 +1622,29 @@ class identity implements Core{ $project = $this->libClass->getProject($projId); $project->revokeGroupRole([ - 'groupId' => $groupId, - 'roleId' => $roleId, + 'groupId' => $groupId, + 'roleId' => $roleId, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a role. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addRole(){ @@ -1968,28 +1657,28 @@ class identity implements Core{ try{ $role = $this->libClass->createRole([ - 'name' => $name, + 'name' => $name, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * List the different roles * - * @return void + * @return NULL */ private function listRoles(){ @@ -2001,21 +1690,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** - * @todo + * List the different assignments for a given role * - * @return void + * @return NULL */ private function listRoleAssignements(){ @@ -2027,23 +1716,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a service. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addService(){ $name = $this->app->getPostParam("name"); @@ -2056,29 +1743,29 @@ class identity implements Core{ try{ $service = $this->libClass->createService([ - 'name' => $name, - 'type' => $type, + 'name' => $name, + 'type' => $type, ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the different services. * - * @return void + * @return NULL */ private function listServices(){ @@ -2090,23 +1777,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the details for a given service. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function showService(){ $servId = $this->app->getPostParam("serviceId"); @@ -2123,23 +1808,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a given service. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deleteService(){ @@ -2159,23 +1842,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Generate a new token for a given user id. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function genTokenUserID(){ @@ -2189,33 +1870,31 @@ class identity implements Core{ try{ $token = $this->libClass->generateToken([ - 'user' => [ - 'id' => $userId, - 'password' => $userPass - ] + 'user' => [ + 'id' => $userId, + 'password' => $userPass + ] ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Generate a new token for a given user name. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function genTokenUserName(){ $username = $this->app->getPostParam("username"); @@ -2230,36 +1909,34 @@ class identity implements Core{ try{ $token = $this->libClass->generateToken([ - 'user' => [ - 'name' => $username, - 'password' => $userPass, - 'domain' => [ - 'id' => $domId - ] - ] + 'user' => [ + 'name' => $username, + 'password' => $userPass, + 'domain' => [ + 'id' => $domId + ] + ] ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Generate a new token from another token ID. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function genTokenID(){ @@ -2273,31 +1950,29 @@ class identity implements Core{ try{ $token = $this->libClass->generateToken([ - 'tokenId' => $tokenId, - 'scope' => ['project' => ['id' => $projectId]] + 'tokenId' => $tokenId, + 'scope' => ['project' => ['id' => $projectId]] ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Generate a new token scoped by a project ID. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function genTokenScopedProjectID(){ @@ -2312,36 +1987,34 @@ class identity implements Core{ try{ $token = $this->libClass->generateToken([ - 'user' => [ - 'id' => $userId, - 'password' => $userPass - ], - 'scope' => [ - 'project' => ['id' => $projId] - ] + 'user' => [ + 'id' => $userId, + 'password' => $userPass + ], + 'scope' => [ + 'project' => ['id' => $projId] + ] ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Generate a new token scoped by a project name. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function genTokenScopedProjectName(){ @@ -2357,41 +2030,39 @@ class identity implements Core{ try{ $token = $this->libClass->generateToken([ - 'user' => [ - 'id' => $userId, - 'password' => $userPass - ], - 'scope' => [ - 'project' => [ - 'name' => $projName, - 'domain' => [ - 'id' => $domId - ] - ] - ] + 'user' => [ + 'id' => $userId, + 'password' => $userPass + ], + 'scope' => [ + 'project' => [ + 'name' => $projName, + 'domain' => [ + 'id' => $domId + ] + ] + ] ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Check if a token is validate. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function validateToken(){ @@ -2413,23 +2084,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a given token. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function revokeToken(){ @@ -2447,23 +2116,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Add a new user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function addUser(){ //Todo Optionnal Parameter @@ -2475,40 +2142,40 @@ class identity implements Core{ $domId = $this->app->getPostParam("domId"); if(!isset($domId) || !isset($groupId)){ - + } try{ $user = $this->libClass->createUser([ - 'defaultProjectId' => $projId, - 'description' => $desc, - 'domainId' => $domId, - 'email' => $email, - 'enabled' => true, - 'name' => $name, - 'password' => $pass + 'defaultProjectId' => $projId, + 'description' => $desc, + 'domainId' => $domId, + 'email' => $email, + 'enabled' => true, + 'name' => $name, + 'password' => $pass ]); //TODO parse answer }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the different users. * - * @return void + * @return NULL */ private function listUsers(){ @@ -2520,23 +2187,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the details of a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function showUser(){ @@ -2555,23 +2220,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Update a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function updateUser(){ @@ -2596,23 +2259,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Delete a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function deleteUser(){ @@ -2631,23 +2292,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the groups which contains a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listUserGroups(){ @@ -2667,23 +2326,21 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } /** * Retrieve the projects which contains a given user. * - * @throws [Type] [] - * - * @return void + * @return NULL */ private function listUserProjects(){ @@ -2703,14 +2360,14 @@ class identity implements Core{ }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } } } -- cgit v1.2.3