ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
Class ilObjAuthSettingsGUI.
global $lng
Definition: privfeed.php:17

Member Function Documentation

◆ __buildAccessLimitationSelection()

ilRegistrationSettingsGUI::__buildAccessLimitationSelection (   $a_role_id)

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

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

Referenced by editRoleAccessLimitations().

801  {
802  global $lng;
803 
804  $options = array(
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')
809  );
810 
811  $attribs = array('onchange' => 'displayAccessLimitationSelectionForm(document.cmd.access_limitation_mode_'.$a_role_id.','.$a_role_id.')');
812 
813  $selected = $this->access_limitations_obj->getMode($a_role_id);
814 
815  return ilUtil::formSelect($selected,'access_limitation_mode_'.$a_role_id,$options,false,true,0,"",$attribs);
816 
817  }
if(!is_array($argv)) $options
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.
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:

◆ __buildRoleSelection()

ilRegistrationSettingsGUI::__buildRoleSelection (   $assignment_id)

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

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

Referenced by editEmailAssignments().

762  {
763  include_once './Services/AccessControl/classes/class.ilObjRole.php';
764 
765  global $rbacreview;
766 
767  $assignments = $this->assignments_obj->getAssignments();
768  $selected = ($assignment_id > 0) ?
769  $assignments[$assignment_id]['role'] :
770  $this->assignments_obj->getDefaultRole();
771 
772  if(!$selected)
773  {
774  $roles[0] = $this->lng->txt('please_choose');
775  }
776 
777  foreach($rbacreview->getGlobalRoles() as $role_id)
778  {
779  if($role_id == ANONYMOUS_ROLE_ID)
780  {
781  continue;
782  }
783  $roles[$role_id] = ilObjRole::_lookupTitle($role_id);
784  }
785 
786  if($assignment_id > 0)
787  {
788  return ilUtil::formSelect($selected,
789  "role[$assignment_id][role]",
790  $roles,false,true);
791  }
792  else
793  {
794  return ilUtil::formSelect($selected,
795  "default_role",
796  $roles,false,true);
797  }
798  }
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 749 of file class.ilRegistrationSettingsGUI.php.

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

750  {
751  if(is_object($this->access_limitations_obj))
752  {
753  return true;
754  }
755 
756  include_once 'Services/Registration/classes/class.ilRegistrationRoleAccessLimitations.php';
757 
758  $this->access_limitations_obj = new ilRegistrationRoleAccessLimitations();
759  }
+ Here is the caller graph for this function:

◆ __initRoleAssignments()

ilRegistrationSettingsGUI::__initRoleAssignments ( )

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

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

738  {
739  if(is_object($this->assignments_obj))
740  {
741  return true;
742  }
743 
744  include_once 'Services/Registration/classes/class.ilRegistrationEmailRoleAssignments.php';
745 
746  $this->assignments_obj = new ilRegistrationRoleAssignments();
747  }
+ Here is the caller graph for this function:

◆ __parseRoleList()

ilRegistrationSettingsGUI::__parseRoleList (   $roles,
  $url 
)

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

References $url.

Referenced by initForm().

604  {
605  $tpl = new ilTemplate('tpl.registration_roles.html', true, true,'Services/Registration');
606 
607  $tpl->setVariable("EDIT", $this->lng->txt("edit"));
608  $tpl->setVariable("LINK_EDIT", $url);
609 
610  if (is_array($roles) && sizeof($roles))
611  {
612  foreach($roles as $role)
613  {
614  $tpl->setCurrentBlock("list_item");
615  $tpl->setVariable("LIST_ITEM_ITEM", $role);
616  $tpl->parseCurrentBlock();
617  }
618  }
619  else
620  {
621  $tpl->setVariable("NONE", $this->lng->txt('none'));
622  }
623 
624  return $tpl->get();
625  }
$url
Definition: shib_logout.php:72
special template class to simplify handling of ITX/PEAR
+ Here is the caller graph for this function:

◆ __prepareAccessLimitationRoleList()

ilRegistrationSettingsGUI::__prepareAccessLimitationRoleList ( )

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

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

Referenced by initForm().

