ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilRegistrationSettingsGUI Class Reference

Class ilRegistrationSettingsGUI. More...

+ Collaboration diagram for ilRegistrationSettingsGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 setSubTabs ($activeTab='registration_settings')
 set sub tabs More...
 
 initForm ()
 
 initFormValues ()
 
 view ()
 
 save ()
 
 editRoles ()
 
 updateRoles ()
 
 editEmailAssignments ()
 
 editRoleAccessLimitations ()
 
 addAssignment ()
 
 deleteAssignment ()
 
 saveAssignment ()
 
 saveRoleAccessLimitations ()
 
 __parseRoleList ($roles, $url)
 
 __prepareRoleList ()
 
 __prepareAutomaticRoleList ()
 
 __prepareAccessLimitationRoleList ()
 
 __initRoleAssignments ()
 
 __initRoleAccessLimitations ()
 
 __buildRoleSelection ($assignment_id)
 
 __buildAccessLimitationSelection ($a_role_id)
 
 __prepareDateSelect ($a_unix_time)
 
 listCodes ()
 
 initAddCodesForm ()
 
 getLocalRoleAutoComplete ()
 
 addCodes ()
 
 createCodes ()
 
 deleteCodes ()
 
 deleteConfirmation ()
 
 resetCodesFilter ()
 
 applyCodesFilter ()
 
 exportCodes ()
 

Data Fields

const CODE_TYPE_REGISTRATION = 1
 
const CODE_TYPE_EXTENSION = 2
 
 $ctrl
 
 $tpl
 
 $ref_id
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilRegistrationSettingsGUI::__construct ( )

Definition at line 45 of file class.ilRegistrationSettingsGUI.php.

References $_GET, $ilCtrl, $lng, and $tpl.

46  {
47  global $ilCtrl,$tpl,$lng;
48 
49  $this->tpl = $tpl;
50  $this->ctrl = $ilCtrl;
51 
52  $this->lng = $lng;
53  $this->lng->loadLanguageModule('administration');
54  $this->lng->loadLanguageModule('registration');
55  $this->lng->loadLanguageModule('user');
56 
57  $this->ref_id = (int) $_GET['ref_id'];
58 
59  $this->registration_settings = new ilRegistrationSettings();
60  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17

Member Function Documentation

◆ __buildAccessLimitationSelection()

ilRegistrationSettingsGUI::__buildAccessLimitationSelection (   $a_role_id)

Definition at line 752 of file class.ilRegistrationSettingsGUI.php.

References $lng, $options, array, and ilUtil\formSelect().

Referenced by editRoleAccessLimitations().

753  {
754  global $lng;
755 
756  $options = array(
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')
761  );
762 
763  $attribs = array('onchange' => 'displayAccessLimitationSelectionForm(document.cmd.access_limitation_mode_' . $a_role_id . ',' . $a_role_id . ')');
764 
765  $selected = $this->access_limitations_obj->getMode($a_role_id);
766 
767  return ilUtil::formSelect($selected, 'access_limitation_mode_' . $a_role_id, $options, false, true, 0, "", $attribs);
768  }
Create styles array
The data for the language used.
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.
global $lng
Definition: privfeed.php:17
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __buildRoleSelection()

ilRegistrationSettingsGUI::__buildRoleSelection (   $assignment_id)

Definition at line 711 of file class.ilRegistrationSettingsGUI.php.

References ilObject\_lookupTitle(), and ilUtil\formSelect().

Referenced by editEmailAssignments().

712  {
713  include_once './Services/AccessControl/classes/class.ilObjRole.php';
714 
715  global $rbacreview;
716 
717  $assignments = $this->assignments_obj->getAssignments();
718  $selected = ($assignment_id > 0) ?
719  $assignments[$assignment_id]['role'] :
720  $this->assignments_obj->getDefaultRole();
721 
722  if (!$selected) {
723  $roles[0] = $this->lng->txt('please_choose');
724  }
725 
726  foreach ($rbacreview->getGlobalRoles() as $role_id) {
727  if ($role_id == ANONYMOUS_ROLE_ID) {
728  continue;
729  }
730  $roles[$role_id] = ilObjRole::_lookupTitle($role_id);
731  }
732 
733  if ($assignment_id > 0) {
734  return ilUtil::formSelect(
735  $selected,
736  "role[$assignment_id][role]",
737  $roles,
738  false,
739  true
740  );
741  } else {
742  return ilUtil::formSelect(
743  $selected,
744  "default_role",
745  $roles,
746  false,
747  true
748  );
749  }
750  }
static _lookupTitle($a_id)
lookup object title
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __initRoleAccessLimitations()

ilRegistrationSettingsGUI::__initRoleAccessLimitations ( )

Definition at line 700 of file class.ilRegistrationSettingsGUI.php.

Referenced by __prepareAccessLimitationRoleList(), editRoleAccessLimitations(), and saveRoleAccessLimitations().

701  {
702  if (is_object($this->access_limitations_obj)) {
703  return true;
704  }
705 
706  include_once 'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
707 
708  $this->access_limitations_obj = new ilRegistrationRoleAccessLimitations();
709  }
+ Here is the caller graph for this function:

◆ __initRoleAssignments()

ilRegistrationSettingsGUI::__initRoleAssignments ( )

Definition at line 689 of file class.ilRegistrationSettingsGUI.php.

Referenced by __prepareAutomaticRoleList(), addAssignment(), deleteAssignment(), editEmailAssignments(), and saveAssignment().

690  {
691  if (is_object($this->assignments_obj)) {
692  return true;
693  }
694 
695  include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
696 
697  $this->assignments_obj = new ilRegistrationRoleAssignments();
698  }
+ Here is the caller graph for this function:

◆ __parseRoleList()

ilRegistrationSettingsGUI::__parseRoleList (   $roles,
  $url 
)

Definition at line 575 of file class.ilRegistrationSettingsGUI.php.

References $tpl, and $url.

Referenced by initForm().

576  {
577  $tpl = new ilTemplate('tpl.registration_roles.html', true, true, 'Services/Registration');
578 
579  $tpl->setVariable("EDIT", $this->lng->txt("edit"));
580  $tpl->setVariable("LINK_EDIT", $url);
581 
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();
587  }
588  } else {
589  $tpl->setVariable("NONE", $this->lng->txt('none'));
590  }
591 
592  return $tpl->get();
593  }
special template class to simplify handling of ITX/PEAR
$url
+ Here is the caller graph for this function:

