Repository: airavata-php-gateway Updated Branches: refs/heads/develop 67c21ca66 -> 0bb7892b8
AIRAVATA-2295 Handle missing default SSH credential A user should not be able to delete their default SSH credential. However, if that should happen because of a bug or something, then this change makes it possible for a user to set a default SSH credential. 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/0bb7892b Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/0bb7892b Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/0bb7892b Branch: refs/heads/develop Commit: 0bb7892b8c63bd2a5a104b5644b386d71b2fec34 Parents: 67c21ca Author: Marcus Christie <machris...@apache.org> Authored: Fri Dec 30 16:29:21 2016 -0500 Committer: Marcus Christie <machris...@apache.org> Committed: Fri Dec 30 16:29:21 2016 -0500 ---------------------------------------------------------------------- app/controllers/UserSettingsController.php | 6 +++--- app/views/account/credential-store.blade.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0bb7892b/app/controllers/UserSettingsController.php ---------------------------------------------------------------------- diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php index ef09932..a3eba04 100644 --- a/app/controllers/UserSettingsController.php +++ b/app/controllers/UserSettingsController.php @@ -15,15 +15,15 @@ class UserSettingsController extends BaseController $userResourceProfile = URPUtilities::get_or_create_user_resource_profile(); $userCredentialSummaries = URPUtilities::get_all_ssh_pub_keys_summary_for_user(); - $defaultCredentialSummary = $userCredentialSummaries[$userResourceProfile->credentialStoreToken]; + $defaultCredentialToken = $userResourceProfile->credentialStoreToken; foreach ($userCredentialSummaries as $credentialSummary) { - $credentialSummary->canDelete = ($credentialSummary->token != $defaultCredentialSummary->token); + $credentialSummary->canDelete = ($credentialSummary->token != $defaultCredentialToken); } return View::make("account/credential-store", array( "userResourceProfile" => $userResourceProfile, "credentialSummaries" => $userCredentialSummaries, - "defaultCredentialSummary" => $defaultCredentialSummary + "defaultCredentialToken" => $defaultCredentialToken )); } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/0bb7892b/app/views/account/credential-store.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/credential-store.blade.php b/app/views/account/credential-store.blade.php index 1d56804..a6b0b33 100644 --- a/app/views/account/credential-store.blade.php +++ b/app/views/account/credential-store.blade.php @@ -54,7 +54,7 @@ </div> </div> <div class="col-md-6"> - @if ($credentialSummary->token != $defaultCredentialSummary->token) + @if ($credentialSummary->token != $defaultCredentialToken) <form style="display: inline" action="{{ URL::to('/') }}/account/set-default-credential" method="post"> <input type="hidden" name="defaultToken" value="{{$credentialSummary->token}}"/> <button type="submit" class="btn btn-default">Make Default</button>