662  {
663  global $lng;
664 
666 
667  include_once './Services/AccessControl/classes/class.ilObjRole.php';
668 
669  $all = array();
670  foreach(ilObjRole::_lookupRegisterAllowed() as $role)
671  {
672  switch ($this->access_limitations_obj->getMode($role['id']))
673  {
674  case 'absolute':
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)));
677  break;
678 
679  case 'relative':
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');
683 
684  $txt_access_value = $lng->txt('reg_access_limitation_limited_time')." ";
685 
686  if ($years)
687  {
688  $txt_access_value .= $years." ";
689  $txt_access_value .= ($years == 1) ? $lng->txt('year') : $lng->txt('years');
690 
691  if ($months)
692  {
693  if ($days)
694  {
695  $txt_access_value .= ", ";
696  }
697  else
698  {
699  $txt_access_value .= " ".$lng->txt('and')." ";
700  }
701  }
702  elseif ($days)
703  {
704  $txt_access_value .= " ".$lng->txt('and')." ";
705  }
706  }
707 
708  if ($months)
709  {
710  $txt_access_value .= $months." ";
711  $txt_access_value .= ($months == 1) ? $lng->txt('month') : $lng->txt('months');
712 
713  if ($days)
714  {
715  $txt_access_value .= " ".$lng->txt('and')." ";
716  }
717  }
718 
719  if ($days)
720  {
721  $txt_access_value .= $days." ";
722  $txt_access_value .= ($days == 1) ? $lng->txt('day') : $lng->txt('days');
723  }
724  break;
725 
726  default:
727  $txt_access_value = $lng->txt('reg_access_limitation_none');
728  break;
729  }
730 
731  $all[] = $role['title'].' ('.$txt_access_value.')';
732  }
733 
734  return $all;
735  }
static _lookupRegisterAllowed()
get all roles that are activated in user registration
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 639 of file class.ilRegistrationSettingsGUI.php.

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

Referenced by initForm().

640  {
641  include_once './Services/AccessControl/classes/class.ilObjRole.php';
642  $this->__initRoleAssignments();
643 
644  $all = array();
645  foreach($this->assignments_obj->getAssignments() as $assignment)
646  {
647  if(strlen($assignment['domain']) and $assignment['role'])
648  {
649  $all[] = $assignment['domain'].' -> '.ilObjRole::_lookupTitle($assignment['role']);
650  }
651  }
652 
653  if(strlen($this->assignments_obj->getDefaultRole()))
654  {
655  $all[] = $this->lng->txt('reg_default').' -> '.ilObjRole::_lookupTitle($this->assignments_obj->getDefaultRole());
656  }
657 
658  return $all;
659  }
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 819 of file class.ilRegistrationSettingsGUI.php.

References array, date, and time.

Referenced by editRoleAccessLimitations().

820  {
821  if (!$a_unix_time)
822  {
823  $a_unix_time = time();
824  }
825 
826  return array('y' => date('Y',$a_unix_time),
827  'm' => date('n',$a_unix_time),
828  'd' => date('d',$a_unix_time));
829  }
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 627 of file class.ilRegistrationSettingsGUI.php.

References ilObjRole\_lookupRegisterAllowed(), and array.

Referenced by initForm().

628  {
629  include_once './Services/AccessControl/classes/class.ilObjRole.php';
630 
631  $all = array();
632  foreach(ilObjRole::_lookupRegisterAllowed() as $role)
633  {
634  $all[] = $role['title'];
635  }
636  return $all;
637  }
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 466 of file class.ilRegistrationSettingsGUI.php.

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

467  {
468  global $ilAccess,$ilErr,$rbacreview;
469 
470  if(!$ilAccess->checkAccess('write','',$this->ref_id))
471  {
472  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
473  }
474 
475  $this->__initRoleAssignments();
476  $this->assignments_obj->add();
477 
478  ilUtil::sendSuccess($this->lng->txt('reg_added_assignment'));
479  $this->editEmailAssignments();
480 
481  return true;
482  }
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 957 of file class.ilRegistrationSettingsGUI.php.

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

958  {
959  global $ilAccess, $ilErr;
960 
961  if(!$ilAccess->checkAccess('write', '', $this->ref_id))
962  {
963  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
964  }
965 
966  $this->setSubTabs('registration_codes');
967 
968  $this->initAddCodesForm();
969 
970  // default
971  $limit = $this->form_gui->getItemByPostVar("reg_limit");
972  $limit->setValue("none");
973 
974  $this->tpl->setContent($this->form_gui->getHTML());
975  }
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 1129 of file class.ilRegistrationSettingsGUI.php.

References listCodes().

