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 DD547200B7F for ; Sat, 27 Aug 2016 21:11:56 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DBED2160A93; Sat, 27 Aug 2016 19:11:56 +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 090D9160AB2 for ; Sat, 27 Aug 2016 21:11:55 +0200 (CEST) Received: (qmail 63264 invoked by uid 500); 27 Aug 2016 19:11:55 -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 63255 invoked by uid 99); 27 Aug 2016 19:11:55 -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; Sat, 27 Aug 2016 19:11:55 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1427BE0E06; Sat, 27 Aug 2016 19:11:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ndoshi@apache.org To: commits@airavata.apache.org Date: Sat, 27 Aug 2016 19:11:56 -0000 Message-Id: <4c474555d8ca4851aaa912703117c2d5@git.apache.org> In-Reply-To: <5d82eda3176a4efa837f2cc6ad594342@git.apache.org> References: <5d82eda3176a4efa837f2cc6ad594342@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/3] airavata-php-gateway git commit: Domain URL changes for Gateway request archived-at: Sat, 27 Aug 2016 19:11:57 -0000 Domain URL changes for Gateway request 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/3f22c2ac Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3f22c2ac Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3f22c2ac Branch: refs/heads/develop Commit: 3f22c2ace64f99fd93baf34173e3b0ece33b8ac0 Parents: 3f5ea2f Author: Nipurn Doshi Authored: Sat Aug 27 12:11:14 2016 -0700 Committer: Nipurn Doshi Committed: Sat Aug 27 12:11:14 2016 -0700 ---------------------------------------------------------------------- app/controllers/AdminController.php | 2 +- app/libraries/AdminUtilities.php | 19 +++++-------------- app/views/account/dashboard.blade.php | 6 ++---- 3 files changed, 8 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f22c2ac/app/controllers/AdminController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php index e5396f9..a151bc3 100644 --- a/app/controllers/AdminController.php +++ b/app/controllers/AdminController.php @@ -21,7 +21,7 @@ class AdminController extends BaseController { $gatewayApprovalStatuses = AdminUtilities::get_gateway_approval_statuses(); foreach ($gatewaysInfo as $index => $gateway) { - if ($gateway->identityServerUserName == $userProfile["username"]) { + if ($gateway->requesterUsername == $userProfile["username"]) { $gatewayOfUser = $gateway->gatewayId; Session::forget("super-admin"); Session::put("new-gateway-provider", true); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f22c2ac/app/libraries/AdminUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php index b7c5117..f1d1b33 100644 --- a/app/libraries/AdminUtilities.php +++ b/app/libraries/AdminUtilities.php @@ -29,14 +29,10 @@ class AdminUtilities $gateway = new Gateway( $inputs); $gateway->gatewayId = $inputs["gateway-name"]; $gateway->gatewayApprovalStatus = GatewayApprovalStatus::REQUESTED; - if( strpos($inputs["domain"], "//") != false) - $inputs["domain"] = substr( $inputs["domain"], 2 + strpos($inputs["domain"], "//")); - $gateway->domain = $inputs["domain"]; + $gateway->domain = 'airavata.' . $inputs["gateway-acronym"]; $gateway->gatewayName = $inputs["gateway-name"]; $gateway->emailAddress = $inputs["email-address"]; $gateway->gatewayAcronym = $inputs["gateway-acronym"]; - if( strpos($inputs["gateway-url"], "//") != false) - $inputs["gateway-url"] = substr( $inputs["gateway-url"], 2 + strpos($inputs["gateway-url"], "//")); $gateway->gatewayURL = $inputs["gateway-url"]; $gateway->gatewayAdminFirstName = $inputs["admin-firstname"]; $gateway->gatewayAdminLastName = $inputs["admin-lastname"]; @@ -44,6 +40,8 @@ class AdminUtilities $gateway->identityServerPasswordToken = $inputs["admin-password"]; $gateway->reviewProposalDescription = $inputs["project-details"]; $gateway->gatewayPublicAbstract = $inputs["public-project-description"]; + $userProfile = Session::get("user-profile"); + $gateway->requesterUsername = $userProfile["username"]; return Airavata::addGateway(Session::get('authz-token'), $gateway); } @@ -86,10 +84,7 @@ class AdminUtilities $tenants = WSIS::getTenants(); $tenantExists = false; foreach( $tenants as $tenant){ - $gatewayURL = $gateway->gatewayURL; - if( strpos($gateway->gatewayURL, "//") != false) - $gatewayURL = substr( $gateway->gatewayURL, 2 + strpos($gateway->gatewayURL, "//")); - if( $tenant->tenantDomain == $gateway->gatewayURL){ + if( $tenant->tenantDomain == $gateway->domain){ $tenantExists = true; } } @@ -97,13 +92,9 @@ class AdminUtilities $gatewayURL = $gateway->gatewayURL; $gatewayDomain = $gateway->domain; if( strpos($gateway->gatewayURL, "//") != false) - $gatewayURL = substr( $gateway->gatewayURL, 2 + strpos($gateway->gatewayURL, "//")); - - if( strpos($gateway->domain, "//") != false) - $gatewayDomain = substr( $gateway->domain, 2 + strpos( $gateway->domain, "//")); //finally create tenant - return WSIS::createTenant(1, $gateway->identityServerUserName . "@" . $gatewayDomain, $gateway->identityServerPasswordToken, $gateway->emailAddress,$gateway->gatewayAdminFirstName, $gateway->gatewayAdminLastName, $gatewayURL); + return WSIS::createTenant(1, $gateway->identityServerUserName, $gateway->identityServerPasswordToken, $gateway->emailAddress, $gateway->gatewayAdminFirstName, $gateway->gatewayAdminLastName, $gatewayDomain); } else return false; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f22c2ac/app/views/account/dashboard.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php index b765f1b..ea9220b 100644 --- a/app/views/account/dashboard.blade.php +++ b/app/views/account/dashboard.blade.php @@ -435,10 +435,6 @@ 'trigger':'focus' }); - $("#domain").popover({ - 'trigger':'focus' - }); - $("#gateway-url").popover({ 'trigger':'focus' }); @@ -455,10 +451,12 @@ 'trigger':'focus' }); + /* $("#add-tenant-form").on("submit", function(e){ e.preventDefault(); console.log( !/[^a-z]/i.test( $(".gateway-acronym").val())); }); + */ $(".deactivateGateway-button").click( function(){ var gatewayId = $(this).data("gatewayid");