From 5405bc4684bda2cdd3066821f5709be4dbd7bb06 Mon Sep 17 00:00:00 2001 From: Axel Stohn Date: Thu, 7 Jul 2022 12:14:12 -0700 Subject: [PATCH] adding I2 user reqs --- Controller/GrouperGroupsController.php | 46 ++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index 5295a67..4900424 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -759,26 +759,58 @@ function isAuthorized() $roles = $this->Role->calculateCMRoles(); //TODO - This is needed for my dev enviro since I do not log in via I2 IdP - + // BEGIN =============================================== if ($this->Session->check('Auth.User.username')) { $this->userId = $this->Session->read('Auth.User.username'); } + // END =============================================== + //TODO - Need to make the following code configurable in getting the user ID. In this case the code is + // specific to the needs of I2. + // BEGIN =============================================== - /* - * TODO - Need to make the following code configurable in getting the user ID. In this case the code is - * specific to the needs of I2. - */ +// $uid=$this->Session->read('Auth.User.co_person_id'); +// $username=$this->Session->read('Auth.User.username'); +// error_log("HUBING ================ " . $username); +// +// switch ($username) { +// case "chubing@internet2.edu": +// error_log("username is " . $username); +// $uid=32; +// break; +// case "pcaskey@internet2.edu": +// error_log("username is " . $username); +// $uid=28; +// break; +// case "ij@internet2.edu": +// error_log("username is " . $username); +// $uid=6842; +// break; +// case "aaschenbrener@internet2.edu": +// error_log("username is " . $username); +// $uid=13643; +// // 12430 in dev +// break; +// case "sho@internet2.edu": +// error_log("username is " . $username); +// $uid=6103; +// break; +// case "wkaufman@internet2.edu": +// error_log("username is " . $username); +// $uid=6830; +// break; +// } +// error_log("UID IS ================ " . $uid); // // if ($this->Session->check('Plugin.Grouper.UserId')) { // $this->userId = $this->Session->read('Plugin.Grouper.UserId'); // } else { -// $this->userId = $this->getUserId($this->Session->read('Auth.User.co_person_id')); +// $this->userId = $this->getUserId($uid); // $this->Session->write('Plugin.Grouper.UserId', $this->userId); // } + // END =============================================== // Determine what operations this user can perform - // Construct the permission set for this user, which will also be passed to the view. //Note: Leaving in current format, in case need to restrict certain pages, can just remove true and add params. $p = array();