You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/10/18 03:54:36 UTC

[1/2] airavata-php-gateway git commit: AIRAVATA-2164 Remove pending role from user when given access

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 555cf68a3 -> 26ed2cfda


AIRAVATA-2164 Remove pending role from user when given access


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/f41820ea
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/f41820ea
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/f41820ea

Branch: refs/heads/develop
Commit: f41820eae9e2cc48e7a8993dab60b0d3f84aec3d
Parents: 6254204
Author: Marcus Christie <ma...@gmail.com>
Authored: Fri Oct 7 15:49:21 2016 -0400
Committer: Marcus Christie <ma...@gmail.com>
Committed: Thu Oct 13 08:42:17 2016 -0400

----------------------------------------------------------------------
 app/controllers/AdminController.php | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/f41820ea/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index b66b5a4..91156c1 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -213,12 +213,20 @@ class AdminController extends BaseController {
 
         $username = Input::all()["username"];
         WSIS::updateUserRoles($username, $roles);
-		$roles = WSIS::getUserRoles(Input::get("username"));
-		if(in_array(Config::get("pga_config.wsis")["admin-role-name"], $roles) || in_array(Config::get("pga_config.wsis")["read-only-admin-role-name"], $roles)
-			|| in_array(Config::get("pga_config.wsis")["user-role-name"], $roles)){
-			$userProfile = WSIS::getUserProfile(Input::get("username"));
-			$recipients = array($userProfile["email"]);
-			$this->sendAccessGrantedEmailToTheUser(Input::get("username"), $recipients);
+        $newCurrentRoles = WSIS::getUserRoles(Input::get("username"));
+        if(in_array(Config::get("pga_config.wsis")["admin-role-name"], $newCurrentRoles) || in_array(Config::get("pga_config.wsis")["read-only-admin-role-name"], $newCurrentRoles)
+                || in_array(Config::get("pga_config.wsis")["user-role-name"], $newCurrentRoles)){
+            $userProfile = WSIS::getUserProfile(Input::get("username"));
+            $recipients = array($userProfile["email"]);
+            $this->sendAccessGrantedEmailToTheUser(Input::get("username"), $recipients);
+
+            // remove the pending role when access is granted, unless
+            // the admin is trying to add the user to the pending role
+            if(in_array("user-pending", $newCurrentRoles) && !in_array("user-pending", $roles["new"])) {
+                $userRoles["new"] = array();
+                $userRoles["deleted"] = "user-pending";
+                WSIS::updateUserRoles( $username, $userRoles);
+            }
 		}
         return Redirect::to("admin/dashboard/roles")->with( "message", "Roles has been added.");
     }


[2/2] airavata-php-gateway git commit: Merge branch 'AIRAVATA-2164-remove-user-from-pending-role' of https://github.com/machristie/airavata-php-gateway into develop

Posted by sc...@apache.org.
Merge branch 'AIRAVATA-2164-remove-user-from-pending-role' of https://github.com/machristie/airavata-php-gateway into develop


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/26ed2cfd
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/26ed2cfd
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/26ed2cfd

Branch: refs/heads/develop
Commit: 26ed2cfdab6c8a47f807b2a21f52cd7975568868
Parents: 555cf68 f41820e
Author: scnakandala <su...@gmail.com>
Authored: Mon Oct 17 23:54:29 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Mon Oct 17 23:54:29 2016 -0400

----------------------------------------------------------------------
 app/controllers/AdminController.php | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26ed2cfd/app/controllers/AdminController.php
----------------------------------------------------------------------