◆ __prepareAccessLimitationRoleList()

ilRegistrationSettingsGUI::__prepareAccessLimitationRoleList ( )

Definition at line 625 of file class.ilRegistrationSettingsGUI.php.

References $lng, $years, __initRoleAccessLimitations(), ilObjRole\_lookupRegisterAllowed(), array, ilDatePresentation\formatDate(), and IL_CAL_UNIX.

Referenced by initForm().

626  {
627  global $lng;
628 
630 
631  include_once './Services/AccessControl/classes/class.ilObjRole.php';
632 
633  $all = array();
634  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
635  switch ($this->access_limitations_obj->getMode($role['id'])) {
636  case 'absolute':
637  $txt_access_value = $lng->txt('reg_access_limitation_limited_until');
638  $txt_access_value .= " " . ilDatePresentation::formatDate(new ilDateTime($this->access_limitations_obj->getAbsolute($role['id'], IL_CAL_UNIX)));
639  break;
640 
641  case 'relative':
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');
645 
646  $txt_access_value = $lng->txt('reg_access_limitation_limited_time') . " ";
647 
648  if ($years) {
649  $txt_access_value .= $years . " ";
650  $txt_access_value .= ($years == 1) ? $lng->txt('year') : $lng->txt('years');
651 
652  if ($months) {
653  if ($days) {
654  $txt_access_value .= ", ";
655  } else {
656  $txt_access_value .= " " . $lng->txt('and') . " ";
657  }
658  } elseif ($days) {
659  $txt_access_value .= " " . $lng->txt('and') . " ";
660  }
661  }
662 
663  if ($months) {
664  $txt_access_value .= $months . " ";
665  $txt_access_value .= ($months == 1) ? $lng->txt('month') : $lng->txt('months');
666 
667  if ($days) {
668  $txt_access_value .= " " . $lng->txt('and') . " ";
669  }
670  }
671 
672  if ($days) {
673  $txt_access_value .= $days . " ";
674  $txt_access_value .= ($days == 1) ? $lng->txt('day') : $lng->txt('days');
675  }
676  break;
677 
678  default:
679  $txt_access_value = $lng->txt('reg_access_limitation_none');
680  break;
681  }
682 
683  $all[] = $role['title'] . ' (' . $txt_access_value . ')';
684  }
685 
686  return $all;
687  }
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
const IL_CAL_UNIX
Date and time handling
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __prepareAutomaticRoleList()

ilRegistrationSettingsGUI::__prepareAutomaticRoleList ( )

Definition at line 606 of file class.ilRegistrationSettingsGUI.php.

References __initRoleAssignments(), ilObject\_lookupTitle(), and array.

Referenced by initForm().

607  {
608  include_once './Services/AccessControl/classes/class.ilObjRole.php';
609  $this->__initRoleAssignments();
610 
611  $all = array();
612  foreach ($this->assignments_obj->getAssignments() as $assignment) {
613  if (strlen($assignment['domain']) and $assignment['role']) {
614  $all[] = $assignment['domain'] . ' -> ' . ilObjRole::_lookupTitle($assignment['role']);
615  }
616  }
617 
618  if (strlen($this->assignments_obj->getDefaultRole())) {
619  $all[] = $this->lng->txt('reg_default') . ' -> ' . ilObjRole::_lookupTitle($this->assignments_obj->getDefaultRole());
620  }
621 
622  return $all;
623  }
static _lookupTitle($a_id)
lookup object title
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __prepareDateSelect()

ilRegistrationSettingsGUI::__prepareDateSelect (   $a_unix_time)

Definition at line 770 of file class.ilRegistrationSettingsGUI.php.

References array, date, and time.

Referenced by editRoleAccessLimitations().

771  {
772  if (!$a_unix_time) {
773  $a_unix_time = time();
774  }
775 
776  return array('y' => date('Y', $a_unix_time),
777  'm' => date('n', $a_unix_time),
778  'd' => date('d', $a_unix_time));
779  }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the caller graph for this function:

◆ __prepareRoleList()

ilRegistrationSettingsGUI::__prepareRoleList ( )

Definition at line 595 of file class.ilRegistrationSettingsGUI.php.

References ilObjRole\_lookupRegisterAllowed(), and array.

Referenced by initForm().

596  {
597  include_once './Services/AccessControl/classes/class.ilObjRole.php';
598 
599  $all = array();
600  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
601  $all[] = $role['title'];
602  }
603  return $all;
604  }
static _lookupRegisterAllowed()
get all roles that are activated in user registration
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addAssignment()

ilRegistrationSettingsGUI::addAssignment ( )

Definition at line 451 of file class.ilRegistrationSettingsGUI.php.

References $ilErr, __initRoleAssignments(), editEmailAssignments(), and ilUtil\sendSuccess().

452  {
453  global $ilAccess,$ilErr,$rbacreview;
454 
455  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
456  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
457  }
458 
459  $this->__initRoleAssignments();
460  $this->assignments_obj->add();
461 
462  ilUtil::sendSuccess($this->lng->txt('reg_added_assignment'));
463  $this->editEmailAssignments();
464 
465  return true;
466  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
+ Here is the call graph for this function:

