Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D09E120049D for ; Wed, 9 Aug 2017 16:50:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CF39B1694F0; Wed, 9 Aug 2017 14:50:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 454EA1694CA for ; Wed, 9 Aug 2017 16:50:03 +0200 (CEST) Received: (qmail 48754 invoked by uid 500); 9 Aug 2017 14:50:02 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 48670 invoked by uid 99); 9 Aug 2017 14:50:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 14:50:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 035C5F5555; Wed, 9 Aug 2017 14:50:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: machristie@apache.org To: commits@airavata.apache.org Date: Wed, 09 Aug 2017 14:50:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/50] airavata-php-gateway git commit: Modifying generation of the password token archived-at: Wed, 09 Aug 2017 14:50:05 -0000 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 Authored: Tue Jul 4 11:55:50 2017 -0500 Committer: Sneha Tilak 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; }