add option to disable setting a password

This commit is contained in:
Uwe Steinmann 2023-08-25 12:34:09 +02:00
parent c51088a3b6
commit 95372d6905
5 changed files with 10 additions and 0 deletions

View File

@ -47,6 +47,8 @@ class Settings { /* {{{ */
var $_enableGuestAutoLogin = false;
// Allow users to reset their password
var $_enablePasswordForgotten = false;
// Do not allow users to change password
var $_disableChangePassword = false;
// Minimum password strength (0 - x, 0 means no check)
var $_passwordStrength = 0;
// Password strength algorithm (simple, advanced)
@ -627,6 +629,7 @@ class Settings { /* {{{ */
$this->_restricted = Settings::boolVal($tab["restricted"]);
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
$this->_disableChangePassword = Settings::boolVal($tab["disableChangePassword"]);
}
// XML Path: /configuration/system/authentication/connectors/connector
@ -998,6 +1001,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "restricted", $this->_restricted);
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
$this->setXMLAttributValue($node, "disableChangePassword", $this->_disableChangePassword);
// XML Path: /configuration/system/authentication/connectors
foreach($this->_usersConnectors as $keyConn => $paramConn)

View File

@ -196,6 +196,7 @@ if ($action == "saveSettings")
setBoolValue("restricted");
setBoolValue("enableUserImage");
setBoolValue("disableSelfEdit");
setBoolValue("disableChangePassword");
setBoolValue("enablePasswordForgotten");
setIntValue("passwordStrength");
setStrValue("passwordStrengthAlgorithm");

View File

@ -48,6 +48,7 @@ if($view) {
$view->setParam('enablelanguageselector', $settings->_enableLanguageSelector);
$view->setParam('enablethemeselector', $settings->_enableThemeSelector);
$view->setParam('passwordstrength', $settings->_passwordStrength);
$view->setParam('disablechangepassword', $settings->_disableChangePassword);
$view->setParam('httproot', $settings->_httpRoot);
$view->setParam('accessobject', $accessop);
$view($_GET);

View File

@ -75,6 +75,7 @@ $(document).ready( function() {
$enablelanguageselector = $this->params['enablelanguageselector'];
$enablethemeselector = $this->params['enablethemeselector'];
$passwordstrength = $this->params['passwordstrength'];
$disablechangepassword = $this->params['disablechangepassword'];
$httproot = $this->params['httproot'];
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
@ -102,6 +103,7 @@ $(document).ready( function() {
'required'=>true
)
);
if(!$disablechangepassword) {
$this->formField(
getMLText("new_password"),
'<input class="form-control pwd" type="password" rel="strengthbar" id="pwd" name="pwd" size="30">'
@ -122,6 +124,7 @@ $(document).ready( function() {
'autocomplete'=>'off',
)
);
}
$this->formField(
getMLText("name"),
array(

View File

@ -437,6 +437,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigCheckbox('settings_restricted', 'restricted'); ?>
<?php $this->showConfigCheckbox('settings_enableUserImage', 'enableUserImage'); ?>
<?php $this->showConfigCheckbox('settings_disableSelfEdit', 'disableSelfEdit'); ?>
<?php $this->showConfigCheckbox('settings_disableChangePassword', 'disableChangePassword'); ?>
<?php $this->showConfigCheckbox('settings_enablePasswordForgotten', 'enablePasswordForgotten'); ?>
<?php $this->showConfigText('settings_passwordStrength', 'passwordStrength'); ?>
<?php $this->showConfigOption('settings_passwordStrengthAlgorithm', 'passwordStrengthAlgorithm', array('simple'=>'settings_passwordStrengthAlgorithm_valsimple', 'advanced'=>'settings_passwordStrengthAlgorithm_valadvanced'), false, true); ?>