summaryrefslogtreecommitdiff
path: root/server/core/Identity.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/core/Identity.php')
-rwxr-xr-xserver/core/Identity.php1286
1 files changed, 474 insertions, 812 deletions
diff --git a/server/core/Identity.php b/server/core/Identity.php
index 464522a..112c9e3 100755
--- a/server/core/Identity.php
+++ b/server/core/Identity.php
@@ -2,21 +2,24 @@
/**
* File containing the identity Class.
*
-* @version 1.0 Initialisation of this file
-* @since 1.0 Core application's file
-*
-* @author Eole 'eoledev at outlook . fr'
-*
-* @todo Complete the functions and finish the descriptions
+*/
+
+/**
+* Import the Error of the Library
*/
use OpenCloud\Common\Error;
-
+
+include("CoreInterface.php");
/**
* 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
*
+* @version 1.0 Initialisation of this file
+* @since 1.0 Core application's file
+*
+* @author Eole 'eoledev at outlook . fr'
+*
*/
class identity implements Core{
@@ -31,9 +34,7 @@ class identity implements Core{
*
* @param App $app the main app object
*
- * @throws [Type] [<description>]
- *
- * @return identity
+ * @return identity Object
*/
public function __construct($app){
@@ -51,7 +52,7 @@ class identity implements Core{
*/
public function action($action){
- $this->{$action.""}();
+ $this->{$action.""}();
}
/**
@@ -88,15 +89,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);
+ }
}
@@ -114,15 +115,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);
+ }
}
@@ -149,15 +150,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);
+ }
}
@@ -194,15 +195,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);
+ }
}
/**
@@ -229,16 +230,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);
+ }
+
}-
/**
@@ -262,13 +263,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,15 +279,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);
+ }
}
@@ -305,15 +306,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);
+ }
}
@@ -341,15 +342,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);
+ }
}
/**
@@ -374,17 +375,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 +393,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);
+ }
}
/**
@@ -427,22 +428,20 @@ 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] [<description>]
- *
* @return void
*/
private function listRolesDomainUser(){
@@ -464,22 +463,20 @@ 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] [<description>]
- *
* @return void
*/
private function grantRoleDomainUser(){
@@ -496,30 +493,28 @@ 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] [<description>]
- *
* @return void
*/
private function checkRoleDomainUser(){
@@ -545,22 +540,20 @@ 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] [<description>]
- *
* @return void
*/
private function revokeRoleDomainUser(){
@@ -577,30 +570,28 @@ 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] [<description>]
- *
* @return void
*/
private function listRolesDomainGroup(){
@@ -622,22 +613,20 @@ 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] [<description>]
- *
* @return void
*/
private function grantRoleDomainGroup(){
@@ -654,30 +643,28 @@ 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] [<description>]
- *
* @return void
*/
private function checkRoleDomainGroup(){
@@ -703,28 +690,20 @@ 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] [<description>]
- *
* @return void
*/
private function revokeRoleDomainGroup(){
@@ -741,8 +720,8 @@ class identity implements Core{
$domain = $this->libClass->getDomain($roleId);
$domain->revokeGroupRole([
- 'groupId' => $groupId,
- 'roleId' => $roleId,
+ 'groupId' => $groupId,
+ 'roleId' => $roleId,
]);
@@ -750,22 +729,20 @@ 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] [<description>]
- *
* @return void
*/
private function addEndpoint(){
@@ -781,33 +758,31 @@ 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] [<description>]
- *
* @return void
*/
private function getEndpoint(){
@@ -826,15 +801,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);
+ }
}
/**
@@ -843,7 +818,7 @@ class identity implements Core{
* @return void
*/
private function listEndpoints(){
-
+
try{
$res = $this->libClass->listEndpoints();
@@ -852,63 +827,29 @@ 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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
private function deleteEndpoint(){
@@ -927,128 +868,47 @@ 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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
private function updateGroup(){
@@ -1066,9 +926,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,22 +936,20 @@ 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] [<description>]
- *
* @return void
*/
private function deleteGroup(){
@@ -1112,22 +970,20 @@ 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] [<description>]
- *
* @return void
*/
private function listGroupUsers(){
@@ -1148,22 +1004,20 @@ 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] [<description>]
- *
* @return void
*/
private function addGroupUser(){
@@ -1185,22 +1039,20 @@ 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] [<description>]
- *
* @return void
*/
private function removeGroupUser(){
@@ -1222,22 +1074,20 @@ 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] [<description>]
- *
* @return void
*/
private function checkGroupUser(){
@@ -1259,198 +1109,66 @@ 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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
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] [<description>]
- *
* @return void
*/
private function addProject(){
@@ -1465,24 +1183,24 @@ 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);
+ }
}
/**
@@ -1500,22 +1218,20 @@ 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] [<description>]
- *
* @return void
*/
private function showProject(){
@@ -1535,22 +1251,20 @@ 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] [<description>]
- *
* @return void
*/
private function updateProject(){
@@ -1577,22 +1291,20 @@ 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] [<description>]
- *
* @return void
*/
private function deleteProject(){
@@ -1612,22 +1324,20 @@ 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] [<description>]
- *
* @return void
*/
private function listRolesProjectUser(){
@@ -1649,24 +1359,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);
- }
+ }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] [<description>]
- *
* @return void
*/
private function grantRoleProjectUser(){
@@ -1684,30 +1392,28 @@ 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] [<description>]
- *
* @return void
*/
private function checkRoleProjectUser(){
@@ -1724,8 +1430,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,22 +1441,20 @@ 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] [<description>]
- *
* @return void
*/
private function revokeRoleProjectUser(){
@@ -1768,30 +1472,28 @@ 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] [<description>]
- *
* @return void
*/
private function listRolesProjectGroup(){
@@ -1803,7 +1505,7 @@ class identity implements Core{
if(!isset($projId) || !isset($groupId)){
}
-
+
try{
$project = $this->libClass->getProject($projId);
@@ -1814,22 +1516,20 @@ 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] [<description>]
- *
* @return void
*/
private function grantRoleProjectGroup(){
@@ -1841,36 +1541,34 @@ 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] [<description>]
- *
* @return void
*/
private function checkRoleProjectGroup(){
@@ -1888,8 +1586,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,22 +1596,20 @@ 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] [<description>]
- *
* @return void
*/
private function revokeRoleProjectGroup(){
@@ -1931,30 +1627,28 @@ 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] [<description>]
- *
* @return void
*/
private function addRole(){
@@ -1968,22 +1662,22 @@ 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);
+ }
}
/**
@@ -2001,19 +1695,19 @@ 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
*/
@@ -2027,22 +1721,20 @@ 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] [<description>]
- *
* @return void
*/
private function addService(){
@@ -2056,23 +1748,23 @@ 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);
+ }
}
/**
@@ -2090,22 +1782,20 @@ 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] [<description>]
- *
* @return void
*/
private function showService(){
@@ -2123,22 +1813,20 @@ 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] [<description>]
- *
* @return void
*/
private function deleteService(){
@@ -2159,22 +1847,20 @@ 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] [<description>]
- *
* @return void
*/
private function genTokenUserID(){
@@ -2189,32 +1875,30 @@ 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] [<description>]
- *
* @return void
*/
private function genTokenUserName(){
@@ -2230,35 +1914,33 @@ 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] [<description>]
- *
* @return void
*/
private function genTokenID(){
@@ -2273,30 +1955,28 @@ 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] [<description>]
- *
* @return void
*/
private function genTokenScopedProjectID(){
@@ -2312,35 +1992,33 @@ 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] [<description>]
- *
* @return void
*/
private function genTokenScopedProjectName(){
@@ -2357,40 +2035,38 @@ 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] [<description>]
- *
* @return void
*/
private function validateToken(){
@@ -2413,22 +2089,20 @@ 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] [<description>]
- *
* @return void
*/
private function revokeToken(){
@@ -2447,22 +2121,20 @@ 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] [<description>]
- *
* @return void
*/
private function addUser(){
@@ -2475,34 +2147,34 @@ 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);
+ }
}
/**
@@ -2520,22 +2192,20 @@ 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] [<description>]
- *
* @return void
*/
private function showUser(){
@@ -2555,22 +2225,20 @@ 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] [<description>]
- *
* @return void
*/
private function updateUser(){
@@ -2596,22 +2264,20 @@ 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] [<description>]
- *
* @return void
*/
private function deleteUser(){
@@ -2631,22 +2297,20 @@ 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] [<description>]
- *
* @return void
*/
private function listUserGroups(){
@@ -2667,22 +2331,20 @@ 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] [<description>]
- *
* @return void
*/
private function listUserProjects(){
@@ -2703,14 +2365,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);
+ }
}
}