1130  {
1131  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1132  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1133  $utab->resetOffset();
1134  $utab->writeFilterToSession();
1135 
1136  $this->listCodes();
1137  }
TableGUI class for registration codes.
+ Here is the call graph for this function:

◆ createCodes()

ilRegistrationSettingsGUI::createCodes ( )

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

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

978  {
979  global $ilAccess, $ilErr, $rbacreview;
980 
981  if(!$ilAccess->checkAccess('write', '', $this->ref_id))
982  {
983  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
984  }
985 
986  $this->setSubTabs('registration_codes');
987 
988  $this->initAddCodesForm();
989  $valid = $this->form_gui->checkInput();
990  if($valid)
991  {
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");
995 
996  if(is_array($local))
997  {
998  $role_ids = array();
999  foreach(array_unique($local) as $item)
1000  {
1001  if(trim($item))
1002  {
1003  $role_id = $rbacreview->roleExists($item);
1004  if($role_id)
1005  {
1006  $role_ids[] = $role_id;
1007  }
1008  }
1009  }
1010  if(sizeof($role_ids))
1011  {
1012  $local = $role_ids;
1013  }
1014  }
1015 
1016  $date = null;
1017  $limit = $this->form_gui->getInput("reg_limit");
1018  switch($limit)
1019  {
1020  case "absolute":
1021  $date_input = $this->form_gui->getItemByPostVar("abs_date");
1022  $date = $date_input->getDate()->get(IL_CAL_DATE);
1023  if($date < date("Y-m-d"))
1024  {
1025  $date_input->setAlert($this->lng->txt("form_msg_wrong_date"));
1026  $valid = false;
1027  }
1028  break;
1029 
1030  case "relative":
1031  $date = $this->form_gui->getInput("rel_date");
1032  if(!array_sum($date))
1033  {
1034  $valid = false;
1035  }
1036  else
1037  {
1038  $date = array(
1039  "d" => $date["dd"],
1040  "m" => $date["MM"]%12,
1041  "y" => floor($date["MM"]/12)
1042  );
1043  }
1044  break;
1045 
1046  case "none":
1047  $limit = null;
1048  break;
1049  }
1050  }
1051 
1052  if($valid)
1053  {
1054  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1055 
1056  $stamp = time();
1057  for($loop = 1; $loop <= $number; $loop++)
1058  {
1059  $code_types = (array) $this->form_gui->getInput('code_type');
1060 
1062  $role,
1063  $stamp,
1064  $local,
1065  $limit,
1066  $date,
1067  in_array(self::CODE_TYPE_REGISTRATION, $code_types) ? TRUE : FALSE,
1068  in_array(self::CODE_TYPE_EXTENSION, $code_types) ? TRUE : FALSE
1069  );
1070  }
1071 
1072  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
1073  $this->ctrl->redirect($this, "listCodes");
1074  }
1075  else
1076  {
1077  $this->form_gui->setValuesByPost();
1078  $this->tpl->setContent($this->form_gui->getHtml());
1079  }
1080  }
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 484 of file class.ilRegistrationSettingsGUI.php.

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

485  {
486  global $ilAccess,$ilErr,$rbacreview;
487 
488  if(!$ilAccess->checkAccess('write','',$this->ref_id))
489  {
490  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
491  }
492 
493  if(!count($_POST['del_assign']))
494  {
495  ilUtil::sendFailure($this->lng->txt('reg_select_one'));
496  $this->editEmailAssignments();
497  return false;
498  }
499 
500  $this->__initRoleAssignments();
501 
502  foreach($_POST['del_assign'] as $assignment_id)
503  {
504  $this->assignments_obj->delete($assignment_id);
505  }
506 
507  ilUtil::sendSuccess($this->lng->txt('reg_deleted_assignment'));
508  $this->editEmailAssignments();
509 
510  return true;
511  }
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 1082 of file class.ilRegistrationSettingsGUI.php.

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

1083  {
1084  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1086 
1087  ilUtil::sendSuccess($this->lng->txt('info_deleted'), true);
1088  $this->ctrl->redirect($this, "listCodes");
1089  }
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 1091 of file class.ilRegistrationSettingsGUI.php.

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

