24 require_once
'./Services/Registration/classes/class.ilRegistrationSettings.php';
53 $this->lng->loadLanguageModule(
'administration');
54 $this->lng->loadLanguageModule(
'registration');
55 $this->lng->loadLanguageModule(
'user');
57 $this->ref_id = (int)
$_GET[
'ref_id'];
64 $next_class = $this->ctrl->getNextClass($this);
65 $cmd = $this->ctrl->getCmd();
66 switch ($next_class) {
81 public function setSubTabs($activeTab =
'registration_settings')
86 "registration_settings",
87 $lng->txt(
"registration_tab_settings"),
88 $this->ctrl->getLinkTarget($this,
'view')
93 $lng->txt(
"registration_tab_codes"),
94 $this->ctrl->getLinkTarget($this,
'listCodes')
97 $ilTabs->activateSubTab($activeTab);
102 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
105 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'save'));
106 $this->form_gui->setTitle($this->lng->txt(
'reg_settings_header'));
111 $option->
setInfo($this->lng->txt(
'reg_direct_info'));
113 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
114 $option->addSubItem($cd);
115 $reg_type->addOption($option);
117 $option->
setInfo($this->lng->txt(
'reg_approve_info'));
119 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
120 $option->addSubItem($cd);
121 $reg_type->addOption($option);
123 $option->
setInfo($this->lng->txt(
'reg_type_confirmation_info'));
124 $lt =
new ilNumberInputGUI($this->lng->txt(
'reg_confirmation_hash_life_time'),
'reg_hash_life_time');
126 $lt->setMaxLength(6);
128 $lt->setRequired(
true);
129 $lt->setInfo($this->lng->txt(
'reg_confirmation_hash_life_time_info'));
130 $lt->setSuffix($this->lng->txt(
'seconds'));
131 $option->addSubItem($lt);
133 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
134 $option->addSubItem($cd);
135 $reg_type->addOption($option);
137 $option->
setInfo($this->lng->txt(
'registration_reg_type_codes_info'));
138 $reg_type->addOption($option);
139 $this->form_gui->addItem($reg_type);
143 $pwd_gen->setInfo($this->lng->txt(
'reg_info_pwd'));
144 $this->form_gui->addItem($pwd_gen);
146 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
147 $cap =
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'),
'activate_captcha_anonym');
148 $cap->
setInfo($this->lng->txt(
'adm_captcha_anonymous_reg'));
151 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
153 $this->form_gui->addItem($cap);
155 $approver =
new ilTextInputGUI($this->lng->txt(
'reg_notification'),
'reg_approver');
157 $approver->setMaxLength(50);
158 $approver->setInfo($this->lng->txt(
'reg_notification_info'));
159 $this->form_gui->addItem($approver);
164 $edit = $this->ctrl->getLinkTarget($this,
'editRoles');
167 $roles->addOption($option);
170 $edit = $this->ctrl->getLinkTarget($this,
'editEmailAssignments');
173 $roles->addOption($option);
174 $roles->setInfo($this->lng->txt(
'registration_codes_override_global_info'));
175 $this->form_gui->addItem($roles);
177 $limit =
new ilCheckboxInputGUI($this->lng->txt(
'reg_access_limitations'),
'reg_access_limitation');
180 $edit = $this->ctrl->getLinkTarget($this,
'editRoleAccessLimitations');
182 $list->
setInfo($this->lng->txt(
'registration_codes_override_global_info'));
183 $limit->addSubItem($list);
184 $this->form_gui->addItem($limit);
186 $domains =
new ilTextInputGUI($this->lng->txt(
'reg_allowed_domains'),
'reg_allowed_domains');
187 $domains->
setInfo($this->lng->txt(
'reg_allowed_domains_info'));
188 $this->form_gui->addItem($domains);
190 $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'save'));
195 if ($this->registration_settings->roleSelectionEnabled()) {
197 } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
201 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
203 'reg_type' => $this->registration_settings->getRegistrationType(),
204 'reg_hash_life_time' => (int) $this->registration_settings->getRegistrationHashLifetime(),
205 'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
206 'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
207 'reg_role_type' => $role_type,
208 'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
209 'reg_allowed_domains' => implode(
';', $this->registration_settings->getAllowedDomains()),
210 'activate_captcha_anonym' => ilCaptchaUtil::isActiveForRegistration()
213 $allow_codes = $this->registration_settings->getAllowCodes();
214 $reg_type = $this->registration_settings->getRegistrationType();
216 $values[
'reg_codes_' . $reg_type] =
true;
219 $this->form_gui->setValuesByArray($values);
226 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
227 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
233 $ilCtrl->setParameterByClass(
"ilobjuserfoldergui",
"ref_id",
USER_FOLDER_ID);
234 $ilToolbar->addButton(
235 $this->lng->txt(
'registration_user_new_account_mail'),
236 $ilCtrl->getLinkTargetByClass(
array(
"iladministrationgui",
"ilobjuserfoldergui"),
"newAccountMail")
238 $ilCtrl->setParameterByClass(
"ilobjuserfoldergui",
"ref_id",
$_GET[
"ref_id"]);
242 $this->tpl->setContent($this->form_gui->getHTML());
249 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
250 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
253 $this->registration_settings->setRegistrationType((
int)
$_POST[
'reg_type']);
254 $this->registration_settings->setPasswordGenerationStatus((
int) $_POST[
'reg_pwd']);
255 $this->registration_settings->setApproveRecipientLogins(
ilUtil::stripSlashes($_POST[
'reg_approver']));
256 $this->registration_settings->setRoleType((
int) $_POST[
'reg_role_type']);
257 $this->registration_settings->setAccessLimitation((
int) $_POST[
'reg_access_limitation']);
258 $this->registration_settings->setAllowedDomains($_POST[
'reg_allowed_domains']);
260 $allow_codes =
false;
262 $allow_codes = (bool) $_POST[
'reg_codes_' . (
int) $_POST[
'reg_type']];
264 $this->registration_settings->setAllowCodes($allow_codes);
266 if (!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (
int) $_POST[
'reg_hash_life_time'])) {
272 if ($error_code = $this->registration_settings->validate()) {
273 switch ($error_code) {
276 ilUtil::sendFailure($this->lng->txt(
'reg_unknown_recipients') .
' ' . $this->registration_settings->getUnknown());
282 ilUtil::sendFailure($this->lng->txt(
'reg_approve_needs_recipient') .
' ' . $this->registration_settings->getUnknown());
289 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
290 ilCaptchaUtil::setActiveForRegistration((
bool) $_POST[
'activate_captcha_anonym']);
292 $this->registration_settings->save();
301 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
303 global $ilAccess,
$ilErr,$rbacreview;
305 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
306 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
309 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_roles.html',
'Services/Registration');
311 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
312 $this->tpl->setVariable(
"TXT_SELECTABLE_ROLES", $this->lng->txt(
'reg_selectable_roles'));
314 $this->tpl->setVariable(
"ACTIONS", $this->lng->txt(
'actions'));
315 $this->tpl->setVariable(
"UPDATE", $this->lng->txt(
'save'));
316 $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
'cancel'));
319 foreach ($rbacreview->getGlobalRoles() as $role) {
320 if ($role == SYSTEM_ROLE_ID or $role == ANONYMOUS_ROLE_ID) {
323 $this->tpl->setCurrentBlock(
"roles");
331 $this->tpl->parseCurrentBlock();
337 global $ilAccess,
$ilErr,$rbacreview;
339 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
340 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
343 if (count(
$_POST[
'roles']) < 1) {
349 foreach ($rbacreview->getGlobalRoles() as $role) {
351 $role_obj->setAllowRegister(
$_POST[
'roles'][$role] ? 1 : 0);
364 global $ilAccess,
$ilErr,$rbacreview;
366 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
367 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
372 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.reg_email_role_assignments.html',
'Services/Registration');
373 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
374 $this->tpl->setVariable(
"TXT_EMAIL_ROLE_ASSIGN", $this->lng->txt(
'reg_email_role_assignment'));
375 $this->tpl->setVariable(
"TXT_MAIL", $this->lng->txt(
'reg_email'));
376 $this->tpl->setVariable(
"TXT_ROLE", $this->lng->txt(
'obj_role'));
377 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
'reg_default'));
379 $this->tpl->setVariable(
"TXT_DOMAIN", $this->lng->txt(
'reg_domain'));
382 $this->tpl->setVariable(
"BTN_DELETE", $this->lng->txt(
'delete'));
383 $this->tpl->setVariable(
"BTN_SAVE", $this->lng->txt(
'save'));
384 $this->tpl->setVariable(
"BTN_ADD", $this->lng->txt(
'reg_add_assignment'));
385 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
'cancel'));
388 foreach ($this->assignments_obj->getAssignments() as $assignment) {
389 $this->tpl->setCurrentBlock(
"roles");
391 $this->tpl->setVariable(
"ASSIGN_ID", $assignment[
'id']);
392 $this->tpl->setVariable(
"DOMAIN", $assignment[
'domain']);
393 $this->tpl->setVariable(
"CHECK_ROLE",
ilUtil::formCheckbox(0,
'del_assign[]', $assignment[
'id']));
395 $this->tpl->parseCurrentBlock();
399 $this->tpl->setVariable(
"TXT_DEFAULT", $this->lng->txt(
'default'));
407 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
408 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
413 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.reg_role_access_limitations.html',
'Services/Registration');
415 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
416 $this->tpl->setVariable(
"TXT_REG_ROLE_ACCESS_LIMITATIONS", $lng->txt(
'reg_role_access_limitations'));
417 $this->tpl->setVariable(
"TXT_ROLE", $lng->txt(
'obj_role'));
418 $this->tpl->setVariable(
"TXT_ACCESS_LIMITATION_MODE", $lng->txt(
'reg_access_limitation_mode'));
420 $this->tpl->setVariable(
"BTN_SAVE", $lng->txt(
'save'));
421 $this->tpl->setVariable(
"BTN_CANCEL", $lng->txt(
'cancel'));
424 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
427 $this->tpl->setCurrentBlock(
"roles");
429 $this->tpl->setVariable(
"ROLE_ID", $role[
'id']);
430 $this->tpl->setVariable(
"ROLE_TITLE", $role[
'title']);
432 $this->tpl->setVariable(
"CSS_DISPLAY_ABSOLUTE", ($this->access_limitations_obj->getMode($role[
'id']) ==
'absolute') ?
'inline' :
'none');
433 $this->tpl->setVariable(
"CSS_DISPLAY_RELATIVE", ($this->access_limitations_obj->getMode($role[
'id']) ==
'relative') ?
'inline' :
'none');
434 $this->tpl->setVariable(
"CSS_DISPLAY_UNLIMITED", ($this->access_limitations_obj->getMode($role[
'id']) ==
'unlimited') ?
'inline' :
'none');
435 $this->tpl->setVariable(
"TXT_ACCESS_LIMITATION_UNLIMITED", $lng->txt(
'reg_access_limitation_none'));
437 $date = $this->
__prepareDateSelect($this->access_limitations_obj->getAbsolute($role[
'id']));
438 $this->tpl->setVariable(
"SEL_ACCESS_LIMITATION_ABSOLUTE",
ilUtil::makeDateSelect(
'access_limitation_absolute_' . $role[
'id'], $date[
'y'], $date[
'm'], $date[
'd'],
'2007'));
440 $this->tpl->setVariable(
"TXT_DAYS", $lng->txt(
'days'));
441 $this->tpl->setVariable(
"TXT_MONTHS", $lng->txt(
'months'));
442 $this->tpl->setVariable(
"TXT_YEARS", $lng->txt(
'years'));
444 $this->tpl->setVariable(
"DAYS", $this->access_limitations_obj->getRelative($role[
'id'],
'd'));
445 $this->tpl->setVariable(
"MONTHS", $this->access_limitations_obj->getRelative($role[
'id'],
'm'));
446 $this->tpl->setVariable(
"YEARS", $this->access_limitations_obj->getRelative($role[
'id'],
'y'));
447 $this->tpl->parseCurrentBlock();
453 global $ilAccess,
$ilErr,$rbacreview;
455 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
456 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
460 $this->assignments_obj->add();
470 global $ilAccess,
$ilErr,$rbacreview;
472 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
473 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
476 if (!count(
$_POST[
'del_assign'])) {
484 foreach (
$_POST[
'del_assign'] as $assignment_id) {
485 $this->assignments_obj->delete($assignment_id);
496 global $ilAccess,
$ilErr,$rbacreview;
498 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
499 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
504 if (!is_array(
$_POST[
'domain'])) {
512 $this->assignments_obj->setDefaultRole((
int)
$_POST[
'default_role']);
514 if ($err = $this->assignments_obj->validate()) {
529 $this->assignments_obj->save();
537 global $ilAccess,
$ilErr,$rbacreview;
539 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
540 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
545 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
547 $this->access_limitations_obj->resetAccessLimitations();
549 $this->access_limitations_obj->setMode(
$_POST[
'access_limitation_mode_' . $role[
'id']], $role[
'id']);
550 $this->access_limitations_obj->setAbsolute(
$_POST[
'access_limitation_absolute_' . $role[
'id']], $role[
'id']);
551 $this->access_limitations_obj->setRelative(
$_POST[
'access_limitation_relative_' . $role[
'id']], $role[
'id']);
554 if ($err = $this->access_limitations_obj->validate()) {
569 $this->access_limitations_obj->save();
577 $tpl =
new ilTemplate(
'tpl.registration_roles.html',
true,
true,
'Services/Registration');
579 $tpl->setVariable(
"EDIT", $this->lng->txt(
"edit"));
580 $tpl->setVariable(
"LINK_EDIT",
$url);
582 if (is_array($roles) &&
sizeof($roles)) {
583 foreach ($roles as $role) {
584 $tpl->setCurrentBlock(
"list_item");
585 $tpl->setVariable(
"LIST_ITEM_ITEM", $role);
586 $tpl->parseCurrentBlock();
589 $tpl->setVariable(
"NONE", $this->lng->txt(
'none'));
597 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
601 $all[] = $role[
'title'];
608 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
612 foreach ($this->assignments_obj->getAssignments() as $assignment) {
613 if (strlen($assignment[
'domain']) and $assignment[
'role']) {
618 if (strlen($this->assignments_obj->getDefaultRole())) {
619 $all[] = $this->lng->txt(
'reg_default') .
' -> ' .
ilObjRole::_lookupTitle($this->assignments_obj->getDefaultRole());
631 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
635 switch ($this->access_limitations_obj->getMode($role[
'id'])) {
637 $txt_access_value = $lng->txt(
'reg_access_limitation_limited_until');
642 $years = $this->access_limitations_obj->getRelative($role[
'id'],
'y');
643 $months = $this->access_limitations_obj->getRelative($role[
'id'],
'm');
644 $days = $this->access_limitations_obj->getRelative($role[
'id'],
'd');
646 $txt_access_value = $lng->txt(
'reg_access_limitation_limited_time') .
" ";
649 $txt_access_value .=
$years .
" ";
650 $txt_access_value .= (
$years == 1) ? $lng->txt(
'year') : $lng->txt(
'years');
654 $txt_access_value .=
", ";
656 $txt_access_value .=
" " . $lng->txt(
'and') .
" ";
659 $txt_access_value .=
" " . $lng->txt(
'and') .
" ";
664 $txt_access_value .= $months .
" ";
665 $txt_access_value .= ($months == 1) ? $lng->txt(
'month') : $lng->txt(
'months');
668 $txt_access_value .=
" " . $lng->txt(
'and') .
" ";
673 $txt_access_value .= $days .
" ";
674 $txt_access_value .= ($days == 1) ? $lng->txt(
'day') : $lng->txt(
'days');
679 $txt_access_value = $lng->txt(
'reg_access_limitation_none');
683 $all[] = $role[
'title'] .
' (' . $txt_access_value .
')';
691 if (is_object($this->assignments_obj)) {
695 include_once
'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
702 if (is_object($this->access_limitations_obj)) {
706 include_once
'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
713 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
717 $assignments = $this->assignments_obj->getAssignments();
718 $selected = ($assignment_id > 0) ?
719 $assignments[$assignment_id][
'role'] :
720 $this->assignments_obj->getDefaultRole();
723 $roles[0] = $this->lng->txt(
'please_choose');
726 foreach ($rbacreview->getGlobalRoles() as $role_id) {
727 if ($role_id == ANONYMOUS_ROLE_ID) {
733 if ($assignment_id > 0) {
736 "role[$assignment_id][role]",
757 'null' => $lng->txt(
'please_choose'),
758 'unlimited' => $lng->txt(
'reg_access_limitation_mode_unlimited'),
759 'absolute' => $lng->txt(
'reg_access_limitation_mode_absolute'),
760 'relative' => $lng->txt(
'reg_access_limitation_mode_relative')
763 $attribs =
array(
'onchange' =>
'displayAccessLimitationSelectionForm(document.cmd.access_limitation_mode_' . $a_role_id .
',' . $a_role_id .
')');
765 $selected = $this->access_limitations_obj->getMode($a_role_id);
773 $a_unix_time =
time();
776 return array(
'y' =>
date(
'Y', $a_unix_time),
777 'm' =>
date(
'n', $a_unix_time),
778 'd' =>
date(
'd', $a_unix_time));
785 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
786 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
791 $ilToolbar->addButton(
792 $this->lng->txt(
"registration_codes_add"),
793 $this->ctrl->getLinkTarget($this,
"addCodes")
796 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
798 $this->tpl->setContent($ctab->getHTML());
803 global $rbacreview, $ilObjDataCache,
$lng;
805 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
808 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'createCodes'));
809 $this->form_gui->setTitle($this->lng->txt(
'registration_codes_edit_header'));
811 $count =
new ilNumberInputGUI($this->lng->txt(
'registration_codes_number'),
'reg_codes_number');
813 $count->setMaxLength(4);
814 $count->setMinValue(1);
815 $count->setMaxValue(1000);
816 $count->setRequired(
true);
817 $this->form_gui->addItem($count);
823 $code_type->addOption(
825 $this->lng->txt(
'registration_codes_type_reg'),
826 self::CODE_TYPE_REGISTRATION,
827 $this->lng->txt(
'registration_codes_type_reg_info')
830 $code_type->addOption(
832 $this->lng->txt(
'registration_codes_type_ext'),
833 self::CODE_TYPE_EXTENSION,
834 $this->lng->txt(
'registration_codes_type_ext_info')
837 $this->form_gui->addItem($code_type);
841 $sec->setTitle($this->lng->txt(
'registration_codes_roles_title'));
842 $this->form_gui->addItem($sec);
844 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
845 $options =
array(
"" => $this->lng->txt(
'registration_codes_no_assigned_role'));
846 foreach ($rbacreview->getGlobalRoles() as $role_id) {
847 if (!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID))) {
848 $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
851 $roles =
new ilSelectInputGUI($this->lng->txt(
"registration_codes_roles"),
"reg_codes_role");
852 $roles->
setInfo($this->lng->txt(
"registration_codes_override_info"));
854 $this->form_gui->addItem($roles);
856 $local =
new ilTextInputGUI($this->lng->txt(
"registration_codes_roles_local"),
"reg_codes_local");
858 $local->setDataSource($this->ctrl->getLinkTarget($this,
"getLocalRoleAutoComplete",
"",
true));
859 $this->form_gui->addItem($local);
863 $sec->setTitle($this->lng->txt(
'reg_access_limitations'));
864 $this->form_gui->addItem($sec);
867 $limit->
setInfo($this->lng->txt(
"registration_codes_override_info"));
868 $this->form_gui->addItem($limit);
870 $opt =
new ilRadioOption($this->lng->txt(
"registration_codes_roles_limitation_none"),
"none");
871 $limit->addOption($opt);
873 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_none"),
"unlimited");
874 $limit->addOption($opt);
876 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_mode_absolute"),
"absolute");
877 $limit->addOption($opt);
879 $dt =
new ilDateTimeInputGUI($this->lng->txt(
"reg_access_limitation_mode_absolute_target"),
"abs_date");
881 $opt->addSubItem($dt);
883 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_mode_relative"),
"relative");
884 $limit->addOption($opt);
886 $dur =
new ilDurationInputGUI($this->lng->txt(
"reg_access_limitation_mode_relative_target"),
"rel_date");
888 $dur->setShowMonths(
true);
889 $dur->setShowDays(
true);
890 $dur->setShowHours(
false);
891 $dur->setShowMinutes(
false);
892 $opt->addSubItem($dur);
894 $this->form_gui->addCommandButton(
'createCodes', $this->lng->txt(
'create'));
895 $this->form_gui->addCommandButton(
'listCodes', $this->lng->txt(
'cancel'));
901 $q = $_REQUEST[
"term"];
902 include_once(
"./Services/AccessControl/classes/class.ilRoleAutoComplete.php");
912 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
913 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
921 $limit = $this->form_gui->getItemByPostVar(
"reg_limit");
922 $limit->setValue(
"none");
924 $this->tpl->setContent($this->form_gui->getHTML());
929 global $ilAccess,
$ilErr, $rbacreview;
931 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
932 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
938 $valid = $this->form_gui->checkInput();
940 $number = $this->form_gui->getInput(
'reg_codes_number');
941 $role = $this->form_gui->getInput(
'reg_codes_role');
942 $local = $this->form_gui->getInput(
"reg_codes_local");
944 if (is_array($local)) {
946 foreach (array_unique($local) as $item) {
948 $role_id = $rbacreview->roleExists($item);
950 $role_ids[] = $role_id;
954 if (
sizeof($role_ids)) {
960 $limit = $this->form_gui->getInput(
"reg_limit");
963 $date_input = $this->form_gui->getItemByPostVar(
"abs_date");
965 if ($date <
date(
"Y-m-d")) {
966 $date_input->setAlert($this->lng->txt(
"form_msg_wrong_date"));
972 $date = $this->form_gui->getInput(
"rel_date");
973 if (!array_sum($date)) {
978 "m" => $date[
"MM"]%12,
979 "y" => floor($date[
"MM"]/12)
991 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
994 for ($loop = 1; $loop <= $number; $loop++) {
995 $code_types = (
array) $this->form_gui->getInput(
'code_type');
1003 in_array(self::CODE_TYPE_REGISTRATION, $code_types) ?
true :
false,
1004 in_array(self::CODE_TYPE_EXTENSION, $code_types) ?
true :
false 1009 $this->ctrl->redirect($this,
"listCodes");
1011 $this->form_gui->setValuesByPost();
1012 $this->tpl->setContent($this->form_gui->getHtml());
1018 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1022 $this->ctrl->redirect($this,
"listCodes");
1029 if (!isset(
$_POST[
"id"])) {
1030 $ilErr->raiseError($this->lng->txt(
"no_checkbox"), $ilErr->MESSAGE);
1035 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1037 $gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
1038 $gui->setCancel($this->lng->txt(
"cancel"),
"listCodes");
1039 $gui->setConfirm($this->lng->txt(
"confirm"),
"deleteCodes");
1040 $gui->setFormAction($this->ctrl->getFormAction($this,
"deleteCodes"));
1042 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1045 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
1048 $this->tpl->setContent($gui->getHTML());
1053 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1055 $utab->resetOffset();
1056 $utab->resetFilter();
1063 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1065 $utab->resetOffset();
1066 $utab->writeFilterToSession();
1073 global $ilAccess,
$ilErr;
1075 if (!$ilAccess->checkAccess(
'read',
'', $this->ref_id)) {
1076 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
1079 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1082 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1085 if (
sizeof($codes)) {
1086 ilUtil::deliverData(implode(
"\r\n", $codes),
"ilias_registration_codes_" .
date(
"d-m-Y") .
".txt",
"text/plain");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
__prepareAutomaticRoleList()
__prepareDateSelect($a_unix_time)
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.
__parseRoleList($roles, $url)
editRoleAccessLimitations()
if(isset($_REQUEST['delete'])) $list
This class represents an option in a checkbox group.
const IL_REG_ACCESS_LIMITATION_OUT_OF_DATE
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static deleteCodes(array $ids)
const CODE_TYPE_REGISTRATION
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $id
static getList($a_str)
Get completion list.
__prepareAccessLimitationRoleList()
static checkFreetype()
Check whether captcha support is active.
static _lookupTitle($a_id)
lookup object title
const REG_HASH_LIFETIME_MIN_VALUE
const IL_REG_MISSING_ROLE
setInfo($a_info)
Set Info.
setSubTabs($activeTab='registration_settings')
set sub tabs
getLocalRoleAutoComplete()
static create($role, $stamp, $local_roles, $limit, $limit_date, $reg_type, $ext_type)
static loadCodesByIds(array $ids)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const IL_REG_MISSING_DOMAIN
Class class.ilregistrationEmailRoleAssignments.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
setSize($a_size)
Set Size.
This class represents a text property in a property form.
Class ilRegistrationSettingsGUI.
TableGUI class for registration codes.
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
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__buildAccessLimitationSelection($a_role_id)
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.
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.
saveRoleAccessLimitations()
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
const CODE_TYPE_EXTENSION
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
__initRoleAccessLimitations()
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.
__buildRoleSelection($assignment_id)