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)) {
259 foreach ($form_gui->
getItems() as $item) {
264 $item->setDisabled(
true);
273 if ($this->registration_settings->roleSelectionEnabled()) {
275 } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
281 'reg_type' => $this->registration_settings->getRegistrationType(),
282 'reg_hash_life_time' => $this->registration_settings->getRegistrationHashLifetime(),
283 'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
284 'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
285 'reg_role_type' => $role_type,
286 'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
287 'reg_allowed_domains' => implode(
';', $this->registration_settings->getAllowedDomains())
290 $allow_codes = $this->registration_settings->getAllowCodes();
291 $reg_type = $this->registration_settings->getRegistrationType();
292 if ($allow_codes && in_array($reg_type, [
297 $values[
'reg_codes_' . $reg_type] =
true;
312 $this->
lng->txt(
'registration_user_new_account_mail'),
313 $this->ctrl->getLinkTargetByClass(
315 ilAdministrationGUI::class,
316 ilObjUserFolderGUI::class,
317 NewAccountMailSettingsGUI::class
323 $this->
ctrl->setParameterByClass(ilObjUserFolderGUI::class,
'ref_id',
$_GET[
'ref_id']);
328 $this->tpl->setContent($form->getHTML());
336 $res = $form->checkInput();
337 $this->registration_settings->setRegistrationType((
int) $form->getInput(
'reg_type'));
338 $this->registration_settings->setPasswordGenerationStatus((
bool) $form->getInput(
'reg_pwd'));
339 $this->registration_settings->setApproveRecipientLogins($form->getInput(
'reg_approver'));
340 $this->registration_settings->setRoleType((
int) $form->getInput(
'reg_role_type'));
341 $this->registration_settings->setAccessLimitation((
bool) $form->getInput(
'reg_access_limitation'));
342 $this->registration_settings->setAllowedDomains((
string) $form->getInput(
'reg_allowed_domains'));
344 $allow_codes =
false;
345 $reg_type = (
int) $form->getInput(
'reg_type');
346 if (in_array($reg_type, [
351 $allow_codes = (bool) $form->getInput(
'reg_codes_' . $reg_type);
353 $this->registration_settings->setAllowCodes($allow_codes);
355 $hash_life_time = $form->getInput(
'reg_hash_life_time');
356 if (!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9]+)?$/', (
string) $hash_life_time)) {
359 $this->registration_settings->setRegistrationHashLifetime(max(
360 (
int) $hash_life_time,
365 if ($error_code = $this->registration_settings->validate()) {
366 switch ($error_code) {
368 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_unknown_recipients') .
' ' . $this->registration_settings->getUnknown());
373 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_approve_needs_recipient') .
' ' . $this->registration_settings->getUnknown());
379 $this->registration_settings->save();
380 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
388 $role_form->setFormAction($this->
ctrl->getFormAction($this,
'save'));
389 $role_form->setTitle($this->
lng->txt(
'reg_selectable_roles'));
393 foreach ($this->rbacreview->getGlobalRoles() as $role) {
398 $role_option->setValue((
string) $role);
399 $roles->addOption($role_option);
403 $roles->setUseValuesAsKeys(
true);
404 $roles->setValue($allowed_roles);
405 $role_form->addItem($roles);
408 $role_form->addCommandButton(
"updateRoles", $this->
lng->txt(
"save"));
410 $role_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
417 $this->
tabs->clearTargets();
418 $this->
tabs->setBackTarget(
419 $this->
lng->txt(
"registration_settings"),
420 $this->ctrl->getLinkTarget($this,
"view")
425 $this->tpl->setContent($form->getHTML());
432 if ($form->checkInput()) {
433 $roles = (array) $form->getInput(
'roles');
434 if (count($roles) < 1) {
435 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_last_role_for_registration'));
439 foreach ($this->rbacreview->getGlobalRoles() as $role) {
441 $role_obj->setAllowRegister(isset($roles[$role]) && (
int) $roles[$role] === 1);
446 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
454 $this->
tabs->clearTargets();
455 $this->
tabs->setBackTarget(
456 $this->
lng->txt(
"registration_settings"),
457 $this->ctrl->getLinkTarget($this,
"view")
462 $this->tpl->setContent($form->getHTML());
468 $role_assignment_form->setFormAction($this->
ctrl->getFormAction($this));
469 $role_assignment_form->setTitle($this->
lng->txt(
'reg_email_role_assignment'));
471 $global_roles = [
"" => $this->
lng->txt(
"links_select_one")];
472 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
480 $domains = $this->assignments_obj->getDomainsByRole($role_id);
483 $domain->setMulti(
true);
484 $domain->setValidationRegexp(
"/^@.*\.[a-zA-Z]{1,4}$/");
485 if (!empty($domains)) {
486 $domain->setValue($domains[0]);
487 $domain->setMultiValues($domains);
488 $role_assignments->setChecked(
true);
491 $role_assignments->addSubItem($domain);
492 $role_assignment_form->addItem($role_assignments);
496 $default_role->setPostVar(
"default_role");
497 $default_role->setOptions($global_roles);
498 $default_role->setValue($this->assignments_obj->getDefaultRole());
499 $default_role->setRequired(
true);
500 $role_assignment_form->addItem($default_role);
502 $role_assignment_form->addCommandButton(
"saveAssignment", $this->
lng->txt(
"save"));
503 $role_assignment_form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
505 return $role_assignment_form;
513 $this->
tabs->clearTargets();
514 $this->
tabs->setBackTarget(
515 $this->
lng->txt(
"registration_settings"),
516 $this->ctrl->getLinkTarget($this,
"view")
519 if (
null === $form) {
522 $this->tpl->setContent($form->getHTML());
528 $form->setFormAction($this->
ctrl->getFormAction($this));
529 $form->setTitle($this->
lng->txt(
'reg_role_access_limitations'));
533 $op_unlimited =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_unlimited'),
"unlimited");
535 $op_absolute =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_absolute'),
"absolute");
537 date(
"d.m.Y", $this->access_limitations_obj->getAbsolute($role[
'id'])),
541 $date->setDate($absolute_date);
542 $op_absolute->addSubItem($date);
544 $op_relative =
new ilRadioOption($this->
lng->txt(
'reg_access_limitation_mode_relative'),
"relative");
550 $duration->setDays($this->access_limitations_obj->getRelative($role[
'id'],
'd'));
551 $duration->setMonths($this->access_limitations_obj->getRelative($role[
'id'],
'm'));
554 $role_access->addOption($op_unlimited);
555 $role_access->addOption($op_absolute);
556 $role_access->addOption($op_relative);
557 $role_access->setValue(
558 $this->access_limitations_obj->getMode(
560 ) ===
'null' ?
'unlimited' : $this->access_limitations_obj->getMode($role[
'id'])
563 $form->addItem($role_access);
566 $form->addCommandButton(
"saveRoleAccessLimitations", $this->
lng->txt(
"save"));
567 $form->addCommandButton(
"view", $this->
lng->txt(
"cancel"));
577 $is_valid = $form->checkInput();
578 $form->setValuesByPost();
584 $assignments_by_domain = [];
585 $problems_domains_by_field_id = [];
586 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
591 $role_assigned_input = $form->getInput(
"role_assigned_$role_id");
592 if (!$role_assigned_input) {
596 $domain_input = $form->getInput(
"domain_$role_id");
597 foreach ($domain_input as $domain) {
598 if (!is_string($domain) || $domain ===
'') {
602 if (isset($assignments_by_domain[$domain])) {
603 if (!isset($problems_domains_by_field_id[
"role_assigned_$role_id"])) {
604 $problems_domains_by_field_id[
"role_assigned_$role_id"] = [];
607 $problems_domains_by_field_id[
"domain_$role_id"][$domain] = $domain;
611 $assignments_by_domain[$domain] = $role_id;
615 if ($problems_domains_by_field_id !== []) {
616 foreach ($problems_domains_by_field_id as $field_id => $domains) {
617 $domain_string = implode(
', ', $domains);
618 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_p'), $domain_string);
619 if (count($domains) === 1) {
620 $alert = sprintf($this->
lng->txt(
'reg_domain_already_assigned_s'), $domain_string);
622 $form->getItemByPostVar($field_id)->setAlert($alert);
625 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
630 $this->assignments_obj->deleteAll();
633 foreach ($assignments_by_domain as $domain => $role_id) {
634 $this->assignments_obj->setDomain(
$counter, $domain);
635 $this->assignments_obj->setRole(
$counter, $role_id);
638 $default_role = $form->getInput(
"default_role");
639 $this->assignments_obj->setDefaultRole((
int) $default_role);
640 $this->assignments_obj->save();
641 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
652 if (!$form->checkInput()) {
653 $form->setValuesByPost();
658 $this->access_limitations_obj->resetAccessLimitations();
660 $mode = $form->getInput(
'role_access_' . $role[
'id']);
661 $this->access_limitations_obj->setMode($mode, $role[
'id']);
663 if ($mode ===
'absolute') {
664 $this->access_limitations_obj->setAbsolute($form->getInput(
'absolute_date_' . $role[
'id']), $role[
'id']);
667 if ($mode ===
'relative') {
668 $this->access_limitations_obj->setRelative($form->getInput(
'duration_' . $role[
'id']), $role[
'id']);
672 if ($err = $this->access_limitations_obj->validate()) {
675 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_missing_mode'));
679 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'reg_access_limitation_out_of_date'));
686 $this->access_limitations_obj->save();
687 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
699 $tpl =
new ilTemplate(
'tpl.registration_roles.html',
true,
true,
'components/ILIAS/Registration');
704 if (is_array($roles) && count($roles)) {
705 foreach ($roles as $role) {
723 $all[] = $role[
'title'];
736 foreach ($this->assignments_obj->getAssignments() as $assignment) {
737 if ($assignment[
'domain'] !==
'' && $assignment[
'role']) {
742 if ((
string) $this->assignments_obj->getDefaultRole() !==
'') {
754 switch ($this->access_limitations_obj->getMode((
int) $role[
'id'])) {
756 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_until');
763 $months = $this->access_limitations_obj->getRelative($role[
'id'],
'm');
764 $days = $this->access_limitations_obj->getRelative($role[
'id'],
'd');
766 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_limited_time') .
" ";
770 $txt_access_value .=
", ";
772 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
775 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
779 $txt_access_value .= $months .
" ";
780 $txt_access_value .= ($months === 1) ? $this->
lng->txt(
'month') : $this->
lng->txt(
'months');
783 $txt_access_value .=
" " . $this->
lng->txt(
'and') .
" ";
788 $txt_access_value .= $days .
" ";
789 $txt_access_value .= ($days === 1) ? $this->
lng->txt(
'day') : $this->
lng->txt(
'days');
794 $txt_access_value = $this->
lng->txt(
'reg_access_limitation_none');
798 $all[] = $role[
'title'] .
' (' . $txt_access_value .
')';
824 $this->
lng->txt(
'registration_codes_add'),
825 $this->ctrl->getLinkTarget($this,
'addCodes')
828 $this->tpl->setContent($this->ui_renderer->render([
829 $this->getRegistrationFilter()->getFilterComponent(),
830 $this->getRegistrationCodeTable()->getTableComponent($this->getRegistrationFilter())
836 if (!isset($this->registration_codes_table)) {
838 $this->
http->request(),
843 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
845 $this->code_repository,
846 $this->checkAccessBool(
'write'),
855 if (!isset($this->registration_code_filter)) {
857 $this->
ctrl->getLinkTarget($this,
'listCodes',
'',
true),
862 $this->code_repository
872 $this->form_gui->setFormAction($this->
ctrl->getFormAction($this,
'createCodes'));
873 $this->form_gui->setTitle($this->
lng->txt(
'registration_codes_edit_header'));
875 $count =
new ilNumberInputGUI($this->
lng->txt(
'registration_codes_number'),
'reg_codes_number');
877 $count->setMaxLength(4);
878 $count->setMinValue(1);
879 $count->setMaxValue(1000);
880 $count->setRequired(
true);
881 $this->form_gui->addItem($count);
885 $code_type->setRequired(
true);
887 $code_type->addOption(
889 $this->
lng->txt(
'registration_codes_type_reg'),
890 (
string) self::CODE_TYPE_REGISTRATION,
891 $this->lng->txt(
'registration_codes_type_reg_info')
894 $code_type->addOption(
896 $this->
lng->txt(
'registration_codes_type_ext'),
897 (
string) self::CODE_TYPE_EXTENSION,
898 $this->lng->txt(
'registration_codes_type_ext_info')
901 $this->form_gui->addItem($code_type);
904 $sec->setTitle($this->
lng->txt(
'registration_codes_roles_title'));
905 $this->form_gui->addItem($sec);
907 $options = [
"" => $this->
lng->txt(
'registration_codes_no_assigned_role')];
908 foreach ($this->rbacreview->getGlobalRoles() as $role_id) {
913 $roles =
new ilSelectInputGUI($this->
lng->txt(
"registration_codes_roles"),
"reg_codes_role");
914 $roles->setInfo($this->
lng->txt(
"registration_codes_override_info"));
916 $this->form_gui->addItem($roles);
918 $local =
new ilTextInputGUI($this->
lng->txt(
"registration_codes_roles_local"),
"reg_codes_local");
919 $local->setMulti(
true);
920 $local->setDataSource($this->
ctrl->getLinkTarget($this,
"getLocalRoleAutoComplete",
"",
true));
921 $this->form_gui->addItem($local);
924 $sec->setTitle($this->
lng->txt(
'reg_access_limitations'));
925 $this->form_gui->addItem($sec);
928 $limit->setInfo($this->
lng->txt(
"registration_codes_override_info"));
929 $this->form_gui->addItem($limit);
931 $opt =
new ilRadioOption($this->
lng->txt(
"registration_codes_roles_limitation_none"),
"none");
932 $limit->addOption($opt);
934 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_none"),
"unlimited");
935 $limit->addOption($opt);
937 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_absolute"),
"absolute");
938 $limit->addOption($opt);
940 $dt =
new ilDateTimeInputGUI($this->
lng->txt(
"reg_access_limitation_mode_absolute_target"),
"abs_date");
941 $dt->setRequired(
true);
942 $opt->addSubItem($dt);
944 $opt =
new ilRadioOption($this->
lng->txt(
"reg_access_limitation_mode_relative"),
"relative");
945 $limit->addOption($opt);
947 $dur =
new ilDurationInputGUI($this->
lng->txt(
"reg_access_limitation_mode_relative_target"),
"rel_date");
948 $dur->setRequired(
true);
949 $dur->setShowMonths(
true);
950 $dur->setShowDays(
true);
951 $dur->setShowHours(
false);
952 $dur->setShowMinutes(
false);
953 $opt->addSubItem($dur);
955 $this->form_gui->addCommandButton(
'createCodes', $this->
lng->txt(
'create'));
956 $this->form_gui->addCommandButton(
'listCodes', $this->
lng->txt(
'cancel'));
963 $q = $_REQUEST[
"term"];
976 $limit = $this->form_gui->getItemByPostVar(
"reg_limit");
977 $limit->setValue(
"none");
978 $this->tpl->setContent($this->form_gui->getHTML());
987 $valid = $this->form_gui->checkInput();
989 $number = $this->form_gui->getInput(
'reg_codes_number');
990 $role = (
int) $this->form_gui->getInput(
'reg_codes_role');
991 $local = $this->form_gui->getInput(
"reg_codes_local");
993 if (is_array($local)) {
995 foreach (array_unique($local) as $item) {
997 $role_id = $this->rbacreview->roleExists($item);
999 $role_ids[] = $role_id;
1003 if (count($role_ids)) {
1009 $limit = $this->form_gui->getInput(
"reg_limit");
1012 $date_input = $this->form_gui->getItemByPostVar(
"abs_date");
1014 if ($date < date(
"Y-m-d")) {
1015 $date_input->setAlert($this->
lng->txt(
"form_msg_wrong_date"));
1021 $date = $this->form_gui->getInput(
"rel_date");
1022 if (!array_sum($date)) {
1027 "m" => $date[
"MM"] % 12,
1028 "y" => (
int) floor($date[
"MM"] / 12)
1041 for ($loop = 1; $loop <= $number; $loop++) {
1042 $code_types = (array) $this->form_gui->getInput(
'code_type');
1050 in_array(self::CODE_TYPE_REGISTRATION, $code_types) ?
true :
false,
1051 in_array(self::CODE_TYPE_EXTENSION, $code_types) ?
true :
false
1055 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'),
true);
1056 $this->
ctrl->redirect($this,
"listCodes");
1058 $this->form_gui->setValuesByPost();
1059 $this->tpl->setContent($this->form_gui->getHTML());
1068 if ($this->
http->wrapper()->post()->has(
'id')) {
1069 $ids = $this->
http->wrapper()->post()->retrieve(
1071 $this->
refinery->kindlyTo()->listOf(
1072 $this->refinery->kindlyTo()->int()
1076 $this->code_repository->deleteCodes($ids);
1077 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'info_deleted'),
true);
1078 $this->
ctrl->redirect($this,
"listCodes");
1085 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1086 $ids = $this->
http->wrapper()->query()->retrieve(
1087 'registration_codes_code_ids',
1088 $this->
refinery->kindlyTo()->listOf(
1089 $this->refinery->kindlyTo()->string()
1092 if ($ids === [
'ALL_OBJECTS']) {
1095 $ids = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($ids);
1096 $codes = $this->code_repository->loadCodesByIds($ids);
1099 if (!count($codes)) {
1100 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_select_one'),
true);
1101 $this->
ctrl->redirect($this,
'listCodes');
1106 $gui->setHeaderText($this->
lng->txt(
'info_delete_sure'));
1107 $gui->setCancel($this->
lng->txt(
'cancel'),
'listCodes');
1108 $gui->setConfirm($this->
lng->txt(
'confirm'),
'deleteCodes');
1109 $gui->setFormAction($this->
ctrl->getFormAction($this,
'deleteCodes'));
1111 foreach ($codes as $code) {
1112 $gui->addItem(
'id[]', (
string) $code[
'code_id'], $code[
'code']);
1114 $this->tpl->setContent($gui->getHTML());
1120 if ($this->
http->wrapper()->query()->has(
'registration_codes_code_ids')) {
1121 $ids = $this->
http->wrapper()->query()->retrieve(
1122 'registration_codes_code_ids',
1123 $this->
refinery->kindlyTo()->listOf(
1124 $this->refinery->kindlyTo()->string()
1127 if ($ids === [
'ALL_OBJECTS']) {
1130 $ids = $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($ids);
1131 $codes = $this->code_repository->loadCodesByIds($ids);
1134 $codes = array_filter(array_map(
1135 static fn($code) => (
string) ($code[
'code'] ??
''),
1140 if (count($codes)) {
1142 implode(
"\r\n", $codes),
1143 'ilias_registration_codes_' . date(
'd-m-Y') .
'.txt',
1147 $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.