airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [13/50] [abbrv] airavata-php-gateway git commit: fixing minor issue in usernameExists
Date Fri, 16 Jun 2017 20:36:16 GMT
fixing minor issue in usernameExists


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/501460fc
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/501460fc
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/501460fc

Branch: refs/heads/develop
Commit: 501460fc70689a28650bd4ce355823525c91c642
Parents: f83e0e5
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Mar 24 13:20:27 2017 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Mar 24 13:20:27 2017 -0400

----------------------------------------------------------------------
 app/libraries/Keycloak/Keycloak.php | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/501460fc/app/libraries/Keycloak/Keycloak.php
----------------------------------------------------------------------
diff --git a/app/libraries/Keycloak/Keycloak.php b/app/libraries/Keycloak/Keycloak.php
index 819541d..aeac3ad 100644
--- a/app/libraries/Keycloak/Keycloak.php
+++ b/app/libraries/Keycloak/Keycloak.php
@@ -221,10 +221,10 @@ class Keycloak {
 
     /**
      * Function to get the user profile of a user
-     * @param $user_id
+     * @param $username
      */
-    public function getUserProfile($user_id){
-        $user = $this->users->getUser($this->realm, $user_id);
+    public function getUserProfile($username){
+        $user = $this->users->getUser($this->realm, $username);
         $result = [];
         $result["email"] = $user->email;
         $result["firstname"] = $user->firstName;
@@ -239,8 +239,8 @@ class Keycloak {
      */
     public function usernameExists($user_id){
         try{
-            $user = $this->users->getUser($this->realm, $user_id);
-            return $user != null;
+            $users = $this->users->getUsers($this->realm, $user_id);
+            return $users != null && len($users) > 0;
         }catch (Exception $ex){
             // Username does not exists
             return false;


Mime
View raw message