airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndo...@apache.org
Subject [3/4] airavata-php-gateway git commit: Super Admin UI flow changes
Date Thu, 10 Dec 2015 20:21:00 GMT
Super Admin UI flow changes


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

Branch: refs/heads/master
Commit: bb809f5f1c69bcf7cf37059bbe92b253c16110fc
Parents: 0713c67
Author: Nipurn Doshi <nipunhere@gmail.com>
Authored: Thu Dec 10 14:27:23 2015 -0500
Committer: Nipurn Doshi <nipunhere@gmail.com>
Committed: Thu Dec 10 14:27:23 2015 -0500

----------------------------------------------------------------------
 app/controllers/AdminController.php | 40 +++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/bb809f5f/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index e40a249..8d3cad3 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -5,12 +5,33 @@ class AdminController extends BaseController {
 	public function __construct()
 	{
         $this->beforeFilter('verifyadmin');
-		Session::put("scigap_admin", true);
 		Session::put("nav-active", "user-console");
 	}
 
 	public function dashboard(){
-    	return View::make("account/dashboard");
+		//only for super admin
+		//Session::put("scigap_admin", true);
+
+		if( Session::has("scigap_admin"))
+		{
+			$crData = CRUtilities::getEditCRData();
+			$gateways = CRUtilities::getAllGatewayProfilesData();
+
+			$gatewayData = array( 
+									"gateways" => $gateways, 
+									"computeResources" => CRUtilities::getAllCRObjects(),
+									"crData" => $crData
+								);
+			
+			$view = "scigap-admin/manage-gateway";
+
+            Session::put("admin-nav", "gateway-prefs");
+			return View::make( $view, $gatewayData);
+		}
+		else{
+        	return View::make("account/dashboard");
+
+        }
 	}
 
 	public function addAdminSubmit(){
@@ -52,7 +73,8 @@ class AdminController extends BaseController {
     }
 
     public function gatewayView(){
-
+    	//only for super admin
+		//Session::put("scigap_admin", true);
 		$crData = CRUtilities::getEditCRData();
 		$gateways = CRUtilities::getAllGatewayProfilesData();
 		$tokens = AdminUtilities::get_ssh_tokens();
@@ -65,11 +87,11 @@ class AdminController extends BaseController {
 								"tokens" => $tokens
 							);
 		//var_dump( $gateways); exit;
-		/*if( Session::has("scigap_admin"))
+		if( Session::has("scigap_admin"))
 			$view = "scigap-admin/manage-gateway";
 		else{
-		*/
 			$view = "admin/manage-gateway";
+        }
 
         Session::put("admin-nav", "gateway-prefs");
 		return View::make( $view, $gatewayData);
@@ -170,12 +192,12 @@ class AdminController extends BaseController {
 
 		$inputs = Input::all();
 
-		$tm = WSIS::createTenant(true, $inputs["admin-username"], $inputs["admin-password"],
-			$inputs["admin-email"], $inputs["admin-firstname"], $inputs["admin-lastname"], $inputs["domain"]);
-
         $gateway = AdminUtilities::add_gateway(Input::all());
 
-		return Redirect::to("admin/dashboard/gateway")->with("message", "Gateway has been registered
successfully.");
+		$tm = WSIS::createTenant(1, $inputs["admin-username"] . "@" . $inputs["domain"], $inputs["admin-password"],
+			$inputs["admin-email"], $inputs["admin-firstname"], $inputs["admin-lastname"], $inputs["domain"]);
+
+		return $gateway;
 	}
 
 


Mime
View raw message