19declare(strict_types=1);
76 $this->registration_type = $a_type;
86 if ($ret < 1 || $ret > 5) {
125 $this->password_generation_enabled = $a_status;
135 $this->access_limitation = $a_access_limitation;
140 $this->approve_recipient_logins = $a_rec_string;
141 $this->approve_recipient_ids = [];
144 foreach (explode(
',', trim($this->approve_recipient_logins)) as $login) {
146 $this->approve_recipient_ids[] = $uid;
163 return implode(
',', $this->unknown);
178 $this->role_type = $a_type;
183 $this->reg_hash_life_time = $a_lifetime;
189 return max($this->reg_hash_life_time, self::REG_HASH_LIFETIME_MIN_VALUE);
194 $this->reg_allow_codes = $a_allow_codes;
206 $a_value = array_map(
207 static function (
string $value):
string {
210 explode(
";", trim($a_value))
213 $this->allowed_domains = $a_value;
226 $login_arr = $login_arr ?: [];
228 foreach ($login_arr as $recipient) {
229 if (!$recipient = trim($recipient)) {
233 $this->unknown[] = $recipient;
238 if (count($this->unknown)) {
249 $this->
settings->set(
'reg_role_assignment', (
string) $this->role_type);
250 $this->
settings->set(
'new_registration_type', (
string) $this->registration_type);
251 $this->
settings->set(
'passwd_reg_auto_generate', (
string) $this->password_generation_enabled);
252 $this->
settings->set(
'approve_recipient', addslashes(serialize($this->approve_recipient_ids)));
253 $this->
settings->set(
'reg_access_limitation', (
string) $this->access_limitation);
254 $this->
settings->set(
'reg_hash_life_time', (
string) $this->reg_hash_life_time);
255 $this->
settings->set(
'reg_allow_codes', (
string) $this->reg_allow_codes);
256 $this->
settings->set(
'reg_allowed_domains', implode(
';', $this->allowed_domains));
265 $this->role_type = (
int) $this->
settings->get(
'reg_role_assignment',
'1');
266 $this->password_generation_enabled = (bool) $this->
settings->get(
'passwd_reg_auto_generate');
267 $this->access_limitation = (bool) $this->
settings->get(
'reg_access_limitation');
268 $this->reg_hash_life_time = (
int) $this->
settings->get(
'reg_hash_life_time');
269 $this->reg_allow_codes = (bool) $this->
settings->get(
'reg_allow_codes');
271 $this->approve_recipient_ids = unserialize(
272 stripslashes($this->
settings->get(
'approve_recipient', serialize([]))),
273 [
'allowed_classes' =>
false]
278 foreach ($this->approve_recipient_ids as
$id) {
280 $tmp_logins[] = $login;
283 $this->approve_recipient_logins = implode(
',', $tmp_logins);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static _lookupId(string|array $a_user_str)
static _lookupLogin(int $a_user_id)
Class ilObjAuthSettingsGUI.
const IL_REG_ROLE_UNDEFINED
const IL_REG_ERROR_NO_PERM
const REG_HASH_LIFETIME_MIN_VALUE
setRegistrationHashLifetime(int $a_lifetime)
setApproveRecipientLogins(string $a_rec_string)
setAllowedDomains(string $a_value)
__construct(?ilSetting $settings=null)
automaticRoleAssignmentEnabled()
string $approve_recipient_logins
array $approve_recipient_ids
setPasswordGenerationStatus(bool $a_status)
static _lookupRegistrationType()
passwordGenerationEnabled()
const IL_REG_ERROR_UNKNOWN
getRegistrationHashLifetime()
registrationCodeRequired()
bool $password_generation_enabled
setAllowCodes(bool $a_allow_codes)
setRegistrationType(int $a_type)
getApproveRecipientLogins()
setAccessLimitation(bool $a_access_limitation)