mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 22:47:19 +00:00
- added more configuration settings for password handling, stopwords file
and user listing
This commit is contained in:
parent
d80c68ad51
commit
36dc571aa5
|
@ -40,6 +40,16 @@ class Settings { /* {{{ */
|
||||||
var $_enableGuestLogin = false;
|
var $_enableGuestLogin = false;
|
||||||
// Allow users to reset their password
|
// Allow users to reset their password
|
||||||
var $_enablePasswordForgotten = false;
|
var $_enablePasswordForgotten = false;
|
||||||
|
// Minimum password strength (0 - x, 0 means no check)
|
||||||
|
var $_passwordStrength = 0;
|
||||||
|
// Password strength algorithm (simple, advanced)
|
||||||
|
var $_passwordStrengthAlgorithm = 'advanced';
|
||||||
|
// Number of days when a password expires and must be reset
|
||||||
|
var $_passwordExpiration = 10;
|
||||||
|
// Number of different passwords before a password can be reused
|
||||||
|
var $_passwordHistory = 10;
|
||||||
|
// Number of failed logins before account is disabled
|
||||||
|
var $_loginFailure = 0;
|
||||||
// Restricted access: only allow users to log in if they have an entry in
|
// Restricted access: only allow users to log in if they have an entry in
|
||||||
// the local database (irrespective of successful authentication with LDAP).
|
// the local database (irrespective of successful authentication with LDAP).
|
||||||
var $_restricted = true;
|
var $_restricted = true;
|
||||||
|
@ -60,6 +70,8 @@ class Settings { /* {{{ */
|
||||||
var $_stagingDir = null;
|
var $_stagingDir = null;
|
||||||
// Where the lucene fulltext index is saved
|
// Where the lucene fulltext index is saved
|
||||||
var $_luceneDir = null;
|
var $_luceneDir = null;
|
||||||
|
// Where the stop word file is located
|
||||||
|
var $_stopWordsFile = null;
|
||||||
// enable/disable lucene fulltext search
|
// enable/disable lucene fulltext search
|
||||||
var $_enableFullSearch = true;
|
var $_enableFullSearch = true;
|
||||||
// contentOffsetDirTo
|
// contentOffsetDirTo
|
||||||
|
@ -108,6 +120,9 @@ class Settings { /* {{{ */
|
||||||
var $_expandFolderTree = 1;
|
var $_expandFolderTree = 1;
|
||||||
// enable/disable editing of users own profile
|
// enable/disable editing of users own profile
|
||||||
var $_disableSelfEdit = false;
|
var $_disableSelfEdit = false;
|
||||||
|
// Sort order of users in lists('fullname' or '' (login))
|
||||||
|
var $_sortUsersInList = '';
|
||||||
|
// enable/disable lucene fulltext search
|
||||||
// if enabled admin can login only by specified IP addres
|
// if enabled admin can login only by specified IP addres
|
||||||
var $_adminIP = "";
|
var $_adminIP = "";
|
||||||
// Max Execution Time
|
// Max Execution Time
|
||||||
|
@ -251,6 +266,8 @@ class Settings { /* {{{ */
|
||||||
$this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]);
|
$this->_enableUsersView = Settings::boolVal($tab["enableUsersView"]);
|
||||||
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
|
$this->_enableFolderTree = Settings::boolVal($tab["enableFolderTree"]);
|
||||||
$this->_enableFullSearch = Settings::boolVal($tab["enableFullSearch"]);
|
$this->_enableFullSearch = Settings::boolVal($tab["enableFullSearch"]);
|
||||||
|
$this->_stopWordsFile = strval($tab["stopWordsFile"]);
|
||||||
|
$this->_sortUsersInList = strval($tab["sortUsersInList"]);
|
||||||
$this->_expandFolderTree = intval($tab["expandFolderTree"]);
|
$this->_expandFolderTree = intval($tab["expandFolderTree"]);
|
||||||
|
|
||||||
// XML Path: /configuration/site/calendar
|
// XML Path: /configuration/site/calendar
|
||||||
|
@ -278,6 +295,11 @@ class Settings { /* {{{ */
|
||||||
$tab = $node[0]->attributes();
|
$tab = $node[0]->attributes();
|
||||||
$this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]);
|
$this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]);
|
||||||
$this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]);
|
$this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]);
|
||||||
|
$this->_passwordStrength = intval($tab["passwordStrength"]);
|
||||||
|
$this->_passwordStrengthAlgorithm = strval($tab["passwordStrengthAlgorithm"]);
|
||||||
|
$this->_passwordExpiration = intval($tab["passwordExpiration"]);
|
||||||
|
$this->_passwordHistory = intval($tab["passwordHistory"]);
|
||||||
|
$this->_loginFailure = intval($tab["loginFailure"]);
|
||||||
$this->_restricted = Settings::boolVal($tab["restricted"]);
|
$this->_restricted = Settings::boolVal($tab["restricted"]);
|
||||||
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
|
$this->_enableUserImage = Settings::boolVal($tab["enableUserImage"]);
|
||||||
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
|
$this->_disableSelfEdit = Settings::boolVal($tab["disableSelfEdit"]);
|
||||||
|
@ -472,6 +494,8 @@ class Settings { /* {{{ */
|
||||||
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
|
$this->setXMLAttributValue($node, "enableFolderTree", $this->_enableFolderTree);
|
||||||
$this->setXMLAttributValue($node, "enableFullSearch", $this->_enableFullSearch);
|
$this->setXMLAttributValue($node, "enableFullSearch", $this->_enableFullSearch);
|
||||||
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
|
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
|
||||||
|
$this->setXMLAttributValue($node, "stopWordsFile", $this->_stopWordsFile);
|
||||||
|
$this->setXMLAttributValue($node, "sortUsersInList", $this->_sortUsersInList);
|
||||||
|
|
||||||
// XML Path: /configuration/site/calendar
|
// XML Path: /configuration/site/calendar
|
||||||
$node = $this->getXMLNode($xml, '/configuration/site', 'calendar');
|
$node = $this->getXMLNode($xml, '/configuration/site', 'calendar');
|
||||||
|
@ -496,6 +520,11 @@ class Settings { /* {{{ */
|
||||||
$node = $this->getXMLNode($xml, '/configuration/system', 'authentication');
|
$node = $this->getXMLNode($xml, '/configuration/system', 'authentication');
|
||||||
$this->setXMLAttributValue($node, "enableGuestLogin", $this->_enableGuestLogin);
|
$this->setXMLAttributValue($node, "enableGuestLogin", $this->_enableGuestLogin);
|
||||||
$this->setXMLAttributValue($node, "enablePasswordForgotten", $this->_enablePasswordForgotten);
|
$this->setXMLAttributValue($node, "enablePasswordForgotten", $this->_enablePasswordForgotten);
|
||||||
|
$this->setXMLAttributValue($node, "passwordStrength", $this->_passwordStrength);
|
||||||
|
$this->setXMLAttributValue($node, "passwordStrengthAlgorithm", $this->_passwordStrengthAlgorithm);
|
||||||
|
$this->setXMLAttributValue($node, "passwordExpiration", $this->_passwordExpiration);
|
||||||
|
$this->setXMLAttributValue($node, "passwordHistory", $this->_passwordHistory);
|
||||||
|
$this->setXMLAttributValue($node, "loginFailure", $this->_loginFailure);
|
||||||
$this->setXMLAttributValue($node, "restricted", $this->_restricted);
|
$this->setXMLAttributValue($node, "restricted", $this->_restricted);
|
||||||
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
|
$this->setXMLAttributValue($node, "enableUserImage", $this->_enableUserImage);
|
||||||
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
|
$this->setXMLAttributValue($node, "disableSelfEdit", $this->_disableSelfEdit);
|
||||||
|
@ -631,21 +660,6 @@ class Settings { /* {{{ */
|
||||||
if (file_exists($configDir."/settings.xml"))
|
if (file_exists($configDir."/settings.xml"))
|
||||||
return $configDir."/settings.xml";
|
return $configDir."/settings.xml";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
// Search config file
|
|
||||||
$_tmp = dirname($_SERVER['SCRIPT_FILENAME']);
|
|
||||||
if(is_link($_tmp)) {
|
|
||||||
$_arr = preg_split('/\//', $_tmp);
|
|
||||||
array_pop($_arr);
|
|
||||||
|
|
||||||
$configFilePath = implode('/', $_arr)."/conf/settings.xml";
|
|
||||||
} else {
|
|
||||||
if (file_exists("../conf/settings.xml"))
|
|
||||||
$configFilePath = "../conf/settings.xml";
|
|
||||||
else if (file_exists("conf/settings.xml"))
|
|
||||||
$configFilePath = "conf/settings.xml";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
return $configFilePath;
|
return $configFilePath;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -854,7 +868,7 @@ class Settings { /* {{{ */
|
||||||
// $this->_ADOdbPath
|
// $this->_ADOdbPath
|
||||||
$bCheckDB = true;
|
$bCheckDB = true;
|
||||||
if($this->_ADOdbPath) {
|
if($this->_ADOdbPath) {
|
||||||
if (!file_exists($this->_ADOdbPath."adodb/adodb.inc.php")) {
|
if (!file_exists($this->_ADOdbPath."/adodb/adodb.inc.php")) {
|
||||||
$bCheckDB = false;
|
$bCheckDB = false;
|
||||||
if (file_exists($rootDir."adodb/adodb.inc.php")) {
|
if (file_exists($rootDir."adodb/adodb.inc.php")) {
|
||||||
$result["ADOdbPath"] = array(
|
$result["ADOdbPath"] = array(
|
||||||
|
|
|
@ -67,6 +67,8 @@ if ($action == "saveSettings")
|
||||||
$settings->_enableFullSearch = getBoolValue("enableFullSearch");
|
$settings->_enableFullSearch = getBoolValue("enableFullSearch");
|
||||||
$settings->_enableFolderTree = getBoolValue("enableFolderTree");
|
$settings->_enableFolderTree = getBoolValue("enableFolderTree");
|
||||||
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
|
$settings->_expandFolderTree = intval($_POST["expandFolderTree"]);
|
||||||
|
$settings->_stopWordsFile = $_POST["stopWordsFile"];
|
||||||
|
$settings->_sortUsersInList = $_POST["sortUsersInList"];
|
||||||
|
|
||||||
// SETTINGS - SITE - CALENDAR
|
// SETTINGS - SITE - CALENDAR
|
||||||
$settings->_enableCalendar = getBoolValue("enableCalendar");
|
$settings->_enableCalendar = getBoolValue("enableCalendar");
|
||||||
|
@ -90,6 +92,11 @@ if ($action == "saveSettings")
|
||||||
$settings->_enableUserImage = getBoolValue("enableUserImage");
|
$settings->_enableUserImage = getBoolValue("enableUserImage");
|
||||||
$settings->_disableSelfEdit = getBoolValue("disableSelfEdit");
|
$settings->_disableSelfEdit = getBoolValue("disableSelfEdit");
|
||||||
$settings->_enablePasswordForgotten = getBoolValue("enablePasswordForgotten");
|
$settings->_enablePasswordForgotten = getBoolValue("enablePasswordForgotten");
|
||||||
|
$settings->_passwordStrength = intval($_POST["passwordStrength"]);
|
||||||
|
$settings->_passwordStrengthAlgorithm = strval($_POST["passwordStrengthAlgorithm"]);
|
||||||
|
$settings->_passwordExpiration = intval($_POST["passwordExpiration"]);
|
||||||
|
$settings->_passwordHistory = intval($_POST["passwordHistory"]);
|
||||||
|
$settings->_loginFailure = intval($_POST["loginFailure"]);
|
||||||
|
|
||||||
// TODO Connectors
|
// TODO Connectors
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,10 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
<td><?php printMLText("settings_enableFullSearch");?>:</td>
|
<td><?php printMLText("settings_enableFullSearch");?>:</td>
|
||||||
<td><input name="enableFullSearch" type="checkbox" <?php if ($settings->_enableFullSearch) echo "checked" ?> /></td>
|
<td><input name="enableFullSearch" type="checkbox" <?php if ($settings->_enableFullSearch) echo "checked" ?> /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_stopWordsFile_desc");?>">
|
||||||
|
<td><?php printMLText("settings_stopWordsFile");?>:</td>
|
||||||
|
<td><input name="stopWordsFile" value="<?php echo $settings->_stopWordsFile; ?>" size="100" /></td>
|
||||||
|
</tr>
|
||||||
<tr title="<?php printMLText("settings_enableFolderTree_desc");?>">
|
<tr title="<?php printMLText("settings_enableFolderTree_desc");?>">
|
||||||
<td><?php printMLText("settings_enableFolderTree");?>:</td>
|
<td><?php printMLText("settings_enableFolderTree");?>:</td>
|
||||||
<td><input name="enableFolderTree" type="checkbox" <?php if ($settings->_enableFolderTree) echo "checked" ?> /></td>
|
<td><input name="enableFolderTree" type="checkbox" <?php if ($settings->_enableFolderTree) echo "checked" ?> /></td>
|
||||||
|
@ -163,6 +167,14 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
<OPTION VALUE="2" <?php if ($settings->_expandFolderTree==2) echo "SELECTED" ?> ><?php printMLText("settings_expandFolderTree_val2");?></OPTION>
|
<OPTION VALUE="2" <?php if ($settings->_expandFolderTree==2) echo "SELECTED" ?> ><?php printMLText("settings_expandFolderTree_val2");?></OPTION>
|
||||||
</SELECT>
|
</SELECT>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_sortUsersInList_desc");?>">
|
||||||
|
<td><?php printMLText("settings_sortUsersInList");?>:</td>
|
||||||
|
<td>
|
||||||
|
<SELECT name="sortUsersInList">
|
||||||
|
<OPTION VALUE="" <?php if ($settings->_sortUsersInList=='') echo "SELECTED" ?> ><?php printMLText("settings_sortUsersInList_val_login");?></OPTION>
|
||||||
|
<OPTION VALUE="fullname" <?php if ($settings->_sortUsersInList=='fullname') echo "SELECTED" ?> ><?php printMLText("settings_sortUsersInList_val_fullname");?></OPTION>
|
||||||
|
</SELECT>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- SETTINGS - SITE - CALENDAR
|
-- SETTINGS - SITE - CALENDAR
|
||||||
|
@ -269,6 +281,31 @@ if(!is_writeable($settings->_configFilePath)) {
|
||||||
<td><?php printMLText("settings_enablePasswordForgotten");?>:</td>
|
<td><?php printMLText("settings_enablePasswordForgotten");?>:</td>
|
||||||
<td><input name="enablePasswordForgotten" type="checkbox" <?php if ($settings->_enablePasswordForgotten) echo "checked" ?> /></td>
|
<td><input name="enablePasswordForgotten" type="checkbox" <?php if ($settings->_enablePasswordForgotten) echo "checked" ?> /></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_passwordЅtrength_desc");?>">
|
||||||
|
<td><?php printMLText("settings_passwordStrength");?>:</td>
|
||||||
|
<td><input name="passwordStrength" value="<?php echo $settings->_passwordStrength; ?>" size="2" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_passwordStrengthAlgorithm_desc");?>">
|
||||||
|
<td><?php printMLText("settings_passwordStrengthAlgorithm");?>:</td>
|
||||||
|
<td>
|
||||||
|
<select name="passwordStrengthAlgorithm">
|
||||||
|
<option value="simple" <?php if ($settings->_passwordStrengthAlgorithm=='simple') echo "selected" ?>><?php printMLText("settings_passwordStrengthAlgorithm_valsimple");?></option>
|
||||||
|
<option value="advanced" <?php if ($settings->_passwordStrengthAlgorithm=='advanced') echo "selected" ?>><?php printMLText("settings_passwordStrengthAlgorithm_valadvanced");?></option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_passwordExpiration_desc");?>">
|
||||||
|
<td><?php printMLText("settings_passwordExpiration");?>:</td>
|
||||||
|
<td><input name="passwordExpiration" value="<?php echo $settings->_passwordExpiration; ?>" size="3" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_passwordHistory_desc");?>">
|
||||||
|
<td><?php printMLText("settings_passwordHistory");?>:</td>
|
||||||
|
<td><input name="passwordHistory" value="<?php echo $settings->_passwordHistory; ?>" size="2" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr title="<?php printMLText("settings_loginFailure_desc");?>">
|
||||||
|
<td><?php printMLText("settings_loginFailure");?>:</td>
|
||||||
|
<td><input name="loginFailure" value="<?php echo $settings->_loginFailure; ?>" size="2" /></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<!-- TODO Connectors -->
|
<!-- TODO Connectors -->
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user