diff --git a/CHANGELOG b/CHANGELOG index 45f2f2a19..4e864b567 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -19,6 +19,7 @@ - much better form validation based on jquery validation - secure unlocking/locking of a documents with form token to prevent CSRF attacks - append referuri to base url to prevent redirects to arbitraty sites in op.Login.php +- theme can be set in user manager -------------------------------------------------------------------------------- Changes in version 5.1.22 diff --git a/op/op.UsrMgr.php b/op/op.UsrMgr.php index f5991e74a..d94614bd9 100644 --- a/op/op.UsrMgr.php +++ b/op/op.UsrMgr.php @@ -66,6 +66,7 @@ if ($action == "adduser") { UI::exitError(getMLText("admin_tools"),getMLText("user_email_missing")); } $comment = $_POST["comment"]; + $theme = $_POST["theme"]; if ($settings->_strictFormCheck && !$comment) { UI::exitError(getMLText("admin_tools"),getMLText("user_comment_missing")); } @@ -79,7 +80,7 @@ if ($action == "adduser") { UI::exitError(getMLText("admin_tools"),getMLText("user_exists")); } - $newUser = $dms->addUser($login, seed_pass_hash($pwd), $name, $email, $settings->_language, $settings->_theme, $comment, $role, $isHidden, $isDisabled, $pwdexpiration, $quota, $homefolder); + $newUser = $dms->addUser($login, seed_pass_hash($pwd), $name, $email, $settings->_language, $theme, $comment, $role, $isHidden, $isDisabled, $pwdexpiration, $quota, $homefolder); if ($newUser) { /* Set user image if uploaded */ @@ -350,6 +351,7 @@ else if ($action == "edituser") { $name = $_POST["name"]; $email = $_POST["email"]; $comment = $_POST["comment"]; + $theme = $_POST["theme"]; $role = preg_replace('/[^0-2]+/', '', $_POST["role"]); $isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0); $isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0); @@ -387,6 +389,8 @@ else if ($action == "edituser") { $editedUser->setEmail($email); if ($editedUser->getComment() != $comment) $editedUser->setComment($comment); + if ($editedUser->getTheme() != $theme) + $editedUser->setTheme($theme); if ($editedUser->getRole() != $role) $editedUser->setRole($role); if ($editedUser->getQuota() != $quota) diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index fa81cc378..acb4f0ed3 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -214,6 +214,7 @@ $(document).ready( function() { function showUserForm($currUser) { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; + $settings = $this->params['settings']; $users = $this->params['allusers']; $groups = $this->params['allgroups']; $passwordstrength = $this->params['passwordstrength']; @@ -328,6 +329,19 @@ $(document).ready( function() { 'options'=>$options ) ); + $themes = UI::getStyles(); + $options = array(); + foreach ($themes as $currTheme) { + $options[] = array($currTheme, $currTheme, ($currUser && ($currTheme == $currUser->getTheme())) || ($currTheme == $settings->_theme)); + } + $this->formField( + getMLText("theme"), + array( + 'element'=>'select', + 'name'=>'theme', + 'options'=>$options + ) + ); $options = array(); foreach($groups as $group) { $options[] = array($group->getID(), htmlspecialchars($group->getName()), ($currUser && $group->isMember($currUser)));