Modifying generation of the password token

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

Branch: refs/heads/dreg-gateway
Commit: 944ffea4d3e8574ababd458444c214b61fd3bacc
Parents: 5d992bb
Author: Sneha Tilak <tilaks@Snehas-MacBook-Pro.local>
Authored: Tue Jul 4 11:55:50 2017 -0500
Committer: Sneha Tilak <tilaks@Snehas-MacBook-Pro.local>
Committed: Tue Jul 4 11:55:50 2017 -0500

----------------------------------------------------------------------
 app/libraries/AdminUtilities.php | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/944ffea4/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 1dc4d63..03a2402 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -28,7 +28,8 @@ class AdminUtilities
         $gateway->gatewayAdminEmail = $inputs["admin-email"];
         $gateway->gatewayAdminLastName = $inputs["admin-lastname"];
         $gateway->identityServerUserName = $inputs["admin-username"];
-        $gateway->identityServerPasswordToken  = $inputs["admin-password"];
+        $token = create_pwd_token([Session::get('username'), 
$inputs["admin-password"]]);
+        $gateway->identityServerPasswordToken  = $token;
         $gateway->reviewProposalDescription = $inputs["project-details"];
         $gateway->gatewayPublicAbstract = 
$inputs["public-project-description"];
         $gateway->requesterUsername = Session::get('username');
@@ -88,7 +89,8 @@ class AdminUtilities
         $gateway->gatewayAdminFirstName = $inputs["admin-firstname"];
         $gateway->gatewayAdminLastName = $inputs["admin-lastname"];
         $gateway->identityServerUserName = $inputs["admin-username"];
-        $gateway->identityServerPasswordToken  = $inputs["admin-password"];
+        $token = create_pwd_token([Session::get('username'), 
$inputs["admin-password"]]);
+        $gateway->identityServerPasswordToken  = $token;
         $gateway->reviewProposalDescription = $inputs["project-details"];
         $gateway->gatewayPublicAbstract = 
$inputs["public-project-description"];
         $gateway->requesterUsername = Session::get('username');
@@ -116,7 +118,8 @@ class AdminUtilities
         $gateway->emailAddress = $gatewayData["email-address"];
         $gateway->gatewayURL = $gatewayData["gateway-url"];
         $gateway->identityServerUserName = $gatewayData["admin-username"];
-        $gateway->identityServerPasswordToken  = 
$gatewayData["admin-password"];
+        $token = create_pwd_token([Session::get('username'), 
$gatewayData["admin-password"]]);
+        $gateway->identityServerPasswordToken  = $token;
         $gateway->gatewayAdminFirstName = $gatewayData["admin-firstname"];
         $gateway->gatewayAdminLastName = $gatewayData["admin-lastname"];
         $gateway->gatewayAdminEmail = $gatewayData["admin-email"];
@@ -147,14 +150,13 @@ class AdminUtilities
             if ($gateway->identityServerPasswordToken == null)
             {
                 Session::put("errorMessages", "Error: Please ask the Gateway 
Provider to submit a password.");
+                return -1;
             }
             foreach ($gatewayData as $data) {
                 if ($data == null) {
                     return -1;
                 }
             }
-            if ($gateway->identityServerPasswordToken == null)
-                return -1;
             $gateway = IamAdminServices::setUpGateway( 
Session::get('authz-token'), $gateway);
             $gateway->gatewayApprovalStatus = GatewayApprovalStatus::CREATED;
         }

Reply via email to