You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2016/08/27 19:11:56 UTC

[3/3] airavata-php-gateway git commit: Domain URL changes for Gateway request

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 <ni...@gmail.com>
Authored: Sat Aug 27 12:11:14 2016 -0700
Committer: Nipurn Doshi <ni...@gmail.com>
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");