Skip to content

Commit

Permalink
Fixed issue #6985: Custom default template is not used as default in …
Browse files Browse the repository at this point in the history
…user template permission
  • Loading branch information
c-schmitz committed Dec 3, 2012
1 parent b0240db commit 403f027
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion application/controllers/admin/globalsettings.php
Expand Up @@ -68,7 +68,12 @@ private function _displaySettings()

// Some URLs are not to be allowed to refered back to.
// These exceptions can be added to the $aReplacements array
$aReplacements=array('admin/user/adduser'=>'admin/user/index');
$aReplacements=array('admin/user/adduser'=>'admin/user/index',
'admin/user/sa/adduser'=>'admin/user/sa/index',
'admin/user/sa/setusertemplates'=>'admin/user/sa/index',
'admin/user/setusertemplates'=>'admin/user/sa/index'

);
$refurl= str_replace(array_keys($aReplacements),array_values($aReplacements),$refurl);
Yii::app()->session['refurl'] = htmlspecialchars($refurl); //just to be safe!

Expand Down
4 changes: 2 additions & 2 deletions application/controllers/admin/useraction.php
Expand Up @@ -105,7 +105,7 @@ function adduser()

if ($iNewUID) {
// add default template to template rights for user
Templates_rights::model()->insertRecords(array('uid' => $iNewUID, 'folder' => 'default', 'use' => '1'));
Templates_rights::model()->insertRecords(array('uid' => $iNewUID, 'folder' => Yii::app()->getConfig("defaulttemplate"), 'use' => '1'));

// add new user to userlist
$sresult = User::model()->getAllRecords(array('uid' => $iNewUID));
Expand Down Expand Up @@ -433,7 +433,7 @@ function userrights()
$postuserid = Yii::app()->request->getPost("uid");
$aViewUrls = array();

// A user can't modify his own rights ;-)
// A user can't modify his own rights
if ($postuserid != Yii::app()->session['loginID']) {
$sresult = User::model()->findAllByAttributes(array('uid' => $postuserid, 'parent_id' => Yii::app()->session['loginID']));
$sresultcount = count($sresult);
Expand Down

0 comments on commit 403f027

Please sign in to comment.