ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilRegistrationSettings Class Reference

Class ilObjAuthSettingsGUI. More...

+ Collaboration diagram for ilRegistrationSettings:

Public Member Functions

 ilRegistrationSettings ()
 
 getRegistrationType ()
 
 setRegistrationType ($a_type)
 
 _lookupRegistrationType ()
 
 enabled ()
 
 directEnabled ()
 
 approveEnabled ()
 
 activationEnabled ()
 
 registrationCodeRequired ()
 
 passwordGenerationEnabled ()
 
 setPasswordGenerationStatus ($a_status)
 
 getAccessLimitation ()
 
 setAccessLimitation ($a_access_limitation)
 
 setApproveRecipientLogins ($a_rec_string)
 
 getApproveRecipientLogins ()
 
 getApproveRecipients ()
 
 getUnknown ()
 
 roleSelectionEnabled ()
 
 automaticRoleAssignmentEnabled ()
 
 setRoleType ($a_type)
 
 setRegistrationHashLifetime ($a_lifetime)
 
 getRegistrationHashLifetime ()
 
 setAllowCodes ($a_allow_codes)
 
 getAllowCodes ()
 
 setAllowedDomains ($a_value)
 
 getAllowedDomains ()
 
 validate ()
 
 save ()
 
 __read ()
 

Data Fields

const ERR_UNKNOWN_RCP = 1
 
const ERR_MISSING_RCP = 2
 
const REG_HASH_LIFETIME_MIN_VALUE = 60
 

Private Attributes

 $registration_type
 
 $password_generation_enabled
 
 $access_limitation
 
 $approve_recipient_logins
 
 $approve_recipient_ids
 
 $role_type
 
 $unknown
 
 $reg_hash_life_time = 0
 
 $reg_allow_codes = false
 
 $allowed_domains
 

Detailed Description

Class ilObjAuthSettingsGUI.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 45 of file class.ilRegistrationSettings.php.

Member Function Documentation

◆ __read()

ilRegistrationSettings::__read ( )

Definition at line 258 of file class.ilRegistrationSettings.php.

259 {
260 global $ilias;
261
262 //static method validates value
263 $this->registration_type = self::_lookupRegistrationType();
264
265 $this->role_type = $ilias->getSetting('reg_role_assignment',1);
266 $this->password_generation_enabled = $ilias->getSetting('passwd_reg_auto_generate');
267 $this->access_limitation = $ilias->getSetting('reg_access_limitation');
268 $this->reg_hash_life_time = $ilias->getSetting('reg_hash_life_time');
269 $this->reg_allow_codes = (bool)$ilias->getSetting('reg_allow_codes');
270
271 $this->approve_recipient_ids = unserialize(stripslashes($ilias->getSetting('approve_recipient')));
272 $this->approve_recipient_ids = $this->approve_recipient_ids ?
273 $this->approve_recipient_ids :
274 array();
275
276 // create login array
277 $tmp_logins = array();
278 foreach($this->approve_recipient_ids as $id)
279 {
280 if($login = ilObjUser::_lookupLogin($id))
281 {
282 $tmp_logins[] = $login;
283 }
284 }
285 $this->approve_recipient_logins = implode(',',$tmp_logins);
286
287 $this->setAllowedDomains($ilias->getSetting('reg_allowed_domains'));
288 }
static _lookupLogin($a_user_id)
lookup login

References ilObjUser\_lookupLogin(), _lookupRegistrationType(), and setAllowedDomains().

Referenced by ilRegistrationSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupRegistrationType()

ilRegistrationSettings::_lookupRegistrationType ( )

Definition at line 77 of file class.ilRegistrationSettings.php.

78 {
79 global $ilias;
80
81 $ret = (int)$ilias->getSetting('new_registration_type',IL_REG_DISABLED);
82
83 if($ret < 1 or $ret > 5)
84 {
85 //data is corrupted and should be processed like "No Registration possible" (#18261)
87 }
88
89 return $ret;
90 }

References $ret, and IL_REG_DISABLED.

Referenced by __read(), and ilStartUpGUI\showRegistrationLinks().

+ Here is the caller graph for this function:

◆ activationEnabled()

ilRegistrationSettings::activationEnabled ( )

Definition at line 104 of file class.ilRegistrationSettings.php.

105 {
106 return $this->registration_type == IL_REG_ACTIVATION;
107 }
const IL_REG_ACTIVATION

References IL_REG_ACTIVATION.

◆ approveEnabled()

ilRegistrationSettings::approveEnabled ( )

Definition at line 100 of file class.ilRegistrationSettings.php.

101 {
102 return $this->registration_type == IL_REG_APPROVE;
103 }

References IL_REG_APPROVE.

◆ automaticRoleAssignmentEnabled()

ilRegistrationSettings::automaticRoleAssignmentEnabled ( )

Definition at line 163 of file class.ilRegistrationSettings.php.

164 {
165 return $this->role_type == IL_REG_ROLES_EMAIL;
166 }
const IL_REG_ROLES_EMAIL

