mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
theme can be set in user manager
This commit is contained in:
parent
e21ef794c4
commit
f8d81bd734
|
@ -19,6 +19,7 @@
|
||||||
- much better form validation based on jquery validation
|
- much better form validation based on jquery validation
|
||||||
- secure unlocking/locking of a documents with form token to prevent CSRF attacks
|
- 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
|
- 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
|
Changes in version 5.1.22
|
||||||
|
|
|
@ -66,6 +66,7 @@ if ($action == "adduser") {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("user_email_missing"));
|
UI::exitError(getMLText("admin_tools"),getMLText("user_email_missing"));
|
||||||
}
|
}
|
||||||
$comment = $_POST["comment"];
|
$comment = $_POST["comment"];
|
||||||
|
$theme = $_POST["theme"];
|
||||||
if ($settings->_strictFormCheck && !$comment) {
|
if ($settings->_strictFormCheck && !$comment) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("user_comment_missing"));
|
UI::exitError(getMLText("admin_tools"),getMLText("user_comment_missing"));
|
||||||
}
|
}
|
||||||
|
@ -79,7 +80,7 @@ if ($action == "adduser") {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("user_exists"));
|
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) {
|
if ($newUser) {
|
||||||
|
|
||||||
/* Set user image if uploaded */
|
/* Set user image if uploaded */
|
||||||
|
@ -350,6 +351,7 @@ else if ($action == "edituser") {
|
||||||
$name = $_POST["name"];
|
$name = $_POST["name"];
|
||||||
$email = $_POST["email"];
|
$email = $_POST["email"];
|
||||||
$comment = $_POST["comment"];
|
$comment = $_POST["comment"];
|
||||||
|
$theme = $_POST["theme"];
|
||||||
$role = preg_replace('/[^0-2]+/', '', $_POST["role"]);
|
$role = preg_replace('/[^0-2]+/', '', $_POST["role"]);
|
||||||
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
$isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0);
|
||||||
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
$isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0);
|
||||||
|
@ -387,6 +389,8 @@ else if ($action == "edituser") {
|
||||||
$editedUser->setEmail($email);
|
$editedUser->setEmail($email);
|
||||||
if ($editedUser->getComment() != $comment)
|
if ($editedUser->getComment() != $comment)
|
||||||
$editedUser->setComment($comment);
|
$editedUser->setComment($comment);
|
||||||
|
if ($editedUser->getTheme() != $theme)
|
||||||
|
$editedUser->setTheme($theme);
|
||||||
if ($editedUser->getRole() != $role)
|
if ($editedUser->getRole() != $role)
|
||||||
$editedUser->setRole($role);
|
$editedUser->setRole($role);
|
||||||
if ($editedUser->getQuota() != $quota)
|
if ($editedUser->getQuota() != $quota)
|
||||||
|
|
|
@ -214,6 +214,7 @@ $(document).ready( function() {
|
||||||
function showUserForm($currUser) { /* {{{ */
|
function showUserForm($currUser) { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$user = $this->params['user'];
|
||||||
|
$settings = $this->params['settings'];
|
||||||
$users = $this->params['allusers'];
|
$users = $this->params['allusers'];
|
||||||
$groups = $this->params['allgroups'];
|
$groups = $this->params['allgroups'];
|
||||||
$passwordstrength = $this->params['passwordstrength'];
|
$passwordstrength = $this->params['passwordstrength'];
|
||||||
|
@ -328,6 +329,19 @@ $(document).ready( function() {
|
||||||
'options'=>$options
|
'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();
|
$options = array();
|
||||||
foreach($groups as $group) {
|
foreach($groups as $group) {
|
||||||
$options[] = array($group->getID(), htmlspecialchars($group->getName()), ($currUser && $group->isMember($currUser)));
|
$options[] = array($group->getID(), htmlspecialchars($group->getName()), ($currUser && $group->isMember($currUser)));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user