1092  {
1093  global $ilErr, $ilias;
1094 
1095  if(!isset($_POST["id"]))
1096  {
1097  $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
1098  }
1099 
1100  $this->setSubTabs('registration_codes');
1101 
1102  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
1103  $gui = new ilConfirmationGUI();
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"));
1108 
1109  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1111  foreach($data as $code)
1112  {
1113  $gui->addItem("id[]", $code["code_id"], $code["code"]);
1114  }
1115 
1116  $this->tpl->setContent($gui->getHTML());
1117  }
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 373 of file class.ilRegistrationSettingsGUI.php.

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

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

374  {
375  global $ilAccess,$ilErr,$rbacreview;
376 
377  if(!$ilAccess->checkAccess('write','',$this->ref_id))
378  {
379  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
380  }
381 
382  $this->__initRoleAssignments();
383 
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'));
390  $this->tpl->setVariable("ARR_DOWNRIGHT",ilUtil::getImagePath('arrow_downright.svg'));
391  $this->tpl->setVariable("TXT_DOMAIN",$this->lng->txt('reg_domain'));
392 
393 
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'));
398 
399  $counter = 0;
400  foreach($this->assignments_obj->getAssignments() as $assignment)
401  {
402  $this->tpl->setCurrentBlock("roles");
403  $this->tpl->setVariable("CSSROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow1'));
404  $this->tpl->setVariable("ASSIGN_ID",$assignment['id']);
405  $this->tpl->setVariable("DOMAIN",$assignment['domain']);
406  $this->tpl->setVariable("CHECK_ROLE",ilUtil::formCheckbox(0,'del_assign[]',$assignment['id']));
407  $this->tpl->setVariable("ROLE_SEL",$this->__buildRoleSelection($assignment['id']));
408  $this->tpl->parseCurrentBlock();
409  }
410 
411  $this->tpl->setVariable("DEF_CSSROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow1'));
412  $this->tpl->setVariable("TXT_DEFAULT",$this->lng->txt('default'));
413  $this->tpl->setVariable("DEF_ROLE",$this->__buildRoleSelection(-1));
414  }
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 416 of file class.ilRegistrationSettingsGUI.php.

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

Referenced by saveRoleAccessLimitations().

417  {
418  global $lng,$ilAccess,$ilErr,$rbacreview;
419 
420  if(!$ilAccess->checkAccess('write','',$this->ref_id))
421  {
422  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
423  }
424 
426 
427  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.reg_role_access_limitations.html','Services/Registration');
428 
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'));
433 
434  $this->tpl->setVariable("BTN_SAVE",$lng->txt('save'));
435  $this->tpl->setVariable("BTN_CANCEL",$lng->txt('cancel'));
436 
437  $counter = 0;
438  include_once './Services/AccessControl/classes/class.ilObjRole.php';
439 
440  foreach(ilObjRole::_lookupRegisterAllowed() as $role)
441  {
442  $this->tpl->setCurrentBlock("roles");
443  $this->tpl->setVariable("CSSROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow1'));
444  $this->tpl->setVariable("ROLE_ID",$role['id']);
445  $this->tpl->setVariable("ROLE_TITLE",$role['title']);
446  $this->tpl->setVariable("SEL_ACCESS_LIMITATION",$this->__buildAccessLimitationSelection($role['id']));
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'));
451 
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'));
454 
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'));
458 
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();
463  }
464  }
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 304 of file class.ilRegistrationSettingsGUI.php.

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

Referenced by updateRoles().

305  {
306  include_once './Services/AccessControl/classes/class.ilObjRole.php';
307 
308  global $ilAccess,$ilErr,$rbacreview;
309 
310  if(!$ilAccess->checkAccess('write','',$this->ref_id))
311  {
312  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
313  }
314 
315  $this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.edit_roles.html','Services/Registration');
316 
317  $this->tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
318  $this->tpl->setVariable("TXT_SELECTABLE_ROLES",$this->lng->txt('reg_selectable_roles'));
319  $this->tpl->setVariable("ARR_DOWNRIGHT",ilUtil::getImagePath('arrow_downright.svg'));
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'));
323 
324  $counter = 0;
325  foreach($rbacreview->getGlobalRoles() as $role)
326  {
327  if($role == SYSTEM_ROLE_ID or $role == ANONYMOUS_ROLE_ID)
328  {
329  continue;
330  }
331  $this->tpl->setCurrentBlock("roles");
332  $this->tpl->setVariable("CSSROW",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
333  $this->tpl->setVariable("CHECK_ROLE",ilUtil::formCheckbox(ilObjRole::_lookupAllowRegister($role),
334  "roles[$role]",
335  1));
336  $this->tpl->setVariable("ROLE",ilObjRole::_lookupTitle($role));
337  $this->tpl->parseCurrentBlock();
338 
339  }
340  }
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.

References $cmd.

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

◆ exportCodes()

ilRegistrationSettingsGUI::exportCodes ( )

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

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

1140  {
1141  global $ilAccess, $ilErr;
1142 
1143  if(!$ilAccess->checkAccess('read', '', $this->ref_id))
1144  {
1145  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
1146  }
1147 
1148  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1149  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1150 
1151  include_once './Services/Registration/classes/class.ilRegistrationCode.php';
1152  $codes = ilRegistrationCode::getCodesForExport($utab->filter["code"], $utab->filter["role"], $utab->filter["generated"], $utab->filter["alimit"]);
1153 
1154  if(sizeof($codes))
1155  {
1156  ilUtil::deliverData(implode("\r\n", $codes), "ilias_registration_codes_".date("d-m-Y").".txt","text/plain");
1157  }
1158  else
1159  {
1160  ilUtil::sendFailure($this->lng->txt("registration_export_codes_no_data"));
1161  $this->listCodes();
1162  }
1163  }
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 948 of file class.ilRegistrationSettingsGUI.php.

References exit, and ilRoleAutoComplete\getList().

949  {
950  $q = $_REQUEST["term"];
951  include_once("./Services/AccessControl/classes/class.ilRoleAutoComplete.php");
952  $list = ilRoleAutoComplete::getList($q);
953  echo $list;
954  exit;
955  }
static getList($a_str)
Get completion list.
+ Here is the call graph for this function:

◆ initAddCodesForm()

ilRegistrationSettingsGUI::initAddCodesForm ( )

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

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

Referenced by addCodes(), and createCodes().

851  {
852  global $rbacreview, $ilObjDataCache, $lng;
853 
854  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
855 
856  $this->form_gui = new ilPropertyFormGUI();
857  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'createCodes'));
858  $this->form_gui->setTitle($this->lng->txt('registration_codes_edit_header'));
859 
860  $count = new ilNumberInputGUI($this->lng->txt('registration_codes_number'), 'reg_codes_number');
861  $count->setSize(4);
862  $count->setMaxLength(4);
863  $count->setMinValue(1);
864  $count->setMaxValue(1000);
865  $count->setRequired(true);
866  $this->form_gui->addItem($count);
867 
868  // type
869  $code_type = new ilCheckboxGroupInputGUI($this->lng->txt('registration_codes_type'),'code_type');
870  $code_type->setRequired(TRUE);
871 
872  $code_type->addOption(
873  new ilCheckboxOption(
874  $this->lng->txt('registration_codes_type_reg'),
875  self::CODE_TYPE_REGISTRATION,
876  $this->lng->txt('registration_codes_type_reg_info'))
877  );
878  $code_type->addOption(
879  new ilCheckboxOption(
880  $this->lng->txt('registration_codes_type_ext'),
881  self::CODE_TYPE_EXTENSION,
882  $this->lng->txt('registration_codes_type_ext_info'))
883  );
884  $this->form_gui->addItem($code_type);
885 
886 
887  $sec = new ilFormSectionHeaderGUI();
888  $sec->setTitle($this->lng->txt('registration_codes_roles_title'));
889  $this->form_gui->addItem($sec);
890 
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)
894  {
895  if(!in_array($role_id, array(SYSTEM_ROLE_ID, ANONYMOUS_ROLE_ID)))
896  {
897  $options[$role_id] = $ilObjDataCache->lookupTitle($role_id);
898  }
899  }
900  $roles = new ilSelectInputGUI($this->lng->txt("registration_codes_roles"), "reg_codes_role");
901  $roles->setInfo($this->lng->txt("registration_codes_override_info"));
902  $roles->setOptions($options);
903  $this->form_gui->addItem($roles);
904 
905  $local = new ilTextInputGUI($this->lng->txt("registration_codes_roles_local"), "reg_codes_local");
906  $local->setMulti(true);
907  $local->setDataSource($this->ctrl->getLinkTarget($this, "getLocalRoleAutoComplete", "", true));
908  $this->form_gui->addItem($local);
909 
910 
911  $sec = new ilFormSectionHeaderGUI();
912  $sec->setTitle($this->lng->txt('reg_access_limitations'));
913  $this->form_gui->addItem($sec);
914 
915  $limit = new ilRadioGroupInputGUI($this->lng->txt("reg_access_limitation_mode"), "reg_limit");
916  $limit->setInfo($this->lng->txt("registration_codes_override_info"));
917  $this->form_gui->addItem($limit);
918 
919  $opt = new ilRadioOption($this->lng->txt("registration_codes_roles_limitation_none"), "none");
920  $limit->addOption($opt);
921 
922  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_none"), "unlimited");
923  $limit->addOption($opt);
924 
925  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_absolute"), "absolute");
926  $limit->addOption($opt);
927 
928  $dt = new ilDateTimeInputGUI($this->lng->txt("reg_access_limitation_mode_absolute_target"), "abs_date");
929  $dt->setRequired(true);
930  $opt->addSubItem($dt);
931 
932  $opt = new ilRadioOption($this->lng->txt("reg_access_limitation_mode_relative"), "relative");
933  $limit->addOption($opt);
934 
935  $dur = new ilDurationInputGUI($this->lng->txt("reg_access_limitation_mode_relative_target"), "rel_date");
936  $dur->setRequired(true);
937  $dur->setShowMonths(true);
938  $dur->setShowDays(true);
939  $dur->setShowHours(false);
940  $dur->setShowMinutes(false);
941  $opt->addSubItem($dur);
942 
943  $this->form_gui->addCommandButton('createCodes', $this->lng->txt('create'));
944  $this->form_gui->addCommandButton('listCodes',$this->lng->txt('cancel'));
945  }
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.
if(!is_array($argv)) $options
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initForm()

ilRegistrationSettingsGUI::initForm ( )

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

References __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().

99  {
100  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
101 
102  $this->form_gui = new ilPropertyFormGUI();
103  $this->form_gui->setFormAction($this->ctrl->getFormAction($this, 'save'));
104  $this->form_gui->setTitle($this->lng->txt('reg_settings_header'));
105 
106  $reg_type = new ilRadioGroupInputGUI($this->lng->txt('reg_type'), 'reg_type');
107  $reg_type->addOption(new ilRadioOption($this->lng->txt('reg_disabled'), IL_REG_DISABLED));
108  $option = new ilRadioOption($this->lng->txt('reg_direct'), IL_REG_DIRECT);
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);
114  $option = new ilRadioOption($this->lng->txt('reg_approve'), IL_REG_APPROVE);
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);
120  $option = new ilRadioOption($this->lng->txt('reg_type_confirmation'), IL_REG_ACTIVATION);
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');
123  $lt->setSize(6); // #8511
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);
134  $option = new ilRadioOption($this->lng->txt('registration_reg_type_codes'), IL_REG_CODES);
135  $option->setInfo($this->lng->txt('registration_reg_type_codes_info'));
136  $reg_type->addOption($option);
137  $this->form_gui->addItem($reg_type);
138 
139  $pwd_gen = new ilCheckboxInputGUI($this->lng->txt('passwd_generation'), 'reg_pwd');
140  $pwd_gen->setValue(1);
141  $pwd_gen->setInfo($this->lng->txt('reg_info_pwd'));
142  $this->form_gui->addItem($pwd_gen);
143 
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'));
147  $cap->setValue(1);
149  {
150  $cap->setAlert(ilCaptchaUtil::getPreconditionsMessage());
151  }
152  $this->form_gui->addItem($cap);
153 
154  $approver = new ilTextInputGUI($this->lng->txt('reg_notification'), 'reg_approver');
155  $approver->setSize(32);
156  $approver->setMaxLength(50);
157  $approver->setInfo($this->lng->txt('reg_notification_info'));
158  $this->form_gui->addItem($approver);
159 
160  $roles = new ilRadioGroupInputGUI($this->lng->txt('reg_role_assignment'), 'reg_role_type');
161  $option = new ilRadioOption($this->lng->txt('reg_fixed'), IL_REG_ROLES_FIXED);
162  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
163  $edit = $this->ctrl->getLinkTarget($this,'editRoles');
164  $list->setHtml($this->__parseRoleList($this->__prepareRoleList(), $edit));
165  $option->addSubItem($list);
166  $roles->addOption($option);
167  $option = new ilRadioOption($this->lng->txt('reg_email'), IL_REG_ROLES_EMAIL);
168  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
169  $edit = $this->ctrl->getLinkTarget($this,'editEmailAssignments');
170  $list->setHtml($this->__parseRoleList($this->__prepareAutomaticRoleList(), $edit));
171  $option->addSubItem($list);
172  $roles->addOption($option);
173  $roles->setInfo($this->lng->txt('registration_codes_override_global_info'));
174  $this->form_gui->addItem($roles);
175 
176  $limit = new ilCheckboxInputGUI($this->lng->txt('reg_access_limitations'), 'reg_access_limitation');
177  $limit->setValue(1);
178  $list = new ilCustomInputGUI($this->lng->txt('reg_available_roles'));
179  $edit = $this->ctrl->getLinkTarget($this,'editRoleAccessLimitations');
180  $list->setHtml($this->__parseRoleList($this->__prepareAccessLimitationRoleList(), $edit));
181  $list->setInfo($this->lng->txt('registration_codes_override_global_info'));
182  $limit->addSubItem($list);
183  $this->form_gui->addItem($limit);
184 
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);
188 
189  $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
190  }
This class represents an option in a radio group.
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 192 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().

