You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/07/13 15:16:43 UTC
[6/9] airavata-php-gateway git commit: Ongoing changes for
scigap-portal gateway request - UNSTABLE - do not merge with master
Ongoing changes for scigap-portal gateway request - UNSTABLE - do not merge with master
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/28649af1
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/28649af1
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/28649af1
Branch: refs/heads/grouper-integration
Commit: 28649af14d57e97365da4e79746db692141b068f
Parents: f8a61cb
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Tue Jul 12 23:52:50 2016 -0700
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Tue Jul 12 23:52:50 2016 -0700
----------------------------------------------------------------------
app/controllers/AccountController.php | 20 +++++++++++++-------
app/controllers/GatewayController.php | 7 +++----
app/libraries/AdminUtilities.php | 9 +++++++--
app/views/account/dashboard.blade.php | 6 +++---
4 files changed, 26 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/28649af1/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index d41bc2f..32ae4b0 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -78,7 +78,7 @@ class AccountController extends BaseController
if(! in_array( "gateway-provider", $allRoles)){
WSIS::addRole( "gateway-provider");
}
- $userRoles["new"] = array("gateway-provider");
+ $userRoles["new"] = array("gateway-provider", "admin");
}
$userRoles["deleted"] = array();
WSIS::updateUserRoles( $username, $userRoles);
@@ -292,24 +292,30 @@ class AccountController extends BaseController
}
public function dashboard(){
- if( Session::has("gateway-provider")){
+
+ $userProfile = Session::get("user-profile");
+
+ if( in_array( "gateway-provider", $userProfile["roles"]) ){
$gatewayOfUser = "";
- //var_dump( Session::get("authz-token")->accessToken); exit;
- $userProfile = Session::get("user-profile");
$gatewaysInfo = CRUtilities::getAllGateways();
foreach( $gatewaysInfo as $index => $gateway){
if( $gateway->emailAddress == $userProfile["email"]){
Session::set("gateway_id", $gateway->gatewayId);
$gatewayOfUser = $gateway->gatewayId;
+ Session::forget("super-admin");
break;
}
}
if( $gatewayOfUser == ""){
- Session::put("new-gateway-provider");
+ $userInfo["username"] = $userProfile["username"];
+ $userInfo["email"] = $userProfile["email"];
+ Session::put("new-gateway-provider", true);
}
- }
- return View::make("account/dashboard");
+ $errors = array();
+ if( Session::has("errors"))
+ $errors = Session::get("errors");
+ return View::make("account/dashboard",array("message"=> implode( "," , $errors)));
}
public function resetPassword()
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/28649af1/app/controllers/GatewayController.php
----------------------------------------------------------------------
diff --git a/app/controllers/GatewayController.php b/app/controllers/GatewayController.php
index bd0e298..4f13c57 100644
--- a/app/controllers/GatewayController.php
+++ b/app/controllers/GatewayController.php
@@ -24,21 +24,20 @@ class GatewayController extends BaseController {
$validator = Validator::make( $checkValidation, $rules, $messages);
if ($validator->fails()) {
- return Response::json( $validator->messages() );
+ return Redirect::to("account/dashboard", array( "errors"=>$validator->messages() );
}
else{
- $gateway = AdminUtilities::add_gateway(Input::all());
+ $gateway = AdminUtilities::request_gateway(Input::all());
//$tm = WSIS::createTenant(1, $inputs["admin-username"] . "@" . $inputs["domain"], $inputs["admin-password"], inputs["admin-email"], $inputs["admin-firstname"], $inputs["admin-lastname"], $inputs["domain"]);
- Session::put("message", "Gateway " . $inputs["gatewayName"] . " has been added.");
+ Session::put("message", "Your request for Gateway " . $inputs["gatewayName"] . " has been created.");
return Response::json( array( "gateway" =>$gateway, "tm" => $tm ) );
if( $gateway == $inputs["gatewayName"] && is_object( $tm ) )
return Response::json( array( "gateway" =>$gateway, "tm" => $tm ) );
else
return 0;
- //return Redirect::to("admin/dashboard/gateway")->with("message", "Gateway has been successfully added.");
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/28649af1/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 46d0e55..16fca27 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -32,8 +32,13 @@ class AdminUtilities
$gateway->emailAddress = $input["admin-email"];
$gateway->gatewayAcronym = $input["gateway-acronym"];
$gateway->gatewayURL = $input["gateway-url"];
- $gateway->reviewProposalDescription = $input["project-description"];
- $gateway->gatewayPublicAbstract - $input["public-project-description"]
+ $gateway->gatewayAdminFirstName = $input["admin-firstname"];
+ $gateway->gatewayAdminLastName = $input["admin-lastname"];
+ $gateway->identityServerUserName = $input["admin-username"];
+ $gateway->identityServerPasswordToken = $input["admin-password"];
+ $gateway->reviewProposalDescription = $input["project-details"];
+ $gateway->gatewayPublicAbstract - $input["public-project-description"];
+
return Airavata::addGateway(Session::get('authz-token'), $gateway);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/28649af1/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 04321e5..c7a9340 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -22,7 +22,7 @@
@if( Session::has('new-gateway-provider') )
<div class="row">
<div class="col-md-offset-2 col-md-8">
- <form id="add-tenant-form" action="{{ URL::to("/") }}/provider/request-gateway">
+ <form id="add-tenant-form" action="{{ URL::to('/') }}/provider/request-gateway">
<div class="col-md-12 text-center" style="margin-top:50px;">
<h3>Request your gateway now!</h3>
</div>
@@ -48,11 +48,11 @@
</div>
<div class="form-group required">
<label class="control-label">Project Details</label>
- <textarea type="text" name="domain" class="form-control" required="required"></textarea>
+ <textarea type="text" name="project-details" class="form-control" required="required"></textarea>
</div>
<div class="form-group required">
<label class="control-label">Public Project Description</label>
- <textarea type="text" name="domain" class="form-control" required="required"></textarea>
+ <textarea type="text" name="public-project-description" class="form-control" required="required"></textarea>
</div>
<input type="submit" value="Send Request" class="btn btn-primary"/>
<input type="reset" value="Reset" class="btn">