ILIAS  release_4-4 Revision
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 250 of file class.ilRegistrationSettings.php.

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

Referenced by ilRegistrationSettings().

251  {
252  global $ilias;
253 
254  $this->registration_type = $ilias->getSetting('new_registration_type');
255  $this->role_type = $ilias->getSetting('reg_role_assignment',1);
256  $this->password_generation_enabled = $ilias->getSetting('passwd_reg_auto_generate');
257  $this->access_limitation = $ilias->getSetting('reg_access_limitation');
258  $this->reg_hash_life_time = $ilias->getSetting('reg_hash_life_time');
259  $this->reg_allow_codes = (bool)$ilias->getSetting('reg_allow_codes');
260 
261  $this->approve_recipient_ids = unserialize(stripslashes($ilias->getSetting('approve_recipient')));
262  $this->approve_recipient_ids = $this->approve_recipient_ids ?
263  $this->approve_recipient_ids :
264  array();
265 
266  // create login array
267  $tmp_logins = array();
268  foreach($this->approve_recipient_ids as $id)
269  {
270  if($login = ilObjUser::_lookupLogin($id))
271  {
272  $tmp_logins[] = $login;
273  }
274  }
275  $this->approve_recipient_logins = implode(',',$tmp_logins);
276 
277  $this->setAllowedDomains($ilias->getSetting('reg_allowed_domains'));
278  }
_lookupLogin($a_user_id)
lookup login
+ 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.

References IL_REG_DISABLED.

Referenced by ilMainMenuGUI\getLanguageSelection(), and ilStartUpGUI\showRegistrationLinks().

78  {
79  global $ilias;
80 
81  return $ilias->getSetting('new_registration_type',IL_REG_DISABLED);
82  }
+ Here is the caller graph for this function:

◆ activationEnabled()

ilRegistrationSettings::activationEnabled ( )

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

References IL_REG_ACTIVATION.

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

◆ approveEnabled()

ilRegistrationSettings::approveEnabled ( )

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

References IL_REG_APPROVE.

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

◆ automaticRoleAssignmentEnabled()

ilRegistrationSettings::automaticRoleAssignmentEnabled ( )

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

References IL_REG_ROLES_EMAIL.

156  {
157  return $this->role_type == IL_REG_ROLES_EMAIL;
158  }
const IL_REG_ROLES_EMAIL

◆ directEnabled()

ilRegistrationSettings::directEnabled ( )

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

References IL_REG_DIRECT.

89  {
90  return $this->registration_type == IL_REG_DIRECT;
91  }

◆ enabled()

ilRegistrationSettings::enabled ( )

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

References IL_REG_DISABLED.

85  {
86  return $this->registration_type != IL_REG_DISABLED;
87  }

◆ getAccessLimitation()

ilRegistrationSettings::getAccessLimitation ( )

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

References $access_limitation.

◆ getAllowCodes()

ilRegistrationSettings::getAllowCodes ( )

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

References $reg_allow_codes.

◆ getAllowedDomains()

ilRegistrationSettings::getAllowedDomains ( )

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

References $allowed_domains.

195  {
196  return (array)$this->allowed_domains;
197  }

◆ getApproveRecipientLogins()

ilRegistrationSettings::getApproveRecipientLogins ( )

Definition at line 138 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 142 of file class.ilRegistrationSettings.php.

143  {
144  return $this->approve_recipient_ids ? $this->approve_recipient_ids : array();
145  }

◆ getRegistrationHashLifetime()

ilRegistrationSettings::getRegistrationHashLifetime ( )

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

172  {
173  return max($this->reg_hash_life_time, self::REG_HASH_LIFETIME_MIN_VALUE);
174  }

◆ 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 146 of file class.ilRegistrationSettings.php.

147  {
148  return implode(',',$this->unknown);
149  }

◆ ilRegistrationSettings()

ilRegistrationSettings::ilRegistrationSettings ( )

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

References __read().

64  {
65  $this->__read();
66  }
+ Here is the call graph for this function:

◆ passwordGenerationEnabled()

ilRegistrationSettings::passwordGenerationEnabled ( )

◆ registrationCodeRequired()

ilRegistrationSettings::registrationCodeRequired ( )

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

References IL_REG_CODES.

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

◆ roleSelectionEnabled()

