summaryrefslogtreecommitdiff
path: root/server/core/Identity.php
diff options
context:
space:
mode:
Diffstat (limited to 'server/core/Identity.php')
-rwxr-xr-xserver/core/Identity.php34
1 files changed, 30 insertions, 4 deletions
diff --git a/server/core/Identity.php b/server/core/Identity.php
index 7b6293c..1dc8373 100755
--- a/server/core/Identity.php
+++ b/server/core/Identity.php
@@ -9,7 +9,7 @@
*
* @todo Complete the functions and finish the descriptions
*/
-
+use OpenStack\Common\Error;
/**
* Identity Class of the back-end application
@@ -59,6 +59,25 @@ class identity implements Core{
*/
$credentials["addCredential"] = function(){
+ $blob = $this->app->getPostParam("blob");
+ $projectId = $this->app->getPostParam("projectId");
+ $type = $this->app->getPostParam("type");
+ $userId = $this->app->getPostParam("userId");
+
+ if(!isset($blob) || !isset($projectId) || !isset($type) || !isset($userId)){
+ $this->app->setOutput("Error", "Parameters Incorrect");
+ }
+
+ try{
+
+ $opt = array('blob' => $blob, 'projectId' => $projectId, 'type' => $type, 'userId' => $userId);
+ $res = $this->libClass->createCredential($opt);
+
+ }catch(Exception $e){
+
+ }
+
+ ]
}
@@ -82,7 +101,8 @@ class identity implements Core{
* @return void
*/
$credentials["showCredential"] = function(){
-
+ $credential = $identity->getCredential('credentialId');
+$credential->retrieve();
}
@@ -94,7 +114,12 @@ class identity implements Core{
* @return void
*/
$credentials["updateCredential"] = function(){
-
+ $credential = $identity->getCredential('credentialId');
+
+$credential->type = 'foo';
+$credential->blob = 'bar';
+
+$credential->update();
}
@@ -106,7 +131,8 @@ class identity implements Core{
* @return void
*/
$credentials["deleteCredential"] = function(){
-
+ $credential = $identity->getCredential('credentialId');
+$credential->delete();
}