◆ addCodes()

ilRegistrationSettingsGUI::addCodes ( )

Definition at line 908 of file class.ilRegistrationSettingsGUI.php.

References $ilErr, initAddCodesForm(), and setSubTabs().

909  {
910  global $ilAccess, $ilErr;
911 
912  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
913  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
914  }
915 
916  $this->setSubTabs('registration_codes');
917 
918  $this->initAddCodesForm();
919 
920  // default
921  $limit = $this->form_gui->getItemByPostVar("reg_limit");
922  $limit->setValue("none");
923 
924  $this->tpl->setContent($this->form_gui->getHTML());
925  }
global $ilErr
Definition: raiseError.php:16
setSubTabs($activeTab='registration_settings')
set sub tabs
+ Here is the call graph for this function:

◆ applyCodesFilter()

ilRegistrationSettingsGUI::applyCodesFilter ( )

Definition at line 1061 of file class.ilRegistrationSettingsGUI.php.

References listCodes().

1062  {
1063  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1064  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1065  $utab->resetOffset();
1066  $utab->writeFilterToSession();
1067 
1068  $this->listCodes();
1069  }
TableGUI class for registration codes.
+ Here is the call graph for this function:

◆ createCodes()

ilRegistrationSettingsGUI::createCodes ( )

Definition at line 927 of file class.ilRegistrationSettingsGUI.php.

References $ilErr, $valid, array, ilRegistrationCode\create(), date, IL_CAL_DATE, initAddCodesForm(), ilUtil\sendSuccess(), setSubTabs(), and time.

928  {
929  global $ilAccess, $ilErr, $rbacreview;
930 
931  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
932  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
933  }
934 
935  $this->setSubTabs('registration_codes');
936 
937  $this->initAddCodesForm();
938  $valid = $this->form_gui->checkInput();
939  if ($valid) {
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");
943 
944  if (is_array($local)) {
945  $role_ids = array();
946  foreach (array_unique($local) as $item) {
947  if (trim($item)) {
948  $role_id = $rbacreview->roleExists($item);
949  if ($role_id) {
950  $role_ids[] = $role_id;
951  }
952  }
953  }
954  if (sizeof($role_ids)) {
955  $local = $role_ids;
956  }
957  }
958 
959  $date = null;
960  $limit = $this->form_gui->getInput("reg_limit");
961  switch ($limit) {
962  case "absolute":
963  $date_input = $this->form_gui->getItemByPostVar("abs_date");
964  $date = $date_input->getDate()->get(IL_CAL_DATE);
965  if ($date < date("Y-m-d")) {
966  $date_input->setAlert($this->lng->txt("form_msg_wrong_date"));
967  $valid = false;
968  }
969  break;
970 
971  case "relative":
972  $date = $this->form_gui->getInput("rel_date");
973  if (!array_sum($date)) {
974  $valid = false;
975  } else {
976  $date = array(
977  "d" => $date["dd"],
978  "m" => $date["MM"]%12,
979  "y" => floor($date["MM"]/12)
980  );
981  }
982  break;
983 
984  case "none":
985  $limit = null;
986  break;
987  }
988  }
989 
990  if ($valid) {
991  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
992 
993  $stamp = time();
994  for ($loop = 1; $loop <= $number; $loop++) {
995  $code_types = (array) $this->form_gui->getInput('code_type');
996 
998  $role,
999  $stamp,
1000  $local,
1001  $limit,
1002  $date,
1003  in_array(self::CODE_TYPE_REGISTRATION, $code_types) ? true : false,
1004  in_array(self::CODE_TYPE_EXTENSION, $code_types) ? true : false
1005  );
1006  }
1007 
1008  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
1009  $this->ctrl->redirect($this, "listCodes");
1010  } else {
1011  $this->form_gui->setValuesByPost();
1012  $this->tpl->setContent($this->form_gui->getHtml());
1013  }
1014  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
$valid
setSubTabs($activeTab='registration_settings')
set sub tabs
static create($role, $stamp, $local_roles, $limit, $limit_date, $reg_type, $ext_type)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
const IL_CAL_DATE
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

◆ deleteAssignment()

ilRegistrationSettingsGUI::deleteAssignment ( )

