Repository: airavata-php-gateway Updated Branches: refs/heads/develop 1281d8277 -> 26a207a08
AIRAVATA-2470 Using internal gateway id 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/26a207a0 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/26a207a0 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/26a207a0 Branch: refs/heads/develop Commit: 26a207a081cac676ca2ca254daba7a8cbaf7de5e Parents: 1281d82 Author: Marcus Christie <[email protected]> Authored: Mon Jul 3 12:12:23 2017 -0400 Committer: Marcus Christie <[email protected]> Committed: Mon Jul 3 12:12:23 2017 -0400 ---------------------------------------------------------------------- app/controllers/AccountController.php | 31 ++++++----------- app/controllers/AdminController.php | 35 +++++++++----------- .../GatewayRequestUpdateController.php | 9 +++-- app/filters.php | 2 +- app/libraries/AdminUtilities.php | 5 +++ .../Profile/Tenant/CPI/TenantProfileService.php | 28 ++++++++-------- app/libraries/CRUtilities.php | 2 +- app/libraries/SRUtilities.php | 29 ---------------- app/views/account/dashboard.blade.php | 17 ++++++---- app/views/account/update.blade.php | 3 +- app/views/admin/manage-gateway.blade.php | 4 +++ 11 files changed, 68 insertions(+), 97 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/controllers/AccountController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 380d2f5..a47407d 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -169,7 +169,7 @@ class AccountController extends BaseController CommonUtilities::store_id_in_session($username); Session::put("gateway_id", Config::get('pga_config.airavata')['gateway-id']); - if(Session::has("admin") || Session::has("admin-read-only") || Session::has("authorized-user")){ + if(Session::has("admin") || Session::has("admin-read-only") || Session::has("authorized-user") || Session::has("gateway-provider")){ return $this->initializeWithAiravata($username, $userEmail, $firstName, $lastName, $accessToken, $refreshToken, $expirationTime); } @@ -234,11 +234,19 @@ class AccountController extends BaseController if (in_array(Config::get('pga_config.wsis')['user-role-name'], $userRoles)) { Session::put("authorized-user", true); } + //gateway-provider-code + if (in_array("gateway-provider", $userRoles)) { + Session::put("gateway-provider", true); + } + //only for super admin + if( Config::get('pga_config.portal')['super-admin-portal'] == true && Session::has("admin")){ + Session::put("super-admin", true); + } CommonUtilities::store_id_in_session($username); Session::put("gateway_id", Config::get('pga_config.airavata')['gateway-id']); - if(Session::get("admin") || Session::get("admin-read-only") || Session::get("authorized-user")){ + if(Session::has("admin") || Session::has("admin-read-only") || Session::has("authorized-user") || Session::has("gateway-provider")){ return $this->initializeWithAiravata($username, $userEmail, $firstName, $lastName, $accessToken, $refreshToken, $expirationTime); } @@ -286,7 +294,7 @@ class AccountController extends BaseController $userProfile = UserProfileUtilities::get_user_profile($username); Session::put('user-profile', $userProfile); - if(Session::has("admin") || Session::has("admin-read-only")){ + if(Session::has("admin") || Session::has("admin-read-only") || Session::has("gateway-provider")){ return Redirect::to("admin/dashboard". "?status=ok&code=".$accessToken . "&username=".$username . "&refresh_code=" . $refreshToken . "&valid_time=" . $validTime); }else{ @@ -333,23 +341,6 @@ class AccountController extends BaseController $userEmail = Session::get("iam-user-profile")["email"]; } - if( in_array( "gateway-provider", $userRoles ) ) { - $gatewayOfUser = ""; - - $gatewaysInfo = CRUtilities::getAllGateways(); - foreach ($gatewaysInfo as $index => $gateway) { - if ($gateway->emailAddress == $userEmail) { - Session::set("gateway_id", $gateway->gatewayId); - $gatewayOfUser = $gateway->gatewayId; - Session::forget("super-admin"); - break; - } - } - if ($gatewayOfUser == "") { - Session::put("new-gateway-provider", true); - } - } - return View::make("account/dashboard"); } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/controllers/AdminController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php index 2d87c2a..1227901 100644 --- a/app/controllers/AdminController.php +++ b/app/controllers/AdminController.php @@ -24,30 +24,27 @@ class AdminController extends BaseController { if( in_array( "gateway-provider", $userRoles) ) { $gatewayOfUser = ""; Session::put("super-admin", true); - $gatewaysInfo = CRUtilities::getAllGateways(); + $gatewaysInfo = AdminUtilities::get_gateways_for_requester( $username ); Log::info("Gateways: ", $gatewaysInfo); Log::info("Username: ", [Session::get("username")]); - //$gatewaysInfo = CRUtilities::getAllGateways(); //var_dump( $gatewaysInfo); exit; $requestedGateways = array(); $gatewayApprovalStatuses = AdminUtilities::get_gateway_approval_statuses(); foreach ($gatewaysInfo as $index => $gateway) { - if ($gateway->requesterUsername == $username) { - $gatewayOfUser = $gateway->gatewayId; - Session::forget("super-admin"); - Session::put("new-gateway-provider", true); - Session::put("existing-gateway-provider", true); - - $requestedGateways[ $gateway->airavataInternalGatewayId]["gatewayInfo"] = $gateway; - $requestedGateways[ $gateway->airavataInternalGatewayId]["approvalStatus"] = $gatewayApprovalStatuses[ $gateway->gatewayApprovalStatus]; - //seeing if admin wants to start managing one of the gateways - if( Input::has("gatewayId")){ - if( Input::get("gatewayId") == $gateway->gatewayId) - { - Session::put("gateway_id", $gateway->gatewayId); - } - } + $gatewayOfUser = $gateway->gatewayId; + Session::forget("super-admin"); + Session::put("new-gateway-provider", true); + Session::put("existing-gateway-provider", true); + + $requestedGateways[ $gateway->airavataInternalGatewayId]["gatewayInfo"] = $gateway; + $requestedGateways[ $gateway->airavataInternalGatewayId]["approvalStatus"] = $gatewayApprovalStatuses[ $gateway->gatewayApprovalStatus]; + //seeing if admin wants to start managing one of the gateways + if( Input::has("gatewayId")){ + if( Input::get("gatewayId") == $gateway->gatewayId) + { + Session::put("gateway_id", $gateway->gatewayId); + } } } $data["requestedGateways"] = $requestedGateways; @@ -173,7 +170,7 @@ class AdminController extends BaseController { public function updateGatewayRequest(){ - $returnVal = AdminUtilities::update_gateway( Input::get("gateway_id"), Input::except("oauthClientId","oauthClientSecret")); + $returnVal = AdminUtilities::update_gateway( Input::get("internal_gateway_id"), Input::except("oauthClientId","oauthClientSecret")); if( Request::ajax()){ if( $returnVal == 1) { $username = Session::get("username"); @@ -181,7 +178,7 @@ 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")); - return json_encode(AdminUtilities::get_gateway(Input::get("gateway_id"))); + return json_encode(AdminUtilities::get_gateway(Input::get("internal_gateway_id"))); } else { return $returnVal; // anything other than positive update result http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/controllers/GatewayRequestUpdateController.php ---------------------------------------------------------------------- diff --git a/app/controllers/GatewayRequestUpdateController.php b/app/controllers/GatewayRequestUpdateController.php index e67d40d..16835af 100644 --- a/app/controllers/GatewayRequestUpdateController.php +++ b/app/controllers/GatewayRequestUpdateController.php @@ -7,13 +7,14 @@ class GatewayRequestUpdateController extends BaseController $gateway = AdminUtilities::update_form( Input::get("gateway-id"), Input::all() ); - $gatewayData = array ("gatewayId" => $gateway->gatewayId, + $gatewayData = array ("airavataInternalGatewayId" => $gateway->airavataInternalGatewayId, + "gatewayId" => $gateway->gatewayId, "gatewayName" => $gateway->gatewayName, "emailAddress" => $gateway->emailAddress, "publicProjectDescription" => $gateway->gatewayPublicAbstract, "gatewayURL" => $gateway->gatewayURL, "adminFirstName" => $gateway->gatewayAdminFirstName, - "adminLastName" => $gateway-> gatewayAdminLastName, + "adminLastName" => $gateway->gatewayAdminLastName, "adminUsername" => $gateway->identityServerUserName, "adminEmail" => $gateway->gatewayAdminEmail, "projectDetails" => $gateway->reviewProposalDescription); @@ -26,7 +27,6 @@ class GatewayRequestUpdateController extends BaseController $inputs = Input::all(); $rules = array( - "username" => "required|min:6", "password" => "required|min:6|max:48|regex:/^.*(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@!$#*]).*$/", "confirm_password" => "required|same:password", "email" => "required|email", @@ -37,7 +37,6 @@ class GatewayRequestUpdateController extends BaseController ); $checkValidation = array(); - $checkValidation["username"] = $inputs["admin-username"]; $checkValidation["password"] = $inputs["admin-password"]; $checkValidation["confirm_password"] = $inputs["admin-password-confirm"]; $checkValidation["email"] = $inputs["admin-email"]; @@ -50,7 +49,7 @@ class GatewayRequestUpdateController extends BaseController ->withErrors($validator); } else { - $returnVal = AdminUtilities::user_update_gateway(Input::get("gateway-id"), Input::all()); + $returnVal = AdminUtilities::user_update_gateway(Input::get("internal-gateway-id"), Input::all()); if ($returnVal == 1) { $username = Session::get("username"); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/filters.php ---------------------------------------------------------------------- diff --git a/app/filters.php b/app/filters.php index c92ff8a..427eeaa 100755 --- a/app/filters.php +++ b/app/filters.php @@ -137,7 +137,7 @@ Route::filter('verifyauthorizeduser', function () { Route::filter('verifyadmin', function () { if (CommonUtilities::verify_login()) { - if (!Session::has("admin") && !Session::has("admin-read-only")) { + if (!Session::has("admin") && !Session::has("admin-read-only") && !Session::has("gateway-provider")) { return Redirect::to("home")->with("admin-alert", true); } } else http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/libraries/AdminUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php index ed80bda..dc107cf 100644 --- a/app/libraries/AdminUtilities.php +++ b/app/libraries/AdminUtilities.php @@ -48,6 +48,11 @@ class AdminUtilities return TenantProfileService::getGateway( Session::get("authz-token"), $gateway_id); } + public static function get_gateways_for_requester( $username ) + { + return TenantProfileService::getAllGatewaysForUser( Session::get("authz-token"), $username ); + } + public static function check_request( $inputs) { $gateway = new Gateway( $inputs); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/libraries/Airavata/Service/Profile/Tenant/CPI/TenantProfileService.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/Service/Profile/Tenant/CPI/TenantProfileService.php b/app/libraries/Airavata/Service/Profile/Tenant/CPI/TenantProfileService.php index 40fd7fe..a1211be 100644 --- a/app/libraries/Airavata/Service/Profile/Tenant/CPI/TenantProfileService.php +++ b/app/libraries/Airavata/Service/Profile/Tenant/CPI/TenantProfileService.php @@ -44,12 +44,12 @@ interface TenantProfileServiceIf { public function updateGateway(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\Workspace\Gateway $updatedGateway); /** * @param \Airavata\Model\Security\AuthzToken $authzToken - * @param string $gatewayId + * @param string $airavataInternalGatewayId * @return \Airavata\Model\Workspace\Gateway * @throws \Airavata\Service\Profile\Tenant\CPI\Error\TenantProfileServiceException * @throws \Airavata\API\Error\AuthorizationException */ - public function getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId); + public function getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $airavataInternalGatewayId); /** * @param \Airavata\Model\Security\AuthzToken $authzToken * @param string $airavataInternalGatewayId @@ -268,17 +268,17 @@ class TenantProfileServiceClient implements \Airavata\Service\Profile\Tenant\CPI throw new \Exception("updateGateway failed: unknown result"); } - public function getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId) + public function getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $airavataInternalGatewayId) { - $this->send_getGateway($authzToken, $gatewayId); + $this->send_getGateway($authzToken, $airavataInternalGatewayId); return $this->recv_getGateway(); } - public function send_getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId) + public function send_getGateway(\Airavata\Model\Security\AuthzToken $authzToken, $airavataInternalGatewayId) { $args = new \Airavata\Service\Profile\Tenant\CPI\TenantProfileService_getGateway_args(); $args->authzToken = $authzToken; - $args->gatewayId = $gatewayId; + $args->airavataInternalGatewayId = $airavataInternalGatewayId; $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary'); if ($bin_accel) { @@ -1243,7 +1243,7 @@ class TenantProfileService_getGateway_args { /** * @var string */ - public $gatewayId = null; + public $airavataInternalGatewayId = null; public function __construct($vals=null) { if (!isset(self::$_TSPEC)) { @@ -1254,7 +1254,7 @@ class TenantProfileService_getGateway_args { 'class' => '\Airavata\Model\Security\AuthzToken', ), 2 => array( - 'var' => 'gatewayId', + 'var' => 'airavataInternalGatewayId', 'type' => TType::STRING, ), ); @@ -1263,8 +1263,8 @@ class TenantProfileService_getGateway_args { if (isset($vals['authzToken'])) { $this->authzToken = $vals['authzToken']; } - if (isset($vals['gatewayId'])) { - $this->gatewayId = $vals['gatewayId']; + if (isset($vals['airavataInternalGatewayId'])) { + $this->airavataInternalGatewayId = $vals['airavataInternalGatewayId']; } } } @@ -1298,7 +1298,7 @@ class TenantProfileService_getGateway_args { break; case 2: if ($ftype == TType::STRING) { - $xfer += $input->readString($this->gatewayId); + $xfer += $input->readString($this->airavataInternalGatewayId); } else { $xfer += $input->skip($ftype); } @@ -1324,9 +1324,9 @@ class TenantProfileService_getGateway_args { $xfer += $this->authzToken->write($output); $xfer += $output->writeFieldEnd(); } - if ($this->gatewayId !== null) { - $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2); - $xfer += $output->writeString($this->gatewayId); + if ($this->airavataInternalGatewayId !== null) { + $xfer += $output->writeFieldBegin('airavataInternalGatewayId', TType::STRING, 2); + $xfer += $output->writeString($this->airavataInternalGatewayId); $xfer += $output->writeFieldEnd(); } $xfer += $output->writeFieldStop(); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/libraries/CRUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php index 71cd779..3643e72 100755 --- a/app/libraries/CRUtilities.php +++ b/app/libraries/CRUtilities.php @@ -539,7 +539,7 @@ class CRUtilities usort($gateways, CommonUtilities::arrSortObjsByKey('requestCreationTime', 'ASC')); } else { - $gateways[0] = TenantProfileService::getGateway(Session::get('authz-token'), Session::get("gateway_id")); + $gateways[0] = Airavata::getGateway(Session::get('authz-token'), Session::get("gateway_id")); } return $gateways; } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/libraries/SRUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/SRUtilities.php b/app/libraries/SRUtilities.php index 22ae80b..377a526 100644 --- a/app/libraries/SRUtilities.php +++ b/app/libraries/SRUtilities.php @@ -238,35 +238,6 @@ class SRUtilities $gatewayProfileId = Airavata::registerGatewayResourceProfile(Session::get('authz-token'), $gatewayProfile); } - public static function getAllGatewayProfilesData() - { - - if (Session::has("super-admin")) - $gateways = Airavata::getAllGateways(Session::get('authz-token')); - else { - $gateways[0] = Airavata::getGateway(Session::get('authz-token'), Session::get("gateway_id")); - } - - $gatewayProfiles = Airavata::getAllGatewayResourceProfiles(Session::get('authz-token')); - //var_dump( $gatewayProfiles); exit; - //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5", "GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8"); - foreach ($gateways as $key => $gw) { - $gateways[$key]->profile = array(); - foreach ((array)$gatewayProfiles as $index => $gp) { - - if ($gw->gatewayId == $gp->gatewayID) { - foreach ((array)$gp->computeResourcePreferences as $i => $crp) { - $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails = Airavata::getComputeResource(Session::get('authz-token'), $crp->computeResourceId); - } - $gateways[$key]->profile = $gatewayProfiles[$index]; - } - } - } - //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit; - - return $gateways; - } - public static function updateGatewayProfile( $data){ $gatewayResourceProfile = Airavata::getGatewayResourceProfile( Session::get('authz-token'), $data["gateway_id"]); $gatewayResourceProfile->credentialStoreToken = $data["cst"]; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/views/account/dashboard.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php index f1e5428..45abfa6 100644 --- a/app/views/account/dashboard.blade.php +++ b/app/views/account/dashboard.blade.php @@ -49,7 +49,7 @@ </tr> </thead> <tbody> - @foreach( $requestedGateways as $gatewayId => $gateway) + @foreach( $requestedGateways as $internalGatewayId => $gateway) <tr> <td>{{ $gateway["gatewayInfo"]->gatewayName }}</td> <?php @@ -71,17 +71,17 @@ <div class="btn-group" role="group" aria-label="..."> <button type="button" class="btn btn-default view-credentials" data-gatewayobject="{{ htmlentities( json_encode( $gateway['gatewayInfo'])) }}">View Credentials</button> <!-- - <button type="button" class="btn btn-default"><a href="{{URL::to('/')}}/admin/dashboard?gatewayId={{$gatewayId}}">Manage Gateway</a></button> + <button type="button" class="btn btn-default"><a href="{{URL::to('/')}}/admin/dashboard?gatewayId={{$internalGatewayId}}">Manage Gateway</a></button> - <button type="button" class="btn btn-danger deactivateGateway-button" data-toggle="modal" data-target="#deactivateGateway" data-gatewayid="{{$gatewayId}}">Deactivate Gateway</button> + <button type="button" class="btn btn-danger deactivateGateway-button" data-toggle="modal" data-target="#deactivateGateway" data-gateway_id="{{$gateway['gatewayInfo']->gatewayId}}" data-internal_gateway_id="{{$internalGatewayId}}">Deactivate Gateway</button> --> </div> @elseif( $gateway["approvalStatus"] == "REQUESTED" || $gateway["approvalStatus"] == "APPROVED") - <a href="{{URL::to('/')}}/admin/update-gateway-request?gateway_id={{$gatewayId}}&cancelRequest=true"> + <a href="{{URL::to('/')}}/admin/update-gateway-request?internal_gateway_id={{$internalGatewayId}}&gateway_id={{$gateway['gatewayInfo']->gatewayId}}&cancelRequest=true"> <button type="button" class="btn btn-danger">Cancel Request</button> </a> @if( $gateway["approvalStatus"] == "APPROVED") - <a href="{{URL::to('/')}}/account/update-gateway?gateway-id={{$gatewayId}}&updateRequest=true"> + <a href="{{URL::to('/')}}/account/update-gateway?gateway-id={{$internalGatewayId}}&updateRequest=true"> <button type="button" class="gateway-update-button btn btn-default">Update Request</button> </a> @endif @@ -213,6 +213,7 @@ <form action="{{URL::to('/')}}/admin/update-gateway-request?status=3" method="GET"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <input type="hidden" id="deactivateGatewayId" name="gateway_id" value=""/> + <input type="hidden" id="deactivateInternalGatewayId" name="internal_gateway_id" value=""/> <button type="submit" class="btn btn-danger">Deactivate</button> </form> </div> @@ -466,8 +467,10 @@ */ $(".deactivateGateway-button").click( function(){ - var gatewayId = $(this).data("gatewayid"); - $("#deactivateGatewayId").val( gatewayId); + var gatewayId = $(this).data("gateway_id"); + var internalGatewayId = $(this).data("internal_gateway_id"); + $("#deactivateGatewayId").val( gatewayId ); + $("#deactivateInternalGatewayId").val( internalGatewayId ); }); $(".view-credentials").click( function(){ http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/app/views/account/update.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/update.blade.php b/app/views/account/update.blade.php index 77e94b6..e2e905c 100644 --- a/app/views/account/update.blade.php +++ b/app/views/account/update.blade.php @@ -40,10 +40,11 @@ @endforeach @endif - <form id="add-tenant-form" action="{{ URL::to('/') }}/provider/update-details?gateway_id={{ $gatewayData["gatewayId"] }}&updateRequest=true"> + <form id="add-tenant-form" action="{{ URL::to('/') }}/provider/update-details?updateRequest=true"> <div class="col-md-12 text-center" style="margin-top:20px;"> <h3>Update your Gateway details now!</h3> </div> + <input type="hidden" name="internal-gateway-id" value="{{ $gatewayData["airavataInternalGatewayId"] }}" /> <div class="form-group required"> <label class="control-label">Gateway ID</label> <input type="text" maxlength="50" name="gateway-id" class="form-control" readonly="readonly" required="required" value="{{ $gatewayData["gatewayId"] }}" /> http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/26a207a0/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 3ecddc5..d619f40 100644 --- a/app/views/admin/manage-gateway.blade.php +++ b/app/views/admin/manage-gateway.blade.php @@ -311,6 +311,7 @@ --> </div> <input type="hidden" class="gatewayid-for-approval" name="gateway_id"> + <input type="hidden" name="internal_gateway_id"> </div> <div class="modal-footer submit-actions"> <button type="submit" name="status" class="btn btn-primary update-gateway notApprovedGateway" value="approveRequest" >Approve Request</button> @@ -345,6 +346,7 @@ </div> </div> <input type="hidden" class="gatewayid-for-approval" name="gateway_id"> + <input type="hidden" name="internal_gateway_id"> <div class="modal-footer"> <input type="submit" name="status" class="btn btn-danger" value="Deny"/> <input type="cancel" data-dismiss="modal" class="btn btn-default" value="Cancel"/> @@ -592,6 +594,7 @@ $(".onTenantLoad").removeClass("hide"); $(".gatewayid-for-approval").val( gatewayId).html( gatewayId); + $("#approve-gateway").find("input[name=internal_gateway_id]").val( gatewayObject.airavataInternalGatewayId ); $(".gatewayName").val( gatewayObject.gatewayName); $(".gatewayAcronym").val( gatewayObject.gatewayAcronym); //$(".domain").val( gatewayObject.domain); @@ -813,6 +816,7 @@ $(".deny-approval").click( function(){ $(".gatewayid-for-approval").val( $(this).data("gatewayid")).html( $(this).data("gatewayid")); + $("#deny-gateway").find("input[name=internal_gateway_id]").val( gatewayObject.airavataInternalGatewayId ); $("#deny-gateway").modal("show"); });
