109 if (is_object(self::$instance)) {
117 return $this->ref_id;
129 $this->password_chars_and_numbers_enabled = $a_chars_and_numbers_enabled;
153 $this->password_special_chars_enabled = $a_password_special_chars_enabled;
175 $this->password_min_length = $a_password_min_length;
195 $this->password_max_length = $a_password_max_length;
215 $this->password_max_age = $a_password_max_age;
235 $this->login_max_attempts = $a_login_max_attempts;
255 $this->https_enable = $value;
277 $this->password_change_on_first_login_enabled = $a_password_change_on_first_login_enabled;
307 $this->protect_admin_role = $a_stat;
318 $rbacreview =
$DIC[
'rbacreview'];
323 if ($rbacreview->isAssigned($a_usr_id, SYSTEM_ROLE_ID)) {
365 $query =
"SELECT object_reference.ref_id FROM object_reference,tree,object_data " .
366 "WHERE tree.parent = " .
$ilDB->quote(SYSTEM_FOLDER_ID,
'integer') .
" " .
367 "AND object_data.type = 'ps' " .
368 "AND object_reference.ref_id = tree.child " .
369 "AND object_reference.obj_id = object_data.obj_id";
372 $this->ref_id = $row[
"ref_id"];
374 $this->https_enable = (boolean) $this->
settings->get(
'https',
false);
376 $this->password_chars_and_numbers_enabled = (bool) $this->
settings->get(
'ps_password_chars_and_numbers_enabled', self::DEFAULT_PASSWORD_CHARS_AND_NUMBERS_ENABLED);
377 $this->password_special_chars_enabled = (bool) $this->
settings->get(
'ps_password_special_chars_enabled', self::DEFAULT_PASSWORD_SPECIAL_CHARS_ENABLED);
378 $this->password_min_length = (int) $this->
settings->get(
'ps_password_min_length', self::DEFAULT_PASSWORD_MIN_LENGTH);
379 $this->password_max_length = (int) $this->
settings->get(
'ps_password_max_length', self::DEFAULT_PASSWORD_MAX_LENGTH);
380 $this->password_max_age = (int) $this->
settings->get(
'ps_password_max_age', self::DEFAULT_PASSWORD_MAX_AGE);
381 $this->login_max_attempts = (int) $this->
settings->get(
'ps_login_max_attempts', self::DEFAULT_LOGIN_MAX_ATTEMPTS);
382 $this->password_ucase_chars_num = (int) $this->
settings->get(
'ps_password_uppercase_chars_num', 0);
383 $this->password_lcase_chars_num = (int) $this->
settings->get(
'ps_password_lowercase_chars_num', 0);
384 $this->password_must_not_contain_loginname = $this->
settings->get(
'ps_password_must_not_contain_loginame', 0) ==
'1' ? true :
false;
386 $this->password_change_on_first_login_enabled = (bool) $this->
settings->get(
'ps_password_change_on_first_login_enabled', self::DEFAULT_PASSWORD_CHANGE_ON_FIRST_LOGIN_ENABLED);
387 $this->prevent_simultaneous_logins = (bool) $this->
settings->get(
'ps_prevent_simultaneous_logins', self::DEFAULT_PREVENT_SIMULTANEOUS_LOGINS);
389 $this->protect_admin_role = (bool) $this->
settings->get(
'ps_protect_admin', $this->protect_admin_role);
402 include_once
"Services/PrivacySecurity/classes/class.ilObjPrivacySecurityGUI.php";
405 include_once
'./Services/Http/classes/class.ilHTTPS.php';
413 $a_form->getItemByPostVar(
'https_enabled')
424 $a_form->getItemByPostVar(
'password_min_length')
434 $a_form->getItemByPostVar(
'password_max_length')
466 $code = $password_min_length_error_code;
470 $a_form->getItemByPostVar(
'password_min_length')
479 $a_form->getItemByPostVar(
'password_max_length')
489 $a_form->getItemByPostVar(
'password_max_age')
499 $a_form->getItemByPostVar(
'login_max_attempts')
512 return !(bool) $code;
533 $this->prevent_simultaneous_logins = (bool) $value;
578 $this->password_must_not_contain_loginname = $status;
An exception for terminatinating execution or to throw for unit testing.
static _checkHTTPS()
static method to check if https connections are possible for this server @access public
static getErrorMessage($code)
return error message for error code
Singleton class that stores all security settings.
setLoginMaxAttempts($a_login_max_attempts)
set the maximum count of login attempts
setPasswordMaxAge($a_password_max_age)
set the maximum password age
checkAdminRoleAccessible($a_usr_id)
Check if the administrator role is accessible for a specific user.
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2
validate(ilPropertyFormGUI $a_form=null)
validate settings
setPasswordMaxLength($a_password_max_length)
set the maximum length for passwords
isPasswordSpecialCharsEnabled()
get boolean if the passwords have to contain special characters
isAdminRoleProtected()
Check if admin role is protected.
const DEFAULT_PASSWORD_MAX_LENGTH
getLoginMaxAttempts()
get the maximum count of login attempts
setPasswordCharsAndNumbersEnabled($a_chars_and_numbers_enabled)
set if the passwords have to contain characters and numbers
getPasswordMustNotContainLoginnameStatus()
Return whether the password must not contain the loginname or not.
$password_change_on_first_login_enabled
const SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS
getPasswordMinLength()
get the minimum length for passwords
$prevent_simultaneous_logins
setPasswordNumberOfUppercaseChars($password_ucase_chars_num)
Set number of uppercase characters required.
protectedAdminRole($a_stat)
Set admin role protection status.
static $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS
getSecuritySettingsRefId()
static $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3
$password_lcase_chars_num
setPasswordChangeOnFirstLoginEnabled($a_password_change_on_first_login_enabled)
set if the passwords have to be changed by users on first login
getPasswordMaxLength()
get the maximum length for passwords
setPasswordMustNotContainLoginnameStatus($status)
Set whether the password must not contain the loginname or not.
isPreventionOfSimultaneousLoginsEnabled()
Prevention of simultaneous logins with the same account.
const DEFAULT_PASSWORD_CHARS_AND_NUMBERS_ENABLED
setPasswordSpecialCharsEnabled($a_password_special_chars_enabled)
set if the passwords have to contain special characters
getPasswordNumberOfUppercaseChars()
Returns number of uppercase characters required.
const DEFAULT_PASSWORD_SPECIAL_CHARS_ENABLED
isHTTPSEnabled()
read access to https enabled property
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE
isPasswordCharsAndNumbersEnabled()
get boolean if the passwords have to contain characters and numbers
isPasswordChangeOnFirstLoginEnabled()
get boolean if the passwords have to be changed by users on first login
const DEFAULT_LOGIN_MAX_ATTEMPTS
$password_must_not_contain_loginname
setHTTPSEnabled($value)
Enable https for certain scripts.
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH
setPreventionOfSimultaneousLogins($value)
Enable/Disable prevention of simultaneous logins with the same account.
$password_ucase_chars_num
getPasswordMaxAge()
get the maximum password age
const DEFAULT_PASSWORD_MAX_AGE
const DEFAULT_PREVENT_SIMULTANEOUS_LOGINS
const DEFAULT_PASSWORD_CHANGE_ON_FIRST_LOGIN_ENABLED
setPasswordNumberOfLowercaseChars($password_lcase_chars_num)
Set number of lowercase characters required.
$password_special_chars_enabled
$password_chars_and_numbers_enabled
setPasswordMinLength($a_password_min_length)
set the minimum length for passwords
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH
static $SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE
static _getInstance()
Get instance of ilSecuritySettings.
getPasswordNumberOfLowercaseChars()
Returns number of lowercase characters required.
__construct()
Private constructor: use _getInstance()
const DEFAULT_PASSWORD_MIN_LENGTH
foreach($_POST as $key=> $value) $res