Definition at line 468 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $ilErr, __initRoleAssignments(), editEmailAssignments(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

469  {
470  global $ilAccess,$ilErr,$rbacreview;
471 
472  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
473  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
474  }
475 
476  if (!count($_POST['del_assign'])) {
477  ilUtil::sendFailure($this->lng->txt('reg_select_one'));
478  $this->editEmailAssignments();
479  return false;
480  }
481 
482  $this->__initRoleAssignments();
483 
484  foreach ($_POST['del_assign'] as $assignment_id) {
485  $this->assignments_obj->delete($assignment_id);
486  }
487 
488  ilUtil::sendSuccess($this->lng->txt('reg_deleted_assignment'));
489  $this->editEmailAssignments();
490 
491  return true;
492  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteCodes()

ilRegistrationSettingsGUI::deleteCodes ( )

Definition at line 1016 of file class.ilRegistrationSettingsGUI.php.

References $_POST, ilRegistrationCode\deleteCodes(), and ilUtil\sendSuccess().

1017  {
1018  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1020 
1021  ilUtil::sendSuccess($this->lng->txt('info_deleted'), true);
1022  $this->ctrl->redirect($this, "listCodes");
1023  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static deleteCodes(array $ids)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteConfirmation()

ilRegistrationSettingsGUI::deleteConfirmation ( )

Definition at line 1025 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $code, $data, $ilErr, ilRegistrationCode\loadCodesByIds(), and setSubTabs().

1026  {
1027  global $ilErr, $ilias;
1028 
1029  if (!isset($_POST["id"])) {
1030  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1031  }
1032 
1033  $this->setSubTabs('registration_codes');
1034 
1035  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1036  $gui = new ilConfirmationGUI();
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"));
1041 
1042  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1044  foreach ($data as $code) {
1045  $gui->addItem("id[]", $code["code_id"], $code["code"]);
1046  }
1047 
1048  $this->tpl->setContent($gui->getHTML());
1049  }
global $ilErr
Definition: raiseError.php:16
$code
Definition: example_050.php:99
setSubTabs($activeTab='registration_settings')
set sub tabs
static loadCodesByIds(array $ids)
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ editEmailAssignments()

ilRegistrationSettingsGUI::editEmailAssignments ( )

Definition at line 362 of file class.ilRegistrationSettingsGUI.php.

References $counter, $ilErr, __buildRoleSelection(), __initRoleAssignments(), ilUtil\formCheckbox(), ilUtil\getImagePath(), and ilUtil\switchColor().

Referenced by addAssignment(), deleteAssignment(), and saveAssignment().

363  {
364  global $ilAccess,$ilErr,$rbacreview;
365 
366  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
367  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
368  }
369 
370  $this->__initRoleAssignments();
371 
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'));
378  $this->tpl->setVariable("ARR_DOWNRIGHT", ilUtil::getImagePath('arrow_downright.svg'));
379  $this->tpl->setVariable("TXT_DOMAIN", $this->lng->txt('reg_domain'));
380 
381 
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'));
386 
387  $counter = 0;
388  foreach ($this->assignments_obj->getAssignments() as $assignment) {
389  $this->tpl->setCurrentBlock("roles");
390  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
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']));
394  $this->tpl->setVariable("ROLE_SEL", $this->__buildRoleSelection($assignment['id']));
395  $this->tpl->parseCurrentBlock();
396  }
397 
398  $this->tpl->setVariable("DEF_CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
399  $this->tpl->setVariable("TXT_DEFAULT", $this->lng->txt('default'));
400  $this->tpl->setVariable("DEF_ROLE", $this->__buildRoleSelection(-1));
401  }
global $ilErr
Definition: raiseError.php:16
$counter
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editRoleAccessLimitations()

ilRegistrationSettingsGUI::editRoleAccessLimitations ( )

Definition at line 403 of file class.ilRegistrationSettingsGUI.php.

References $counter, $ilErr, $lng, __buildAccessLimitationSelection(), __initRoleAccessLimitations(), __prepareDateSelect(), ilObjRole\_lookupRegisterAllowed(), ilUtil\makeDateSelect(), and ilUtil\switchColor().

Referenced by saveRoleAccessLimitations().

404  {
405  global $lng,$ilAccess,$ilErr,$rbacreview;
406 
407  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
408  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
409  }
410 
412 
413  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.reg_role_access_limitations.html', 'Services/Registration');
414 
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'));
419 
420  $this->tpl->setVariable("BTN_SAVE", $lng->txt('save'));
421  $this->tpl->setVariable("BTN_CANCEL", $lng->txt('cancel'));
422 
423  $counter = 0;
424  include_once './Services/AccessControl/classes/class.ilObjRole.php';
425 
426  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
427  $this->tpl->setCurrentBlock("roles");
428  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow1'));
429  $this->tpl->setVariable("ROLE_ID", $role['id']);
430  $this->tpl->setVariable("ROLE_TITLE", $role['title']);
431  $this->tpl->setVariable("SEL_ACCESS_LIMITATION", $this->__buildAccessLimitationSelection($role['id']));
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'));
436 
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'));
439 
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'));
443 
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();
448  }
449  }
global $ilErr
Definition: raiseError.php:16
static _lookupRegisterAllowed()
get all roles that are activated in user registration
$counter
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.
global $lng
Definition: privfeed.php:17
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editRoles()

ilRegistrationSettingsGUI::editRoles ( )

Definition at line 299 of file class.ilRegistrationSettingsGUI.php.

References $counter, $ilErr, ilObjRole\_lookupAllowRegister(), ilObject\_lookupTitle(), ilUtil\formCheckbox(), ilUtil\getImagePath(), and ilUtil\switchColor().

Referenced by updateRoles().

300  {
301  include_once './Services/AccessControl/classes/class.ilObjRole.php';
302 
303  global $ilAccess,$ilErr,$rbacreview;
304 
305  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
306  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
307  }
308 
309  $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.edit_roles.html', 'Services/Registration');
310 
311  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
312  $this->tpl->setVariable("TXT_SELECTABLE_ROLES", $this->lng->txt('reg_selectable_roles'));
313  $this->tpl->setVariable("ARR_DOWNRIGHT", ilUtil::getImagePath('arrow_downright.svg'));
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'));
317 
318  $counter = 0;
319  foreach ($rbacreview->getGlobalRoles() as $role) {
320  if ($role == SYSTEM_ROLE_ID or $role == ANONYMOUS_ROLE_ID) {
321  continue;
322  }
323  $this->tpl->setCurrentBlock("roles");
324  $this->tpl->setVariable("CSSROW", ilUtil::switchColor(++$counter, 'tblrow1', 'tblrow2'));
325  $this->tpl->setVariable("CHECK_ROLE", ilUtil::formCheckbox(
327  "roles[$role]",
328  1
329  ));
330  $this->tpl->setVariable("ROLE", ilObjRole::_lookupTitle($role));
331  $this->tpl->parseCurrentBlock();
332  }
333  }
global $ilErr
Definition: raiseError.php:16
static _lookupTitle($a_id)
lookup object title
$counter
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
static _lookupAllowRegister($a_role_id)
check whether role is allowed in user registration or not
static formCheckbox($checked, $varname, $value, $disabled=false)
??? public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilRegistrationSettingsGUI::executeCommand ( )