ilRegistrationSettings::roleSelectionEnabled ( )

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

References IL_REG_ROLES_FIXED.

152  {
153  return $this->role_type == IL_REG_ROLES_FIXED;
154  }
const IL_REG_ROLES_FIXED

◆ save()

ilRegistrationSettings::save ( )

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

235  {
236  global $ilias;
237 
238  $ilias->setSetting('reg_role_assignment',$this->role_type);
239  $ilias->setSetting('new_registration_type',$this->registration_type);
240  $ilias->setSetting('passwd_reg_auto_generate',$this->password_generation_enabled);
241  $ilias->setSetting('approve_recipient',addslashes(serialize($this->approve_recipient_ids)));
242  $ilias->setSetting('reg_access_limitation',$this->access_limitation);
243  $ilias->setSetting('reg_hash_life_time',$this->reg_hash_life_time);
244  $ilias->setSetting('reg_allow_codes',$this->reg_allow_codes);
245  $ilias->setSetting('reg_allowed_domains',implode(';', $this->allowed_domains));
246 
247  return true;
248  }

◆ setAccessLimitation()

ilRegistrationSettings::setAccessLimitation (   $a_access_limitation)

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

120  {
121  $this->access_limitation = $a_access_limitation;
122  }

◆ setAllowCodes()

ilRegistrationSettings::setAllowCodes (   $a_allow_codes)

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

177  {
178  $this->reg_allow_codes = (bool)$a_allow_codes;
179 
180  return $this;
181  }

◆ setAllowedDomains()

ilRegistrationSettings::setAllowedDomains (   $a_value)

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

Referenced by __read().

189  {
190  $a_value = explode(";", trim($a_value));
191  $this->allowed_domains = $a_value;
192  }
+ Here is the caller graph for this function:

◆ setApproveRecipientLogins()

ilRegistrationSettings::setApproveRecipientLogins (   $a_rec_string)

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

References ilObjUser\_lookupId().

125  {
126  $this->approve_recipient_logins = $a_rec_string;
127  $this->approve_recipient_ids = array();
128 
129  // convert logins to array of ids
130  foreach(explode(',',trim($this->approve_recipient_logins)) as $login)
131  {
132  if($uid = ilObjUser::_lookupId(trim($login)))
133  {
134  $this->approve_recipient_ids[] = $uid;
135  }
136  }
137  }
static _lookupId($a_user_str)
lookup id by login
+ Here is the call graph for this function:

◆ setPasswordGenerationStatus()

ilRegistrationSettings::setPasswordGenerationStatus (   $a_status)

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

110  {
111  $this->password_generation_enabled = $a_status;
112  }

◆ setRegistrationHashLifetime()

ilRegistrationSettings::setRegistrationHashLifetime (   $a_lifetime)

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

165  {
166  $this->reg_hash_life_time = $a_lifetime;
167 
168  return $this;
169  }

◆ 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 159 of file class.ilRegistrationSettings.php.

160  {
161  $this->role_type = $a_type;
162  }

◆ validate()

ilRegistrationSettings::validate ( )

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

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

200  {
201  $this->unknown = array();
202  $this->mail_perm = array();
203 
204  $login_arr = explode(',',$this->getApproveRecipientLogins());
205  $login_arr = $login_arr ? $login_arr : array();
206  foreach($login_arr as $recipient)
207  {
208  if(!$recipient = trim($recipient))
209  {
210  continue;
211  }
212  if(!ilObjUser::_lookupId($recipient))
213  {
214  $this->unknown[] = $recipient;
215  continue;
216  }
217  else
218  {
219  $valid = $recipient;
220  }
221  }
222  if(count($this->unknown))
223  {
224  return self::ERR_UNKNOWN_RCP;
225  }
226  if($this->getRegistrationType() == IL_REG_APPROVE and !count((array) $valid))
227  {
228  return self::ERR_MISSING_RCP;
229  }
230  return 0;
231  }
$valid
static _lookupId($a_user_str)
lookup id by login
+ 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().

◆ ERR_UNKNOWN_RCP

const ilRegistrationSettings::ERR_UNKNOWN_RCP = 1

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

Referenced by ilRegistrationSettingsGUI\save().

◆ REG_HASH_LIFETIME_MIN_VALUE

const ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE = 60

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