References IL_REG_ROLES_EMAIL.

◆ directEnabled()

ilRegistrationSettings::directEnabled ( )

Definition at line 96 of file class.ilRegistrationSettings.php.

97 {
98 return $this->registration_type == IL_REG_DIRECT;
99 }

References IL_REG_DIRECT.

◆ enabled()

ilRegistrationSettings::enabled ( )

Definition at line 92 of file class.ilRegistrationSettings.php.

93 {
94 return $this->registration_type != IL_REG_DISABLED;
95 }

References IL_REG_DISABLED.

◆ getAccessLimitation()

ilRegistrationSettings::getAccessLimitation ( )

◆ getAllowCodes()

ilRegistrationSettings::getAllowCodes ( )

Definition at line 191 of file class.ilRegistrationSettings.php.

References $reg_allow_codes.

◆ getAllowedDomains()

ilRegistrationSettings::getAllowedDomains ( )

Definition at line 202 of file class.ilRegistrationSettings.php.

References $allowed_domains.

◆ getApproveRecipientLogins()

ilRegistrationSettings::getApproveRecipientLogins ( )

Definition at line 146 of file class.ilRegistrationSettings.php.

References $approve_recipient_logins.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getApproveRecipients()

ilRegistrationSettings::getApproveRecipients ( )

Definition at line 150 of file class.ilRegistrationSettings.php.

151 {
152 return $this->approve_recipient_ids ? $this->approve_recipient_ids : array();
153 }

◆ getRegistrationHashLifetime()

ilRegistrationSettings::getRegistrationHashLifetime ( )

Definition at line 179 of file class.ilRegistrationSettings.php.

180 {
181 return max($this->reg_hash_life_time, self::REG_HASH_LIFETIME_MIN_VALUE);
182 }

◆ getRegistrationType()

ilRegistrationSettings::getRegistrationType ( )

Definition at line 68 of file class.ilRegistrationSettings.php.

References $registration_type.

Referenced by validate().

+ Here is the caller graph for this function:

◆ getUnknown()

ilRegistrationSettings::getUnknown ( )

Definition at line 154 of file class.ilRegistrationSettings.php.

155 {
156 return implode(',',$this->unknown);
157 }

◆ ilRegistrationSettings()

ilRegistrationSettings::ilRegistrationSettings ( )

Definition at line 63 of file class.ilRegistrationSettings.php.

References __read().

+ Here is the call graph for this function:

◆ passwordGenerationEnabled()

ilRegistrationSettings::passwordGenerationEnabled ( )

◆ registrationCodeRequired()

ilRegistrationSettings::registrationCodeRequired ( )

Definition at line 108 of file class.ilRegistrationSettings.php.

109 {
110 return $this->registration_type == IL_REG_CODES;
111 }

References IL_REG_CODES.

◆ roleSelectionEnabled()

ilRegistrationSettings::roleSelectionEnabled ( )

Definition at line 159 of file class.ilRegistrationSettings.php.

160 {
161 return $this->role_type == IL_REG_ROLES_FIXED;
162 }
const IL_REG_ROLES_FIXED

References IL_REG_ROLES_FIXED.

◆ save()

ilRegistrationSettings::save ( )

Definition at line 242 of file class.ilRegistrationSettings.php.

243 {
244 global $ilias;
245
246 $ilias->setSetting('reg_role_assignment',$this->role_type);
247 $ilias->setSetting('new_registration_type',$this->registration_type);
248 $ilias->setSetting('passwd_reg_auto_generate',$this->password_generation_enabled);
249 $ilias->setSetting('approve_recipient',addslashes(serialize($this->approve_recipient_ids)));
250 $ilias->setSetting('reg_access_limitation',$this->access_limitation);
251 $ilias->setSetting('reg_hash_life_time',$this->reg_hash_life_time);
252 $ilias->setSetting('reg_allow_codes',$this->reg_allow_codes);
253 $ilias->setSetting('reg_allowed_domains',implode(';', $this->allowed_domains));
254
255 return true;
256 }

◆ setAccessLimitation()

ilRegistrationSettings::setAccessLimitation (   $a_access_limitation)

Definition at line 127 of file class.ilRegistrationSettings.php.

128 {
129 $this->access_limitation = $a_access_limitation;
130 }

◆ setAllowCodes()

ilRegistrationSettings::setAllowCodes (   $a_allow_codes)

Definition at line 184 of file class.ilRegistrationSettings.php.

185 {
186 $this->reg_allow_codes = (bool)$a_allow_codes;
187
188 return $this;
189 }

◆ setAllowedDomains()

ilRegistrationSettings::setAllowedDomains (   $a_value)

Definition at line 196 of file class.ilRegistrationSettings.php.

197 {
198 $a_value = explode(";", trim($a_value));
199 $this->allowed_domains = $a_value;
200 }

Referenced by __read().

+ Here is the caller graph for this function:

◆ setApproveRecipientLogins()

ilRegistrationSettings::setApproveRecipientLogins (   $a_rec_string)

Definition at line 132 of file class.ilRegistrationSettings.php.