Definition at line 62 of file class.ilRegistrationSettingsGUI.php.

63  {
64  $next_class = $this->ctrl->getNextClass($this);
65  $cmd = $this->ctrl->getCmd();
66  switch ($next_class) {
67  default:
68  if (!$cmd) {
69  $cmd = 'view';
70  }
71  $this->$cmd();
72  break;
73  }
74  return true;
75  }

◆ exportCodes()

ilRegistrationSettingsGUI::exportCodes ( )

Definition at line 1071 of file class.ilRegistrationSettingsGUI.php.

References $ilErr, date, ilUtil\deliverData(), ilRegistrationCode\getCodesForExport(), listCodes(), and ilUtil\sendFailure().

1072  {
1073  global $ilAccess, $ilErr;
1074 
1075  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
1076  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
1077  }
1078 
1079  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1080  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1081 
1082  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1083  $codes = ilRegistrationCode::getCodesForExport($utab->filter["code"], $utab->filter["role"], $utab->filter["generated"], $utab->filter["alimit"]);
1084 
1085  if (sizeof($codes)) {
1086  ilUtil::deliverData(implode("\r\n", $codes), "ilias_registration_codes_" . date("d-m-Y") . ".txt", "text/plain");
1087  } else {
1088  ilUtil::sendFailure($this->lng->txt("registration_export_codes_no_data"));
1089  $this->listCodes();
1090  }
1091  }
global $ilErr
Definition: raiseError.php:16
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
TableGUI class for registration codes.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getCodesForExport($filter_code, $filter_role, $filter_generated, $filter_access_limitation)
+ Here is the call graph for this function:

◆ getLocalRoleAutoComplete()

ilRegistrationSettingsGUI::getLocalRoleAutoComplete ( )

Definition at line 899 of file class.ilRegistrationSettingsGUI.php.

References $list, exit, and ilRoleAutoComplete\getList().

900  {
901  $q = $_REQUEST["term"];
902  include_once("./Services/AccessControl/classes/class.ilRoleAutoComplete.php");
904  echo $list;
905  exit;
906  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
static getList($a_str)
Get completion list.
+ Here is the call graph for this function:

◆ initAddCodesForm()

ilRegistrationSettingsGUI::initAddCodesForm ( )

Definition at line 801 of file class.ilRegistrationSettingsGUI.php.

References $lng, $options, array, ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setMulti(), ilFormPropertyGUI\setRequired(), and ilNumberInputGUI\setSize().

Referenced by addCodes(), and createCodes().

802  {
803  global $rbacreview, $ilObjDataCache, $lng;
804 
805  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
806 
807  $this->form_gui = new ilPropertyFormGUI();
808  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
809  $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
810 
811  $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
812  $count->setSize(4);
813  $count->setMaxLength(4);
814  $count->setMinValue(1);
815  $count->setMaxValue(1000);
816  $count->setRequired(true);
817  $this->form_gui->addItem($count);
818 
819  // type
820  $code_type = new ilCheckboxGroupInputGUI($this->lng->txt('registration_codes_type'), 'code_type');
821  $code_type->setRequired(true);
822 
823  $code_type->addOption(
824  new ilCheckboxOption(
825  $this->lng->txt('registration_codes_type_reg'),
826  self::CODE_TYPE_REGISTRATION,
827  $this->lng->txt('registration_codes_type_reg_info')
828  )
829  );
830  $code_type->addOption(
831  new ilCheckboxOption(
832  $this->lng->txt('registration_codes_type_ext'),
833  self::CODE_TYPE_EXTENSION,
834  $this->lng->txt('registration_codes_type_ext_info')
835  )
836  );
837  $this->form_gui->addItem($code_type);
838 
839 
840  $sec = new ilFormSectionHeaderGUI();
841  $sec->setTitle($this->lng->txt('registration_codes_roles_title'));
842  $this->form_gui->addItem($sec);
843 
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);
849  }
850  }
851  $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
852  $roles->setInfo($this->lng->txt("registration_codes_override_info"));
853  $roles->setOptions($options);
854  $this->form_gui->addItem($roles);
855 
856  $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
857  $local->setMulti(true);
858  $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
859  $this->form_gui->addItem($local);
860 
861 
862  $sec = new ilFormSectionHeaderGUI();
863  $sec->setTitle($this->lng->txt('reg_access_limitations'));
864  $this->form_gui->addItem($sec);
865 
866  $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
867  $limit->setInfo($this->lng->txt("registration_codes_override_info"));
868  $this->form_gui->addItem($limit);
869 
870  $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
871  $limit->addOption($opt);
872 
873  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
874  $limit->addOption($opt);
875 
876  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
877  $limit->addOption($opt);
878 
879  $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
880  $dt->setRequired(true);
881  $opt->addSubItem($dt);
882 
883  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
884  $limit->addOption($opt);
885 
886  $dur = new ilDurationInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"), "rel_date");
887  $dur->setRequired(true);
888  $dur->setShowMonths(true);
889  $dur->setShowDays(true);
890  $dur->setShowHours(false);
891  $dur->setShowMinutes(false);
892  $opt->addSubItem($dur);
893 
894  $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
895  $this->form_gui->addCommandButton('listCodes', $this->lng->txt('cancel'));
896  }
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents an option in a radio group.
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a date/time property in a property form.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
This class represents a number property in a property form.
This class represents a text property in a property form.
This class represents a property in a property form.
Create styles array
The data for the language used.
setSize($a_size)
Set Size.
setMulti($a_multi, $a_sortable=false, $a_addremove=true)
Set Multi.
global $lng
Definition: privfeed.php:17
setRequired($a_required)
Set Required.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilRegistrationSettingsGUI::initForm ( )

