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/02/09 16:56:10 UTC
[42/50] [abbrv] airavata-php-gateway git commit: fixing admin
readonly not working issues
fixing admin readonly not working issues
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/9c8eb1fd
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/9c8eb1fd
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/9c8eb1fd
Branch: refs/heads/master
Commit: 9c8eb1fd7d4113b625c2e06d9746b8c6e3ff17dd
Parents: 94f291d
Author: scnakandala <su...@gmail.com>
Authored: Wed Feb 3 08:50:15 2016 -0500
Committer: scnakandala <su...@gmail.com>
Committed: Wed Feb 3 08:50:15 2016 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 2 +-
app/filters.php | 2 +-
app/libraries/Wsis/Wsis.php | 5 ++---
app/views/account/dashboard.blade.php | 10 +++++-----
app/views/admin/manage-credentials.blade.php | 4 ++++
5 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9c8eb1fd/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index a213870..a8ac349 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -144,7 +144,7 @@ class AccountController extends BaseController
}
//only for super admin
- if( Config::get('pga_config.portal')['super-admin-portal'] == true){
+ if( Config::get('pga_config.portal')['super-admin-portal'] == true && Session::has("admin")){
Session::put("super-admin", true);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9c8eb1fd/app/filters.php
----------------------------------------------------------------------
diff --git a/app/filters.php b/app/filters.php
index 5926e7d..638be33 100755
--- a/app/filters.php
+++ b/app/filters.php
@@ -120,7 +120,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")) {
return Redirect::to("home")->with("admin-alert", true);
}
} else
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9c8eb1fd/app/libraries/Wsis/Wsis.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php
index b62b254..aa40bda 100755
--- a/app/libraries/Wsis/Wsis.php
+++ b/app/libraries/Wsis/Wsis.php
@@ -278,8 +278,6 @@ class Wsis {
try {
$this->userStoreManager->deleteRole($roleName);
} catch (Exception $ex) {
- var_dump( $ex); exit;
-
throw new Exception("Unable to delete role", 0, $ex);
}
}
@@ -310,7 +308,8 @@ class Wsis {
*/
public function getUserRoles( $username){
try {
- return $this->userStoreManager->getRoleListOfUser( $username);
+ $roles = $this->userStoreManager->getRoleListOfUser( $username);
+ return array_filter($roles, "Wsis::nonInternalRoles");
} catch (Exception $ex) {
throw new Exception("Unable to get User roles.", 0, $ex);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9c8eb1fd/app/views/account/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/dashboard.blade.php b/app/views/account/dashboard.blade.php
index 2de5b68..c210d2c 100644
--- a/app/views/account/dashboard.blade.php
+++ b/app/views/account/dashboard.blade.php
@@ -19,7 +19,7 @@
{{ Session::forget("message") }}
@endif
- @if( Session::has('authorized-user') || Session::has('admin') )
+ @if( Session::has('authorized-user') || Session::has('admin') || Session::has('admin-read-only') )
<div class="row text-center breathing-space">
<h1>Let's get started!</h1>
</div>
@@ -30,7 +30,7 @@
<h3>See what's happening in your projects</h3>
<a href="{{URL::to('/')}}/project/browse">
- <div class="@if( Session::has('admin')) col-md-4 @else col-md-6 @endif well">
+ <div class="@if( Session::has('admin') || Session::has('admin-read-only')) col-md-4 @else col-md-6 @endif well">
<div class="col-md-12">
<span class="glyphicon glyphicon-off console-icon"></span>
</div>
@@ -41,7 +41,7 @@
</a>
<a href="{{URL::to('/')}}/experiment/browse">
- <div class="@if( Session::has('admin')) col-md-4 @else col-md-6 @endif well">
+ <div class="@if( Session::has('admin') || Session::has('admin-read-only')) col-md-4 @else col-md-6 @endif well">
<div class="col-md-12">
<span class="glyphicon glyphicon-tasks console-icon"></span>
</div>
@@ -51,7 +51,7 @@
</div>
</a>
- @if( Session::has('admin'))
+ @if( Session::has('admin') || Session::has('admin-read-only'))
<a href="{{URL::to('/')}}/admin/dashboard/experiments">
<div class="col-md-4 well">
<div class="col-md-12">
@@ -65,7 +65,7 @@
@endif
</div>
- @if( Session::has('admin'))
+ @if( Session::has('admin') || Session::has('admin-read-only'))
<div class="row well">
<h3>Manage Users Access</h3>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/9c8eb1fd/app/views/admin/manage-credentials.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-credentials.blade.php b/app/views/admin/manage-credentials.blade.php
index 14708c4..16b2a34 100644
--- a/app/views/admin/manage-credentials.blade.php
+++ b/app/views/admin/manage-credentials.blade.php
@@ -44,7 +44,9 @@
Token
</th>
<th class="text-center">Public Key</th>
+ @if( Session::has("admin"))
<th>Delete</th>
+ @endif
</tr>
<tbody class="token-values">
@foreach( $tokens as $token => $publicKey)
@@ -55,9 +57,11 @@
<td class="public-key">
{{ $publicKey }}
</td>
+ @if( Session::has("admin"))
<td>
<span data-token="{{$token}}" class="glyphicon glyphicon-trash remove-token"></span>
</td>
+ @endif
</tr>
@endforeach
</tbody>