ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilRegistrationSettingsGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 require_once './Services/Registration/classes/class.ilRegistrationSettings.php';
25 
37 {
40 
41  public $ctrl;
42  public $tpl;
43  public $ref_id;
44 
45  public function __construct()
46  {
47  global $DIC;
48 
49  $ilCtrl = $DIC['ilCtrl'];
50  $tpl = $DIC['tpl'];
51  $lng = $DIC['lng'];
52 
53  $this->tpl = $tpl;
54  $this->ctrl = $ilCtrl;
55 
56  $this->lng = $lng;
57  $this->lng->loadLanguageModule('administration');
58  $this->lng->loadLanguageModule('registration');
59  $this->lng->loadLanguageModule('user');
60 
61  $this->ref_id = (int) $_GET['ref_id'];
62 
63  $this->registration_settings = new ilRegistrationSettings();
64  }
65 
66  public function executeCommand()
67  {
68  $next_class = $this->ctrl->getNextClass($this);
69  $cmd = $this->ctrl->getCmd();
70  switch ($next_class) {
71  default:
72  if (!$cmd) {
73  $cmd = 'view';
74  }
75  $this->$cmd();
76  break;
77  }
78  return true;
79  }
80 
85  public function setSubTabs($activeTab = 'registration_settings')
86  {
87  global $DIC;
88 
89  $ilTabs = $DIC['ilTabs'];
90  $lng = $DIC['lng'];
91 
92  $ilTabs->addSubTab(
93  "registration_settings",
94  $lng->txt("registration_tab_settings"),
95  $this->ctrl->getLinkTarget($this, 'view')
96  );
97 
98  $ilTabs->addSubTab(
99  "registration_codes",
100  $lng->txt("registration_tab_codes"),
101  $this->ctrl->getLinkTarget($this, 'listCodes')
102  );
103 
104  $ilTabs->activateSubTab($activeTab);
105  }
106 
107  public function initForm()
108  {
109  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
110 
111  $this->form_gui = new ilPropertyFormGUI();
112  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
113  $this->form_gui->setTitle($this->lng->txt('reg_settings_header'));
114 
115  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('reg_type'), 'reg_type');
116  $reg_type->addOption(new ilRadioOption($this->lng->txt('reg_disabled'), IL_REG_DISABLED));
117  $option = new ilRadioOption($this->lng->txt('reg_direct'), IL_REG_DIRECT);
118  $option->setInfo($this->lng->txt('reg_direct_info'));
119  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_DIRECT);
120  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
121  $option->addSubItem($cd);
122  $reg_type->addOption($option);
123  $option = new ilRadioOption($this->lng->txt('reg_approve'), IL_REG_APPROVE);
124  $option->setInfo($this->lng->txt('reg_approve_info'));
125  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_APPROVE);
126  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
127  $option->addSubItem($cd);
128  $reg_type->addOption($option);
129  $option = new ilRadioOption($this->lng->txt('reg_type_confirmation'), IL_REG_ACTIVATION);
130  $option->setInfo($this->lng->txt('reg_type_confirmation_info'));
131  $lt = new ilNumberInputGUI($this->lng->txt('reg_confirmation_hash_life_time'), 'reg_hash_life_time');
132  $lt->setSize(6); // #8511
133  $lt->setMaxLength(6);
135  $lt->setRequired(true);
136  $lt->setInfo($this->lng->txt('reg_confirmation_hash_life_time_info'));
137  $lt->setSuffix($this->lng->txt('seconds'));
138  $option->addSubItem($lt);
139  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_ACTIVATION);
140  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
141  $option->addSubItem($cd);
142  $reg_type->addOption($option);
143  $option = new ilRadioOption($this->lng->txt('registration_reg_type_codes'), IL_REG_CODES);
144  $option->setInfo($this->lng->txt('registration_reg_type_codes_info'));
145  $reg_type->addOption($option);
146  $this->form_gui->addItem($reg_type);
147 
148  $pwd_gen = new ilCheckboxInputGUI($this->lng->txt('passwd_generation'), 'reg_pwd');
149  $pwd_gen->setValue(1);
150  $pwd_gen->setInfo($this->lng->txt('reg_info_pwd'));
151  $this->form_gui->addItem($pwd_gen);
152 
153  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
154  $cap = new ilCheckboxInputGUI($this->lng->txt('adm_captcha_anonymous_short'), 'activate_captcha_anonym');
155  $cap->setInfo($this->lng->txt('adm_captcha_anonymous_reg'));
156  $cap->setValue(1);
158  $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
159  }
160  $this->form_gui->addItem($cap);
161 
162  $approver = new ilTextInputGUI($this->lng->txt('reg_notification'), 'reg_approver');
163  $approver->setSize(32);
164  $approver->setMaxLength(50);
165  $approver->setInfo($this->lng->txt('reg_notification_info'));
166  $this->form_gui->addItem($approver);
167 
168  $roles = new ilRadioGroupInputGUI($this->lng->txt('reg_role_assignment'), 'reg_role_type');
169  $option = new ilRadioOption($this->lng->txt('reg_fixed'), IL_REG_ROLES_FIXED);
170  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
171  $edit = $this->ctrl->getLinkTarget($this, 'editRoles');
172  $list->setHtml($this->__parseRoleList($this->__prepareRoleList(), $edit));
173  $option->addSubItem($list);
174  $roles->addOption($option);
175  $option = new ilRadioOption($this->lng->txt('reg_email'), IL_REG_ROLES_EMAIL);
176  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
177  $edit = $this->ctrl->getLinkTarget($this, 'editEmailAssignments');
178  $list->setHtml($this->__parseRoleList($this->__prepareAutomaticRoleList(), $edit));
179  $option->addSubItem($list);
180  $roles->addOption($option);
181  $roles->setInfo($this->lng->txt('registration_codes_override_global_info'));
182  $this->form_gui->addItem($roles);
183 
184  $limit = new ilCheckboxInputGUI($this->lng->txt('reg_access_limitations'), 'reg_access_limitation');
185  $limit->setValue(1);
186  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
187  $edit = $this->ctrl->getLinkTarget($this, 'editRoleAccessLimitations');
188  $list->setHtml($this->__parseRoleList($this->__prepareAccessLimitationRoleList(), $edit));
189  $list->setInfo($this->lng->txt('registration_codes_override_global_info'));
190  $limit->addSubItem($list);
191  $this->form_gui->addItem($limit);
192 
193  $domains = new ilTextInputGUI($this->lng->txt('reg_allowed_domains'), 'reg_allowed_domains');
194  $domains->setInfo($this->lng->txt('reg_allowed_domains_info'));
195  $this->form_gui->addItem($domains);
196 
197  $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
198  }
199 
200  public function initFormValues()
201  {
202  if ($this->registration_settings->roleSelectionEnabled()) {
203  $role_type = IL_REG_ROLES_FIXED;
204  } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
205  $role_type = IL_REG_ROLES_EMAIL;
206  }
207 
208  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
209  $values = array(
210  'reg_type' => $this->registration_settings->getRegistrationType(),
211  'reg_hash_life_time' => (int) $this->registration_settings->getRegistrationHashLifetime(),
212  'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
213  'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
214  'reg_role_type' => $role_type,
215  'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
216  'reg_allowed_domains' => implode(';', $this->registration_settings->getAllowedDomains()),
217  'activate_captcha_anonym' => ilCaptchaUtil::isActiveForRegistration()
218  );
219 
220  $allow_codes = $this->registration_settings->getAllowCodes();
221  $reg_type = $this->registration_settings->getRegistrationType();
222  if ($allow_codes && in_array($reg_type, array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION))) {
223  $values['reg_codes_' . $reg_type] = true;
224  }
225 
226  $this->form_gui->setValuesByArray($values);
227  }
228 
229  public function view()
230  {
231  global $DIC;
232 
233  $ilAccess = $DIC['ilAccess'];
234  $ilErr = $DIC['ilErr'];
235  $ilCtrl = $DIC['ilCtrl'];
236  $ilToolbar = $DIC['ilToolbar'];
237  $ilTabs = $DIC['ilTabs'];
238 
239  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
240  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
241  }
242 
243  $this->setSubTabs();
244 
245  // edit new accout mail
246  $ilCtrl->setParameterByClass("ilobjuserfoldergui", "ref_id", USER_FOLDER_ID);
247  $ilToolbar->addButton(
248  $this->lng->txt('registration_user_new_account_mail'),
249  $ilCtrl->getLinkTargetByClass(array("iladministrationgui", "ilobjuserfoldergui"), "newAccountMail")
250  );
251  $ilCtrl->setParameterByClass("ilobjuserfoldergui", "ref_id", $_GET["ref_id"]);
252 
253  $this->initForm();
254  $this->initFormValues();
255  $this->tpl->setContent($this->form_gui->getHTML());
256  }
257 
258  public function save()
259  {
260  global $DIC;
261 
262  $ilAccess = $DIC['ilAccess'];
263  $ilErr = $DIC['ilErr'];
264 
265  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
266  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
267  }
268 
269  $this->registration_settings->setRegistrationType((int) $_POST['reg_type']);
270  $this->registration_settings->setPasswordGenerationStatus((int) $_POST['reg_pwd']);
271  $this->registration_settings->setApproveRecipientLogins(ilUtil::stripSlashes($_POST['reg_approver']));
272  $this->registration_settings->setRoleType((int) $_POST['reg_role_type']);
273  $this->registration_settings->setAccessLimitation((int) $_POST['reg_access_limitation']);
274  $this->registration_settings->setAllowedDomains($_POST['reg_allowed_domains']);
275 
276  $allow_codes = false;
277  if (in_array((int) $_POST['reg_type'], array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION))) {
278  $allow_codes = (bool) $_POST['reg_codes_' . (int) $_POST['reg_type']];
279  }
280  $this->registration_settings->setAllowCodes($allow_codes);
281 
282  if (!preg_match('/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (int) $_POST['reg_hash_life_time'])) {
283  $this->registration_settings->setRegistrationHashLifetime(ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE);
284  } else {
285  $this->registration_settings->setRegistrationHashLifetime(max((int) $_POST['reg_hash_life_time'], ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE));
286  }
287 
288  if ($error_code = $this->registration_settings->validate()) {
289  switch ($error_code) {
291 
292  ilUtil::sendFailure($this->lng->txt('reg_unknown_recipients') . ' ' . $this->registration_settings->getUnknown());
293  $this->view();
294  return false;
295 
297 
298  ilUtil::sendFailure($this->lng->txt('reg_approve_needs_recipient') . ' ' . $this->registration_settings->getUnknown());
299  $this->view();
300  return false;
301 
302  }
303  }
304 
305  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
306  ilCaptchaUtil::setActiveForRegistration((bool) $_POST['activate_captcha_anonym']);
307 
308  $this->registration_settings->save();
309  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
310  $this->view();
311 
312  return true;
313  }
314 
315  public function editRoles()
316  {
317  include_once './Services/AccessControl/classes/class.ilObjRole.php';
318 
319  global $DIC;
320 
321  $ilAccess = $DIC['ilAccess'];
322  $ilErr = $DIC['ilErr'];
323  $rbacreview = $DIC['rbacreview'];
324 
325  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
326  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
327  }
328 
329  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.edit_roles.html', 'Services/Registration');
330 
331  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
332  $this->tpl->setVariable("TXT_SELECTABLE_ROLES", $this->lng->txt('reg_selectable_roles'));
333  $this->tpl->setVariable("ARR_DOWNRIGHT", ilUtil::getImagePath('arrow_downright.svg'));
334  $this->tpl->setVariable("ACTIONS", $this->lng->txt('actions'));
335  $this->tpl->setVariable("UPDATE", $this->lng->txt('save'));
336  $this->tpl->setVariable("CANCEL", $this->lng->txt('cancel'));
337 
338  $counter = 0;
339  foreach ($rbacreview->getGlobalRoles() as $role) {
340  if ($role == SYSTEM_ROLE_ID or $role == ANONYMOUS_ROLE_ID) {
341  continue;
342  }
343  $this->tpl->setCurrentBlock("roles");
344  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow2'));
345  $this->tpl->setVariable("CHECK_ROLE", ilUtil::formCheckbox(
347  "roles[$role]",
348  1
349  ));
350  $this->tpl->setVariable("ROLE", ilObjRole::_lookupTitle($role));
351  $this->tpl->parseCurrentBlock();
352  }
353  }
354 
355  public function updateRoles()
356  {
357  global $DIC;
358 
359  $ilAccess = $DIC['ilAccess'];
360  $ilErr = $DIC['ilErr'];
361  $rbacreview = $DIC['rbacreview'];
362 
363  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
364  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
365  }
366  // Minimum one role
367  if (count($_POST['roles']) < 1) {
368  ilUtil::sendFailure($this->lng->txt('msg_last_role_for_registration'));
369  $this->editRoles();
370  return false;
371  }
372  // update allow register
373  foreach ($rbacreview->getGlobalRoles() as $role) {
374  if ($role_obj = ilObjectFactory::getInstanceByObjId($role, false)) {
375  $role_obj->setAllowRegister($_POST['roles'][$role] ? 1 : 0);
376  $role_obj->update();
377  }
378  }
379 
380  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
381  $this->view();
382 
383  return true;
384  }
385 
386  public function editEmailAssignments()
387  {
388  global $DIC;
389 
390  $ilAccess = $DIC['ilAccess'];
391  $ilErr = $DIC['ilErr'];
392  $rbacreview = $DIC['rbacreview'];
393 
394  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
395  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
396  }
397 
398  $this->__initRoleAssignments();
399 
400  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.reg_email_role_assignments.html', 'Services/Registration');
401  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
402  $this->tpl->setVariable("TXT_EMAIL_ROLE_ASSIGN", $this->lng->txt('reg_email_role_assignment'));
403  $this->tpl->setVariable("TXT_MAIL", $this->lng->txt('reg_email'));
404  $this->tpl->setVariable("TXT_ROLE", $this->lng->txt('obj_role'));
405  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt('reg_default'));
406  $this->tpl->setVariable("ARR_DOWNRIGHT", ilUtil::getImagePath('arrow_downright.svg'));
407  $this->tpl->setVariable("TXT_DOMAIN", $this->lng->txt('reg_domain'));
408 
409 
410  $this->tpl->setVariable("BTN_DELETE", $this->lng->txt('delete'));
411  $this->tpl->setVariable("BTN_SAVE", $this->lng->txt('save'));
412  $this->tpl->setVariable("BTN_ADD", $this->lng->txt('reg_add_assignment'));
413  $this->tpl->setVariable("BTN_CANCEL", $this->lng->txt('cancel'));
414 
415  $counter = 0;
416  foreach ($this->assignments_obj->getAssignments() as $assignment) {
417  $this->tpl->setCurrentBlock("roles");
418  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
419  $this->tpl->setVariable("ASSIGN_ID", $assignment['id']);
420  $this->tpl->setVariable("DOMAIN", $assignment['domain']);
421  $this->tpl->setVariable("CHECK_ROLE", ilUtil::formCheckbox(0, 'del_assign[]', $assignment['id']));
422  $this->tpl->setVariable("ROLE_SEL", $this->__buildRoleSelection($assignment['id']));
423  $this->tpl->parseCurrentBlock();
424  }
425 
426  $this->tpl->setVariable("DEF_CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
427  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt('default'));
428  $this->tpl->setVariable("DEF_ROLE", $this->__buildRoleSelection(-1));
429  }
430 
431  public function editRoleAccessLimitations()
432  {
433  global $DIC;
434 
435  $lng = $DIC['lng'];
436  $ilAccess = $DIC['ilAccess'];
437  $ilErr = $DIC['ilErr'];
438  $rbacreview = $DIC['rbacreview'];
439 
440  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
441  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
442  }
443 
445 
446  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.reg_role_access_limitations.html', 'Services/Registration');
447 
448  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
449  $this->tpl->setVariable("TXT_REG_ROLE_ACCESS_LIMITATIONS", $lng->txt('reg_role_access_limitations'));
450  $this->tpl->setVariable("TXT_ROLE", $lng->txt('obj_role'));
451  $this->tpl->setVariable("TXT_ACCESS_LIMITATION_MODE", $lng->txt('reg_access_limitation_mode'));
452 
453  $this->tpl->setVariable("BTN_SAVE", $lng->txt('save'));
454  $this->tpl->setVariable("BTN_CANCEL", $lng->txt('cancel'));
455 
456  $counter = 0;
457  include_once './Services/AccessControl/classes/class.ilObjRole.php';
458 
459  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
460  $this->tpl->setCurrentBlock("roles");
461  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
462  $this->tpl->setVariable("ROLE_ID", $role['id']);
463  $this->tpl->setVariable("ROLE_TITLE", $role['title']);
464  $this->tpl->setVariable("SEL_ACCESS_LIMITATION", $this->__buildAccessLimitationSelection($role['id']));
465  $this->tpl->setVariable("CSS_DISPLAY_ABSOLUTE", ($this->access_limitations_obj->getMode($role['id']) == 'absolute') ? 'inline' : 'none');
466  $this->tpl->setVariable("CSS_DISPLAY_RELATIVE", ($this->access_limitations_obj->getMode($role['id']) == 'relative') ? 'inline' : 'none');
467  $this->tpl->setVariable("CSS_DISPLAY_UNLIMITED", ($this->access_limitations_obj->getMode($role['id']) == 'unlimited') ? 'inline' : 'none');
468  $this->tpl->setVariable("TXT_ACCESS_LIMITATION_UNLIMITED", $lng->txt('reg_access_limitation_none'));
469 
470  $date = $this->__prepareDateSelect($this->access_limitations_obj->getAbsolute($role['id']));
471  $this->tpl->setVariable("SEL_ACCESS_LIMITATION_ABSOLUTE", ilUtil::makeDateSelect('access_limitation_absolute_' . $role['id'], $date['y'], $date['m'], $date['d'], '2007'));
472 
473  $this->tpl->setVariable("TXT_DAYS", $lng->txt('days'));
474  $this->tpl->setVariable("TXT_MONTHS", $lng->txt('months'));
475  $this->tpl->setVariable("TXT_YEARS", $lng->txt('years'));
476 
477  $this->tpl->setVariable("DAYS", $this->access_limitations_obj->getRelative($role['id'], 'd'));
478  $this->tpl->setVariable("MONTHS", $this->access_limitations_obj->getRelative($role['id'], 'm'));
479  $this->tpl->setVariable("YEARS", $this->access_limitations_obj->getRelative($role['id'], 'y'));
480  $this->tpl->parseCurrentBlock();
481  }
482  }
483 
484  public function addAssignment()
485  {
486  global $DIC;
487 
488  $ilAccess = $DIC['ilAccess'];
489  $ilErr = $DIC['ilErr'];
490  $rbacreview = $DIC['rbacreview'];
491 
492  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
493  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
494  }
495 
496  $this->__initRoleAssignments();
497  $this->assignments_obj->add();
498 
499  ilUtil::sendSuccess($this->lng->txt('reg_added_assignment'));
500  $this->editEmailAssignments();
501 
502  return true;
503  }
504 
505  public function deleteAssignment()
506  {
507  global $DIC;
508 
509  $ilAccess = $DIC['ilAccess'];
510  $ilErr = $DIC['ilErr'];
511  $rbacreview = $DIC['rbacreview'];
512 
513  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
514  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
515  }
516 
517  if (!count($_POST['del_assign'])) {
518  ilUtil::sendFailure($this->lng->txt('reg_select_one'));
519  $this->editEmailAssignments();
520  return false;
521  }
522 
523  $this->__initRoleAssignments();
524 
525  foreach ($_POST['del_assign'] as $assignment_id) {
526  $this->assignments_obj->delete($assignment_id);
527  }
528 
529  ilUtil::sendSuccess($this->lng->txt('reg_deleted_assignment'));
530  $this->editEmailAssignments();
531 
532  return true;
533  }
534 
535  public function saveAssignment()
536  {
537  global $DIC;
538 
539  $ilAccess = $DIC['ilAccess'];
540  $ilErr = $DIC['ilErr'];
541  $rbacreview = $DIC['rbacreview'];
542 
543  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
544  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
545  }
546 
547  $this->__initRoleAssignments();
548 
549  if (!is_array($_POST['domain'])) {
550  $_POST['domain'] = array();
551  }
552 
553  foreach ($_POST['domain'] as $id => $data) {
554  $this->assignments_obj->setDomain($id, ilUtil::stripSlashes($_POST['domain'][$id]['domain']));
555  $this->assignments_obj->setRole($id, ilUtil::stripSlashes($_POST['role'][$id]['role']));
556  }
557  $this->assignments_obj->setDefaultRole((int) $_POST['default_role']);
558 
559  if ($err = $this->assignments_obj->validate()) {
560  switch ($err) {
562  ilUtil::sendFailure($this->lng->txt('reg_missing_domain'));
563  break;
564 
565  case IL_REG_MISSING_ROLE:
566  ilUtil::sendFailure($this->lng->txt('reg_missing_role'));
567  break;
568  }
569  $this->editEmailAssignments();
570  return false;
571  }
572 
573 
574  $this->assignments_obj->save();
575  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
576  $this->view();
577  return true;
578  }
579 
580  public function saveRoleAccessLimitations()
581  {
582  global $DIC;
583 
584  $ilAccess = $DIC['ilAccess'];
585  $ilErr = $DIC['ilErr'];
586  $rbacreview = $DIC['rbacreview'];
587 
588  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
589  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
590  }
591 
593 
594  include_once './Services/AccessControl/classes/class.ilObjRole.php';
595 
596  $this->access_limitations_obj->resetAccessLimitations();
597  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
598  $this->access_limitations_obj->setMode($_POST['access_limitation_mode_' . $role['id']], $role['id']);
599  $this->access_limitations_obj->setAbsolute($_POST['access_limitation_absolute_' . $role['id']], $role['id']);
600  $this->access_limitations_obj->setRelative($_POST['access_limitation_relative_' . $role['id']], $role['id']);
601  }
602 
603  if ($err = $this->access_limitations_obj->validate()) {
604  switch ($err) {
606  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_missing_mode'));
607  break;
608 
610  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_out_of_date'));
611  break;
612  }
613  $this->editRoleAccessLimitations();
614  return false;
615  }
616 
617 
618  $this->access_limitations_obj->save();
619  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
620  $this->view();
621  return true;
622  }
623 
624  public function __parseRoleList($roles, $url)
625  {
626  $tpl = new ilTemplate('tpl.registration_roles.html', true, true, 'Services/Registration');
627 
628  $tpl->setVariable("EDIT", $this->lng->txt("edit"));
629  $tpl->setVariable("LINK_EDIT", $url);
630 
631  if (is_array($roles) && sizeof($roles)) {
632  foreach ($roles as $role) {
633  $tpl->setCurrentBlock("list_item");
634  $tpl->setVariable("LIST_ITEM_ITEM", $role);
635  $tpl->parseCurrentBlock();
636  }
637  } else {
638  $tpl->setVariable("NONE", $this->lng->txt('none'));
639  }
640 
641  return $tpl->get();
642  }
643 
644  public function __prepareRoleList()
645  {
646  include_once './Services/AccessControl/classes/class.ilObjRole.php';
647 
648  $all = array();
649  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
650  $all[] = $role['title'];
651  }
652  return $all;
653  }
654 
655  public function __prepareAutomaticRoleList()
656  {
657  include_once './Services/AccessControl/classes/class.ilObjRole.php';
658  $this->__initRoleAssignments();
659 
660  $all = array();
661  foreach ($this->assignments_obj->getAssignments() as $assignment) {
662  if (strlen($assignment['domain']) and $assignment['role']) {
663  $all[] = $assignment['domain'] . ' -> ' . ilObjRole::_lookupTitle($assignment['role']);
664  }
665  }
666 
667  if (strlen($this->assignments_obj->getDefaultRole())) {
668  $all[] = $this->lng->txt('reg_default') . ' -> ' . ilObjRole::_lookupTitle($this->assignments_obj->getDefaultRole());
669  }
670 
671  return $all;
672  }
673 
675  {
676  global $DIC;
677 
678  $lng = $DIC['lng'];
679 
681 
682  include_once './Services/AccessControl/classes/class.ilObjRole.php';
683 
684  $all = array();
685  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
686  switch ($this->access_limitations_obj->getMode($role['id'])) {
687  case 'absolute':
688  $txt_access_value = $lng->txt('reg_access_limitation_limited_until');
689  $txt_access_value .= " " . ilDatePresentation::formatDate(new ilDateTime($this->access_limitations_obj->getAbsolute($role['id'], IL_CAL_UNIX)));
690  break;
691 
692  case 'relative':
693  $years = $this->access_limitations_obj->getRelative($role['id'], 'y');
694  $months = $this->access_limitations_obj->getRelative($role['id'], 'm');
695  $days = $this->access_limitations_obj->getRelative($role['id'], 'd');
696 
697  $txt_access_value = $lng->txt('reg_access_limitation_limited_time') . " ";
698 
699  if ($years) {
700  $txt_access_value .= $years . " ";
701  $txt_access_value .= ($years == 1) ? $lng->txt('year') : $lng->txt('years');
702 
703  if ($months) {
704  if ($days) {
705  $txt_access_value .= ", ";
706  } else {
707  $txt_access_value .= " " . $lng->txt('and') . " ";
708  }
709  } elseif ($days) {
710  $txt_access_value .= " " . $lng->txt('and') . " ";
711  }
712  }
713 
714  if ($months) {
715  $txt_access_value .= $months . " ";
716  $txt_access_value .= ($months == 1) ? $lng->txt('month') : $lng->txt('months');
717 
718  if ($days) {
719  $txt_access_value .= " " . $lng->txt('and') . " ";
720  }
721  }
722 
723  if ($days) {
724  $txt_access_value .= $days . " ";
725  $txt_access_value .= ($days == 1) ? $lng->txt('day') : $lng->txt('days');
726  }
727  break;
728 
729  default:
730  $txt_access_value = $lng->txt('reg_access_limitation_none');
731  break;
732  }
733 
734  $all[] = $role['title'] . ' (' . $txt_access_value . ')';
735  }
736 
737  return $all;
738  }
739 
740  public function __initRoleAssignments()
741  {
742  if (is_object($this->assignments_obj)) {
743  return true;
744  }
745 
746  include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
747 
748  $this->assignments_obj = new ilRegistrationRoleAssignments();
749  }
750 
751  public function __initRoleAccessLimitations()
752  {
753  if (is_object($this->access_limitations_obj)) {
754  return true;
755  }
756 
757  include_once 'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
758 
759  $this->access_limitations_obj = new ilRegistrationRoleAccessLimitations();
760  }
761 
762  public function __buildRoleSelection($assignment_id)
763  {
764  include_once './Services/AccessControl/classes/class.ilObjRole.php';
765 
766  global $DIC;
767 
768  $rbacreview = $DIC['rbacreview'];
769 
770  $assignments = $this->assignments_obj->getAssignments();
771  $selected = ($assignment_id > 0) ?
772  $assignments[$assignment_id]['role'] :
773  $this->assignments_obj->getDefaultRole();
774 
775  if (!$selected) {
776  $roles[0] = $this->lng->txt('please_choose');
777  }
778 
779  foreach ($rbacreview->getGlobalRoles() as $role_id) {
780  if ($role_id == ANONYMOUS_ROLE_ID) {
781  continue;
782  }
783  $roles[$role_id] = ilObjRole::_lookupTitle($role_id);
784  }
785 
786  if ($assignment_id > 0) {
787  return ilUtil::formSelect(
788  $selected,
789  "role[$assignment_id][role]",
790  $roles,
791  false,
792  true
793  );
794  } else {
795  return ilUtil::formSelect(
796  $selected,
797  "default_role",
798  $roles,
799  false,
800  true
801  );
802  }
803  }
804 
805  public function __buildAccessLimitationSelection($a_role_id)
806  {
807  global $DIC;
808 
809  $lng = $DIC['lng'];
810 
811  $options = array(
812  'null' => $lng->txt('please_choose'),
813  'unlimited' => $lng->txt('reg_access_limitation_mode_unlimited'),
814  'absolute' => $lng->txt('reg_access_limitation_mode_absolute'),
815  'relative' => $lng->txt('reg_access_limitation_mode_relative')
816  );
817 
818  $attribs = array('onchange' => 'displayAccessLimitationSelectionForm(document.cmd.access_limitation_mode_' . $a_role_id . ',' . $a_role_id . ')');
819 
820  $selected = $this->access_limitations_obj->getMode($a_role_id);
821 
822  return ilUtil::formSelect($selected, 'access_limitation_mode_' . $a_role_id, $options, false, true, 0, "", $attribs);
823  }
824 
825  public function __prepareDateSelect($a_unix_time)
826  {
827  if (!$a_unix_time) {
828  $a_unix_time = time();
829  }
830 
831  return array('y' => date('Y', $a_unix_time),
832  'm' => date('n', $a_unix_time),
833  'd' => date('d', $a_unix_time));
834  }
835 
836  public function listCodes()
837  {
838  global $DIC;
839 
840  $ilAccess = $DIC['ilAccess'];
841  $ilErr = $DIC['ilErr'];
842  $ilCtrl = $DIC['ilCtrl'];
843  $ilToolbar = $DIC['ilToolbar'];
844 
845  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
846  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
847  }
848 
849  $this->setSubTabs('registration_codes');
850 
851  $ilToolbar->addButton(
852  $this->lng->txt("registration_codes_add"),
853  $this->ctrl->getLinkTarget($this, "addCodes")
854  );
855 
856  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
857  $ctab = new ilRegistrationCodesTableGUI($this, "listCodes");
858  $this->tpl->setContent($ctab->getHTML());
859  }
860 
861  public function initAddCodesForm()
862  {
863  global $DIC;
864 
865  $rbacreview = $DIC['rbacreview'];
866  $ilObjDataCache = $DIC['ilObjDataCache'];
867  $lng = $DIC['lng'];
868 
869  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
870 
871  $this->form_gui = new ilPropertyFormGUI();
872  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
873  $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
874 
875  $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
876  $count->setSize(4);
877  $count->setMaxLength(4);
878  $count->setMinValue(1);
879  $count->setMaxValue(1000);
880  $count->setRequired(true);
881  $this->form_gui->addItem($count);
882 
883  // type
884  $code_type = new ilCheckboxGroupInputGUI($this->lng->txt('registration_codes_type'), 'code_type');
885  $code_type->setRequired(true);
886 
887  $code_type->addOption(
888  new ilCheckboxOption(
889  $this->lng->txt('registration_codes_type_reg'),
890  self::CODE_TYPE_REGISTRATION,
891  $this->lng->txt('registration_codes_type_reg_info')
892  )
893  );
894  $code_type->addOption(
895  new ilCheckboxOption(
896  $this->lng->txt('registration_codes_type_ext'),
897  self::CODE_TYPE_EXTENSION,
898  $this->lng->txt('registration_codes_type_ext_info')
899  )
900  );
901  $this->form_gui->addItem($code_type);
902 
903 
904  $sec = new ilFormSectionHeaderGUI();
905  $sec->setTitle($this->lng->txt('registration_codes_roles_title'));
906  $this->form_gui->addItem($sec);
907 
908  include_once './Services/AccessControl/classes/class.ilObjRole.php';
909  $options = array("" => $this->lng->txt('registration_codes_no_assigned_role'));
910  foreach ($rbacreview->getGlobalRoles() as $role_id) {
911  if (!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
912  $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
913  }
914  }
915  $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
916  $roles->setInfo($this->lng->txt("registration_codes_override_info"));
917  $roles->setOptions($options);
918  $this->form_gui->addItem($roles);
919 
920  $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
921  $local->setMulti(true);
922  $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
923  $this->form_gui->addItem($local);
924 
925 
926  $sec = new ilFormSectionHeaderGUI();
927  $sec->setTitle($this->lng->txt('reg_access_limitations'));
928  $this->form_gui->addItem($sec);
929 
930  $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
931  $limit->setInfo($this->lng->txt("registration_codes_override_info"));
932  $this->form_gui->addItem($limit);
933 
934  $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
935  $limit->addOption($opt);
936 
937  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
938  $limit->addOption($opt);
939 
940  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
941  $limit->addOption($opt);
942 
943  $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
944  $dt->setRequired(true);
945  $opt->addSubItem($dt);
946 
947  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
948  $limit->addOption($opt);
949 
950  $dur = new ilDurationInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"), "rel_date");
951  $dur->setRequired(true);
952  $dur->setShowMonths(true);
953  $dur->setShowDays(true);
954  $dur->setShowHours(false);
955  $dur->setShowMinutes(false);
956  $opt->addSubItem($dur);
957 
958  $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
959  $this->form_gui->addCommandButton('listCodes', $this->lng->txt('cancel'));
960  }
961 
962  // see ilRoleAutoCompleteInputGUI
963  public function getLocalRoleAutoComplete()
964  {
965  $q = $_REQUEST["term"];
966  include_once("./Services/AccessControl/classes/class.ilRoleAutoComplete.php");
968  echo $list;
969  exit;
970  }
971 
972  public function addCodes()
973  {
974  global $DIC;
975 
976  $ilAccess = $DIC['ilAccess'];
977  $ilErr = $DIC['ilErr'];
978 
979  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
980  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
981  }
982 
983  $this->setSubTabs('registration_codes');
984 
985  $this->initAddCodesForm();
986 
987  // default
988  $limit = $this->form_gui->getItemByPostVar("reg_limit");
989  $limit->setValue("none");
990 
991  $this->tpl->setContent($this->form_gui->getHTML());
992  }
993 
994  public function createCodes()
995  {
996  global $DIC;
997 
998  $ilAccess = $DIC['ilAccess'];
999  $ilErr = $DIC['ilErr'];
1000  $rbacreview = $DIC['rbacreview'];
1001 
1002  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
1003  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
1004  }
1005 
1006  $this->setSubTabs('registration_codes');
1007 
1008  $this->initAddCodesForm();
1009  $valid = $this->form_gui->checkInput();
1010  if ($valid) {
1011  $number = $this->form_gui->getInput('reg_codes_number');
1012  $role = $this->form_gui->getInput('reg_codes_role');
1013  $local = $this->form_gui->getInput("reg_codes_local");
1014 
1015  if (is_array($local)) {
1016  $role_ids = array();
1017  foreach (array_unique($local) as $item) {
1018  if (trim($item)) {
1019  $role_id = $rbacreview->roleExists($item);
1020  if ($role_id) {
1021  $role_ids[] = $role_id;
1022  }
1023  }
1024  }
1025  if (sizeof($role_ids)) {
1026  $local = $role_ids;
1027  }
1028  }
1029 
1030  $date = null;
1031  $limit = $this->form_gui->getInput("reg_limit");
1032  switch ($limit) {
1033  case "absolute":
1034  $date_input = $this->form_gui->getItemByPostVar("abs_date");
1035  $date = $date_input->getDate()->get(IL_CAL_DATE);
1036  if ($date < date("Y-m-d")) {
1037  $date_input->setAlert($this->lng->txt("form_msg_wrong_date"));
1038  $valid = false;
1039  }
1040  break;
1041 
1042  case "relative":
1043  $date = $this->form_gui->getInput("rel_date");
1044  if (!array_sum($date)) {
1045  $valid = false;
1046  } else {
1047  $date = array(
1048  "d" => $date["dd"],
1049  "m" => $date["MM"] % 12,
1050  "y" => floor($date["MM"] / 12)
1051  );
1052  }
1053  break;
1054 
1055  case "none":
1056  $limit = null;
1057  break;
1058  }
1059  }
1060 
1061  if ($valid) {
1062  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1063 
1064  $stamp = time();
1065  for ($loop = 1; $loop <= $number; $loop++) {
1066  $code_types = (array) $this->form_gui->getInput('code_type');
1067 
1069  $role,
1070  $stamp,
1071  $local,
1072  $limit,
1073  $date,
1074  in_array(self::CODE_TYPE_REGISTRATION, $code_types) ? true : false,
1075  in_array(self::CODE_TYPE_EXTENSION, $code_types) ? true : false
1076  );
1077  }
1078 
1079  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
1080  $this->ctrl->redirect($this, "listCodes");
1081  } else {
1082  $this->form_gui->setValuesByPost();
1083  $this->tpl->setContent($this->form_gui->getHtml());
1084  }
1085  }
1086 
1087  public function deleteCodes()
1088  {
1089  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1091 
1092  ilUtil::sendSuccess($this->lng->txt('info_deleted'), true);
1093  $this->ctrl->redirect($this, "listCodes");
1094  }
1095 
1096  public function deleteConfirmation()
1097  {
1098  global $DIC;
1099 
1100  $ilErr = $DIC['ilErr'];
1101  $ilias = $DIC['ilias'];
1102 
1103  if (!isset($_POST["id"])) {
1104  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1105  }
1106 
1107  $this->setSubTabs('registration_codes');
1108 
1109  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1110  $gui = new ilConfirmationGUI();
1111  $gui->setHeaderText($this->lng->txt("info_delete_sure"));
1112  $gui->setCancel($this->lng->txt("cancel"), "listCodes");
1113  $gui->setConfirm($this->lng->txt("confirm"), "deleteCodes");
1114  $gui->setFormAction($this->ctrl->getFormAction($this, "deleteCodes"));
1115 
1116  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1118  foreach ($data as $code) {
1119  $gui->addItem("id[]", $code["code_id"], $code["code"]);
1120  }
1121 
1122  $this->tpl->setContent($gui->getHTML());
1123  }
1124 
1125  public function resetCodesFilter()
1126  {
1127  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1128  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1129  $utab->resetOffset();
1130  $utab->resetFilter();
1131 
1132  $this->listCodes();
1133  }
1134 
1135  public function applyCodesFilter()
1136  {
1137  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1138  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1139  $utab->resetOffset();
1140  $utab->writeFilterToSession();
1141 
1142  $this->listCodes();
1143  }
1144 
1145  public function exportCodes()
1146  {
1147  global $DIC;
1148 
1149  $ilAccess = $DIC['ilAccess'];
1150  $ilErr = $DIC['ilErr'];
1151 
1152  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
1153  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
1154  }
1155 
1156  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1157  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1158 
1159  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1160  $codes = ilRegistrationCode::getCodesForExport($utab->filter["code"], $utab->filter["role"], $utab->filter["generated"], $utab->filter["alimit"]);
1161 
1162  if (sizeof($codes)) {
1163  ilUtil::deliverData(implode("\r\n", $codes), "ilias_registration_codes_" . date("d-m-Y") . ".txt", "text/plain");
1164  } else {
1165  ilUtil::sendFailure($this->lng->txt("registration_export_codes_no_data"));
1166  $this->listCodes();
1167  }
1168  }
1169 }
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents an option in a radio group.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
global $DIC
Definition: saml.php:7
$_GET["client_id"]
static deleteCodes(array $ids)
This class represents a section header in a property form.
$code
Definition: example_050.php:99
$valid
if(!array_key_exists('StateId', $_REQUEST)) $id
static getList($a_str)
Get completion list.
static checkFreetype()
Check whether captcha support is active.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
const IL_REG_ROLES_EMAIL
const IL_CAL_UNIX
setInfo($a_info)
Set Info.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
$ilErr
Definition: raiseError.php:18
setSubTabs($activeTab='registration_settings')
set sub tabs
This class represents a date/time property in a property form.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
static create($role, $stamp, $local_roles, $limit, $limit_date, $reg_type, $ext_type)
This class represents a property in a property form.
addOption($a_option)
Add Option.
static loadCodesByIds(array $ids)
$lng
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a number property in a property form.
$values
const IL_REG_MISSING_DOMAIN
Class class.ilregistrationEmailRoleAssignments.
setValue($a_value)
Set Value.
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
const IL_REG_ACTIVATION
This class represents a text property in a property form.
Class ilRegistrationSettingsGUI.
Date and time handling
TableGUI class for registration codes.
This class represents a property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static makeDateSelect($prefix, $year="", $month="", $day="", $startyear="", $a_long_month=true, $a_further_options=array(), $emptyoption=false)
Creates a combination of HTML selects for date inputs.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
setSize($a_size)
Set Size.
const IL_REG_ROLES_FIXED
exit
Definition: backend.php:16
This class represents a custom property in a property form.
const IL_CAL_DATE
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
setMulti($a_multi, $a_sortable=false, $a_addremove=true)
Set Multi.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
const USER_FOLDER_ID
Class ilObjUserFolder.
$url
const IL_REG_ACCESS_LIMITATION_MISSING_MODE
Class class.ilRegistrationAccessLimitation.
static getCodesForExport($filter_code, $filter_role, $filter_generated, $filter_access_limitation)
static _lookupAllowRegister($a_role_id)
check whether role is allowed in user registration or not
$_POST["username"]
setRequired($a_required)
Set Required.
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
Confirmation screen class.
$data
Definition: bench.php:6