You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/08/09 14:50:01 UTC
[02/50] airavata-php-gateway git commit: Fix for AIRAVATA-2233
Fix for AIRAVATA-2233
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/688fc61b
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/688fc61b
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/688fc61b
Branch: refs/heads/dreg-gateway
Commit: 688fc61b135ea1059fa5662a4dc3f6cd66f4e91c
Parents: 26a207a
Author: Sneha Tilak <ti...@Snehas-MacBook-Pro.local>
Authored: Mon Jul 3 17:52:41 2017 -0500
Committer: Sneha Tilak <ti...@Snehas-MacBook-Pro.local>
Committed: Mon Jul 3 17:52:41 2017 -0500
----------------------------------------------------------------------
app/controllers/AdminController.php | 10 ++++++---
.../GatewayRequestUpdateController.php | 2 +-
app/libraries/AdminUtilities.php | 2 ++
app/routes.php | 4 ++--
app/views/admin/manage-gateway.blade.php | 22 +++++++++++++++-----
5 files changed, 29 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/688fc61b/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index 1227901..fb8005c 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -168,7 +168,7 @@ class AdminController extends BaseController {
}
}
- public function updateGatewayRequest(){
+ public function updateGateway(){
$returnVal = AdminUtilities::update_gateway( Input::get("internal_gateway_id"), Input::except("oauthClientId","oauthClientSecret"));
if( Request::ajax()){
@@ -178,6 +178,10 @@ class AdminController extends BaseController {
$user_profile = Keycloak::getUserProfile($username);
EmailUtilities::mailToUser($user_profile["firstname"], $user_profile["lastname"], $email, Input::get("gateway_id"));
EmailUtilities::mailToAdmin($email, Input::get("gateway_id"));
+ if (isset($gatewayData["createTenant"]))
+ Session::put("successMessages", "Tenant has been created successfully!");
+ else
+ Session::put("successMessages", "Gateway has been updated successfully!");
return json_encode(AdminUtilities::get_gateway(Input::get("internal_gateway_id")));
}
else {
@@ -191,10 +195,10 @@ class AdminController extends BaseController {
$user_profile = Keycloak::getUserProfile($username);
EmailUtilities::mailToUser($user_profile["firstname"], $user_profile["lastname"], $email, Input::get("gateway_id"));
EmailUtilities::mailToAdmin($email, Input::get("gateway_id"));
- Session::put("message", "Request has been updated");
+ Session::put("message", "Gateway has been updated successfully!");
}
else {
- Session::put("message", "An error has occurred while updating your request. Please make sure you've entered all the details correctly. Try again or contact admin to report the issue.");
+ Session::put("message", "An error has occurred while updating your Gateway. Please make sure you've entered all the details correctly. Try again or contact the Admin to report the issue.");
}
return Redirect::back();
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/688fc61b/app/controllers/GatewayRequestUpdateController.php
----------------------------------------------------------------------
diff --git a/app/controllers/GatewayRequestUpdateController.php b/app/controllers/GatewayRequestUpdateController.php
index 16835af..2165191 100644
--- a/app/controllers/GatewayRequestUpdateController.php
+++ b/app/controllers/GatewayRequestUpdateController.php
@@ -3,7 +3,7 @@
class GatewayRequestUpdateController extends BaseController
{
- public function updateGatewayRequest(){
+ public function updateGateway(){
$gateway = AdminUtilities::update_form( Input::get("gateway-id"), Input::all() );
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/688fc61b/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index dc107cf..b57f7cf 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -149,6 +149,8 @@ class AdminUtilities
return -1;
}
}
+ if ($gateway->identityServerPasswordToken == null)
+ return -1;
$gateway = IamAdminServices::setUpGateway( Session::get('authz-token'), $gateway);
$gateway->gatewayApprovalStatus = GatewayApprovalStatus::CREATED;
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/688fc61b/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 1f93efb..61f15eb 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -28,7 +28,7 @@ Route::get("refreshed-token-desktop", "AccountController@getRefreshedTokenForDes
Route::get("account/dashboard", "AccountController@dashboard");
-Route::get("account/update-gateway", "GatewayRequestUpdateController@updateGatewayRequest");
+Route::get("account/update-gateway", "GatewayRequestUpdateController@updateGateway");
Route::get("callback-url", "AccountController@oauthCallback");
@@ -379,7 +379,7 @@ Route::post("notice-seen-ack", "AccountController@noticeSeenAck");
Route::get("admin/add-gateway", "AdminController@createGateway");
Route::get("admin/add-new-gateway", "AdminController@addGateway");
-Route::get("admin/update-gateway-request", "AdminController@updateGatewayRequest");
+Route::get("admin/update-gateway-request", "AdminController@updateGateway");
/*
* Theme Pages Routes
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/688fc61b/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index d619f40..26c51de 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -46,6 +46,17 @@
</div>
{{ Session::forget("errorMessages") }}
@endif
+
+ @if (Session::has("successMessages"))
+ <div class="row">
+ <div class="alert alert-success alert-dismissible" role="alert">
+ <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span><span
+ class="sr-only">Close</span></button>
+ {{ Session::get("successMessages") }}
+ </div>
+ </div>
+ {{ Session::forget("successMessages") }}
+ @endif
</div>
@if ($errors->has())
@@ -230,7 +241,7 @@
<form action="{{URL::to('/')}}/admin/update-gateway-request" id="update-gateway-request" method="GET">
<div class="modal-header">
- <button type="button" class="close update-gateway-request-close-modal" data-dismiss="modal" aria-label="Close" onclick="window.location.reload()"><span
+ <button type="button" class="close update-gateway-request-close-modal" data-dismiss="modal" aria-label="Close" ><span
aria-hidden="true">×</span></button>
<h3>View the Gateway Details</h3>
@@ -768,23 +779,24 @@
if( data == -1 ){
//errors only with -1
if( updateVal == "createTenant"){
- $(".submit-actions").before("<div class='alert alert-danger fail-alert'>All fields are required to create the gateway! Please make sure you've first updated all the Gateway details accurately. Try again or contact admin to report the issue.");
+ $(".submit-actions").before("<div class='alert alert-danger fail-alert'>All fields are required to create the gateway! Please make sure you've first updated all the Gateway details accurately and try again. Ask the Gateway Provider to set a Password token if they haven't set it yet.");
}
else{
$(".submit-actions").before("<div class='alert alert-danger fail-alert'>Error updating Gateway. Please try again.");
}
}
else{
- if( updateVal == "createTenant"){
+ /*if( updateVal == "createTenant"){
$(".submit-actions").before("<div class='alert alert-success success-alert'>Tenant has been created!");
$(".notCreatedGateway").addClass("hide");
$(".createdGateway").removeClass("hide");
-
}
else{
$(".submit-actions").before("<div class='alert alert-success success-alert'>Gateway has been updated successfully.");
- }
+ }*/
+
+ window.location.reload();
//refresh data next time if same popup is opened.
var gatewayIdWithoutSpaces = dataObj['gateway_id'].replace(/\s+/g, '-');