airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing warning message
Date Tue, 12 Jan 2016 06:54:26 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master 91d7391a7 -> 7b8cd1147


fixing warning message


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/7b8cd114
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/7b8cd114
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/7b8cd114

Branch: refs/heads/master
Commit: 7b8cd1147f6d1bdfb3a4f948ec43de285e3fc04c
Parents: 91d7391
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Jan 12 01:54:20 2016 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Jan 12 01:54:20 2016 -0500

----------------------------------------------------------------------
 app/controllers/AdminController.php | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/7b8cd114/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index 2b45e4b..23096f1 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -4,7 +4,6 @@ class AdminController extends BaseController {
 
 	public function __construct()
 	{
-        $this->beforeFilter('verifyadmin');
 		Session::put("nav-active", "user-console");
 	}
 
@@ -13,12 +12,14 @@ class AdminController extends BaseController {
 	}
 
 	public function addAdminSubmit(){
-        WSIS::update_user_roles( Input::get("username"), array( "new"=>array("admin"),
"deleted"=>array() ) );
+		$this->beforeFilter('verifyadmin');
+		WSIS::update_user_roles( Input::get("username"), array( "new"=>array("admin"), "deleted"=>array()
) );
 
    		return View::make("account/admin-dashboard")->with("message", "User has been added
to Admin.");
 	}
 
 	public function usersView(){
+		$this->beforeFilter('verifyadmin');
 		if( Input::has("role"))
 		{
 			$users = WSIS::getUserlistOfRole(Input::get("role"));
@@ -37,6 +38,7 @@ class AdminController extends BaseController {
 	}
 
     public function searchUsersView(){
+		$this->beforeFilter('verifyadmin');
         if(Input::has("search_val"))
         {
             $users =  WSIS::searchUsers(Input::get("search_val"));
@@ -51,6 +53,7 @@ class AdminController extends BaseController {
     }
 
     public function gatewayView(){
+		$this->beforeFilter('verifyadmin');
     	//only for super admin
 		//Session::put("super-admin", true);
 		$crData = CRUtilities::getEditCRData();
@@ -74,6 +77,7 @@ class AdminController extends BaseController {
     }
 
 	public function addGatewayAdminSubmit(){
+		$this->beforeFilter('verifyadmin');
 		//check if username exists
 		if(WSIS::usernameExists( Input::get("username")) )
 		{
@@ -87,29 +91,33 @@ class AdminController extends BaseController {
 	}
 
 	public function rolesView(){
-
+		$this->beforeFilter('verifyadmin');
 		$roles = WSIS::getAllRoles();
         Session::put("admin-nav", "manage-roles");
         return View::make("admin/manage-roles", array("roles" => $roles));
 	}
 
 	public function experimentsView(){
+		$this->beforeFilter('verifyadmin');
         Session::put("admin-nav", "exp-statistics");
 		return View::make("admin/manage-experiments" );
 	}
 
 	public function resourcesView(){
+		$this->beforeFilter('verifyadmin');
 		$data = CRUtilities::getBrowseCRData(false);
 		$allCRs = $data["crObjects"];
 		return View::make("admin/manage-resources", array("resources" => $allCRs) );
 	}
 
 	public function addRole(){
+		$this->beforeFilter('verifyadmin');
 		WSIS::addRole( Input::get("role") );
 		return Redirect::to("admin/dashboard/roles")->with( "message", "Role has been added.");
 	}
 
     public function addRolesToUser(){
+		$this->beforeFilter('verifyadmin');
         $currentRoles = (array)WSIS::getUserRoles(Input::get("username"));
         $roles["new"] = array_diff(Input::all()["roles"], $currentRoles);
         $roles["deleted"] = array_diff($currentRoles, Input::all()["roles"]);
@@ -130,6 +138,7 @@ class AdminController extends BaseController {
     }
 
     public function removeRoleFromUser(){
+		$this->beforeFilter('verifyadmin');
         $roles["deleted"] = array(Input::all()["roleName"]);
         $roles["new"] = array();
         $username = Input::all()["username"];
@@ -138,16 +147,19 @@ class AdminController extends BaseController {
     }
 
 	public function getRoles(){
+		$this->beforeFilter('verifyadmin');
 		return json_encode((array)WSIS::getUserRoles(Input::get("username")));
 	}
 
 	public function deleteRole(){
+		$this->beforeFilter('verifyadmin');
 		WSIS::deleteRole( Input::get("role") );
 		return Redirect::to("admin/dashboard/roles")->with( "message", "Role has been deleted.");
 
 	}
 
 	public function credentialStoreView(){
+		$this->beforeFilter('verifyadmin');
         Session::put("admin-nav", "credential-store");
         $tokens = AdminUtilities::get_all_ssh_tokens();
         //var_dump( $tokens); exit;
@@ -155,6 +167,7 @@ class AdminController extends BaseController {
 	}
 
 	public function updateUserRoles(){
+		$this->beforeFilter('verifyadmin');
 		if( Input::has("add"))
 			return WSIS::updateUserRoles(Input::get("username"), array("new"=> Input::get("roles"),
"deleted" => array() ) );
 		else
@@ -165,7 +178,7 @@ class AdminController extends BaseController {
 	/* ---- Super Admin Functions ------- */
 
 	public function addGateway(){
-
+		$this->beforeFilter('verifyadmin');
 		$inputs = Input::all();
 
         $gateway = AdminUtilities::add_gateway(Input::all());
@@ -181,6 +194,7 @@ class AdminController extends BaseController {
 
     public function experimentStatistics()
     {
+		$this->beforeFilter('verifyadmin');
         if (Request::ajax()) {
             $inputs = Input::all();
             $expStatistics = AdminUtilities::get_experiment_execution_statistics(strtotime($inputs['fromTime'])
* 1000
@@ -191,6 +205,7 @@ class AdminController extends BaseController {
 
     public function getExperimentsOfTimeRange()
     {
+		$this->beforeFilter('verifyadmin');
         if (Request::ajax()) {
             $inputs = Input::all();
             $expContainer = AdminUtilities::get_experiments_of_time_range($inputs);
@@ -204,6 +219,7 @@ class AdminController extends BaseController {
     }
 
     public function enableComputeResource(){
+		$this->beforeFilter('verifyadmin');
         $resourceId = Input::get("resourceId");
         $computeResource = CRUtilities::get_compute_resource($resourceId);
         $computeResource->enabled = true;
@@ -211,6 +227,7 @@ class AdminController extends BaseController {
     }
 
     public function disableComputeResource(){
+		$this->beforeFilter('verifyadmin');
         $resourceId = Input::get("resourceId");
         $computeResource = CRUtilities::get_compute_resource($resourceId);
         $computeResource->enabled = false;
@@ -218,6 +235,7 @@ class AdminController extends BaseController {
     }
 
 	public function createSSH(){
+		$this->beforeFilter('verifyadmin');
 		$newToken = AdminUtilities::create_ssh_token();
 		$pubkey = AdminUtilities::get_pubkey_from_token( $newToken);
 		return Response::json( array( "token" => $newToken, "pubkey" => $pubkey));
@@ -225,6 +243,7 @@ class AdminController extends BaseController {
 	}
 
 	public function removeSSH(){
+		$this->beforeFilter('verifyadmin');
 		$removeToken = Input::get("token");
 		if( AdminUtilities::remove_ssh_token( $removeToken) )
 			return 1;


Mime
View raw message