diff --git a/CHANGELOG b/CHANGELOG index bb774bd1f..c3878be79 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -220,6 +220,8 @@ - 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 +- fields in configuration can be omitted from display -------------------------------------------------------------------------------- Changes in version 5.1.22 diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 9c2548f3e..45b293cf5 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -24,6 +24,8 @@ class Settings { /* {{{ */ // Config File Path var $_configFilePath = null; + // Fields not shown in gui + var $_hiddenConfFields = ''; // Name of site var $_siteName = "SeedDMS"; // Message to display at the bottom of every page. @@ -720,6 +722,7 @@ class Settings { /* {{{ */ $this->_useHomeAsRootFolder = Settings::boolval($tab["useHomeAsRootFolder"]); $this->_titleDisplayHack = Settings::boolval($tab["titleDisplayHack"]); $this->_showMissingTranslations = Settings::boolval($tab["showMissingTranslations"]); + $this->_hiddenConfFields = strval($tab["hiddenConfFields"]); } // XML Path: /configuration/advanced/authentication @@ -1080,6 +1083,7 @@ class Settings { /* {{{ */ $this->setXMLAttributValue($node, "useHomeAsRootFolder", $this->_useHomeAsRootFolder); $this->setXMLAttributValue($node, "titleDisplayHack", $this->_titleDisplayHack); $this->setXMLAttributValue($node, "showMissingTranslations", $this->_showMissingTranslations); + $this->setXMLAttributValue($node, "hiddenConfFields", $this->_hiddenConfFields); // XML Path: /configuration/advanced/authentication $node = $this->getXMLNode($xml, '/configuration/advanced', 'authentication'); diff --git a/op/op.UsrMgr.php b/op/op.UsrMgr.php index 73262cd4e..378c52a56 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 */ @@ -371,6 +372,7 @@ else if ($action == "edituser") { $name = $_POST["name"]; $email = $_POST["email"]; $comment = $_POST["comment"]; + $theme = $_POST["theme"]; $role = $dms->getRole($_POST["role"]); $isHidden = (isset($_POST["ishidden"]) && $_POST["ishidden"]==1 ? 1 : 0); $isDisabled = (isset($_POST["isdisabled"]) && $_POST["isdisabled"]==1 ? 1 : 0); @@ -408,6 +410,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.Settings.php b/views/bootstrap/class.Settings.php index 73bf071f1..e9a95b10b 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -88,6 +88,24 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { $this->showRawConfigHeadline(htmlspecialchars(getMLText($title))); } /* }}} */ + /** + * Show a text input configuration option + * + * @param string $title title of the option + * @param string $name name of html input field + * @param string $type can be 'password', 'array' + * @param string $placeholder placeholder for input field + */ + protected function isVisible($name) { /* {{{ */ + $settings = $this->params['settings']; + if(!($hcf = $settings->_hiddenConfFields)) + return true; + $hcfa = explode(';', $hcf); + if(in_array($name, $hcfa)) + return false; + return true; + } /* }}} */ + /** * Show a text input configuration option * @@ -98,6 +116,8 @@ class SeedDMS_View_Settings extends SeedDMS_Theme_Style { */ protected function showConfigText($title, $name, $type='', $placeholder='') { /* {{{ */ $settings = $this->params['settings']; + if(!$this->isVisible($name)) + return; ?>