133 {
134 $this->approve_recipient_logins = $a_rec_string;
135 $this->approve_recipient_ids = array();
136
137 // convert logins to array of ids
138 foreach(explode(',',trim($this->approve_recipient_logins)) as $login)
139 {
140 if($uid = ilObjUser::_lookupId(trim($login)))
141 {
142 $this->approve_recipient_ids[] = $uid;
143 }
144 }
145 }
static _lookupId($a_user_str)
Lookup id by login.

References ilObjUser\_lookupId().

+ Here is the call graph for this function:

◆ setPasswordGenerationStatus()

ilRegistrationSettings::setPasswordGenerationStatus (   $a_status)

Definition at line 117 of file class.ilRegistrationSettings.php.

118 {
119 $this->password_generation_enabled = $a_status;
120 }

◆ setRegistrationHashLifetime()

ilRegistrationSettings::setRegistrationHashLifetime (   $a_lifetime)

Definition at line 172 of file class.ilRegistrationSettings.php.

173 {
174 $this->reg_hash_life_time = $a_lifetime;
175
176 return $this;
177 }

◆ setRegistrationType()

ilRegistrationSettings::setRegistrationType (   $a_type)

Definition at line 72 of file class.ilRegistrationSettings.php.

73 {
74 $this->registration_type = $a_type;
75 }

◆ setRoleType()

ilRegistrationSettings::setRoleType (   $a_type)

Definition at line 167 of file class.ilRegistrationSettings.php.

168 {
169 $this->role_type = $a_type;
170 }

◆ validate()

ilRegistrationSettings::validate ( )

Definition at line 207 of file class.ilRegistrationSettings.php.

208 {
209 $this->unknown = array();
210 $this->mail_perm = array();
211
212 $login_arr = explode(',',$this->getApproveRecipientLogins());
213 $login_arr = $login_arr ? $login_arr : array();
214 foreach($login_arr as $recipient)
215 {
216 if(!$recipient = trim($recipient))
217 {
218 continue;
219 }
220 if(!ilObjUser::_lookupId($recipient))
221 {
222 $this->unknown[] = $recipient;
223 continue;
224 }
225 else
226 {
227 $valid = $recipient;
228 }
229 }
230 if(count($this->unknown))
231 {
233 }
234 if($this->getRegistrationType() == IL_REG_APPROVE and !count((array) $valid))
235 {
237 }
238 return 0;
239 }
$valid

References $valid, ilObjUser\_lookupId(), ERR_MISSING_RCP, ERR_UNKNOWN_RCP, getApproveRecipientLogins(), getRegistrationType(), and IL_REG_APPROVE.

+ Here is the call graph for this function:

Field Documentation

◆ $access_limitation

ilRegistrationSettings::$access_limitation
private

Definition at line 54 of file class.ilRegistrationSettings.php.

Referenced by getAccessLimitation().

◆ $allowed_domains

ilRegistrationSettings::$allowed_domains
private

Definition at line 61 of file class.ilRegistrationSettings.php.

Referenced by getAllowedDomains().

◆ $approve_recipient_ids

ilRegistrationSettings::$approve_recipient_ids
private

Definition at line 56 of file class.ilRegistrationSettings.php.

◆ $approve_recipient_logins

ilRegistrationSettings::$approve_recipient_logins
private

Definition at line 55 of file class.ilRegistrationSettings.php.

Referenced by getApproveRecipientLogins().

◆ $password_generation_enabled

ilRegistrationSettings::$password_generation_enabled
private

Definition at line 53 of file class.ilRegistrationSettings.php.

Referenced by passwordGenerationEnabled().

◆ $reg_allow_codes

ilRegistrationSettings::$reg_allow_codes = false
private

Definition at line 60 of file class.ilRegistrationSettings.php.

Referenced by getAllowCodes().

◆ $reg_hash_life_time

ilRegistrationSettings::$reg_hash_life_time = 0
private

Definition at line 59 of file class.ilRegistrationSettings.php.

◆ $registration_type

ilRegistrationSettings::$registration_type
private

Definition at line 52 of file class.ilRegistrationSettings.php.

Referenced by getRegistrationType().

◆ $role_type

ilRegistrationSettings::$role_type
private

Definition at line 57 of file class.ilRegistrationSettings.php.

◆ $unknown

ilRegistrationSettings::$unknown
private

Definition at line 58 of file class.ilRegistrationSettings.php.

◆ ERR_MISSING_RCP

const ilRegistrationSettings::ERR_MISSING_RCP = 2

Definition at line 48 of file class.ilRegistrationSettings.php.

Referenced by ilRegistrationSettingsGUI\save(), and validate().

◆ ERR_UNKNOWN_RCP

const ilRegistrationSettings::ERR_UNKNOWN_RCP = 1

Definition at line 47 of file class.ilRegistrationSettings.php.

Referenced by ilRegistrationSettingsGUI\save(), and validate().

◆ REG_HASH_LIFETIME_MIN_VALUE

const ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE = 60

The documentation for this class was generated from the following file: