19declare(strict_types=1);
74 $this->tpl =
$DIC->ui()->mainTemplate();
75 $this->
ctrl = $DIC->ctrl();
76 $this->
access = $DIC->access();
77 $this->rbacsystem =
$DIC->rbac()->system();
78 $this->rbacreview =
$DIC->rbac()->review();
79 $this->
error = $DIC[
'ilErr'];
80 $this->
tabs = $DIC->tabs();
81 $this->
toolbar = $DIC->toolbar();
83 $this->
lng = $DIC->language();
84 $this->
lng->loadLanguageModule(
'administration');
85 $this->
lng->loadLanguageModule(
'registration');
86 $this->
lng->loadLanguageModule(
'user');
89 $this->
http = $DIC->http();
92 $this->ui_factory =
$DIC->ui()->factory();
93 $this->ui_renderer =
$DIC->ui()->renderer();
94 $this->ui_service =
$DIC->uiService();
95 $this->
user = $DIC->user();
101 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
102 return $this->
http->wrapper()->query()->retrieve(
112 $next_class = $this->
ctrl->getNextClass($this);
113 $cmd = $this->
ctrl->getCmd();
115 if ($this->
http->wrapper()->query()->has(
'registration_codes_table_action')) {
116 $cmd = $this->
http->wrapper()->query()->retrieve(
117 'registration_codes_table_action',
118 $this->
refinery->kindlyTo()->string()
122 switch ($next_class) {
135 $this->
error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->WARNING);
141 return $this->
access->checkAccess($a_permission,
'', $this->ref_id);
144 public function setSubTabs(
string $activeTab =
'registration_settings'): void
146 $this->
tabs->addSubTab(
147 "registration_settings",
148 $this->
lng->txt(
"registration_tab_settings"),
149 $this->ctrl->getLinkTarget($this,
'view')
151 $this->
tabs->addSubTab(
152 "registration_codes",
153 $this->
lng->txt(
"registration_tab_codes"),
154 $this->ctrl->getLinkTarget($this,
'listCodes')
156 $this->
tabs->activateSubTab($activeTab);
167 $this->
lng->txt(
'reg_disabled'),
171 $option->setInfo($this->
lng->txt(
'reg_direct_info'));
173 $this->
lng->txt(
'reg_allow_codes'),
174 'reg_codes_' . ilRegistrationSettings::IL_REG_DIRECT
176 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
177 $option->addSubItem($cd);
178 $reg_type->addOption($option);
180 $option->setInfo($this->
lng->txt(
'reg_approve_info'));
182 $this->
lng->txt(
'reg_allow_codes'),
183 'reg_codes_' . ilRegistrationSettings::IL_REG_APPROVE
185 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
186 $option->addSubItem($cd);
187 $reg_type->addOption($option);
189 $this->
lng->txt(
'reg_type_confirmation'),
192 $option->setInfo($this->
lng->txt(
'reg_type_confirmation_info'));
193 $lt =
new ilNumberInputGUI($this->
lng->txt(
'reg_confirmation_hash_life_time'),
'reg_hash_life_time');
195 $lt->setMaxLength(6);
197 $lt->setRequired(
true);
198 $lt->setInfo($this->
lng->txt(
'reg_confirmation_hash_life_time_info'));
199 $lt->setSuffix($this->
lng->txt(
'seconds'));
200 $option->addSubItem($lt);
202 $this->
lng->txt(
'reg_allow_codes'),
203 'reg_codes_' . ilRegistrationSettings::IL_REG_ACTIVATION
205 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
206 $option->addSubItem($cd);
207 $reg_type->addOption($option);
209 $this->
lng->txt(
'registration_reg_type_codes'),
212 $option->setInfo($this->
lng->txt(
'registration_reg_type_codes_info'));
213 $reg_type->addOption($option);
217 $pwd_gen->setValue(
'1');
218 $pwd_gen->setInfo($this->
lng->txt(
'reg_info_pwd'));
221 $approver =
new ilTextInputGUI($this->
lng->txt(
'reg_notification'),
'reg_approver');
222 $approver->setSize(32);
223 $approver->setMaxLength(50);
224 $approver->setInfo($this->
lng->txt(
'reg_notification_info'));
230 $edit = $this->
ctrl->getLinkTarget($this,
'editRoles');
232 $option->addSubItem($list);
233 $roles->addOption($option);
236 $edit = $this->
ctrl->getLinkTarget($this,
'editEmailAssignments');
238 $option->addSubItem($list);
239 $roles->addOption($option);
240 $roles->setInfo($this->
lng->txt(
'registration_codes_override_global_info'));
244 $limit->setValue(
'1');
246 $edit = $this->
ctrl->getLinkTarget($this,
'editRoleAccessLimitations');
248 $list->setInfo($this->
lng->txt(
'registration_codes_override_global_info'));
249 $limit->addSubItem($list);
252 $domains =
new ilTextInputGUI($this->
lng->txt(
'reg_allowed_domains'),
'reg_allowed_domains');
253 $domains->setInfo($this->
lng->txt(
'reg_allowed_domains_info'));
256 if ($this->rbacsystem->checkAccess(
"write", $this->ref_id)) {
265 if ($this->registration_settings->roleSelectionEnabled()) {
267 } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
273 'reg_type' => $this->registration_settings->getRegistrationType(),
274 'reg_hash_life_time' => $this->registration_settings->getRegistrationHashLifetime(),
275 'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
276 'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
277 'reg_role_type' => $role_type,
278 'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
279 'reg_allowed_domains' => implode(
';', $this->registration_settings->getAllowedDomains())
282 $allow_codes = $this->registration_settings->getAllowCodes();
283 $reg_type = $this->registration_settings->getRegistrationType();
284 if ($allow_codes && in_array($reg_type, [
289 $values[
'reg_codes_' . $reg_type] =
true;
304 $this->
lng->txt(
'registration_user_new_account_mail'),
305 $this->ctrl->getLinkTargetByClass(
307 ilAdministrationGUI::class,
308 ilObjUserFolderGUI::class,
309 NewAccountMailSettingsGUI::class
315 $this->
ctrl->setParameterByClass(ilObjUserFolderGUI::class,
'ref_id',
$_GET[
'ref_id']);
320 $this->tpl->setContent($form->getHTML());
328 $res = $form->checkInput();
329 $this->registration_settings->setRegistrationType((
int) $form->getInput(
'reg_type'));
330 $this->registration_settings->setPasswordGenerationStatus((
bool) $form->getInput(
'reg_pwd'));
331 $this->registration_settings->setApproveRecipientLogins($form->getInput(
'reg_approver'));
332 $this->registration_settings->setRoleType((
int) $form->getInput(
'reg_role_type'));
333 $this->registration_settings->setAccessLimitation((
bool) $form->getInput(
'reg_access_limitation'));
334 $this->registration_settings->setAllowedDomains((
string) $form->getInput(
'reg_allowed_domains'));
336 $allow_codes =
false;
337 $reg_type = (
int) $form->getInput(
'reg_type');
338 if (in_array($reg_type, [
343 $allow_codes = (bool) $form->getInput(
'reg_codes_' . $reg_type);
345 $this->registration_settings->setAllowCodes($allow_codes);
347 $hash_life_time = $form->getInput(
'reg_hash_life_time');
348 if (!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9]+)?$/', (
string) $hash_life_time)) {
351 $this->registration_settings->setRegistrationHashLifetime(max(
352 (
int) $hash_life_time,
357 if ($error_code = $this->registration_settings->validate()) {
358 switch ($error_code) {
360 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_unknown_recipients') .
' ' . $this->registration_settings->getUnknown());
365 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_approve_needs_recipient') .
' ' . $this->registration_settings->getUnknown());
371 $this->registration_settings->save();
372 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
380 $role_form->setFormAction($this->
ctrl->getFormAction($this,
'save'));
381 $role_form->setTitle($this->
lng->txt(
'reg_selectable_roles'));
385 foreach ($this->rbacreview->getGlobalRoles() as $role) {
390 $role_option->setValue((
string) $role);
391 $roles->addOption($role_option);
395 $roles->setUseValuesAsKeys(
true);
396 $roles->setValue($allowed_roles);
397 $role_form->addItem($roles);
400 $role_form->addCommandButton(
"updateRoles", $this->
lng->txt(
"save"));
402 $role_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
409 $this->
tabs->clearTargets();
410 $this->
tabs->setBackTarget(
411 $this->
lng->txt(
"registration_settings"),
412 $this->ctrl->getLinkTarget($this,
"view")
417 $this->tpl->setContent($form->getHTML());
424 if ($form->checkInput()) {
425 $roles = (array) $form->getInput(
'roles');
426 if (count($roles) < 1) {
427 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_last_role_for_registration'));
431 foreach ($this->rbacreview->getGlobalRoles() as $role) {
433 $role_obj->setAllowRegister(isset($roles[$role]) && (
int) $roles[$role] === 1);
438 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
446 $this->
tabs->clearTargets();
447 $this->
tabs->setBackTarget(
448 $this->
lng->txt(
"registration_settings"),
449 $this->ctrl->getLinkTarget($this,
"view")
454 $this->tpl->setContent($form->getHTML());
460 $role_assignment_form->setFormAction($this->
ctrl->getFormAction($this));
461 $role_assignment_form->setTitle($this->
lng->txt(
'reg_email_role_assignment'));
463 $global_roles = [
"" => $this->
lng->txt(
"links_select_one")];
464 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
472 $domains = $this->assignments_obj->getDomainsByRole($role_id);
475 $domain->setMulti(
true);
476 $domain->setValidationRegexp(
"/^@.*\.[a-zA-Z]{1,4}$/");
477 if (!empty($domains)) {
478 $domain->setValue($domains[0]);
479 $domain->setMultiValues($domains);
480 $role_assignments->setChecked(
true);
483 $role_assignments->addSubItem($domain);
484 $role_assignment_form->addItem($role_assignments);
488 $default_role->setPostVar(
"default_role");
489 $default_role->setOptions($global_roles);
490 $default_role->setValue($this->assignments_obj->getDefaultRole());
491 $default_role->setRequired(
true);
492 $role_assignment_form->addItem($default_role);
494 $role_assignment_form->addCommandButton(
"saveAssignment", $this->
lng->txt(
"save"));
495 $role_assignment_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
497 return $role_assignment_form;
505 $this->
tabs->clearTargets();
506 $this->
tabs->setBackTarget(
507 $this->
lng->txt(
"registration_settings"),
508 $this->ctrl->getLinkTarget($this,
"view")
511 if (
null === $form) {
514 $this->tpl->setContent($form->getHTML());
520 $form->setFormAction($this->
ctrl->getFormAction($this));
521 $form->setTitle($this->
lng->txt(
'reg_role_access_limitations'));
525 $op_unlimited =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_unlimited'),
"unlimited");
527 $op_absolute =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_absolute'),
"absolute");
529 date(
"d.m.Y", $this->access_limitations_obj->getAbsolute($role[
'id'])),
533 $date->setDate($absolute_date);
534 $op_absolute->addSubItem($date);
536 $op_relative =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_relative'),
"relative");
542 $duration->setDays($this->access_limitations_obj->getRelative($role[
'id'],
'd'));
543 $duration->setMonths($this->access_limitations_obj->getRelative($role[
'id'],
'm'));
546 $role_access->addOption($op_unlimited);
547 $role_access->addOption($op_absolute);
548 $role_access->addOption($op_relative);
549 $role_access->setValue(
550 $this->access_limitations_obj->getMode(
552 ) ===
'null' ?
'unlimited' : $this->access_limitations_obj->getMode($role[
'id'])
555 $form->addItem($role_access);
558 $form->addCommandButton(
"saveRoleAccessLimitations", $this->
lng->txt(
"save"));
559 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
569 $is_valid = $form->checkInput();
570 $form->setValuesByPost();
576 $assignments_by_domain = [];
577 $problems_domains_by_field_id = [];
578 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
583 $role_assigned_input = $form->getInput(
"role_assigned_$role_id");
584 if (!$role_assigned_input) {
588 $domain_input = $form->getInput(
"domain_$role_id");
589 foreach ($domain_input as $domain) {
590 if (!is_string($domain) || $domain ===
'') {
594 if (isset($assignments_by_domain[$domain])) {
595 if (!isset($problems_domains_by_field_id[
"role_assigned_$role_id"])) {
596 $problems_domains_by_field_id[
"role_assigned_$role_id"] = [];
599 $problems_domains_by_field_id[
"domain_$role_id"][$domain] = $domain;
603 $assignments_by_domain[$domain] = $role_id;
607 if ($problems_domains_by_field_id !== []) {
608 foreach ($problems_domains_by_field_id as $field_id => $domains) {
609 $domain_string = implode(
', ', $domains);
610 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_p'), $domain_string);
611 if (count($domains) === 1) {
612 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_s'), $domain_string);
614 $form->getItemByPostVar($field_id)->setAlert($alert);
617 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
622 $this->assignments_obj->deleteAll();
625 foreach ($assignments_by_domain as $domain => $role_id) {
626 $this->assignments_obj->setDomain(
$counter, $domain);
627 $this->assignments_obj->setRole(
$counter, $role_id);
630 $default_role = $form->getInput(
"default_role");
631 $this->assignments_obj->setDefaultRole((
int) $default_role);
632 $this->assignments_obj->save();
633 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
644 if (!$form->checkInput()) {
645 $form->setValuesByPost();
650 $this->access_limitations_obj->resetAccessLimitations();
652 $mode = $form->getInput(
'role_access_' . $role[
'id']);
653 $this->access_limitations_obj->setMode($mode, $role[
'id']);
655 if ($mode ===
'absolute') {
656 $this->access_limitations_obj->setAbsolute($form->getInput(
'absolute_date_' . $role[
'id']), $role[
'id']);
659 if ($mode ===
'relative') {
660 $this->access_limitations_obj->setRelative($form->getInput(
'duration_' . $role[
'id']), $role[
'id']);
664 if ($err = $this->access_limitations_obj->validate()) {
667 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_missing_mode'));
671 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_out_of_date'));
678 $this->access_limitations_obj->save();
679 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
691 $tpl =
new ilTemplate(
'tpl.registration_roles.html',
true,
true,
'components/ILIAS/Registration');
696 if (is_array($roles) && count($roles)) {
697 foreach ($roles as $role) {
715 $all[] = $role[
'title'];
728 foreach ($this->assignments_obj->getAssignments() as $assignment) {
729 if ($assignment[
'domain'] !==
'' && $assignment[
'role']) {
734 if ((
string) $this->assignments_obj->getDefaultRole() !==
'') {
746 switch ($this->access_limitations_obj->getMode((
int) $role[
'id'])) {
748 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_until');
755 $months = $this->access_limitations_obj->getRelative($role[
'id'],
'm');
756 $days = $this->access_limitations_obj->getRelative($role[
'id'],
'd');
758 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_time') .
" ";
762 $txt_access_value .=
", ";
764 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
767 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
771 $txt_access_value .= $months .
" ";
772 $txt_access_value .= ($months === 1) ? $this->
lng->txt(
'month') : $this->
lng->txt(
'months');
775 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
780 $txt_access_value .= $days .
" ";
781 $txt_access_value .= ($days === 1) ? $this->
lng->txt(
'day') : $this->
lng->txt(
'days');
786 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_none');
790 $all[] = $role[
'title'] .
' (' . $txt_access_value .
')';
816 $this->
lng->txt(
'registration_codes_add'),
817 $this->ctrl->getLinkTarget($this,
'addCodes')
820 $this->tpl->setContent($this->ui_renderer->render([
821 $this->getRegistrationFilter()->getFilterComponent(),
822 $this->getRegistrationCodeTable()->getTableComponent($this->getRegistrationFilter())
828 if (!isset($this->registration_codes_table)) {
830 $this->
http->request(),
835 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
837 $this->code_repository,
838 $this->checkAccessBool(
'write'),
847 if (!isset($this->registration_code_filter)) {
849 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
854 $this->code_repository
864 $this->form_gui->setFormAction($this->
ctrl->getFormAction($this,
'createCodes'));
865 $this->form_gui->setTitle($this->
lng->txt(
'registration_codes_edit_header'));
867 $count =
new ilNumberInputGUI($this->
lng->txt(
'registration_codes_number'),
'reg_codes_number');
869 $count->setMaxLength(4);
870 $count->setMinValue(1);
871 $count->setMaxValue(1000);
872 $count->setRequired(
true);
873 $this->form_gui->addItem($count);
877 $code_type->setRequired(
true);
879 $code_type->addOption(
881 $this->
lng->txt(
'registration_codes_type_reg'),
882 (
string) self::CODE_TYPE_REGISTRATION,
883 $this->lng->txt(
'registration_codes_type_reg_info')
886 $code_type->addOption(
888 $this->
lng->txt(
'registration_codes_type_ext'),
889 (
string) self::CODE_TYPE_EXTENSION,
890 $this->lng->txt(
'registration_codes_type_ext_info')
893 $this->form_gui->addItem($code_type);
896 $sec->setTitle($this->
lng->txt(
'registration_codes_roles_title'));
897 $this->form_gui->addItem($sec);
899 $options = [
"" => $this->
lng->txt(
'registration_codes_no_assigned_role')];
900 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
905 $roles =
new ilSelectInputGUI($this->
lng->txt(
"registration_codes_roles"),
"reg_codes_role");
906 $roles->setInfo($this->
lng->txt(
"registration_codes_override_info"));
907 $roles->setOptions($options);
908 $this->form_gui->addItem($roles);
910 $local =
new ilTextInputGUI($this->
lng->txt(
"registration_codes_roles_local"),
"reg_codes_local");
911 $local->setMulti(
true);
912 $local->setDataSource($this->
ctrl->getLinkTarget($this,
"getLocalRoleAutoComplete",
"",
true));
913 $this->form_gui->addItem($local);
916 $sec->setTitle($this->
lng->txt(
'reg_access_limitations'));
917 $this->form_gui->addItem($sec);
920 $limit->setInfo($this->
lng->txt(
"registration_codes_override_info"));
921 $this->form_gui->addItem($limit);
923 $opt =
new ilRadioOption($this->
lng->txt(
"registration_codes_roles_limitation_none"),
"none");
924 $limit->addOption($opt);
926 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_none"),
"unlimited");
927 $limit->addOption($opt);
929 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_absolute"),
"absolute");
930 $limit->addOption($opt);
932 $dt =
new ilDateTimeInputGUI($this->
lng->txt(
"reg_access_limitation_mode_absolute_target"),
"abs_date");
933 $dt->setRequired(
true);
934 $opt->addSubItem($dt);
936 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_relative"),
"relative");
937 $limit->addOption($opt);
939 $dur =
new ilDurationInputGUI($this->
lng->txt(
"reg_access_limitation_mode_relative_target"),
"rel_date");
940 $dur->setRequired(
true);
941 $dur->setShowMonths(
true);
942 $dur->setShowDays(
true);
943 $dur->setShowHours(
false);
944 $dur->setShowMinutes(
false);
945 $opt->addSubItem($dur);
947 $this->form_gui->addCommandButton(
'createCodes', $this->
lng->txt(
'create'));
948 $this->form_gui->addCommandButton(
'listCodes', $this->
lng->txt(
'cancel'));
955 $q = $_REQUEST[
"term"];
968 $limit = $this->form_gui->getItemByPostVar(
"reg_limit");
969 $limit->setValue(
"none");
970 $this->tpl->setContent($this->form_gui->getHTML());
979 $valid = $this->form_gui->checkInput();
981 $number = $this->form_gui->getInput(
'reg_codes_number');
982 $role = (
int) $this->form_gui->getInput(
'reg_codes_role');
983 $local = $this->form_gui->getInput(
"reg_codes_local");
985 if (is_array($local)) {
987 foreach (array_unique($local) as $item) {
989 $role_id = $this->rbacreview->roleExists($item);
991 $role_ids[] = $role_id;
995 if (count($role_ids)) {
1001 $limit = $this->form_gui->getInput(
"reg_limit");
1004 $date_input = $this->form_gui->getItemByPostVar(
"abs_date");
1006 if ($date < date(
"Y-m-d")) {
1007 $date_input->setAlert($this->
lng->txt(
"form_msg_wrong_date"));
1013 $date = $this->form_gui->getInput(
"rel_date");
1014 if (!array_sum($date)) {
1019 "m" => $date[
"MM"] % 12,
1020 "y" => (
int) floor($date[
"MM"] / 12)
1033 for ($loop = 1; $loop <= $number; $loop++) {
1034 $code_types = (array) $this->form_gui->getInput(
'code_type');
1042 in_array(self::CODE_TYPE_REGISTRATION, $code_types) ?
true :
false,
1043 in_array(self::CODE_TYPE_EXTENSION, $code_types) ?
true :
false
1047 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
1048 $this->
ctrl->redirect($this,
"listCodes");
1050 $this->form_gui->setValuesByPost();
1051 $this->tpl->setContent($this->form_gui->getHTML());
1060 if ($this->
http->wrapper()->post()->has(
'id')) {
1061 $ids = $this->
http->wrapper()->post()->retrieve(
1063 $this->
refinery->kindlyTo()->listOf(
1064 $this->refinery->kindlyTo()->int()
1068 $this->code_repository->deleteCodes($ids);
1069 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'info_deleted'),
true);
1070 $this->
ctrl->redirect($this,
"listCodes");
1077 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1078 $ids = $this->
http->wrapper()->query()->retrieve(
1079 'registration_codes_code_ids',
1080 $this->
refinery->kindlyTo()->listOf(
1081 $this->refinery->kindlyTo()->string()
1084 if ($ids === [
'ALL_OBJECTS']) {
1087 $ids = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($ids);
1088 $codes = $this->code_repository->loadCodesByIds($ids);
1091 if (!count($codes)) {
1092 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_select_one'),
true);
1093 $this->
ctrl->redirect($this,
'listCodes');
1098 $gui->setHeaderText($this->
lng->txt(
'info_delete_sure'));
1099 $gui->setCancel($this->
lng->txt(
'cancel'),
'listCodes');
1100 $gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteCodes');
1101 $gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteCodes'));
1103 foreach ($codes as $code) {
1104 $gui->addItem(
'id[]', (
string) $code[
'code_id'], $code[
'code']);
1106 $this->tpl->setContent($gui->getHTML());
1112 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1113 $ids = $this->
http->wrapper()->query()->retrieve(
1114 'registration_codes_code_ids',
1115 $this->
refinery->kindlyTo()->listOf(
1116 $this->refinery->kindlyTo()->string()
1119 if ($ids === [
'ALL_OBJECTS']) {
1122 $ids = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($ids);
1123 $codes = $this->code_repository->loadCodesByIds($ids);
1126 $codes = array_filter(array_map(
1127 static fn($code) => (
string) ($code[
'code'] ??
''),
1132 if (count($codes)) {
1134 implode(
"\r\n", $codes),
1135 'ilias_registration_codes_' . date(
'd-m-Y') .
'.txt',
1139 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'registration_export_codes_no_data'));
Builds a Color from either hex- or rgb values.
@ilCtrl_Calls ILIAS\User\Settings\NewAccountMail\SettingsGUI: ILIAS\User\Settings\NewAccountMail\Uplo...
This class represents an option in a checkbox group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Error Handling & global info handling.
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static _lookupAllowRegister(int $a_role_id)
check whether role is allowed in user registration or not
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static create(int $role, int $stamp, array $local_roles, ?string $limit, ?string $limit_date, bool $reg_type, bool $ext_type)
Class class.ilRegistrationAccessLimitation.
const IL_REG_ACCESS_LIMITATION_MISSING_MODE
const IL_REG_ACCESS_LIMITATION_OUT_OF_DATE
Class class.ilregistrationEmailRoleAssignments.
Class ilRegistrationSettingsGUI.
prepareAccessLimitationRoleList()
saveRoleAccessLimitations()
readonly ILIAS Refinery Factory $refinery
readonly ILIAS HTTP Services $http
editRoleAccessLimitations(?ilPropertyFormGUI $form=null)
readonly RegistrationFilterComponent $registration_code_filter
editEmailAssignments(?ilPropertyFormGUI $form=null)
checkAccessBool(string $a_permission)
ilGlobalTemplateInterface $tpl
const CODE_TYPE_EXTENSION
ilRegistrationRoleAssignments $assignments_obj
initEmailAssignmentForm()
readonly UIRenderer $ui_renderer
getRegistrationCodeTable()
getLocalRoleAutoComplete()
checkAccess(string $a_permission)
readonly ilUIService $ui_service
parseRoleList(array $roles, string $url)
ilRegistrationSettings $registration_settings
readonly RegistrationCodesTable $registration_codes_table
prepareAutomaticRoleList()
setSubTabs(string $activeTab='registration_settings')
initRoleAccessLimitations()
readonly RegistrationCodeRepository $code_repository
editRoles(?ilPropertyFormGUI $form=null)
readonly Factory $ui_factory
ilPropertyFormGUI $form_gui
initFormValues(ilPropertyFormGUI $formGUI)
const CODE_TYPE_REGISTRATION
ilRegistrationRoleAccessLimitations $access_limitations_obj
Class ilObjAuthSettingsGUI.
const IL_REG_ROLE_UNDEFINED
const REG_HASH_LIFETIME_MIN_VALUE
static getList(string $a_str)
Get completion list.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.