19 declare(strict_types=1);
73 $this->tpl = $DIC->ui()->mainTemplate();
74 $this->
ctrl = $DIC->ctrl();
75 $this->
access = $DIC->access();
76 $this->rbacsystem = $DIC->rbac()->system();
77 $this->rbacreview = $DIC->rbac()->review();
78 $this->error = $DIC[
'ilErr'];
79 $this->
tabs = $DIC->tabs();
80 $this->
toolbar = $DIC->toolbar();
82 $this->
lng = $DIC->language();
83 $this->
lng->loadLanguageModule(
'administration');
84 $this->
lng->loadLanguageModule(
'registration');
85 $this->
lng->loadLanguageModule(
'user');
88 $this->
http = $DIC->http();
91 $this->ui_factory = $DIC->ui()->factory();
92 $this->ui_renderer = $DIC->ui()->renderer();
93 $this->ui_service = $DIC->uiService();
94 $this->
user = $DIC->user();
100 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
101 return $this->
http->wrapper()->query()->retrieve(
111 $next_class = $this->
ctrl->getNextClass($this);
112 $cmd = $this->
ctrl->getCmd();
114 if ($this->
http->wrapper()->query()->has(
'registration_codes_table_action')) {
115 $cmd = $this->
http->wrapper()->query()->retrieve(
116 'registration_codes_table_action',
117 $this->
refinery->kindlyTo()->string()
121 switch ($next_class) {
134 $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->WARNING);
140 return $this->
access->checkAccess($a_permission,
'', $this->ref_id);
143 public function setSubTabs(
string $activeTab =
'registration_settings'): void
145 $this->
tabs->addSubTab(
146 "registration_settings",
147 $this->
lng->txt(
"registration_tab_settings"),
148 $this->
ctrl->getLinkTarget($this,
'view')
150 $this->
tabs->addSubTab(
151 "registration_codes",
152 $this->
lng->txt(
"registration_tab_codes"),
153 $this->
ctrl->getLinkTarget($this,
'listCodes')
155 $this->
tabs->activateSubTab($activeTab);
162 $form_gui->
setTitle($this->
lng->txt(
'reg_settings_header'));
166 $this->
lng->txt(
'reg_disabled'),
170 $option->setInfo($this->
lng->txt(
'reg_direct_info'));
172 $this->
lng->txt(
'reg_allow_codes'),
175 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
176 $option->addSubItem($cd);
177 $reg_type->addOption($option);
179 $option->setInfo($this->
lng->txt(
'reg_approve_info'));
181 $this->
lng->txt(
'reg_allow_codes'),
184 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
185 $option->addSubItem($cd);
186 $reg_type->addOption($option);
188 $this->
lng->txt(
'reg_type_confirmation'),
191 $option->setInfo($this->
lng->txt(
'reg_type_confirmation_info'));
192 $lt =
new ilNumberInputGUI($this->
lng->txt(
'reg_confirmation_hash_life_time'),
'reg_hash_life_time');
194 $lt->setMaxLength(6);
196 $lt->setRequired(
true);
197 $lt->setInfo($this->
lng->txt(
'reg_confirmation_hash_life_time_info'));
198 $lt->setSuffix($this->
lng->txt(
'seconds'));
199 $option->addSubItem($lt);
201 $this->
lng->txt(
'reg_allow_codes'),
204 $cd->setInfo($this->
lng->txt(
'reg_allow_codes_info'));
205 $option->addSubItem($cd);
206 $reg_type->addOption($option);
208 $this->
lng->txt(
'registration_reg_type_codes'),
211 $option->setInfo($this->
lng->txt(
'registration_reg_type_codes_info'));
212 $reg_type->addOption($option);
216 $pwd_gen->setValue(
'1');
217 $pwd_gen->setInfo($this->
lng->txt(
'reg_info_pwd'));
220 $approver =
new ilTextInputGUI($this->
lng->txt(
'reg_notification'),
'reg_approver');
221 $approver->setSize(32);
222 $approver->setMaxLength(50);
223 $approver->setInfo($this->
lng->txt(
'reg_notification_info'));
229 $edit = $this->
ctrl->getLinkTarget($this,
'editRoles');
232 $roles->addOption($option);
235 $edit = $this->
ctrl->getLinkTarget($this,
'editEmailAssignments');
238 $roles->addOption($option);
239 $roles->setInfo($this->
lng->txt(
'registration_codes_override_global_info'));
243 $limit->setValue(
'1');
245 $edit = $this->
ctrl->getLinkTarget($this,
'editRoleAccessLimitations');
247 $list->setInfo($this->
lng->txt(
'registration_codes_override_global_info'));
248 $limit->addSubItem($list);
251 $domains =
new ilTextInputGUI($this->
lng->txt(
'reg_allowed_domains'),
'reg_allowed_domains');
252 $domains->setInfo($this->
lng->txt(
'reg_allowed_domains_info'));
255 if ($this->rbacsystem->checkAccess(
"write", $this->ref_id)) {
264 if ($this->registration_settings->roleSelectionEnabled()) {
266 } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
272 'reg_type' => $this->registration_settings->getRegistrationType(),
273 'reg_hash_life_time' => $this->registration_settings->getRegistrationHashLifetime(),
274 'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
275 'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
276 'reg_role_type' => $role_type,
277 'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
278 'reg_allowed_domains' => implode(
';', $this->registration_settings->getAllowedDomains())
281 $allow_codes = $this->registration_settings->getAllowCodes();
282 $reg_type = $this->registration_settings->getRegistrationType();
283 if ($allow_codes && in_array($reg_type, [
288 $values[
'reg_codes_' . $reg_type] =
true;
303 $this->
lng->txt(
'registration_user_new_account_mail'),
304 $this->
ctrl->getLinkTargetByClass(
306 ilAdministrationGUI::class,
307 ilObjUserFolderGUI::class
312 $this->
ctrl->setParameterByClass(ilObjUserFolderGUI::class,
'ref_id',
$_GET[
'ref_id']);
317 $this->tpl->setContent($form->getHTML());
325 $res = $form->checkInput();
326 $this->registration_settings->setRegistrationType((
int) $form->getInput(
'reg_type'));
327 $this->registration_settings->setPasswordGenerationStatus((
bool) $form->getInput(
'reg_pwd'));
328 $this->registration_settings->setApproveRecipientLogins($form->getInput(
'reg_approver'));
329 $this->registration_settings->setRoleType((
int) $form->getInput(
'reg_role_type'));
330 $this->registration_settings->setAccessLimitation((
bool) $form->getInput(
'reg_access_limitation'));
331 $this->registration_settings->setAllowedDomains((
string) $form->getInput(
'reg_allowed_domains'));
333 $allow_codes =
false;
334 $reg_type = (
int) $form->getInput(
'reg_type');
335 if (in_array($reg_type, [
340 $allow_codes = (bool) $form->getInput(
'reg_codes_' . $reg_type);
342 $this->registration_settings->setAllowCodes($allow_codes);
344 $hash_life_time = $form->getInput(
'reg_hash_life_time');
345 if (!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9]+)?$/', (
string) $hash_life_time)) {
348 $this->registration_settings->setRegistrationHashLifetime(max(
349 (
int) $hash_life_time,
354 if ($error_code = $this->registration_settings->validate()) {
355 switch ($error_code) {
357 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_unknown_recipients') .
' ' . $this->registration_settings->getUnknown());
362 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_approve_needs_recipient') .
' ' . $this->registration_settings->getUnknown());
368 $this->registration_settings->save();
369 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
377 $role_form->setFormAction($this->
ctrl->getFormAction($this,
'save'));
378 $role_form->setTitle($this->
lng->txt(
'reg_selectable_roles'));
382 foreach ($this->rbacreview->getGlobalRoles() as $role) {
387 $role_option->setValue((
string) $role);
388 $roles->addOption($role_option);
392 $roles->setUseValuesAsKeys(
true);
393 $roles->setValue($allowed_roles);
394 $role_form->addItem($roles);
397 $role_form->addCommandButton(
"updateRoles", $this->
lng->txt(
"save"));
399 $role_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
406 $this->
tabs->clearTargets();
407 $this->
tabs->setBackTarget(
408 $this->
lng->txt(
"registration_settings"),
409 $this->
ctrl->getLinkTarget($this,
"view")
414 $this->tpl->setContent($form->getHTML());
421 if ($form->checkInput()) {
422 $roles = (array) $form->getInput(
'roles');
423 if (count($roles) < 1) {
424 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_last_role_for_registration'));
428 foreach ($this->rbacreview->getGlobalRoles() as $role) {
430 $role_obj->setAllowRegister(isset($roles[$role]) && (
int) $roles[$role] === 1);
435 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
443 $this->
tabs->clearTargets();
444 $this->
tabs->setBackTarget(
445 $this->
lng->txt(
"registration_settings"),
446 $this->
ctrl->getLinkTarget($this,
"view")
451 $this->tpl->setContent($form->getHTML());
457 $role_assignment_form->setFormAction($this->
ctrl->getFormAction($this));
458 $role_assignment_form->setTitle($this->
lng->txt(
'reg_email_role_assignment'));
460 $global_roles = [
"" => $this->
lng->txt(
"links_select_one")];
461 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
469 $domains = $this->assignments_obj->getDomainsByRole($role_id);
472 $domain->setMulti(
true);
473 $domain->setValidationRegexp(
"/^@.*\.[a-zA-Z]{1,4}$/");
474 if (!empty($domains)) {
475 $domain->setValue($domains[0]);
476 $domain->setMultiValues($domains);
477 $role_assignments->setChecked(
true);
480 $role_assignments->addSubItem($domain);
481 $role_assignment_form->addItem($role_assignments);
486 $default_role->setOptions($global_roles);
487 $default_role->setValue($this->assignments_obj->getDefaultRole());
488 $default_role->setRequired(
true);
489 $role_assignment_form->addItem($default_role);
491 $role_assignment_form->addCommandButton(
"saveAssignment", $this->
lng->txt(
"save"));
492 $role_assignment_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
494 return $role_assignment_form;
502 $this->
tabs->clearTargets();
503 $this->
tabs->setBackTarget(
504 $this->
lng->txt(
"registration_settings"),
505 $this->
ctrl->getLinkTarget($this,
"view")
508 if (
null === $form) {
511 $this->tpl->setContent($form->getHTML());
517 $form->setFormAction($this->
ctrl->getFormAction($this));
518 $form->setTitle($this->
lng->txt(
'reg_role_access_limitations'));
522 $op_unlimited =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_unlimited'),
"unlimited");
524 $op_absolute =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_absolute'),
"absolute");
526 date(
"d.m.Y", $this->access_limitations_obj->getAbsolute($role[
'id'])),
530 $date->setDate($absolute_date);
533 $op_relative =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_relative'),
"relative");
535 $duration->setShowMinutes(
false);
536 $duration->setShowHours(
false);
537 $duration->setShowDays(
true);
538 $duration->setShowMonths(
true);
539 $duration->setDays($this->access_limitations_obj->getRelative($role[
'id'],
'd'));
540 $duration->setMonths($this->access_limitations_obj->getRelative($role[
'id'],
'm'));
543 $role_access->addOption($op_unlimited);
544 $role_access->addOption($op_absolute);
545 $role_access->addOption($op_relative);
546 $role_access->setValue(
547 $this->access_limitations_obj->getMode(
549 ) ===
'null' ?
'unlimited' : $this->access_limitations_obj->getMode($role[
'id'])
552 $form->addItem($role_access);
555 $form->addCommandButton(
"saveRoleAccessLimitations", $this->
lng->txt(
"save"));
556 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
566 $is_valid = $form->checkInput();
567 $form->setValuesByPost();
573 $assignments_by_domain = [];
574 $problems_domains_by_field_id = [];
575 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
580 $role_assigned_input = $form->getInput(
"role_assigned_$role_id");
581 if (!$role_assigned_input) {
585 $domain_input = $form->getInput(
"domain_$role_id");
586 foreach ($domain_input as $domain) {
587 if (!is_string($domain) || $domain ===
'') {
591 if (isset($assignments_by_domain[$domain])) {
592 if (!isset($problems_domains_by_field_id[
"role_assigned_$role_id"])) {
593 $problems_domains_by_field_id[
"role_assigned_$role_id"] = [];
596 $problems_domains_by_field_id[
"domain_$role_id"][$domain] = $domain;
600 $assignments_by_domain[$domain] = $role_id;
604 if ($problems_domains_by_field_id !== []) {
605 foreach ($problems_domains_by_field_id as $field_id => $domains) {
606 $domain_string = implode(
', ', $domains);
607 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_p'), $domain_string);
608 if (count($domains) === 1) {
609 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_s'), $domain_string);
611 $form->getItemByPostVar($field_id)->setAlert($alert);
614 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
619 $this->assignments_obj->deleteAll();
622 foreach ($assignments_by_domain as $domain => $role_id) {
623 $this->assignments_obj->setDomain($counter, $domain);
624 $this->assignments_obj->setRole($counter, $role_id);
627 $default_role = $form->getInput(
"default_role");
628 $this->assignments_obj->setDefaultRole((
int) $default_role);
629 $this->assignments_obj->save();
630 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
641 if (!$form->checkInput()) {
642 $form->setValuesByPost();
647 $this->access_limitations_obj->resetAccessLimitations();
649 $mode = $form->getInput(
'role_access_' . $role[
'id']);
650 $this->access_limitations_obj->setMode($mode, $role[
'id']);
652 if ($mode ===
'absolute') {
653 $this->access_limitations_obj->setAbsolute($form->getInput(
'absolute_date_' . $role[
'id']), $role[
'id']);
656 if ($mode ===
'relative') {
657 $this->access_limitations_obj->setRelative($form->getInput(
'duration_' . $role[
'id']), $role[
'id']);
661 if ($err = $this->access_limitations_obj->validate()) {
664 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_missing_mode'));
668 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_out_of_date'));
675 $this->access_limitations_obj->save();
676 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
688 $tpl =
new ilTemplate(
'tpl.registration_roles.html',
true,
true,
'components/ILIAS/Registration');
693 if (is_array($roles) && count($roles)) {
694 foreach ($roles as $role) {
712 $all[] = $role[
'title'];
725 foreach ($this->assignments_obj->getAssignments() as $assignment) {
726 if ($assignment[
'domain'] !==
'' && $assignment[
'role']) {
731 if ((
string) $this->assignments_obj->getDefaultRole() !==
'') {
743 switch ($this->access_limitations_obj->getMode((
int) $role[
'id'])) {
745 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_until');
752 $months = $this->access_limitations_obj->getRelative($role[
'id'],
'm');
753 $days = $this->access_limitations_obj->getRelative($role[
'id'],
'd');
755 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_time') .
" ";
759 $txt_access_value .=
", ";
761 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
764 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
768 $txt_access_value .= $months .
" ";
769 $txt_access_value .= ($months === 1) ? $this->
lng->txt(
'month') : $this->
lng->txt(
'months');
772 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
777 $txt_access_value .= $days .
" ";
778 $txt_access_value .= ($days === 1) ? $this->
lng->txt(
'day') : $this->
lng->txt(
'days');
783 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_none');
787 $all[] = $role[
'title'] .
' (' . $txt_access_value .
')';
796 $this->assignments_obj =
new ilRegistrationRoleAssignments();
803 $this->access_limitations_obj =
new ilRegistrationRoleAccessLimitations();
813 $this->
lng->txt(
'registration_codes_add'),
814 $this->
ctrl->getLinkTarget($this,
'addCodes')
817 $this->tpl->setContent($this->ui_renderer->render([
818 $this->getRegistrationFilter()->getFilterComponent(),
825 if (!isset($this->registration_codes_table)) {
827 $this->
http->request(),
832 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
844 if (!isset($this->registration_code_filter)) {
846 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
861 $this->form_gui->setFormAction($this->
ctrl->getFormAction($this,
'createCodes'));
862 $this->form_gui->setTitle($this->
lng->txt(
'registration_codes_edit_header'));
864 $count =
new ilNumberInputGUI($this->
lng->txt(
'registration_codes_number'),
'reg_codes_number');
866 $count->setMaxLength(4);
867 $count->setMinValue(1);
868 $count->setMaxValue(1000);
869 $count->setRequired(
true);
870 $this->form_gui->addItem($count);
876 $code_type->addOption(
878 $this->
lng->txt(
'registration_codes_type_reg'),
879 (string) self::CODE_TYPE_REGISTRATION,
880 $this->
lng->txt(
'registration_codes_type_reg_info')
883 $code_type->addOption(
885 $this->
lng->txt(
'registration_codes_type_ext'),
886 (string) self::CODE_TYPE_EXTENSION,
887 $this->
lng->txt(
'registration_codes_type_ext_info')
890 $this->form_gui->addItem($code_type);
893 $sec->setTitle($this->
lng->txt(
'registration_codes_roles_title'));
894 $this->form_gui->addItem($sec);
896 $options = [
"" => $this->
lng->txt(
'registration_codes_no_assigned_role')];
897 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
902 $roles =
new ilSelectInputGUI($this->
lng->txt(
"registration_codes_roles"),
"reg_codes_role");
903 $roles->
setInfo($this->
lng->txt(
"registration_codes_override_info"));
904 $roles->setOptions($options);
905 $this->form_gui->addItem($roles);
907 $local =
new ilTextInputGUI($this->
lng->txt(
"registration_codes_roles_local"),
"reg_codes_local");
908 $local->setMulti(
true);
909 $local->setDataSource($this->
ctrl->getLinkTarget($this,
"getLocalRoleAutoComplete",
"",
true));
910 $this->form_gui->addItem($local);
913 $sec->setTitle($this->
lng->txt(
'reg_access_limitations'));
914 $this->form_gui->addItem($sec);
917 $limit->
setInfo($this->
lng->txt(
"registration_codes_override_info"));
918 $this->form_gui->addItem($limit);
920 $opt =
new ilRadioOption($this->
lng->txt(
"registration_codes_roles_limitation_none"),
"none");
921 $limit->addOption($opt);
923 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_none"),
"unlimited");
924 $limit->addOption($opt);
926 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_absolute"),
"absolute");
927 $limit->addOption($opt);
929 $dt =
new ilDateTimeInputGUI($this->
lng->txt(
"reg_access_limitation_mode_absolute_target"),
"abs_date");
931 $opt->addSubItem($dt);
933 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_relative"),
"relative");
934 $limit->addOption($opt);
936 $dur =
new ilDurationInputGUI($this->
lng->txt(
"reg_access_limitation_mode_relative_target"),
"rel_date");
938 $dur->setShowMonths(
true);
939 $dur->setShowDays(
true);
940 $dur->setShowHours(
false);
941 $dur->setShowMinutes(
false);
942 $opt->addSubItem($dur);
944 $this->form_gui->addCommandButton(
'createCodes', $this->
lng->txt(
'create'));
945 $this->form_gui->addCommandButton(
'listCodes', $this->
lng->txt(
'cancel'));
952 $q = $_REQUEST[
"term"];
965 $limit = $this->form_gui->getItemByPostVar(
"reg_limit");
966 $limit->setValue(
"none");
967 $this->tpl->setContent($this->form_gui->getHTML());
976 $valid = $this->form_gui->checkInput();
978 $number = $this->form_gui->getInput(
'reg_codes_number');
979 $role = (
int) $this->form_gui->getInput(
'reg_codes_role');
980 $local = $this->form_gui->getInput(
"reg_codes_local");
982 if (is_array($local)) {
984 foreach (array_unique($local) as $item) {
986 $role_id = $this->rbacreview->roleExists($item);
988 $role_ids[] = $role_id;
992 if (count($role_ids)) {
998 $limit = $this->form_gui->getInput(
"reg_limit");
1001 $date_input = $this->form_gui->getItemByPostVar(
"abs_date");
1003 if ($date < date(
"Y-m-d")) {
1004 $date_input->setAlert($this->
lng->txt(
"form_msg_wrong_date"));
1010 $date = $this->form_gui->getInput(
"rel_date");
1011 if (!array_sum($date)) {
1016 "m" => $date[
"MM"] % 12,
1017 "y" => (
int) floor($date[
"MM"] / 12)
1030 for ($loop = 1; $loop <= $number; $loop++) {
1031 $code_types = (array) $this->form_gui->getInput(
'code_type');
1039 in_array(self::CODE_TYPE_REGISTRATION, $code_types) ?
true :
false,
1040 in_array(self::CODE_TYPE_EXTENSION, $code_types) ?
true :
false 1044 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
1045 $this->
ctrl->redirect($this,
"listCodes");
1047 $this->form_gui->setValuesByPost();
1048 $this->tpl->setContent($this->form_gui->getHTML());
1057 if ($this->
http->wrapper()->post()->has(
'id')) {
1058 $ids = $this->
http->wrapper()->post()->retrieve(
1060 $this->
refinery->kindlyTo()->listOf(
1065 $this->code_repository->deleteCodes($ids);
1066 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'info_deleted'),
true);
1067 $this->
ctrl->redirect($this,
"listCodes");
1074 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1075 $ids = $this->
http->wrapper()->query()->retrieve(
1076 'registration_codes_code_ids',
1077 $this->
refinery->kindlyTo()->listOf(
1078 $this->
refinery->kindlyTo()->string()
1081 if ($ids === [
'ALL_OBJECTS']) {
1085 $codes = $this->code_repository->loadCodesByIds($ids);
1088 if (!count($codes)) {
1089 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_select_one'),
true);
1090 $this->
ctrl->redirect($this,
'listCodes');
1095 $gui->setHeaderText($this->
lng->txt(
'info_delete_sure'));
1096 $gui->setCancel($this->
lng->txt(
'cancel'),
'listCodes');
1097 $gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteCodes');
1098 $gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteCodes'));
1100 foreach ($codes as $code) {
1101 $gui->addItem(
'id[]', (
string) $code[
'code_id'], $code[
'code']);
1103 $this->tpl->setContent($gui->getHTML());
1109 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1110 $ids = $this->
http->wrapper()->query()->retrieve(
1111 'registration_codes_code_ids',
1112 $this->
refinery->kindlyTo()->listOf(
1113 $this->
refinery->kindlyTo()->string()
1116 if ($ids === [
'ALL_OBJECTS']) {
1120 $codes = $this->code_repository->loadCodesByIds($ids);
1124 static fn($code) => (
string) ($code[
'code'] ??
''),
1129 if (count($codes)) {
1131 implode(
"\r\n", $codes),
1132 'ilias_registration_codes_' . date(
'd-m-Y') .
'.txt',
1136 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'registration_export_codes_no_data'));
prepareAccessLimitationRoleList()
initRoleAccessLimitations()
This class represents an option in a radio group.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
ilRegistrationSettings $registration_settings
This class represents an option in a checkbox group.
parseRoleList(array $roles, string $url)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRegistrationCodeTable()
readonly RegistrationCodeRepository $code_repository
static _lookupRegisterAllowed()
get all roles that are activated in user registration
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
ilGlobalTemplateInterface $tpl
ilRegistrationRoleAccessLimitations $access_limitations_obj
const CODE_TYPE_REGISTRATION
editRoles(?ilPropertyFormGUI $form=null)
ilPropertyFormGUI $form_gui
Class class.ilregistrationEmailRoleAssignments.
readonly RegistrationFilterComponent $registration_code_filter
const REG_HASH_LIFETIME_MIN_VALUE
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.
initFormValues(ilPropertyFormGUI $formGUI)
static getList(string $a_str)
Get completion list.
readonly Factory $ui_factory
readonly RegistrationCodesTable $registration_codes_table
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
editRoleAccessLimitations(?ilPropertyFormGUI $form=null)
getLocalRoleAutoComplete()
checkAccessBool(string $a_permission)
static http()
Fetches the global http state from ILIAS.
static _lookupTitle(int $obj_id)
This is how the factory for UI elements looks.
prepareAutomaticRoleList()
initEmailAssignmentForm()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_REG_ROLE_UNDEFINED
setSubTabs(string $activeTab='registration_settings')
Class ilRegistrationSettingsGUI.
const IL_REG_ACCESS_LIMITATION_OUT_OF_DATE
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
const IL_REG_ACCESS_LIMITATION_MISSING_MODE
Class class.ilRegistrationAccessLimitation.
readonly ILIAS HTTP Services $http
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjAuthSettingsGUI.
static create(int $role, int $stamp, array $local_roles, ?string $limit, ?string $limit_date, bool $reg_type, bool $ext_type)
readonly ilUIService $ui_service
editEmailAssignments(?ilPropertyFormGUI $form=null)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
readonly UIRenderer $ui_renderer
saveRoleAccessLimitations()
readonly ILIAS Refinery Factory $refinery
const CODE_TYPE_EXTENSION
static _lookupAllowRegister(int $a_role_id)
check whether role is allowed in user registration or not
ilRegistrationRoleAssignments $assignments_obj
checkAccess(string $a_permission)