View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
09155Bug reportsOtherpublic2014-08-12 09:57
Reporterbaltes Assigned Tosammousa  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Summary09155: Receiving PHP warning while trying to edit global rights for surveyadmins
Description

After I click on the icon for setting the global rights for a surveyadmin, I get the following PHP-warning:

PHP warning

uasort() expects parameter 2 to be a valid callback, function 'comparePermission' not found or invalid function name

/srv/www/htdocs/limesurvey/application/models/Permission.php(102)

Steps To Reproduce

problem is reproducable for each surveyadmin

Additional Information

Full Error is attached

TagsNo tags attached.
Attached Files
PHP warning.txt (8,370 bytes)   
PHP warning
uasort() expects parameter 2 to be a valid callback, function 'comparePermission' not found or invalid function name 
/srv/www/htdocs/limesurvey/application/models/Permission.php(102)
090     public static function getGlobalBasePermissions()
091     {
092         $clang = Yii::app()->lang;
093         $aPermissions=array(
094             'surveys'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>false,'export'=>true,'title'=>$clang->gT("Surveys"),'description'=>$clang->gT("Permission to create surveys (for which all permissions are automatically given) and view, update and delete surveys from other users"),'img'=>'survey'),
095             'users'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>false,'export'=>false,'title'=>$clang->gT("Users"),'description'=>$clang->gT("Permission to create, view, update and delete users"),'img'=>'security'),
096             'usergroups'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>false,'export'=>false,'title'=>$clang->gT("User groups"),'description'=>$clang->gT("Permission to create, view, update and delete user groups"),'img'=>'usergroup'),
097             'templates'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>true,'export'=>true,'title'=>$clang->gT("Templates"),'description'=>$clang->gT("Permission to create, view, update, delete, export and import templates"),'img'=>'templates'),
098             'labelsets'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>true,'export'=>true,'title'=>$clang->gT("Label sets"),'description'=>$clang->gT("Permission to create, view, update, delete, export and import label sets/labels"),'img'=>'labels'),
099             'settings'=>array('create'=>false,'read'=>true,'update'=>true,'delete'=>false,'import'=>true,'export'=>false,'title'=>$clang->gT("Settings & Plugins"),'description'=>$clang->gT("Permission to view and update global settings & plugins and to delete and import plugins"),'img'=>'global'),
100             'participantpanel'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>false,'export'=>true,'title'=>$clang->gT("Participant panel"),'description'=>$clang->gT("Permission to create your own participants in the central participants database (for which all permissions are automatically given) and view, update and delete participants from other users"),'img'=>'cpdb'),
101         );
102         uasort($aPermissions,"comparePermission");
103         $aPermissions=array('superadmin'=>array('create'=>false,'read'=>true,'update'=>false,'delete'=>false,'import'=>false,'export'=>false,'title'=>$clang->gT("Superadministrator"),'description'=>$clang->gT("Unlimited administration permissions"),'img'=>'superadmin'))+$aPermissions;
104         return $aPermissions;
105     }    
106     
107     public static function getPermissions($iUserID, $iEntityID=null, $sEntityName=null)
108     {
109         if ($sEntityName=='survey')
110         {
111             $aBasePermissions=Permission::model()->getSurveyBasePermissions();
112         }
113         elseif ($sEntityName=='global')
114         {   
Stack Trace
#0 
�
�/srv/www/htdocs/limesurvey/application/models/Permission.php(102): uasort(array("surveys" => array("create" => true, "read" => true, "update" => true, "delete" => true, ...), "users" => array("create" => true, "read" => true, "update" => true, "delete" => true, ...), "usergroups" => array("create" => true, "read" => true, "update" => true, "delete" => true, ...), "templates" => array("create" => true, "read" => true, "update" => true, "delete" => true, ...), ...), "comparePermission") 
097             'templates'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>true,'export'=>true,'title'=>$clang->gT("Templates"),'description'=>$clang->gT("Permission to create, view, update, delete, export and import templates"),'img'=>'templates'),
098             'labelsets'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>true,'export'=>true,'title'=>$clang->gT("Label sets"),'description'=>$clang->gT("Permission to create, view, update, delete, export and import label sets/labels"),'img'=>'labels'),
099             'settings'=>array('create'=>false,'read'=>true,'update'=>true,'delete'=>false,'import'=>true,'export'=>false,'title'=>$clang->gT("Settings & Plugins"),'description'=>$clang->gT("Permission to view and update global settings & plugins and to delete and import plugins"),'img'=>'global'),
100             'participantpanel'=>array('create'=>true,'read'=>true,'update'=>true,'delete'=>true,'import'=>false,'export'=>true,'title'=>$clang->gT("Participant panel"),'description'=>$clang->gT("Permission to create your own participants in the central participants database (for which all permissions are automatically given) and view, update and delete participants from other users"),'img'=>'cpdb'),
101         );
102         uasort($aPermissions,"comparePermission");
103         $aPermissions=array('superadmin'=>array('create'=>false,'read'=>true,'update'=>false,'delete'=>false,'import'=>false,'export'=>false,'title'=>$clang->gT("Superadministrator"),'description'=>$clang->gT("Unlimited administration permissions"),'img'=>'superadmin'))+$aPermissions;
104         return $aPermissions;
105     }    
106     
107     public static function getPermissions($iUserID, $iEntityID=null, $sEntityName=null)
#1 
�
�/srv/www/htdocs/limesurvey/application/controllers/admin/useraction.php(477): Permission::getGlobalBasePermissions() 
472         if ($oInitialAdmin && $oInitialAdmin->uid == $iUserID) // it's the original superadmin !!!
473         {
474             Yii::app()->setFlashMessage(Yii::app()->lang->gT("Initial Superadmin permissions cannot be updated!"),'error');
475             $this->getController()->redirect(array("admin/user/sa/index"));
476         }
477         $aBaseUserPermissions = Permission::model()->getGlobalBasePermissions();
478         if ($iUserID) {//Never update 1st admin
479             if(Permission::model()->hasGlobalPermission('superadmin','read'))
480                 $oUser = User::model()->findByAttributes(array('uid' => $iUserID));
481             else
482                 $oUser = User::model()->findByAttributes(array('uid' => $iUserID, 'parent_id' => Yii::app()->session['loginID']));
#2 
�unknown(0): UserAction->setuserpermissions() 
#3 
+
�/srv/www/htdocs/limesurvey/framework/web/actions/CAction.php(108): ReflectionMethod->invokeArgs(UserAction, array()) 
#4 
�
�/srv/www/htdocs/limesurvey/application/core/Survey_Common_Action.php(99): CAction->runWithParamsInternal(UserAction, ReflectionMethod, array("sa" => "setuserpermissions")) 
094             $oMethod = new ReflectionMethod($this, $sDefault);
095         }
096 
097         // We're all good to go, let's execute it
098         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
099         return parent::runWithParamsInternal($this, $oMethod, $params);
100     }
101 
102     /**
103     * Some functions have different parameters, which are just an alias of the
104     * usual parameters we're getting in the url. This function just populates
#5 
+
�/srv/www/htdocs/limesurvey/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("sa" => "setuserpermissions")) 
#6 
+
�/srv/www/htdocs/limesurvey/framework/web/CController.php(286): CController->runAction(UserAction) 
#7 
+
�/srv/www/htdocs/limesurvey/framework/web/CController.php(265): CController->runActionWithFilters(UserAction, array()) 
#8 
+
�/srv/www/htdocs/limesurvey/application/controllers/AdminController.php(169): CController->run("user") 
#9 
+
�/srv/www/htdocs/limesurvey/framework/web/CWebApplication.php(282): AdminController->run("user") 
#10 
+
�/srv/www/htdocs/limesurvey/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/user/sa/setuserpermissions") 
#11 
+
�/srv/www/htdocs/limesurvey/framework/base/CApplication.php(180): CWebApplication->processRequest() 
#12 
+
�/srv/www/htdocs/limesurvey/index.php(200): CApplication->run() 
2014-08-05 09:33:22 Apache/2.2.12 (Linux/SUSE) Yii Framework/1.1.14 

PHP warning.txt (8,370 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)140730
I will donate to the project if issue is resolvedNo
BrowserFirefox 31
Database type & versionmysql-5.5.37-0.7.1
Server OS (if known)SLES 11 SP3
Webserver software & version (if known)Apache 2.2.12
PHP Version5.3.17

Users monitoring this issue

baltes

Activities

baltes

baltes

2014-08-12 09:02

reporter   ~30408

Reminder sent to: sammousa

The Bug makes it impossible to generate new surveyadmins, it is very important to fix this.

sammousa

sammousa

2014-08-12 09:21

reporter   ~30409

This has already been fixed on github.

c_schmitz

c_schmitz

2014-08-12 09:57

administrator   ~30411

It is also already released - please alway update to the latest version before reporting a bug.

Issue History

Date Modified Username Field Change
2014-08-05 11:49 baltes New Issue
2014-08-05 11:49 baltes File Added: PHP warning.txt
2014-08-05 14:20 c_schmitz Assigned To => sammousa
2014-08-05 14:20 c_schmitz Status new => assigned
2014-08-05 14:33 baltes Issue Monitored: baltes
2014-08-12 09:02 baltes Note Added: 30408
2014-08-12 09:21 sammousa Note Added: 30409
2014-08-12 09:21 sammousa Status assigned => resolved
2014-08-12 09:21 sammousa Resolution open => fixed
2014-08-12 09:57 c_schmitz Status resolved => closed
2014-08-12 09:57 c_schmitz Note Added: 30411