airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-php-gateway] 03/03: AIRAVATA-2571 User enabled instead of email verified
Date Wed, 13 Dec 2017 20:27:25 GMT
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-php-gateway.git

commit 44bd55e70020e91150fcbb8fc5d3854bcd850223
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Wed Dec 13 15:27:12 2017 -0500

    AIRAVATA-2571 User enabled instead of email verified
---
 app/libraries/Keycloak/Keycloak.php    | 6 ++++--
 app/views/admin/manage-users.blade.php | 7 ++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/app/libraries/Keycloak/Keycloak.php b/app/libraries/Keycloak/Keycloak.php
index 5315c6e..46b5c94 100644
--- a/app/libraries/Keycloak/Keycloak.php
+++ b/app/libraries/Keycloak/Keycloak.php
@@ -259,7 +259,8 @@ class Keycloak {
         $users = $this->users->getUsers($this->realm);
         $usernames = [];
         foreach ($users as $user) {
-            array_push($usernames, (object)["firstName"=>$user->firstName,"lastName"=>$user->lastName,"email"=>$user->email,"emailVerified"=>$user->emailVerified,"userName"=>$user->username]);
+            Log::debug("user", array($user));
+            array_push($usernames, (object)["firstName"=>$user->firstName,"lastName"=>$user->lastName,"email"=>$user->email,"userEnabled"=>$user->enabled,"userName"=>$user->username]);
         }
         return $usernames;
     }
@@ -275,7 +276,7 @@ class Keycloak {
         $users = $this->users->searchUsers($this->realm, $phrase);
         $usernames = [];
         foreach ($users as $user) {
-            array_push($usernames, (object)["firstName"=>$user->firstName,"lastName"=>$user->lastName,"email"=>$user->email,"userName"=>$user->username]);
+            array_push($usernames, (object)["firstName"=>$user->firstName,"lastName"=>$user->lastName,"email"=>$user->email,"userEnabled"=>$user->enabled,"userName"=>$user->username]);
         }
         return $usernames;
     }
@@ -374,6 +375,7 @@ class Keycloak {
             $result["email"] = $user->email;
             $result["firstname"] = $user->firstName;
             $result["lastname"] = $user->lastName;
+            $result["userEnabled"] = $user->enabled;
             return $result;
         }else{
             return [];
diff --git a/app/views/admin/manage-users.blade.php b/app/views/admin/manage-users.blade.php
index 166ca0f..e2affb8 100644
--- a/app/views/admin/manage-users.blade.php
+++ b/app/views/admin/manage-users.blade.php
@@ -58,7 +58,7 @@
                         <th>Last Name</th>
                         <th>Username</th>
                         <th>Email</th>
-                        <th>Email Verified</th>
+                        <th>User Enabled</th>
 
                         <th>
                             Role :
@@ -86,14 +86,15 @@
                         <td>{{ $user->lastName }}</td>
                         <td>{{ $user->userName }}</td>
                         <td>{{ $user->email }}</td>
-                        @if($user->emailVerified)
+                        @if($user->userEnabled)
                             <td class="text-success"><span class="glyphicon glyphicon-ok"></span></td>
                         @else
                             <td class="text-danger"><span class="glyphicon glyphicon-remove"></span></td>
                         @endif
                         <td>
                             <button class="button btn btn-default check-roles" type="button"
-                                    data-username="{{$user->userName}}">Check All Roles
+                                    data-username="{{$user->userName}}"
+                                    @if(!$user->userEnabled)disabled @endif>Check All
Roles
                             </button>
                             <div class="user-roles"></div>
                         </td>

-- 
To stop receiving notification emails like this one, please contact
"commits@airavata.apache.org" <commits@airavata.apache.org>.

Mime
View raw message