Definition at line 100 of file class.ilRegistrationSettingsGUI.php.

References $list, __parseRoleList(), __prepareAccessLimitationRoleList(), __prepareAutomaticRoleList(), __prepareRoleList(), ilRadioGroupInputGUI\addOption(), ilSubEnabledFormPropertyGUI\addSubItem(), ilCaptchaUtil\checkFreetype(), IL_REG_ACTIVATION, IL_REG_APPROVE, IL_REG_CODES, IL_REG_DIRECT, IL_REG_DISABLED, IL_REG_ROLES_EMAIL, IL_REG_ROLES_FIXED, ilRegistrationSettings\REG_HASH_LIFETIME_MIN_VALUE, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilTextInputGUI\setSize(), ilNumberInputGUI\setSize(), and ilCheckboxInputGUI\setValue().

Referenced by view().

101  {
102  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
103 
104  $this->form_gui = new ilPropertyFormGUI();
105  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
106  $this->form_gui->setTitle($this->lng->txt('reg_settings_header'));
107 
108  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('reg_type'), 'reg_type');
109  $reg_type->addOption(new ilRadioOption($this->lng->txt('reg_disabled'), IL_REG_DISABLED));
110  $option = new ilRadioOption($this->lng->txt('reg_direct'), IL_REG_DIRECT);
111  $option->setInfo($this->lng->txt('reg_direct_info'));
112  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_DIRECT);
113  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
114  $option->addSubItem($cd);
115  $reg_type->addOption($option);
116  $option = new ilRadioOption($this->lng->txt('reg_approve'), IL_REG_APPROVE);
117  $option->setInfo($this->lng->txt('reg_approve_info'));
118  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_APPROVE);
119  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
120  $option->addSubItem($cd);
121  $reg_type->addOption($option);
122  $option = new ilRadioOption($this->lng->txt('reg_type_confirmation'), IL_REG_ACTIVATION);
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');
125  $lt->setSize(6); // #8511
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);
132  $cd = new ilCheckboxInputGUI($this->lng->txt('reg_allow_codes'), 'reg_codes_' . IL_REG_ACTIVATION);
133  $cd->setInfo($this->lng->txt('reg_allow_codes_info'));
134  $option->addSubItem($cd);
135  $reg_type->addOption($option);
136  $option = new ilRadioOption($this->lng->txt('registration_reg_type_codes'), IL_REG_CODES);
137  $option->setInfo($this->lng->txt('registration_reg_type_codes_info'));
138  $reg_type->addOption($option);
139  $this->form_gui->addItem($reg_type);
140 
141  $pwd_gen = new ilCheckboxInputGUI($this->lng->txt('passwd_generation'), 'reg_pwd');
142  $pwd_gen->setValue(1);
143  $pwd_gen->setInfo($this->lng->txt('reg_info_pwd'));
144  $this->form_gui->addItem($pwd_gen);
145 
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'));
149  $cap->setValue(1);
151  $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
152  }
153  $this->form_gui->addItem($cap);
154 
155  $approver = new ilTextInputGUI($this->lng->txt('reg_notification'), 'reg_approver');
156  $approver->setSize(32);
157  $approver->setMaxLength(50);
158  $approver->setInfo($this->lng->txt('reg_notification_info'));
159  $this->form_gui->addItem($approver);
160 
161  $roles = new ilRadioGroupInputGUI($this->lng->txt('reg_role_assignment'), 'reg_role_type');
162  $option = new ilRadioOption($this->lng->txt('reg_fixed'), IL_REG_ROLES_FIXED);
163  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
164  $edit = $this->ctrl->getLinkTarget($this, 'editRoles');
165  $list->setHtml($this->__parseRoleList($this->__prepareRoleList(), $edit));
166  $option->addSubItem($list);
167  $roles->addOption($option);
168  $option = new ilRadioOption($this->lng->txt('reg_email'), IL_REG_ROLES_EMAIL);
169  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
170  $edit = $this->ctrl->getLinkTarget($this, 'editEmailAssignments');
171  $list->setHtml($this->__parseRoleList($this->__prepareAutomaticRoleList(), $edit));
172  $option->addSubItem($list);
173  $roles->addOption($option);
174  $roles->setInfo($this->lng->txt('registration_codes_override_global_info'));
175  $this->form_gui->addItem($roles);
176 
177  $limit = new ilCheckboxInputGUI($this->lng->txt('reg_access_limitations'), 'reg_access_limitation');
178  $limit->setValue(1);
179  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
180  $edit = $this->ctrl->getLinkTarget($this, 'editRoleAccessLimitations');
181  $list->setHtml($this->__parseRoleList($this->__prepareAccessLimitationRoleList(), $edit));
182  $list->setInfo($this->lng->txt('registration_codes_override_global_info'));
183  $limit->addSubItem($list);
184  $this->form_gui->addItem($limit);
185 
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);
189 
190  $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
191  }
This class represents an option in a radio group.
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
This class represents a property form user interface.
static checkFreetype()
Check whether captcha support is active.
This class represents a checkbox property in a property form.
const IL_REG_ROLES_EMAIL
setInfo($a_info)
Set Info.
setInfo($a_info)
Set Information Text.
This class represents a property in a property form.
addOption($a_option)
Add Option.
This class represents a number property in a property form.
setValue($a_value)
Set Value.
setSize($a_size)
Set Size.
const IL_REG_ACTIVATION
This class represents a text property in a property form.
setSize($a_size)
Set Size.
const IL_REG_ROLES_FIXED
This class represents a custom property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFormValues()

ilRegistrationSettingsGUI::initFormValues ( )

Definition at line 193 of file class.ilRegistrationSettingsGUI.php.