193  {
194  if($this->registration_settings->roleSelectionEnabled())
195  {
196  $role_type = IL_REG_ROLES_FIXED;
197  }
198  else if ($this->registration_settings->automaticRoleAssignmentEnabled())
199  {
200  $role_type = IL_REG_ROLES_EMAIL;
201  }
202 
203  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
204  $values = array(
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()
213  );
214 
215  $allow_codes = $this->registration_settings->getAllowCodes();
216  $reg_type = $this->registration_settings->getRegistrationType();
217  if($allow_codes && in_array($reg_type, array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION)))
218  {
219  $values['reg_codes_'.$reg_type] = true;
220  }
221 
222  $this->form_gui->setValuesByArray($values);
223  }
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 831 of file class.ilRegistrationSettingsGUI.php.

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

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

832  {
833  global $ilAccess, $ilErr, $ilCtrl, $ilToolbar;
834 
835  if(!$ilAccess->checkAccess('read','',$this->ref_id))
836  {
837  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
838  }
839 
840  $this->setSubTabs('registration_codes');
841 
842  $ilToolbar->addButton($this->lng->txt("registration_codes_add"),
843  $this->ctrl->getLinkTarget($this, "addCodes"));
844 
845  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
846  $ctab = new ilRegistrationCodesTableGUI($this, "listCodes");
847  $this->tpl->setContent($ctab->getHTML());
848  }
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 1119 of file class.ilRegistrationSettingsGUI.php.

