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();
83 function setSubTabs($activeTab =
'registration_settings')
87 $ilTabs->addSubTab(
"registration_settings",
88 $lng->txt(
"registration_tab_settings"),
89 $this->ctrl->getLinkTarget($this,
'view'));
91 $ilTabs->addSubTab(
"registration_codes",
92 $lng->txt(
"registration_tab_codes"),
93 $this->ctrl->getLinkTarget($this,
'listCodes'));
95 $ilTabs->activateSubTab($activeTab);
100 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
103 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'save'));
104 $this->form_gui->setTitle($this->lng->txt(
'reg_settings_header'));
109 $option->
setInfo($this->lng->txt(
'reg_direct_info'));
110 $cd =
new ilCheckboxInputGUI($this->lng->txt(
'reg_allow_codes'),
'reg_codes_'.IL_REG_DIRECT);
111 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
112 $option->addSubItem($cd);
113 $reg_type->addOption($option);
115 $option->
setInfo($this->lng->txt(
'reg_approve_info'));
116 $cd =
new ilCheckboxInputGUI($this->lng->txt(
'reg_allow_codes'),
'reg_codes_'.IL_REG_APPROVE);
117 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
118 $option->addSubItem($cd);
119 $reg_type->addOption($option);
121 $option->
setInfo($this->lng->txt(
'reg_type_confirmation_info'));
122 $lt =
new ilNumberInputGUI($this->lng->txt(
'reg_confirmation_hash_life_time'),
'reg_hash_life_time');
124 $lt->setMaxLength(6);
126 $lt->setRequired(
true);
127 $lt->setInfo($this->lng->txt(
'reg_confirmation_hash_life_time_info'));
128 $lt->setSuffix($this->lng->txt(
'seconds'));
129 $option->addSubItem($lt);
130 $cd =
new ilCheckboxInputGUI($this->lng->txt(
'reg_allow_codes'),
'reg_codes_'.IL_REG_ACTIVATION);
131 $cd->
setInfo($this->lng->txt(
'reg_allow_codes_info'));
132 $option->addSubItem($cd);
133 $reg_type->addOption($option);
135 $option->
setInfo($this->lng->txt(
'registration_reg_type_codes_info'));
136 $reg_type->addOption($option);
137 $this->form_gui->addItem($reg_type);
141 $pwd_gen->setInfo($this->lng->txt(
'reg_info_pwd'));
142 $this->form_gui->addItem($pwd_gen);
144 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
145 $cap =
new ilCheckboxInputGUI($this->lng->txt(
'adm_captcha_anonymous_short'),
'activate_captcha_anonym');
146 $cap->
setInfo($this->lng->txt(
'adm_captcha_anonymous_reg'));
150 $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
152 $this->form_gui->addItem($cap);
154 $approver =
new ilTextInputGUI($this->lng->txt(
'reg_notification'),
'reg_approver');
156 $approver->setMaxLength(50);
157 $approver->setInfo($this->lng->txt(
'reg_notification_info'));
158 $this->form_gui->addItem($approver);
163 $edit = $this->ctrl->getLinkTarget($this,
'editRoles');
166 $roles->addOption($option);
169 $edit = $this->ctrl->getLinkTarget($this,
'editEmailAssignments');
172 $roles->addOption($option);
173 $roles->setInfo($this->lng->txt(
'registration_codes_override_global_info'));
174 $this->form_gui->addItem($roles);
176 $limit =
new ilCheckboxInputGUI($this->lng->txt(
'reg_access_limitations'),
'reg_access_limitation');
179 $edit = $this->ctrl->getLinkTarget($this,
'editRoleAccessLimitations');
181 $list->
setInfo($this->lng->txt(
'registration_codes_override_global_info'));
182 $limit->addSubItem($list);
183 $this->form_gui->addItem($limit);
185 $domains =
new ilTextInputGUI($this->lng->txt(
'reg_allowed_domains'),
'reg_allowed_domains');
186 $domains->
setInfo($this->lng->txt(
'reg_allowed_domains_info'));
187 $this->form_gui->addItem($domains);
189 $this->form_gui->addCommandButton(
'save', $this->lng->txt(
'save'));
194 if($this->registration_settings->roleSelectionEnabled())
198 else if ($this->registration_settings->automaticRoleAssignmentEnabled())
203 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
205 'reg_type' => $this->registration_settings->getRegistrationType(),
206 'reg_hash_life_time' => (int)$this->registration_settings->getRegistrationHashLifetime(),
207 'reg_pwd' => $this->registration_settings->passwordGenerationEnabled(),
208 'reg_approver' => $this->registration_settings->getApproveRecipientLogins(),
209 'reg_role_type' => $role_type,
210 'reg_access_limitation' => $this->registration_settings->getAccessLimitation(),
211 'reg_allowed_domains' => implode(
';', $this->registration_settings->getAllowedDomains()),
212 'activate_captcha_anonym' => ilCaptchaUtil::isActiveForRegistration()
215 $allow_codes = $this->registration_settings->getAllowCodes();
216 $reg_type = $this->registration_settings->getRegistrationType();
219 $values[
'reg_codes_'.$reg_type] =
true;
222 $this->form_gui->setValuesByArray($values);
229 if(!$ilAccess->checkAccess(
'read',
'',$this->ref_id))
231 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
237 $ilCtrl->setParameterByClass(
"ilobjuserfoldergui",
"ref_id",
USER_FOLDER_ID);
238 $ilToolbar->addButton($this->lng->txt(
'registration_user_new_account_mail'),
239 $ilCtrl->getLinkTargetByClass(
array(
"iladministrationgui",
"ilobjuserfoldergui"),
"newAccountMail"));
240 $ilCtrl->setParameterByClass(
"ilobjuserfoldergui",
"ref_id",
$_GET[
"ref_id"]);
244 $this->tpl->setContent($this->form_gui->getHTML());
251 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
253 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
256 $this->registration_settings->setRegistrationType((
int)
$_POST[
'reg_type']);
257 $this->registration_settings->setPasswordGenerationStatus((
int) $_POST[
'reg_pwd']);
258 $this->registration_settings->setApproveRecipientLogins(
ilUtil::stripSlashes($_POST[
'reg_approver']));
259 $this->registration_settings->setRoleType((
int) $_POST[
'reg_role_type']);
260 $this->registration_settings->setAccessLimitation((
int) $_POST[
'reg_access_limitation']);
261 $this->registration_settings->setAllowedDomains($_POST[
'reg_allowed_domains']);
263 $allow_codes =
false;
266 $allow_codes = (bool)$_POST[
'reg_codes_'.(
int)$_POST[
'reg_type']];
268 $this->registration_settings->setAllowCodes($allow_codes);
270 if(!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (
int)$_POST[
'reg_hash_life_time']))
275 if($error_code = $this->registration_settings->validate())
281 ilUtil::sendFailure($this->lng->txt(
'reg_unknown_recipients').
' '.$this->registration_settings->getUnknown());
287 ilUtil::sendFailure($this->lng->txt(
'reg_approve_needs_recipient').
' '.$this->registration_settings->getUnknown());
294 require_once
'Services/Captcha/classes/class.ilCaptchaUtil.php';
295 ilCaptchaUtil::setActiveForRegistration((
bool)$_POST[
'activate_captcha_anonym']);
297 $this->registration_settings->save();
306 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
308 global $ilAccess,
$ilErr,$rbacreview;
310 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
312 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
315 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.edit_roles.html',
'Services/Registration');
317 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
318 $this->tpl->setVariable(
"TXT_SELECTABLE_ROLES",$this->lng->txt(
'reg_selectable_roles'));
320 $this->tpl->setVariable(
"ACTIONS",$this->lng->txt(
'actions'));
321 $this->tpl->setVariable(
"UPDATE",$this->lng->txt(
'save'));
322 $this->tpl->setVariable(
"CANCEL",$this->lng->txt(
'cancel'));
325 foreach($rbacreview->getGlobalRoles() as $role)
327 if($role == SYSTEM_ROLE_ID
or $role == ANONYMOUS_ROLE_ID)
331 $this->tpl->setCurrentBlock(
"roles");
337 $this->tpl->parseCurrentBlock();
344 global $ilAccess,
$ilErr,$rbacreview;
346 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
348 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
351 if(count(
$_POST[
'roles']) < 1)
358 foreach($rbacreview->getGlobalRoles() as $role)
362 $role_obj->setAllowRegister(
$_POST[
'roles'][$role] ? 1 : 0);
375 global $ilAccess,
$ilErr,$rbacreview;
377 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
379 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
384 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.reg_email_role_assignments.html',
'Services/Registration');
385 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
386 $this->tpl->setVariable(
"TXT_EMAIL_ROLE_ASSIGN",$this->lng->txt(
'reg_email_role_assignment'));
387 $this->tpl->setVariable(
"TXT_MAIL",$this->lng->txt(
'reg_email'));
388 $this->tpl->setVariable(
"TXT_ROLE",$this->lng->txt(
'obj_role'));
389 $this->tpl->setVariable(
"TXT_DEFAULT",$this->lng->txt(
'reg_default'));
391 $this->tpl->setVariable(
"TXT_DOMAIN",$this->lng->txt(
'reg_domain'));
394 $this->tpl->setVariable(
"BTN_DELETE",$this->lng->txt(
'delete'));
395 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
396 $this->tpl->setVariable(
"BTN_ADD",$this->lng->txt(
'reg_add_assignment'));
397 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
400 foreach($this->assignments_obj->getAssignments() as $assignment)
402 $this->tpl->setCurrentBlock(
"roles");
404 $this->tpl->setVariable(
"ASSIGN_ID",$assignment[
'id']);
405 $this->tpl->setVariable(
"DOMAIN",$assignment[
'domain']);
408 $this->tpl->parseCurrentBlock();
412 $this->tpl->setVariable(
"TXT_DEFAULT",$this->lng->txt(
'default'));
420 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
422 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
427 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.reg_role_access_limitations.html',
'Services/Registration');
429 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
430 $this->tpl->setVariable(
"TXT_REG_ROLE_ACCESS_LIMITATIONS",$lng->txt(
'reg_role_access_limitations'));
431 $this->tpl->setVariable(
"TXT_ROLE",$lng->txt(
'obj_role'));
432 $this->tpl->setVariable(
"TXT_ACCESS_LIMITATION_MODE",$lng->txt(
'reg_access_limitation_mode'));
434 $this->tpl->setVariable(
"BTN_SAVE",$lng->txt(
'save'));
435 $this->tpl->setVariable(
"BTN_CANCEL",$lng->txt(
'cancel'));
438 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
442 $this->tpl->setCurrentBlock(
"roles");
444 $this->tpl->setVariable(
"ROLE_ID",$role[
'id']);
445 $this->tpl->setVariable(
"ROLE_TITLE",$role[
'title']);
447 $this->tpl->setVariable(
"CSS_DISPLAY_ABSOLUTE",($this->access_limitations_obj->getMode($role[
'id']) ==
'absolute') ?
'inline' :
'none');
448 $this->tpl->setVariable(
"CSS_DISPLAY_RELATIVE",($this->access_limitations_obj->getMode($role[
'id']) ==
'relative') ?
'inline' :
'none');
449 $this->tpl->setVariable(
"CSS_DISPLAY_UNLIMITED",($this->access_limitations_obj->getMode($role[
'id']) ==
'unlimited') ?
'inline' :
'none');
450 $this->tpl->setVariable(
"TXT_ACCESS_LIMITATION_UNLIMITED", $lng->txt(
'reg_access_limitation_none'));
452 $date = $this->
__prepareDateSelect($this->access_limitations_obj->getAbsolute($role[
'id']));
453 $this->tpl->setVariable(
"SEL_ACCESS_LIMITATION_ABSOLUTE",
ilUtil::makeDateSelect(
'access_limitation_absolute_'.$role[
'id'],$date[
'y'],$date[
'm'],$date[
'd'],
'2007'));
455 $this->tpl->setVariable(
"TXT_DAYS",$lng->txt(
'days'));
456 $this->tpl->setVariable(
"TXT_MONTHS",$lng->txt(
'months'));
457 $this->tpl->setVariable(
"TXT_YEARS",$lng->txt(
'years'));
459 $this->tpl->setVariable(
"DAYS",$this->access_limitations_obj->getRelative($role[
'id'],
'd'));
460 $this->tpl->setVariable(
"MONTHS",$this->access_limitations_obj->getRelative($role[
'id'],
'm'));
461 $this->tpl->setVariable(
"YEARS",$this->access_limitations_obj->getRelative($role[
'id'],
'y'));
462 $this->tpl->parseCurrentBlock();
468 global $ilAccess,
$ilErr,$rbacreview;
470 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
472 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
476 $this->assignments_obj->add();
486 global $ilAccess,
$ilErr,$rbacreview;
488 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
490 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
493 if(!count(
$_POST[
'del_assign']))
502 foreach(
$_POST[
'del_assign'] as $assignment_id)
504 $this->assignments_obj->delete($assignment_id);
515 global $ilAccess,
$ilErr,$rbacreview;
517 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
519 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
524 if (!is_array(
$_POST[
'domain']))
534 $this->assignments_obj->setDefaultRole((
int)
$_POST[
'default_role']);
536 if($err = $this->assignments_obj->validate())
553 $this->assignments_obj->save();
561 global $ilAccess,
$ilErr,$rbacreview;
563 if(!$ilAccess->checkAccess(
'write',
'',$this->ref_id))
565 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),$ilErr->MESSAGE);
570 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
572 $this->access_limitations_obj->resetAccessLimitations();
575 $this->access_limitations_obj->setMode(
$_POST[
'access_limitation_mode_'.$role[
'id']],$role[
'id']);
576 $this->access_limitations_obj->setAbsolute(
$_POST[
'access_limitation_absolute_'.$role[
'id']],$role[
'id']);
577 $this->access_limitations_obj->setRelative(
$_POST[
'access_limitation_relative_'.$role[
'id']],$role[
'id']);
580 if($err = $this->access_limitations_obj->validate())
597 $this->access_limitations_obj->save();
605 $tpl =
new ilTemplate(
'tpl.registration_roles.html',
true,
true,
'Services/Registration');
607 $tpl->setVariable(
"EDIT", $this->lng->txt(
"edit"));
608 $tpl->setVariable(
"LINK_EDIT",
$url);
610 if (is_array($roles) &&
sizeof($roles))
612 foreach($roles as $role)
614 $tpl->setCurrentBlock(
"list_item");
615 $tpl->setVariable(
"LIST_ITEM_ITEM", $role);
616 $tpl->parseCurrentBlock();
621 $tpl->setVariable(
"NONE", $this->lng->txt(
'none'));
629 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
634 $all[] = $role[
'title'];
641 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
645 foreach($this->assignments_obj->getAssignments() as $assignment)
647 if(strlen($assignment[
'domain'])
and $assignment[
'role'])
653 if(strlen($this->assignments_obj->getDefaultRole()))
655 $all[] = $this->lng->txt(
'reg_default').
' -> '.
ilObjRole::_lookupTitle($this->assignments_obj->getDefaultRole());
667 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
672 switch ($this->access_limitations_obj->getMode($role[
'id']))
675 $txt_access_value = $lng->txt(
'reg_access_limitation_limited_until');
676 $txt_access_value .=
" ".ilDatePresentation::formatDate(
new ilDateTime($this->access_limitations_obj->getAbsolute($role[
'id'],
IL_CAL_UNIX)));
680 $years = $this->access_limitations_obj->getRelative($role[
'id'],
'y');
681 $months = $this->access_limitations_obj->getRelative($role[
'id'],
'm');
682 $days = $this->access_limitations_obj->getRelative($role[
'id'],
'd');
684 $txt_access_value = $lng->txt(
'reg_access_limitation_limited_time').
" ";
688 $txt_access_value .=
$years.
" ";
689 $txt_access_value .= (
$years == 1) ? $lng->txt(
'year') : $lng->txt(
'years');
695 $txt_access_value .=
", ";
699 $txt_access_value .=
" ".$lng->txt(
'and').
" ";
704 $txt_access_value .=
" ".$lng->txt(
'and').
" ";
710 $txt_access_value .= $months.
" ";
711 $txt_access_value .= ($months == 1) ? $lng->txt(
'month') : $lng->txt(
'months');
715 $txt_access_value .=
" ".$lng->txt(
'and').
" ";
721 $txt_access_value .= $days.
" ";
722 $txt_access_value .= ($days == 1) ? $lng->txt(
'day') : $lng->txt(
'days');
727 $txt_access_value = $lng->txt(
'reg_access_limitation_none');
731 $all[] = $role[
'title'].
' ('.$txt_access_value.
')';
739 if(is_object($this->assignments_obj))
744 include_once
'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
751 if(is_object($this->access_limitations_obj))
756 include_once
'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
763 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
767 $assignments = $this->assignments_obj->getAssignments();
768 $selected = ($assignment_id > 0) ?
769 $assignments[$assignment_id][
'role'] :
770 $this->assignments_obj->getDefaultRole();
774 $roles[0] = $this->lng->txt(
'please_choose');
777 foreach($rbacreview->getGlobalRoles() as $role_id)
779 if($role_id == ANONYMOUS_ROLE_ID)
786 if($assignment_id > 0)
789 "role[$assignment_id][role]",
805 'null' => $lng->txt(
'please_choose'),
806 'unlimited' => $lng->txt(
'reg_access_limitation_mode_unlimited'),
807 'absolute' => $lng->txt(
'reg_access_limitation_mode_absolute'),
808 'relative' => $lng->txt(
'reg_access_limitation_mode_relative')
811 $attribs =
array(
'onchange' =>
'displayAccessLimitationSelectionForm(document.cmd.access_limitation_mode_'.$a_role_id.
','.$a_role_id.
')');
813 $selected = $this->access_limitations_obj->getMode($a_role_id);
823 $a_unix_time =
time();
826 return array(
'y' =>
date(
'Y',$a_unix_time),
827 'm' =>
date(
'n',$a_unix_time),
828 'd' =>
date(
'd',$a_unix_time));
835 if(!$ilAccess->checkAccess(
'read',
'',$this->ref_id))
837 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"),$ilErr->MESSAGE);
842 $ilToolbar->addButton($this->lng->txt(
"registration_codes_add"),
843 $this->ctrl->getLinkTarget($this,
"addCodes"));
845 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
847 $this->tpl->setContent($ctab->getHTML());
852 global $rbacreview, $ilObjDataCache,
$lng;
854 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
857 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'createCodes'));
858 $this->form_gui->setTitle($this->lng->txt(
'registration_codes_edit_header'));
860 $count =
new ilNumberInputGUI($this->lng->txt(
'registration_codes_number'),
'reg_codes_number');
862 $count->setMaxLength(4);
863 $count->setMinValue(1);
864 $count->setMaxValue(1000);
865 $count->setRequired(
true);
866 $this->form_gui->addItem($count);
872 $code_type->addOption(
874 $this->lng->txt(
'registration_codes_type_reg'),
875 self::CODE_TYPE_REGISTRATION,
876 $this->lng->txt(
'registration_codes_type_reg_info'))
878 $code_type->addOption(
880 $this->lng->txt(
'registration_codes_type_ext'),
881 self::CODE_TYPE_EXTENSION,
882 $this->lng->txt(
'registration_codes_type_ext_info'))
884 $this->form_gui->addItem($code_type);
888 $sec->setTitle($this->lng->txt(
'registration_codes_roles_title'));
889 $this->form_gui->addItem($sec);
891 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
892 $options =
array(
"" => $this->lng->txt(
'registration_codes_no_assigned_role'));
893 foreach($rbacreview->getGlobalRoles() as $role_id)
895 if(!in_array($role_id,
array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
897 $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
900 $roles =
new ilSelectInputGUI($this->lng->txt(
"registration_codes_roles"),
"reg_codes_role");
901 $roles->
setInfo($this->lng->txt(
"registration_codes_override_info"));
903 $this->form_gui->addItem($roles);
905 $local =
new ilTextInputGUI($this->lng->txt(
"registration_codes_roles_local"),
"reg_codes_local");
907 $local->setDataSource($this->ctrl->getLinkTarget($this,
"getLocalRoleAutoComplete",
"",
true));
908 $this->form_gui->addItem($local);
912 $sec->setTitle($this->lng->txt(
'reg_access_limitations'));
913 $this->form_gui->addItem($sec);
916 $limit->
setInfo($this->lng->txt(
"registration_codes_override_info"));
917 $this->form_gui->addItem($limit);
919 $opt =
new ilRadioOption($this->lng->txt(
"registration_codes_roles_limitation_none"),
"none");
920 $limit->addOption($opt);
922 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_none"),
"unlimited");
923 $limit->addOption($opt);
925 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_mode_absolute"),
"absolute");
926 $limit->addOption($opt);
928 $dt =
new ilDateTimeInputGUI($this->lng->txt(
"reg_access_limitation_mode_absolute_target"),
"abs_date");
930 $opt->addSubItem($dt);
932 $opt =
new ilRadioOption($this->lng->txt(
"reg_access_limitation_mode_relative"),
"relative");
933 $limit->addOption($opt);
935 $dur =
new ilDurationInputGUI($this->lng->txt(
"reg_access_limitation_mode_relative_target"),
"rel_date");
937 $dur->setShowMonths(
true);
938 $dur->setShowDays(
true);
939 $dur->setShowHours(
false);
940 $dur->setShowMinutes(
false);
941 $opt->addSubItem($dur);
943 $this->form_gui->addCommandButton(
'createCodes', $this->lng->txt(
'create'));
944 $this->form_gui->addCommandButton(
'listCodes',$this->lng->txt(
'cancel'));
950 $q = $_REQUEST[
"term"];
951 include_once(
"./Services/AccessControl/classes/class.ilRoleAutoComplete.php");
961 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
963 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
971 $limit = $this->form_gui->getItemByPostVar(
"reg_limit");
972 $limit->setValue(
"none");
974 $this->tpl->setContent($this->form_gui->getHTML());
979 global $ilAccess,
$ilErr, $rbacreview;
981 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
983 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"), $ilErr->MESSAGE);
989 $valid = $this->form_gui->checkInput();
992 $number = $this->form_gui->getInput(
'reg_codes_number');
993 $role = $this->form_gui->getInput(
'reg_codes_role');
994 $local = $this->form_gui->getInput(
"reg_codes_local");
999 foreach(array_unique($local) as $item)
1003 $role_id = $rbacreview->roleExists($item);
1006 $role_ids[] = $role_id;
1010 if(
sizeof($role_ids))
1017 $limit = $this->form_gui->getInput(
"reg_limit");
1021 $date_input = $this->form_gui->getItemByPostVar(
"abs_date");
1023 if($date <
date(
"Y-m-d"))
1025 $date_input->setAlert($this->lng->txt(
"form_msg_wrong_date"));
1031 $date = $this->form_gui->getInput(
"rel_date");
1032 if(!array_sum($date))
1040 "m" => $date[
"MM"]%12,
1041 "y" => floor($date[
"MM"]/12)
1054 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1057 for($loop = 1; $loop <= $number; $loop++)
1059 $code_types = (
array) $this->form_gui->getInput(
'code_type');
1067 in_array(self::CODE_TYPE_REGISTRATION, $code_types) ? TRUE : FALSE,
1068 in_array(self::CODE_TYPE_EXTENSION, $code_types) ? TRUE : FALSE
1073 $this->ctrl->redirect($this,
"listCodes");
1077 $this->form_gui->setValuesByPost();
1078 $this->tpl->setContent($this->form_gui->getHtml());
1084 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1088 $this->ctrl->redirect($this,
"listCodes");
1097 $ilErr->raiseError($this->lng->txt(
"no_checkbox"), $ilErr->MESSAGE);
1102 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
1104 $gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
1105 $gui->setCancel($this->lng->txt(
"cancel"),
"listCodes");
1106 $gui->setConfirm($this->lng->txt(
"confirm"),
"deleteCodes");
1107 $gui->setFormAction($this->ctrl->getFormAction($this,
"deleteCodes"));
1109 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
1113 $gui->addItem(
"id[]", $code[
"code_id"], $code[
"code"]);
1116 $this->tpl->setContent($gui->getHTML());
1121 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1123 $utab->resetOffset();
1124 $utab->resetFilter();
1131 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1133 $utab->resetOffset();
1134 $utab->writeFilterToSession();
1141 global $ilAccess,
$ilErr;
1143 if(!$ilAccess->checkAccess(
'read',
'', $this->ref_id))
1145 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"), $ilErr->MESSAGE);
1148 include_once(
"./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1151 include_once
'./Services/Registration/classes/class.ilRegistrationCode.php';
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()
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 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)
if(!is_array($argv)) $options
static loadCodesByIds(array $ids)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
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.
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)
Class ilObjAuthSettingsGUI.
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
Confirmation screen class.
__buildRoleSelection($assignment_id)