107 if(is_object(self::$instance))
109 return self::$instance;
128 $this->password_chars_and_numbers_enabled = $a_chars_and_numbers_enabled;
152 $this->password_special_chars_enabled = $a_password_special_chars_enabled;
174 $this->password_min_length = $a_password_min_length;
194 $this->password_max_length = $a_password_max_length;
214 $this->password_max_age = $a_password_max_age;
234 $this->login_max_attempts = $a_login_max_attempts;
254 $this->https_enable = $value;
276 $this->password_change_on_first_login_enabled = $a_password_change_on_first_login_enabled;
306 $this->protect_admin_role = $a_stat;
321 if($rbacreview->isAssigned($a_usr_id,SYSTEM_ROLE_ID))
362 $query =
"SELECT object_reference.ref_id FROM object_reference,tree,object_data ".
363 "WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID,
'integer').
" ".
364 "AND object_data.type = 'ps' ".
365 "AND object_reference.ref_id = tree.child ".
366 "AND object_reference.obj_id = object_data.obj_id";
369 $this->ref_id =
$row[
"ref_id"];
371 $this->https_enable = (boolean) $this->
settings->get(
'https',
false);
373 $this->password_chars_and_numbers_enabled = (bool) $this->
settings->get(
'ps_password_chars_and_numbers_enabled', self::DEFAULT_PASSWORD_CHARS_AND_NUMBERS_ENABLED);
374 $this->password_special_chars_enabled = (bool) $this->
settings->get(
'ps_password_special_chars_enabled', self::DEFAULT_PASSWORD_SPECIAL_CHARS_ENABLED);
375 $this->password_min_length = (int) $this->
settings->get(
'ps_password_min_length', self::DEFAULT_PASSWORD_MIN_LENGTH);
376 $this->password_max_length = (int) $this->
settings->get(
'ps_password_max_length', self::DEFAULT_PASSWORD_MAX_LENGTH);
377 $this->password_max_age = (int) $this->
settings->get(
'ps_password_max_age', self::DEFAULT_PASSWORD_MAX_AGE);
378 $this->login_max_attempts = (int) $this->
settings->get(
'ps_login_max_attempts', self::DEFAULT_LOGIN_MAX_ATTEMPTS);
379 $this->password_ucase_chars_num = (int) $this->
settings->get(
'ps_password_uppercase_chars_num', 0);
380 $this->password_lcase_chars_num = (int) $this->
settings->get(
'ps_password_lowercase_chars_num', 0);
381 $this->password_must_not_contain_loginname = $this->
settings->get(
'ps_password_must_not_contain_loginame', 0) ==
'1' ? true :
false;
383 $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);
384 $this->prevent_simultaneous_logins = (bool) $this->
settings->get(
'ps_prevent_simultaneous_logins', self::DEFAULT_PREVENT_SIMULTANEOUS_LOGINS);
386 $this->protect_admin_role = (bool) $this->
settings->get(
'ps_protect_admin',$this->protect_admin_role);
400 include_once
"Services/PrivacySecurity/classes/class.ilObjPrivacySecurityGUI.php";
403 include_once
'./Services/Http/classes/class.ilHTTPS.php';
416 $a_form->getItemByPostVar(
'https_enabled')
424 $code = self::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH;
431 $a_form->getItemByPostVar(
'password_min_length')
438 $code = self::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH;
445 $a_form->getItemByPostVar(
'password_max_length')
463 $password_min_length_error_code = self::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1;
469 $password_min_length_error_code = self::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2;
474 $password_min_length_error_code = self::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3;
480 $password_min_length_error_code = self::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3;
485 $code = $password_min_length_error_code;
492 $a_form->getItemByPostVar(
'password_min_length')
498 $code = self::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH;
505 $a_form->getItemByPostVar(
'password_max_length')
512 $code = self::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE;
519 $a_form->getItemByPostVar(
'password_max_age')
526 $code = self::SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS;
533 $a_form->getItemByPostVar(
'login_max_attempts')
570 $this->prevent_simultaneous_logins = (bool)$value;
615 $this->password_must_not_contain_loginname = $status;
setPasswordMaxAge($a_password_max_age)
set the maximum password age
$password_chars_and_numbers_enabled
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2
setPreventionOfSimultaneousLogins($value)
Enable/Disable prevention of simultaneous logins with the same account.
setPasswordMaxLength($a_password_max_length)
set the maximum length for passwords
$password_must_not_contain_loginname
checkAdminRoleAccessible($a_usr_id)
Check if the administrator role is accessible for a specific user.
setPasswordSpecialCharsEnabled($a_password_special_chars_enabled)
set if the passwords have to contain special characters
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH
static getErrorMessage($code)
return error message for error code
Singleton class that stores all security settings.
isHTTPSEnabled()
read access to https enabled property
setPasswordMinLength($a_password_min_length)
set the minimum length for passwords
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH
const DEFAULT_PASSWORD_MAX_LENGTH
$password_special_chars_enabled
setLoginMaxAttempts($a_login_max_attempts)
set the maximum count of login attempts
isPasswordCharsAndNumbersEnabled()
get boolean if the passwords have to contain characters and numbers
const DEFAULT_PASSWORD_MAX_AGE
setPasswordCharsAndNumbersEnabled($a_chars_and_numbers_enabled)
set if the passwords have to contain characters and numbers
__construct()
Private constructor: use _getInstance()
validate(ilPropertyFormGUI $a_form=null)
validate settings
static _checkHTTPS()
static method to check if https connections are possible for this server public
const DEFAULT_LOGIN_MAX_ATTEMPTS
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE
getPasswordMaxLength()
get the maximum length for passwords
isPasswordChangeOnFirstLoginEnabled()
get boolean if the passwords have to be changed by users on first login
getPasswordNumberOfLowercaseChars()
Returns number of lowercase characters required.
isAdminRoleProtected()
Check if admin role is protected.
getPasswordNumberOfUppercaseChars()
Returns number of uppercase characters required.
$password_lcase_chars_num
isPasswordSpecialCharsEnabled()
get boolean if the passwords have to contain special characters
getPasswordMinLength()
get the minimum length for passwords
$prevent_simultaneous_logins
const DEFAULT_PASSWORD_SPECIAL_CHARS_ENABLED
const DEFAULT_PASSWORD_MIN_LENGTH
setPasswordNumberOfUppercaseChars($password_ucase_chars_num)
Set number of uppercase characters required.
static $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS
$password_ucase_chars_num
getPasswordMaxAge()
get the maximum password age
isPreventionOfSimultaneousLoginsEnabled()
Prevention of simultaneous logins with the same account.
setPasswordMustNotContainLoginnameStatus($status)
Set whether the password must not contain the loginname or not.
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3
setPasswordChangeOnFirstLoginEnabled($a_password_change_on_first_login_enabled)
set if the passwords have to be changed by users on first login
const DEFAULT_PREVENT_SIMULTANEOUS_LOGINS
const SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH
getLoginMaxAttempts()
get the maximum count of login attempts
static $SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE
setPasswordNumberOfLowercaseChars($password_lcase_chars_num)
Set number of lowercase characters required.
$password_change_on_first_login_enabled
getSecuritySettingsRefId()
static _getInstance()
Get instance of ilSecuritySettings.
static $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE
setHTTPSEnabled($value)
Enable https for certain scripts.
getPasswordMustNotContainLoginnameStatus()
Return whether the password must not contain the loginname or not.
protectedAdminRole($a_stat)
Set admin role protection status.
const DEFAULT_PASSWORD_CHANGE_ON_FIRST_LOGIN_ENABLED
const DEFAULT_PASSWORD_CHARS_AND_NUMBERS_ENABLED