References listCodes().

1120  {
1121  include_once("./Services/Registration/classes/class.ilRegistrationCodesTableGUI.php");
1122  $utab = new ilRegistrationCodesTableGUI($this, "listCodes");
1123  $utab->resetOffset();
1124  $utab->resetFilter();
1125 
1126  $this->listCodes();
1127  }
TableGUI class for registration codes.
+ Here is the call graph for this function:

◆ save()

ilRegistrationSettingsGUI::save ( )

Definition at line 247 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().

248  {
249  global $ilAccess,$ilErr;
250 
251  if(!$ilAccess->checkAccess('write','',$this->ref_id))
252  {
253  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
254  }
255 
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']);
262 
263  $allow_codes = false;
264  if(in_array((int)$_POST['reg_type'], array(IL_REG_DIRECT, IL_REG_APPROVE, IL_REG_ACTIVATION)))
265  {
266  $allow_codes = (bool)$_POST['reg_codes_'.(int)$_POST['reg_type']];
267  }
268  $this->registration_settings->setAllowCodes($allow_codes);
269 
270  if(!preg_match('/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (int)$_POST['reg_hash_life_time']))
271  $this->registration_settings->setRegistrationHashLifetime(ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE);
272  else
273  $this->registration_settings->setRegistrationHashLifetime(max((int)$_POST['reg_hash_life_time'], ilRegistrationSettings::REG_HASH_LIFETIME_MIN_VALUE));
274 
275  if($error_code = $this->registration_settings->validate())
276  {
277  switch($error_code)
278  {
280 
281  ilUtil::sendFailure($this->lng->txt('reg_unknown_recipients').' '.$this->registration_settings->getUnknown());
282  $this->view();
283  return false;
284 
286 
287  ilUtil::sendFailure($this->lng->txt('reg_approve_needs_recipient').' '.$this->registration_settings->getUnknown());
288  $this->view();
289  return false;
290 
291  }
292  }
293 
294  require_once 'Services/Captcha/classes/class.ilCaptchaUtil.php';
295  ilCaptchaUtil::setActiveForRegistration((bool)$_POST['activate_captcha_anonym']);
296 
297  $this->registration_settings->save();
298  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
299  $this->view();
300 
301  return true;
302  }
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 513 of file class.ilRegistrationSettingsGUI.php.

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

514  {
515  global $ilAccess,$ilErr,$rbacreview;
516 
517  if(!$ilAccess->checkAccess('write','',$this->ref_id))
518  {
519  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
520  }
521 
522  $this->__initRoleAssignments();
523 
524  if (!is_array($_POST['domain']))
525  {
526  $_POST['domain'] = array();
527  }
528 
529  foreach($_POST['domain'] as $id => $data)
530  {
531  $this->assignments_obj->setDomain($id,ilUtil::stripSlashes($_POST['domain'][$id]['domain']));
532  $this->assignments_obj->setRole($id,ilUtil::stripSlashes($_POST['role'][$id]['role']));
533  }
534  $this->assignments_obj->setDefaultRole((int) $_POST['default_role']);
535 
536  if($err = $this->assignments_obj->validate())
537  {
538  switch($err)
539  {
541  ilUtil::sendFailure($this->lng->txt('reg_missing_domain'));
542  break;
543 
544  case IL_REG_MISSING_ROLE:
545  ilUtil::sendFailure($this->lng->txt('reg_missing_role'));
546  break;
547  }
548  $this->editEmailAssignments();
549  return false;
550  }
551 
552 
553  $this->assignments_obj->save();
554  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
555  $this->view();
556  return true;
557  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
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 559 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().

560  {
561  global $ilAccess,$ilErr,$rbacreview;
562 
563  if(!$ilAccess->checkAccess('write','',$this->ref_id))
564  {
565  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
566  }
567 
569 
570  include_once './Services/AccessControl/classes/class.ilObjRole.php';
571 
572  $this->access_limitations_obj->resetAccessLimitations();
573  foreach(ilObjRole::_lookupRegisterAllowed() as $role)
574  {
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']);
578  }
579 
580  if($err = $this->access_limitations_obj->validate())
581  {
582  switch($err)
583  {
585  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_missing_mode'));
586  break;
587 
589  ilUtil::sendFailure($this->lng->txt('reg_access_limitation_out_of_date'));
590  break;
591  }
592  $this->editRoleAccessLimitations();
593  return false;
594  }
595 
596 
597  $this->access_limitations_obj->save();
598  ilUtil::sendSuccess($this->lng->txt('settings_saved'));
599  $this->view();
600  return true;
601  }
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 83 of file class.ilRegistrationSettingsGUI.php.

References $lng.

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

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

◆ updateRoles()

ilRegistrationSettingsGUI::updateRoles ( )

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

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

343  {
344  global $ilAccess,$ilErr,$rbacreview;
345 
346  if(!$ilAccess->checkAccess('write','',$this->ref_id))
347  {
348  $ilErr->raiseError($this->lng->txt("msg_no_perm_write"),$ilErr->MESSAGE);
349  }
350  // Minimum one role
351  if(count($_POST['roles']) < 1)
352  {
353  ilUtil::sendFailure($this->lng->txt('msg_last_role_for_registration'));
354  $this->editRoles();
355  return false;
356  }
357  // update allow register
358  foreach($rbacreview->getGlobalRoles() as $role)
359  {
360  if($role_obj = ilObjectFactory::getInstanceByObjId($role,false))
361  {
362  $role_obj->setAllowRegister($_POST['roles'][$role] ? 1 : 0);
363  $role_obj->update();
364  }
365  }
366 
367  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
368  $this->view();
369 
370  return true;
371  }
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 225 of file class.ilRegistrationSettingsGUI.php.

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

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

226  {
227  global $ilAccess, $ilErr, $ilCtrl, $ilToolbar, $ilTabs;
228 
229  if(!$ilAccess->checkAccess('read','',$this->ref_id))
230  {
231  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"),$ilErr->MESSAGE);
232  }
233 
234  $this->setSubTabs();
235 
236  // edit new accout mail
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"]);
241 
242  $this->initForm();
243  $this->initFormValues();
244  $this->tpl->setContent($this->form_gui->getHTML());
245  }
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().

◆ 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: