Minor Fix for super admin gateway preferences.
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/428a884c Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/428a884c Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/428a884c Branch: refs/heads/master Commit: 428a884cf13841515054ccc572a55b31901a0649 Parents: 828533a Author: Nipurn Doshi <[email protected]> Authored: Tue Feb 2 16:39:11 2016 -0500 Committer: Nipurn Doshi <[email protected]> Committed: Tue Feb 2 16:39:11 2016 -0500 ---------------------------------------------------------------------- app/libraries/CRUtilities.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/428a884c/app/libraries/CRUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php index 6261acd..e38a475 100755 --- a/app/libraries/CRUtilities.php +++ b/app/libraries/CRUtilities.php @@ -459,11 +459,17 @@ class CRUtilities 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); - $selectedCRs[] = $crp->computeResourceId; + + //had to add this condition since for super admin it takes CRs selected in all gateways. + if( $gp->gatewayID == Session::get("gateway_id")) + $selectedCRs[] = $crp->computeResourceId; } foreach( (array)$gp->storagePreferences as $j => $srp){ $gatewayProfiles[$index]->storagePreferences[$j]->srDetails = Airavata::getStorageResource( Session::get('authz-token'), $srp->storageResourceId); - $selectedSRs[] = $srp->storageResourceId; + + //had to add this condition since for super admin it takes SRs selected in all gateways. + if( $gp->gatewayID == Session::get("gateway_id")) + $selectedSRs[] = $srp->storageResourceId; } $gateways[$key]->profile = $gatewayProfiles[$index]; }