References array, IL_REG_ACTIVATION, IL_REG_APPROVE, IL_REG_DIRECT, IL_REG_ROLES_EMAIL, and IL_REG_ROLES_FIXED.

Referenced by view().

194  {
195  if ($this->registration_settings->roleSelectionEnabled()) {
196  $role_type = IL_REG_ROLES_FIXED;
197  } elseif ($this->registration_settings->automaticRoleAssignmentEnabled()) {
198  $role_type = IL_REG_ROLES_EMAIL;
199  }
200 
201  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
202  $values = array(
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()
211  );
212 
213  $allow_codes = $this->registration_settings->getAllowCodes();
214  $reg_type = $this->registration_settings->getRegistrationType();
215  if ($allow_codes && in_array($reg_type, array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION))) {
216  $values['reg_codes_' . $reg_type] = true;
217  }
218 
219  $this->form_gui->setValuesByArray($values);
220  }
const IL_REG_ROLES_EMAIL
const IL_REG_ACTIVATION
Create styles array
The data for the language used.
const IL_REG_ROLES_FIXED
+ Here is the caller graph for this function:

◆ listCodes()

ilRegistrationSettingsGUI::listCodes ( )

Definition at line 781 of file class.ilRegistrationSettingsGUI.php.

References $ilCtrl, $ilErr, and setSubTabs().

Referenced by applyCodesFilter(), exportCodes(), and resetCodesFilter().

782  {
783  global $ilAccess, $ilErr, $ilCtrl, $ilToolbar;
784 
785  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
786  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
787  }
788 
789  $this->setSubTabs('registration_codes');
790 
791  $ilToolbar->addButton(
792  $this->lng->txt("registration_codes_add"),
793  $this->ctrl->getLinkTarget($this, "addCodes")
794  );
795 
796  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
797  $ctab = new ilRegistrationCodesTableGUI($this, "listCodes");
798  $this->tpl->setContent($ctab->getHTML());
799  }
global $ilErr
Definition: raiseError.php:16
setSubTabs($activeTab='registration_settings')
set sub tabs
global $ilCtrl
Definition: ilias.php:18
TableGUI class for registration codes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetCodesFilter()

ilRegistrationSettingsGUI::resetCodesFilter ( )

Definition at line 1051 of file class.ilRegistrationSettingsGUI.php.

References listCodes().

1052  {
1053  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1054  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1055  $utab->resetOffset();
1056  $utab->resetFilter();
1057 
1058  $this->listCodes();
1059  }
TableGUI class for registration codes.
+ Here is the call graph for this function:

◆ save()

ilRegistrationSettingsGUI::save ( )

Definition at line 245 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $ilErr, array, ilRegistrationSettings\ERR_MISSING_RCP, ilRegistrationSettings\ERR_UNKNOWN_RCP, IL_REG_ACTIVATION, IL_REG_APPROVE, IL_REG_DIRECT, ilRegistrationSettings\REG_HASH_LIFETIME_MIN_VALUE, ilUtil\sendFailure(), ilUtil\sendSuccess(), ilUtil\stripSlashes(), and view().

246  {
247  global $ilAccess,$ilErr;
248 
249  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
250  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
251  }
252 
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']);
259 
260  $allow_codes = false;
261  if (in_array((int) $_POST['reg_type'], array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION))) {
262  $allow_codes = (bool) $_POST['reg_codes_' . (int) $_POST['reg_type']];
263  }
264  $this->registration_settings->setAllowCodes($allow_codes);
265 
266  if (!preg_match('/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (int) $_POST['reg_hash_life_time'])) {
267  $this->registration_settings->setRegistrationHashLifetime(ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE);
268  } else {
269  $this->registration_settings->setRegistrationHashLifetime(max((int) $_POST['reg_hash_life_time'], ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE));
270  }
271 
272  if ($error_code = $this->registration_settings->validate()) {
273  switch ($error_code) {
275 
276  ilUtil::sendFailure($this->lng->txt('reg_unknown_recipients') . ' ' . $this->registration_settings->getUnknown());
277  $this->view();
278  return false;
279 
281 
282  ilUtil::sendFailure($this->lng->txt('reg_approve_needs_recipient') . ' ' . $this->registration_settings->getUnknown());
283  $this->view();
284  return false;
285 
286  }
287  }
288 
289  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
290  ilCaptchaUtil::setActiveForRegistration((bool) $_POST['activate_captcha_anonym']);
291 
292  $this->registration_settings->save();
293  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
294  $this->view();
295 
296  return true;
297  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
const IL_REG_ACTIVATION
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveAssignment()

ilRegistrationSettingsGUI::saveAssignment ( )

Definition at line 494 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $data, $id, $ilErr, __initRoleAssignments(), array, editEmailAssignments(), IL_REG_MISSING_DOMAIN, IL_REG_MISSING_ROLE, ilUtil\sendFailure(), ilUtil\sendSuccess(), ilUtil\stripSlashes(), and view().

495  {
496  global $ilAccess,$ilErr,$rbacreview;
497 
498  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
499  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
500  }
501 
502  $this->__initRoleAssignments();
503 
504  if (!is_array($_POST['domain'])) {
505  $_POST['domain'] = array();
506  }
507 
508  foreach ($_POST['domain'] as $id => $data) {
509  $this->assignments_obj->setDomain($id, ilUtil::stripSlashes($_POST['domain'][$id]['domain']));
510  $this->assignments_obj->setRole($id, ilUtil::stripSlashes($_POST['role'][$id]['role']));
511  }
512  $this->assignments_obj->setDefaultRole((int) $_POST['default_role']);
513 
514  if ($err = $this->assignments_obj->validate()) {
515  switch ($err) {
517  ilUtil::sendFailure($this->lng->txt('reg_missing_domain'));
518  break;
519 
520  case IL_REG_MISSING_ROLE:
521  ilUtil::sendFailure($this->lng->txt('reg_missing_role'));
522  break;
523  }
524  $this->editEmailAssignments();
525  return false;
526  }
527 
528 
529  $this->assignments_obj->save();
530  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
531  $this->view();
532  return true;
533  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_REG_MISSING_DOMAIN
Class class.ilregistrationEmailRoleAssignments.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveRoleAccessLimitations()

ilRegistrationSettingsGUI::saveRoleAccessLimitations ( )

Definition at line 535 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $ilErr, __initRoleAccessLimitations(), ilObjRole\_lookupRegisterAllowed(), editRoleAccessLimitations(), IL_REG_ACCESS_LIMITATION_MISSING_MODE, IL_REG_ACCESS_LIMITATION_OUT_OF_DATE, ilUtil\sendFailure(), ilUtil\sendSuccess(), and view().

536  {
537  global $ilAccess,$ilErr,$rbacreview;
538 
539  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
540  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
541  }
542 
544 
545  include_once './Services/AccessControl/classes/class.ilObjRole.php';
546 
547  $this->access_limitations_obj->resetAccessLimitations();
548  foreach (ilObjRole::_lookupRegisterAllowed() as $role) {
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']);
552  }
553 
554  if ($err = $this->access_limitations_obj->validate()) {
555  switch ($err) {
557  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_missing_mode'));
558  break;
559 
561  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_out_of_date'));
562  break;
563  }
564  $this->editRoleAccessLimitations();
565  return false;
566  }
567 
568 
569  $this->access_limitations_obj->save();
570  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
571  $this->view();
572  return true;
573  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
static _lookupRegisterAllowed()
get all roles that are activated in user registration
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const IL_REG_ACCESS_LIMITATION_MISSING_MODE
Class class.ilRegistrationAccessLimitation.
$_POST["username"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilRegistrationSettingsGUI::setSubTabs (   $activeTab = 'registration_settings')

set sub tabs

Parameters
string$activeTab

Definition at line 81 of file class.ilRegistrationSettingsGUI.php.

References $lng.

Referenced by addCodes(), createCodes(), deleteConfirmation(), listCodes(), and view().

82  {
83  global $ilTabs, $lng;
84 
85  $ilTabs->addSubTab(
86  "registration_settings",
87  $lng->txt("registration_tab_settings"),
88  $this->ctrl->getLinkTarget($this, 'view')
89  );
90 
91  $ilTabs->addSubTab(
92  "registration_codes",
93  $lng->txt("registration_tab_codes"),
94  $this->ctrl->getLinkTarget($this, 'listCodes')
95  );
96 
97  $ilTabs->activateSubTab($activeTab);
98  }
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ updateRoles()

ilRegistrationSettingsGUI::updateRoles ( )

Definition at line 335 of file class.ilRegistrationSettingsGUI.php.

References $_POST, $ilErr, editRoles(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and view().

336  {
337  global $ilAccess,$ilErr,$rbacreview;
338 
339  if (!$ilAccess->checkAccess('write', '', $this->ref_id)) {
340  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
341  }
342  // Minimum one role
343  if (count($_POST['roles']) < 1) {
344  ilUtil::sendFailure($this->lng->txt('msg_last_role_for_registration'));
345  $this->editRoles();
346  return false;
347  }
348  // update allow register
349  foreach ($rbacreview->getGlobalRoles() as $role) {
350  if ($role_obj = ilObjectFactory::getInstanceByObjId($role, false)) {
351  $role_obj->setAllowRegister($_POST['roles'][$role] ? 1 : 0);
352  $role_obj->update();
353  }
354  }
355 
356  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
357  $this->view();
358 
359  return true;
360  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ view()

ilRegistrationSettingsGUI::view ( )

Definition at line 222 of file class.ilRegistrationSettingsGUI.php.

References $_GET, $ilCtrl, $ilErr, array, initForm(), initFormValues(), setSubTabs(), and USER_FOLDER_ID.

Referenced by save(), saveAssignment(), saveRoleAccessLimitations(), and updateRoles().

223  {
224  global $ilAccess, $ilErr, $ilCtrl, $ilToolbar, $ilTabs;
225 
226  if (!$ilAccess->checkAccess('read', '', $this->ref_id)) {
227  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
228  }
229 
230  $this->setSubTabs();
231 
232  // edit new accout mail
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")
237  );
238  $ilCtrl->setParameterByClass("ilobjuserfoldergui", "ref_id", $_GET["ref_id"]);
239 
240  $this->initForm();
241  $this->initFormValues();
242  $this->tpl->setContent($this->form_gui->getHTML());
243  }
global $ilErr
Definition: raiseError.php:16
$_GET["client_id"]
setSubTabs($activeTab='registration_settings')
set sub tabs
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilRegistrationSettingsGUI::$ctrl

Definition at line 41 of file class.ilRegistrationSettingsGUI.php.

◆ $ref_id

ilRegistrationSettingsGUI::$ref_id

Definition at line 43 of file class.ilRegistrationSettingsGUI.php.

◆ $tpl

ilRegistrationSettingsGUI::$tpl

Definition at line 42 of file class.ilRegistrationSettingsGUI.php.

Referenced by __construct(), and __parseRoleList().

◆ CODE_TYPE_EXTENSION

const ilRegistrationSettingsGUI::CODE_TYPE_EXTENSION = 2

Definition at line 39 of file class.ilRegistrationSettingsGUI.php.

◆ CODE_TYPE_REGISTRATION

const ilRegistrationSettingsGUI::CODE_TYPE_REGISTRATION = 1

Definition at line 38 of file class.ilRegistrationSettingsGUI.php.


The documentation for this class was generated from the following file: