34 use ilTableCommandHelper;
37 "visible" =>
"user_visible_in_profile",
38 "changeable" =>
"changeable",
39 "searchable" =>
"header_searchable",
40 "required" =>
"required_field",
42 "course_export" =>
"course_export",
43 'group_export' =>
'group_export',
44 "visib_reg" =>
"header_visible_registration",
45 'visib_lua' =>
'usr_settings_visib_lua',
46 'changeable_lua' =>
'usr_settings_changeable_lua'
64 bool $a_call_by_reference
69 $ilCtrl =
$DIC[
'ilCtrl'];
79 $this->
lng->loadLanguageModule(
'search');
80 $this->
lng->loadLanguageModule(
"user");
81 $this->
lng->loadLanguageModule(
'tos');
82 $ilCtrl->saveParameter(
87 $this->user_request = new \ILIAS\User\StandardGUIRequest(
92 $this->selected_action = $this->user_request->getSelectedAction();
96 $this->requested_ids = $this->user_request->getIds();
103 $translation = (!isset($properties[
"lang_var"]) || $properties[
"lang_var"] ===
"")
105 : $properties[
"lang_var"];
107 if ($fieldName ===
"country") {
108 $translation =
"country_free_text";
110 if ($fieldName ===
"sel_country") {
111 $translation =
"country_selection";
114 return $this->
lng->txt($translation);
119 $this->user_owner_id = $a_id;
131 $ilTabs =
$DIC->tabs();
132 $access =
$DIC->access();
134 $next_class = $this->
ctrl->getNextClass($this);
135 $cmd = $this->
ctrl->getCmd();
136 $this->prepareOutput();
138 switch ($next_class) {
139 case 'ilusertablegui':
144 $u_table->initFilter();
145 $this->
ctrl->setReturn(
149 $this->
ctrl->forwardCommand($u_table);
152 case 'ilpermissiongui':
154 $this->
ctrl->forwardCommand($perm_gui);
157 case 'ilrepositorysearchgui':
158 if (!$this->
access->checkRbacOrPositionPermissionAccess(
163 $this->
ilias->raiseError(
164 $this->
lng->txt(
"permission_denied"),
165 $this->ilias->error_obj->MESSAGE
170 $user_search->setTitle($this->
lng->txt(
"search_user_extended"));
171 $user_search->enableSearchableCheck(
false);
172 $user_search->setUserLimitations(
false);
173 $user_search->setCallback(
175 'searchResultHandler',
176 $this->getUserMultiCommands(
true)
178 $user_search->addUserAccessFilterCallable(array($this,
"searchUserAccessFilterCallable"));
179 $this->tabs_gui->setTabActive(
'search_user_extended');
180 $this->
ctrl->setReturn(
184 $this->
ctrl->forwardCommand($user_search);
187 case 'ilaccountcodesgui':
188 $this->tabs_gui->setTabActive(
'settings');
189 $this->setSubTabs(
"settings");
190 $ilTabs->activateSubTab(
"account_codes");
192 $this->
ctrl->forwardCommand($acc);
195 case 'ilcustomuserfieldsgui':
196 $this->raiseErrorOnMissingWrite();
197 $this->tabs_gui->setTabActive(
'settings');
198 $this->setSubTabs(
"settings");
199 $ilTabs->activateSubTab(
"user_defined_fields");
201 $this->requested_ref_id,
202 $this->user_request->getFieldId()
204 $this->
ctrl->forwardCommand($cf);
207 case 'iluserstartingpointgui':
208 $this->raiseErrorOnMissingWrite();
209 $this->tabs_gui->setTabActive(
'settings');
210 $this->setSubTabs(
"settings");
211 $ilTabs->activateSubTab(
"starting_points");
213 $this->
ctrl->forwardCommand($cf);
216 case 'iluserprofileinfosettingsgui':
217 $this->raiseErrorOnMissingWrite();
218 $this->tabs_gui->setTabActive(
'settings');
219 $this->setSubTabs(
"settings");
220 $ilTabs->activateSubTab(
"user_profile_info");
222 $this->
ctrl->forwardCommand($ps);
241 $utab->resetOffset();
242 $utab->resetFilter();
243 $this->viewObject(
true);
251 $this->
ctrl->setParameterByClass(
256 $this->
ctrl->redirectByClass(
257 array(
"iladministrationgui",
"ilobjusergui"),
266 $ilTabs =
$DIC[
'ilTabs'];
271 $utab->resetOffset();
272 $utab->writeFilterToSession();
274 $ilTabs->activateTab(
"usrf");
281 bool $reset_filter =
false
285 $rbacsystem =
$DIC[
'rbacsystem'];
286 $ilToolbar =
$DIC->toolbar();
289 $access =
$DIC->access();
292 if ($rbacsystem->checkAccess(
'create_usr', $this->object->getRefId())
293 || $rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getRefId())) {
295 $button->setCaption(
"usr_add");
297 $this->
ctrl->getLinkTarget(
302 $ilToolbar->addButtonInstance($button);
305 $button->setCaption(
"import_users");
307 $this->
ctrl->getLinkTarget(
312 $ilToolbar->addButtonInstance($button);
316 !$access->checkAccess(
321 $access->checkRbacOrPositionPermissionAccess(
327 $user_filter = $access->filterUserIdsByRbacOrPositionOfCurrentUser(
336 if ((
int)
$ilSetting->get(
'user_adm_alpha_nav')) {
337 if (count($ilToolbar->getItems()) > 0) {
338 $ilToolbar->addSeparator();
347 $ai->setParentCommand(
351 $ai->setHighlighted($this->user_request->getLetter());
352 $ilToolbar->addInputItem(
364 $utab->addFilterItemValue(
370 $tpl->setContent($utab->getHTML());
379 $auto->addUserAccessFilterCallable(\Closure::fromCallable([$this,
'filterUserIdsByRbacOrPositionOfCurrentUser']));
381 $auto->setSearchFields(array(
'login',
'firstname',
'lastname',
'email',
'second_email'));
382 $auto->enableFieldSearchableCheck(
false);
383 $auto->setMoreLinkAvailable(
true);
385 if ($this->user_request->getFetchAll()) {
389 echo $auto->getList($this->user_request->getTerm());
400 $access =
$DIC->access();
401 return $access->filterUserIdsByRbacOrPositionOfCurrentUser(
413 $ilCtrl =
$DIC[
'ilCtrl'];
429 $rbacsystem =
$DIC[
'rbacsystem'];
432 $d = $this->obj_definition->getCreatableSubObjects($this->
object->getType());
434 if (!$rbacsystem->checkAccess(
436 $this->object->getRefId()
442 foreach (
$d as $row) {
444 if ($row[
"max"] > 0) {
446 for (
$i = 0, $iMax = count($this->data[
"ctrl"]);
$i < $iMax;
$i++) {
447 if ($this->data[
"ctrl"][
$i][
"type"] == $row[
"name"]) {
452 if ($row[
"max"] ==
"" || $count < $row[
"max"]) {
453 $subobj[] = $row[
"name"];
458 if (is_array($subobj)) {
465 $this->tpl->setCurrentBlock(
"add_object");
466 $this->tpl->setVariable(
470 $this->tpl->setVariable(
474 $this->tpl->setVariable(
476 $this->
lng->txt(
"add")
478 $this->tpl->parseCurrentBlock();
484 $this->
ctrl->redirect(
492 $this->
ctrl->redirectByClass(
493 'ilrepositorysearchgui',
507 if (!$this->checkUserManipulationAccessBool()) {
508 $this->
ilias->raiseError(
509 $this->
lng->txt(
"msg_no_perm_write"),
510 $this->ilias->error_obj->WARNING
515 foreach ($this->getActionUserIds() as
$id) {
521 if (!$obj->getActive()) {
522 $obj->setLoginAttempts(0);
532 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_activated"),
true);
534 if ($this->user_request->getFrSearch()) {
535 $this->
ctrl->redirectByClass(
536 'ilRepositorySearchGUI',
540 $this->
ctrl->redirect(
556 if (!$this->checkUserManipulationAccessBool()) {
557 $this->
ilias->raiseError(
558 $this->
lng->txt(
"msg_no_perm_write"),
559 $this->ilias->error_obj->WARNING
563 foreach ($this->getActionUserIds() as
$id) {
578 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_deactivated"),
true);
580 if ($this->user_request->getFrSearch()) {
581 $this->
ctrl->redirectByClass(
582 'ilRepositorySearchGUI',
586 $this->
ctrl->redirect(
595 if (!$this->checkUserManipulationAccessBool()) {
596 $this->
ilias->raiseError(
597 $this->
lng->txt(
"msg_no_perm_write"),
598 $this->ilias->error_obj->WARNING
602 foreach ($this->getActionUserIds() as
$id) {
608 $obj->setTimeLimitUnlimited(
true);
609 $obj->setTimeLimitFrom(
null);
610 $obj->setTimeLimitUntil(
null);
611 $obj->setTimeLimitMessage(
"");
617 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"access_free_granted"),
true);
619 if ($this->user_request->getFrSearch()) {
620 $this->
ctrl->redirectByClass(
621 'ilRepositorySearchGUI',
625 $this->
ctrl->redirect(
634 bool $a_from_search =
false
637 $a_form = $this->initAccessRestrictionForm($a_from_search);
639 $this->tpl->setContent($a_form->getHTML());
646 bool $a_from_search =
false
648 $user_ids = $this->getActionUserIds();
650 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
656 $form->
setTitle($this->
lng->txt(
"time_limit_add_time_limit_for_selected"));
658 $this->
ctrl->getFormAction(
660 "confirmaccessRestrict"
665 $this->
lng->txt(
"access_from"),
668 $from->setShowTime(
true);
669 $from->setRequired(
true);
673 $this->
lng->txt(
"access_until"),
676 $to->setRequired(
true);
677 $to->setShowTime(
true);
681 "confirmaccessRestrict",
682 $this->
lng->txt(
"confirm")
686 $this->
lng->txt(
"cancel")
689 foreach ($user_ids as $user_id) {
691 $ufield->setValue($user_id);
696 if ($a_from_search || $this->user_request->getFrSearch()) {
712 $form = $this->initAccessRestrictionForm();
714 return $this->setAccessRestrictionObject($form);
719 if ($timeuntil <= $timefrom) {
720 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"time_limit_not_valid"));
721 return $this->setAccessRestrictionObject($form);
724 if (!$this->checkUserManipulationAccessBool()) {
725 $this->
ilias->raiseError(
726 $this->
lng->txt(
"msg_no_perm_write"),
727 $this->ilias->error_obj->WARNING
730 foreach ($this->getActionUserIds() as
$id) {
736 $obj->setTimeLimitUnlimited(0);
737 $obj->setTimeLimitFrom((
int) $timefrom);
738 $obj->setTimeLimitUntil((
int) $timeuntil);
739 $obj->setTimeLimitMessage(
"");
743 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"access_restricted"),
true);
745 if ($this->user_request->getFrSearch()) {
746 $this->
ctrl->redirectByClass(
747 'ilRepositorySearchGUI',
751 $this->
ctrl->redirect(
763 $rbacsystem =
$DIC[
'rbacsystem'];
764 $ilCtrl =
$DIC[
'ilCtrl'];
768 if (!$rbacsystem->checkAccess(
770 $this->object->getRefId()
772 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_perm_delete"),
true);
779 $ids = $this->user_request->getIds();
784 $this->
ilias->raiseError(
785 $this->
lng->txt(
"msg_no_delete_yourself"),
786 $this->ilias->error_obj->WARNING
791 foreach ($ids as
$id) {
798 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_deleted"),
true);
800 if ($this->user_request->getFrSearch()) {
801 $this->
ctrl->redirectByClass(
802 'ilRepositorySearchGUI',
806 $this->
ctrl->redirect(
820 $access =
$DIC->access();
822 if ($this->getSelectAllPostArray()[
'select_cmd_all']) {
823 include_once(
"./Services/User/classes/class.ilUserTableGUI.php");
831 if (!$access->checkAccess(
836 $access->checkRbacOrPositionPermissionAccess(
842 $filtered_users = $access->filterUserIdsByRbacOrPositionOfCurrentUser(
849 $utab->addFilterItemValue(
855 return $utab->getUserIdsForFilter();
857 return $access->filterUserIdsByRbacOrPositionOfCurrentUser(
873 $access =
$DIC->access();
874 return $access->checkRbacOrPositionPermissionAccess(
886 bool $a_from_search =
false
890 $ilTabs =
$DIC[
'ilTabs'];
892 $user_ids = $this->getActionUserIds();
894 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'));
899 if (!$a_from_search) {
900 $ilTabs->activateTab(
"obj_usrf");
902 $ilTabs->activateTab(
"search_user_extended");
909 return $this->setAccessRestrictionObject(
921 if (strcmp($action,
'addToClipboard') === 0) {
922 $this->addToClipboardObject();
928 if (!$a_from_search) {
929 $cancel =
"cancelUserFolderAction";
931 $cancel =
"cancelSearchAction";
936 $cgui->setFormAction($this->
ctrl->getFormAction($this));
937 $cgui->setHeaderText($this->
lng->txt(
"info_" . $action .
"_sure"));
939 $this->
lng->txt(
"cancel"),
943 $this->
lng->txt(
"confirm"),
947 if ($a_from_search) {
948 $cgui->addHiddenItem(
954 foreach ($user_ids as
$id) {
957 $login = $user->getLastLogin();
959 $login = $this->
lng->txt(
"never");
969 $caption = $user->getFullname() .
" (" . $user->getLogin() .
")" .
", " .
970 $user->getEmail() .
" - " . $this->
lng->txt(
"last_login") .
": " . $login;
979 $this->tpl->setContent($cgui->getHTML());
986 if (!$this->
access->checkRbacOrPositionPermissionAccess(
991 $this->
ilias->raiseError(
992 $this->
lng->txt(
'permission_denied'),
993 $this->ilias->error_obj->MESSAGE
997 if (in_array($this->
user->getId(), $this->getActionUserIds())) {
998 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_delete_yourself'));
1002 $this->showActionConfirmation(
"delete");
1007 $this->raiseErrorOnMissingWrite();
1008 $this->showActionConfirmation(
'activate');
1013 $this->raiseErrorOnMissingWrite();
1014 if (in_array($this->
user->getId(), $this->getActionUserIds())) {
1015 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_deactivate_yourself'));
1016 $this->viewObject();
1019 $this->showActionConfirmation(
"deactivate");
1024 $this->raiseErrorOnMissingWrite();
1025 $this->showActionConfirmation(
'accessRestrict');
1033 $this->raiseErrorOnMissingWrite();
1034 $this->showActionConfirmation(
'accessFree');
1039 $this->raiseErrorOnMissingWrite();
1040 $this->showActionConfirmation($this->user_request->getSelectedAction());
1051 $rbacsystem =
$DIC[
'rbacsystem'];
1052 $ilCtrl =
$DIC->ctrl();
1053 $access =
$DIC->access();
1055 $this->tabs_gui->clearTargets();
1056 $this->tabs_gui->setBackTarget(
1057 $this->
lng->txt(
'usrf'),
1058 $ilCtrl->getLinkTarget(
1064 !$rbacsystem->checkAccess(
'create_usr', $this->object->getRefId())
1065 && !$access->checkAccess(
'cat_administrate_users',
'', $this->object->getRefId())
1067 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"));
1070 $this->initUserImportForm();
1071 $tpl->setContent($this->
form->getHTML());
1082 $ilCtrl =
$DIC[
'ilCtrl'];
1088 $lng->txt(
'import_file'),
1091 $fi->setSuffixes([
'xml']);
1092 $fi->setRequired(
true);
1093 $this->
form->addItem($fi);
1095 $this->
form->addCommandButton(
1096 'importUserRoleAssignment',
1099 $this->
form->addCommandButton(
1104 $this->
form->setTitle(
$lng->txt(
'import_users'));
1105 $this->
form->setFormAction($ilCtrl->getFormAction($this));
1110 return (strtolower($this->user_request->getBaseClass()) ===
'iladministrationgui');
1116 $filesystem =
$DIC->filesystem()->storage();
1119 $import_dir = $this->getImportDir();
1120 if ($filesystem->hasDir($import_dir)) {
1121 $filesystem->deleteDir($import_dir);
1124 if ($this->inAdministration()) {
1125 $this->
ctrl->redirect(
1130 $this->
ctrl->redirectByClass(
1146 $importDir =
'user_import/usr_' .
$ilUser->getId() .
'_' . mb_substr(session_id(), 0, 8);
1159 $ilCtrl =
$DIC->ctrl();
1160 $renderer =
$DIC->ui()->renderer();
1162 $this->tabs_gui->clearTargets();
1163 $this->tabs_gui->setBackTarget(
1164 $this->
lng->txt(
'usrf'),
1165 $ilCtrl->getLinkTarget(
1171 $this->initUserImportForm();
1172 if ($this->
form->checkInput()) {
1173 $xml_file = $this->handleUploadedFiles();
1177 list($form,
$message) = $this->initUserRoleAssignmentForm($xml_file_full_path);
1181 $this->
form->setValuesByPost();
1182 $tpl->setContent($this->
form->getHTML());
1195 $rbacreview =
$DIC->rbac()->review();
1196 $rbacsystem =
$DIC->rbac()->system();
1197 $ui =
$DIC->ui()->factory();
1198 $global_roles_assignment_info =
null;
1199 $local_roles_assignment_info =
null;
1202 $xml_file_full_path,
1205 $import_parser->startParsing();
1207 $message = $this->verifyXmlData($import_parser);
1209 $xml_file_name = explode(
1213 $roles_import_filename = $ui->input()->field()->text($this->
lng->txt(
"import_file"))
1214 ->withDisabled(
true)
1215 ->withValue(end($xml_file_name));
1217 $roles_import_count = $ui->input()->field()->numeric($this->
lng->txt(
"num_users"))
1218 ->withDisabled(
true)
1219 ->withValue($import_parser->getUserCount());
1222 $xml_file_full_path,
1225 $import_parser->startParsing();
1227 $roles = $import_parser->getCollectedRoles();
1230 $all_gl_roles = $rbacreview->getRoleListByObject(
ROLE_FOLDER_ID);
1232 $roles_of_user = $rbacreview->assignedRoles(
$ilUser->getId());
1233 foreach ($all_gl_roles as $obj_data) {
1250 $gl_roles[$obj_data[
"obj_id"]] = $obj_data[
"title"];
1256 $got_globals =
false;
1257 $global_selects = [];
1258 foreach ($roles as $role_id => $role) {
1259 if ($role[
"type"] ==
"Global") {
1260 if (!$got_globals) {
1261 $global_roles_assignment_info = $ui->input()->field()->text(
1262 $this->
lng->txt(
"roles_of_import_global")
1263 )->withDisabled(
true)
1264 ->withValue($this->
lng->txt(
"assign_global_role"));
1266 $select_options[] = $this->
lng->txt(
'usrimport_ignore_role');
1270 $select_options = [];
1271 foreach ($gl_roles as
$key => $value) {
1272 $select_options[$role_id .
"-" .
$key] = $value;
1276 $pre_select = array_search(
1281 switch ($role[
"name"]) {
1282 case "Administrator":
1283 $pre_select = array_search(
1290 $pre_select = array_search(
1297 $pre_select = array_search(
1304 $pre_select = array_search(
1311 $pre_select = array_search(
1319 $select = $ui->input()->field()->select(
1322 )->withValue($pre_select);
1323 if (!$got_globals) {
1324 $got_globals =
true;
1325 $global_selects[] = $select->withRequired(
true);
1327 $global_selects[] = $select;
1333 $got_locals =
false;
1334 foreach ($roles as $role_id => $role) {
1335 if ($role[
"type"] ==
"Local") {
1342 $local_roles_assignment_info = $ui->input()->field()->text($this->
lng->txt(
"roles_of_import_local"))
1343 ->withDisabled(
true)
1344 ->withValue($this->
lng->txt(
"assign_local_role"));
1356 foreach ($roles as $role_id => $role) {
1357 if ($role[
"type"] ==
"Local") {
1358 $searchName = (strpos($role[
'name'],
'#') === 0) ? $role[
'name'] :
'#' . $role[
'name'];
1359 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1360 foreach ($matching_role_ids as $mid) {
1365 $loc_roles[] = $mid;
1374 $loc_roles = $rbacreview->getAssignableRolesInSubtree($this->
object->getRefId());
1379 foreach ($loc_roles as
$key => $loc_role) {
1381 $rolf = $rbacreview->getFoldersAssignedToRole(
1391 !$rbacreview->isDeleted($rolf[0]) &&
1392 $rbacsystem->checkAccess(
1409 if ($this->tree->isInTree($rolf[0])) {
1412 $tmpPath = $this->tree->getPathFull($rolf[0]);
1413 $tmpPath[] = $rolf[0];
1415 for (
$i = 1, $n = count($tmpPath) - 1;
$i < $n;
$i++) {
1416 if ($i < 3 || $i > $n - 3) {
1417 $path_array[] = $tmpPath[
$i][
'title'];
1418 } elseif (
$i == 3 ||
$i == $n - 3) {
1419 $path_array[] =
'...';
1422 $isInSubtree |= $tmpPath[
$i][
'obj_id'] == $this->
object->getId();
1427 array_reverse($path_array)
1430 $path =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $loc_role .
")</b>";
1432 $roleMailboxAddress = (new \ilRoleMailboxAddress($loc_role))->value();
1433 $l_roles[$loc_role] = $roleMailboxAddress .
', ' .
$path;
1437 natcasesort($l_roles);
1438 $l_roles[
"ignore"] = $this->
lng->txt(
"usrimport_ignore_role");
1441 $local_selects = [];
1442 foreach ($roles as $role_id => $role) {
1443 if ($role[
"type"] ==
"Local") {
1446 $searchName = (strpos($role[
'name'],
'#') === 0) ? $role[
'name'] :
'#' . $role[
'name'];
1447 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1448 $pre_select = count($matching_role_ids) == 1 ? $role_id .
"-" . $matching_role_ids[0] :
"ignore";
1450 $selectable_roles = [];
1455 $selectable_roles[
"ignore"] = $this->
lng->txt(
"usrimport_ignore_role");
1456 foreach ($matching_role_ids as
$id) {
1457 $selectable_roles[$role_id .
"-" .
$id] = $l_roles[
$id];
1460 foreach ($l_roles as $local_role_id => $value) {
1461 if ($local_role_id !==
"ignore") {
1462 $selectable_roles[$role_id .
"-" . $local_role_id] = $value;
1467 if (count($selectable_roles) > 0) {
1468 $select = $ui->input()->field()
1469 ->select($role[
"name"], $selectable_roles)
1470 ->withRequired(
true);
1471 if (array_key_exists($pre_select, $selectable_roles)) {
1472 $select = $select->withValue($pre_select);
1474 $local_selects[] = $select;
1485 $conflict_action_select = $ui->input()->field()->select(
1486 $this->
lng->txt(
"conflict_handling"),
1491 $this->
lng->txt(
"usrimport_conflict_handling_info")
1495 ->withRequired(
true);
1498 $this->
lng->loadLanguageModule(
"mail");
1500 $mail_section =
null;
1501 if (trim($amail[
"body"] ??
"") !=
"" && trim($amail[
"subject"] ??
"") !=
"") {
1502 $send_checkbox = $ui->input()->field()->checkbox($this->
lng->txt(
"user_send_new_account_mail"))
1505 $mail_section = $ui->input()->field()->section(
1507 $this->
lng->txt(
"mail_account_mail")
1511 $file_info_section = $ui->input()->field()->section(
1513 "filename" => $roles_import_filename,
1514 "import_count" => $roles_import_count,
1516 $this->
lng->txt(
"file_info")
1519 $form_action = $this->
ctrl->getFormActionByClass(self::class,
'importUsers');
1522 "file_info" => $file_info_section
1525 if (!empty($global_selects)) {
1526 $global_role_info_section = $ui->input()
1528 ->section([$global_roles_assignment_info], $this->
lng->txt(
"global_role_assignment"));
1529 $global_role_selection_section = $ui->input()->field()->section($global_selects,
"");
1530 $form_elements[
"global_role_info"] = $global_role_info_section;
1531 $form_elements[
"global_role_selection"] = $global_role_selection_section;
1534 if (!empty($local_selects)) {
1535 $local_role_info_section = $ui->input()->field()->section(
1536 [$local_roles_assignment_info],
1537 $this->
lng->txt(
"local_role_assignment")
1539 $local_role_selection_section = $ui->input()->field()->section(
1544 $form_elements[
"local_role_info"] = $local_role_info_section;
1545 $form_elements[
"local_role_selection"] = $local_role_selection_section;
1548 $form_elements[
"conflict_action"] = $ui->input()->field()->section([$conflict_action_select],
"");
1550 if ($mail_section !==
null) {
1551 $form_elements[
"send_mail"] = $mail_section;
1554 return [$ui->input()->container()->form()->standard(
1571 $upload =
$DIC->upload();
1573 $filesystem =
$DIC->filesystem()->storage();
1574 $import_dir = $this->getImportDir();
1576 if (!$upload->hasBeenProcessed()) {
1581 if ($filesystem->hasDir($import_dir)) {
1582 $filesystem->deleteDir($import_dir);
1584 $filesystem->createDir($import_dir);
1586 foreach ($upload->getResults() as $single_file_upload) {
1587 $file_name = $single_file_upload->getName();
1588 $parts = pathinfo($file_name);
1591 if (!$single_file_upload->isOK()) {
1592 $filesystem->deleteDir($import_dir);
1593 $this->
ilias->raiseError(
1594 $this->
lng->txt(
"no_import_file_found"),
1595 $this->ilias->error_obj->MESSAGE
1600 $upload->moveFilesTo(
1602 \
ILIAS\FileUpload\Location::STORAGE
1606 if ($single_file_upload->getMimeType() ==
"application/zip") {
1612 $file_list = $filesystem->listContents($import_dir);
1614 foreach ($file_list as
$key => $a_file) {
1619 unset($file_list[
$key]);
1620 $xml_file = $a_file->getPath();
1626 foreach ($file_list as $a_file) {
1627 $filesystem->delete($a_file->getPath());
1630 if (is_null($xml_file)) {
1633 "." .
$parts[
"extension"]
1635 $xml_file = $import_dir .
"/" . $subdir .
"/" . $subdir .
".xml";
1639 $a = $filesystem->listContents($import_dir);
1641 $xml_file = $file->getPath();
1645 if (!$filesystem->has($xml_file)) {
1646 $filesystem->deleteDir($import_dir);
1647 $this->
ilias->raiseError(
1648 $this->
lng->txt(
"no_xml_file_found_in_zip")
1649 .
" " . $subdir .
"/" . $subdir .
".xml",
1650 $this->ilias->error_obj->MESSAGE
1662 $filesystem =
$DIC->filesystem()->storage();
1664 $import_dir = $this->getImportDir();
1671 $filesystem->deleteDir($import_dir);
1672 $this->tpl->setOnScreenMessage(
1675 $this->lng->txt(
'verification_failure_log')
1679 $this->
ctrl->redirectByClass(self::class,
'importUserForm');
1693 $request =
$DIC->http()->request();
1694 $ui_renderer =
$DIC->ui()->renderer();
1695 $rbacreview =
$DIC->rbac()->review();
1696 $rbacsystem =
$DIC->rbac()->system();
1697 $filesystem =
$DIC->filesystem()->storage();
1698 $import_dir = $this->getImportDir();
1700 $file_list = $filesystem->listContents($import_dir);
1703 if (count($file_list) > 1) {
1704 $filesystem->deleteDir($import_dir);
1705 $this->tpl->setOnScreenMessage($this->
lng->txt(
'usrimport_wrong_file_count'),
true);
1706 $this->redirectAfterImport();
1708 $xml_file = $file_list[0]->getPath();
1713 if ($request->getMethod() !==
"POST") {
1714 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'usrimport_form_not_evaluabe'),
true);
1715 $this->redirectAfterImport();
1718 $form = $this->initUserRoleAssignmentForm($xml_path)[0]->withRequest($request);
1719 $result = $form->getData();
1721 if ($result ===
null) {
1722 $this->tpl->setContent($ui_renderer->render($form));
1726 $rule = $result[
"conflict_action"][0] ?? 1;
1729 $local_role_selection = (array) ($result[
'local_role_selection'] ?? []);
1730 $global_role_selection = (array) ($result[
'global_role_selection'] ?? []);
1731 $roles = array_merge(
1732 $local_role_selection,
1733 $global_role_selection
1736 $role_assignment = [];
1737 foreach ($roles as $value) {
1742 if (count(
$keys) === 2) {
1752 $import_parser->setFolderId($this->getUserOwnerId());
1757 if (!empty($role_assignment)) {
1758 $global_roles = $rbacreview->getGlobalRoles();
1759 $roles_of_user = $rbacreview->assignedRoles(
$ilUser->getId());
1760 foreach ($role_assignment as $role_id) {
1761 if ($role_id !=
"") {
1777 $filesystem->deleteDir($import_dir);
1778 $this->tpl->setOnScreenMessage(
1780 $this->
lng->txt(
'usrimport_with_specified_role_not_permitted'),
1783 $this->redirectAfterImport();
1787 $rolf = $rbacreview->getFoldersAssignedToRole(
1791 if ($rbacreview->isDeleted($rolf[0])
1792 || !$rbacsystem->checkAccess(
1796 $filesystem->deleteDir($import_dir);
1797 $this->tpl->setOnScreenMessage(
1799 $this->
lng->txt(
'usrimport_with_specified_role_not_permitted'),
1802 $this->redirectAfterImport();
1809 if (isset($result[
'send_mail'])) {
1810 $import_parser->setSendMail($result[
'send_mail'][0]);
1813 $import_parser->setRoleAssignment($role_assignment);
1814 $import_parser->startParsing();
1817 $filesystem->deleteDir($import_dir);
1819 switch ($import_parser->getErrorLevel()) {
1821 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_imported"),
true);
1824 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_imported_with_warnings") . $import_parser->getProtocolAsHTML(
1825 $this->lng->txt(
"import_warning_log")
1829 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'user_import_failed'),
true);
1830 $this->redirectAfterImport();
1834 if ($this->inAdministration()) {
1835 $this->
ctrl->redirect(
1840 $this->
ctrl->redirectByClass(
1856 $this->raiseErrorOnMissingWrite();
1857 $this->initFormGeneralSettings();
1861 $show_blocking_time_in_days =
$ilSetting->get(
'loginname_change_blocking_time') / 86400;
1862 $show_blocking_time_in_days = (float) $show_blocking_time_in_days;
1867 'lua' => $aset->isLocalUserAdministrationEnabled(),
1868 'lrua' => $aset->isUserAccessRestricted(),
1869 'allow_change_loginname' => (bool)
$ilSetting->get(
'allow_change_loginname'),
1870 'create_history_loginname' => (bool)
$ilSetting->get(
'create_history_loginname'),
1871 'reuse_of_loginnames' => (bool)
$ilSetting->get(
'reuse_of_loginnames'),
1872 'loginname_change_blocking_time' => $show_blocking_time_in_days,
1873 'user_adm_alpha_nav' => (
int)
$ilSetting->get(
'user_adm_alpha_nav'),
1875 'user_reactivate_code' => (
int)
$ilSetting->get(
'user_reactivate_code'),
1876 'user_own_account' => (
int)
$ilSetting->get(
'user_delete_own_account'),
1877 'user_own_account_email' =>
$ilSetting->get(
'user_delete_own_account_email'),
1878 'tos_withdrawal_usr_deletion' => (bool)
$ilSetting->get(
'tos_withdrawal_usr_deletion'),
1881 'session_handling_type',
1884 'session_reminder_enabled' =>
$ilSetting->get(
'session_reminder_enabled'),
1886 'session_max_count',
1897 'session_max_idle_after_first_request' =>
$ilSetting->get(
1898 'session_max_idle_after_first_request',
1902 'login_max_attempts' => $security->getLoginMaxAttempts(),
1903 'ps_prevent_simultaneous_logins' => (
int) $security->isPreventionOfSimultaneousLoginsEnabled(),
1904 'password_assistance' => (bool)
$ilSetting->get(
"password_assistance"),
1905 'letter_avatars' => (
int)
$ilSetting->get(
'letter_avatars'),
1906 'password_change_on_first_login_enabled' => $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0,
1907 'password_max_age' => $security->getPasswordMaxAge()
1910 $passwordPolicySettings = $this->getPasswordPolicySettingsMap($security);
1911 $this->
form->setValuesByArray(
1914 $passwordPolicySettings,
1915 [
'pw_policy_hash' => md5(
1918 $passwordPolicySettings
1925 $this->tpl->setContent($this->
form->getHTML());
1950 $this->raiseErrorOnMissingWrite();
1951 $this->initFormGeneralSettings();
1952 if ($this->
form->checkInput()) {
1954 if (!strlen($this->
form->getInput(
'loginname_change_blocking_time'))) {
1956 $this->
form->getItemByPostVar(
'loginname_change_blocking_time')
1957 ->setAlert($this->
lng->txt(
'loginname_change_blocking_time_invalidity_info'));
1963 $security->setPasswordCharsAndNumbersEnabled(
1964 (
bool) $this->
form->getInput(
"password_chars_and_numbers_enabled")
1966 $security->setPasswordSpecialCharsEnabled(
1967 (
bool) $this->
form->getInput(
"password_special_chars_enabled")
1969 $security->setPasswordMinLength(
1970 (
int) $this->
form->getInput(
"password_min_length")
1972 $security->setPasswordMaxLength(
1973 (
int) $this->
form->getInput(
"password_max_length")
1975 $security->setPasswordNumberOfUppercaseChars(
1976 (
int) $this->
form->getInput(
"password_ucase_chars_num")
1978 $security->setPasswordNumberOfLowercaseChars(
1979 (
int) $this->
form->getInput(
"password_lowercase_chars_num")
1981 $security->setPasswordMaxAge(
1982 (
int) $this->
form->getInput(
"password_max_age")
1984 $security->setLoginMaxAttempts(
1985 (
int) $this->
form->getInput(
"login_max_attempts")
1987 $security->setPreventionOfSimultaneousLogins(
1988 (
bool) $this->
form->getInput(
"ps_prevent_simultaneous_logins")
1990 $security->setPasswordChangeOnFirstLoginEnabled(
1991 (
bool) $this->
form->getInput(
"password_change_on_first_login_enabled")
1993 $security->setPasswordMustNotContainLoginnameStatus(
1994 (
bool) $this->
form->getInput(
"password_must_not_contain_loginame")
1997 if (!is_null($security->validate($this->form))) {
2009 'allow_change_loginname',
2010 (
int) $this->
form->getInput(
'allow_change_loginname')
2013 'create_history_loginname',
2014 (
int) $this->
form->getInput(
'create_history_loginname')
2017 'reuse_of_loginnames',
2018 (
int) $this->
form->getInput(
'reuse_of_loginnames')
2020 $save_blocking_time_in_seconds = (
int) ($this->
form->getInput(
2021 'loginname_change_blocking_time'
2024 'loginname_change_blocking_time',
2025 $save_blocking_time_in_seconds
2028 'user_adm_alpha_nav',
2029 (
int) $this->
form->getInput(
'user_adm_alpha_nav')
2032 'user_reactivate_code',
2033 (
int) $this->
form->getInput(
'user_reactivate_code')
2037 'user_delete_own_account',
2038 (
int) $this->
form->getInput(
'user_own_account')
2041 'user_delete_own_account_email',
2042 $this->
form->getInput(
'user_own_account_email')
2045 'tos_withdrawal_usr_deletion',
2046 (
string) ((
int) $this->
form->getInput(
'tos_withdrawal_usr_deletion'))
2050 "password_assistance",
2051 $this->
form->getInput(
"password_assistance")
2056 'session_handling_type',
2057 (
int) $this->
form->getInput(
'session_handling_type')
2062 'session_reminder_enabled',
2063 $this->
form->getInput(
'session_reminder_enabled')
2065 } elseif ($this->
form->getInput(
2066 'session_handling_type'
2070 'session_allow_client_maintenance',
2078 'session_max_count',
2079 (
int) $this->
form->getInput(
'session_max_count')
2083 (
int) $this->
form->getInput(
'session_min_idle')
2087 (
int) $this->
form->getInput(
'session_max_idle')
2090 'session_max_idle_after_first_request',
2091 (
int) $this->
form->getInput(
'session_max_idle_after_first_request')
2098 (
int) $this->
form->getInput(
'letter_avatars')
2101 $requestPasswordReset =
false;
2102 if ($this->
form->getInput(
'pw_policy_hash')) {
2103 $oldSettingsHash = $this->
form->getInput(
'pw_policy_hash');
2104 $currentSettingsHash = md5(
2107 $this->getPasswordPolicySettingsMap($security)
2110 $requestPasswordReset = ($oldSettingsHash !== $currentSettingsHash);
2113 if ($requestPasswordReset) {
2114 $this->
ctrl->redirect(
2116 'askForUserPasswordReset'
2119 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
2122 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
2125 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
2127 $this->
form->setValuesByPost();
2128 $this->tpl->setContent($this->
form->getHTML());
2134 $this->
lng->loadLanguageModule(
'ps');
2136 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ps_passwd_policy_change_force_user_reset_succ'),
true);
2137 $this->
ctrl->redirect(
2145 $this->
lng->loadLanguageModule(
'ps');
2147 $confirmation = new \ilConfirmationGUI();
2148 $confirmation->setFormAction(
2149 $this->
ctrl->getFormAction(
2151 'askForUserPasswordReset'
2154 $confirmation->setHeaderText($this->
lng->txt(
'ps_passwd_policy_changed_force_user_reset'));
2155 $confirmation->setConfirm(
2156 $this->
lng->txt(
'yes'),
2157 'forceUserPasswordReset'
2159 $confirmation->setCancel(
2160 $this->
lng->txt(
'no'),
2164 $this->tpl->setContent($confirmation->getHTML());
2176 $this->setSubTabs(
'settings');
2177 $this->tabs_gui->setTabActive(
'settings');
2178 $this->tabs_gui->setSubTabActive(
'general_settings');
2181 $this->
form->setFormAction(
2182 $this->
ctrl->getFormAction(
2184 'saveGeneralSettings'
2188 $this->
form->setTitle($this->
lng->txt(
'general_settings'));
2191 $this->
lng->txt(
'enable_local_user_administration'),
2194 $lua->setInfo($this->
lng->txt(
'enable_local_user_administration_info'));
2196 $this->
form->addItem($lua);
2199 $this->
lng->txt(
'restrict_user_access'),
2202 $lrua->setInfo($this->
lng->txt(
'restrict_user_access_info'));
2204 $this->
form->addItem($lrua);
2208 $this->
lng->txt(
'user_adm_enable_alpha_nav'),
2209 'user_adm_alpha_nav'
2213 $this->
form->addItem($alph);
2217 $this->
lng->txt(
"user_account_code_setting"),
2218 "user_reactivate_code"
2220 $code->setInfo($this->
lng->txt(
'user_account_code_setting_info'));
2221 $this->
form->addItem($code);
2225 $this->
lng->txt(
"user_allow_delete_own_account"),
2228 $this->
form->addItem($own);
2230 $this->
lng->txt(
"user_delete_own_account_notification_email"),
2231 "user_own_account_email"
2233 $own->addSubItem($own_email);
2236 $this->
lng->txt(
'tos_withdrawal_usr_deletion'),
2237 'tos_withdrawal_usr_deletion'
2239 $withdrawalProvokesDeletion->setInfo($this->
lng->txt(
'tos_withdrawal_usr_deletion_info'));
2240 $withdrawalProvokesDeletion->setValue(
'1');
2241 $this->
form->addItem($withdrawalProvokesDeletion);
2247 $this->
lng->txt(
'sess_mode'),
2248 'session_handling_type'
2253 $this->
lng->txt(
'sess_fixed_duration'),
2259 $this->
lng->txt(
"session_reminder"),
2260 "session_reminder_enabled"
2268 $this->
lng->txt(
"session_reminder_info") .
"<br />" .
2270 $this->
lng->txt(
'session_reminder_session_duration'),
2274 $fixed->addSubItem($cb);
2277 $ssettings->addOption($fixed);
2281 $this->
lng->txt(
'sess_load_dependent_session_handling'),
2290 $this->
lng->txt(
'session_max_count'),
2293 $sub_ti->setMaxLength(5);
2294 $sub_ti->setSize(5);
2295 $sub_ti->setInfo($this->
lng->txt(
'session_max_count_info'));
2297 'session_allow_client_maintenance',
2300 $sub_ti->setDisabled(
true);
2302 $ldsh->addSubItem($sub_ti);
2308 $this->
lng->txt(
'session_min_idle'),
2311 $sub_ti->setMaxLength(5);
2312 $sub_ti->setSize(5);
2313 $sub_ti->setInfo($this->
lng->txt(
'session_min_idle_info'));
2315 'session_allow_client_maintenance',
2318 $sub_ti->setDisabled(
true);
2320 $ldsh->addSubItem($sub_ti);
2326 $this->
lng->txt(
'session_max_idle'),
2329 $sub_ti->setMaxLength(5);
2330 $sub_ti->setSize(5);
2331 $sub_ti->setInfo($this->
lng->txt(
'session_max_idle_info'));
2333 'session_allow_client_maintenance',
2336 $sub_ti->setDisabled(
true);
2338 $ldsh->addSubItem($sub_ti);
2343 $this->
lng->txt(
'session_max_idle_after_first_request'),
2344 'session_max_idle_after_first_request'
2346 $sub_ti->setMaxLength(5);
2347 $sub_ti->setSize(5);
2348 $sub_ti->setInfo($this->
lng->txt(
'session_max_idle_after_first_request_info'));
2350 'session_allow_client_maintenance',
2353 $sub_ti->setDisabled(
true);
2355 $ldsh->addSubItem($sub_ti);
2358 $ssettings->addOption($ldsh);
2362 'session_allow_client_maintenance',
2367 $this->
form->addItem($ssettings);
2372 $this->
lng->txt(
'session_config'),
2375 $ti->setValue($this->
lng->txt(
'session_config_maintenance_disabled'));
2376 $ssettings->setDisabled(
true);
2377 $ti->addSubItem($ssettings);
2378 $this->
form->addItem($ti);
2383 $this->
lng->loadLanguageModule(
'ps');
2386 $pass->setTitle($this->
lng->txt(
'ps_password_settings'));
2387 $this->
form->addItem($pass);
2390 $this->
lng->txt(
'ps_password_change_on_first_login_enabled'),
2391 'password_change_on_first_login_enabled'
2393 $check->setInfo($this->
lng->txt(
'ps_password_change_on_first_login_enabled_info'));
2397 $this->
lng->txt(
'ps_password_must_not_contain_loginame'),
2398 'password_must_not_contain_loginame'
2400 $check->setInfo($this->
lng->txt(
'ps_password_must_not_contain_loginame_info'));
2404 $this->
lng->txt(
'ps_password_chars_and_numbers_enabled'),
2405 'password_chars_and_numbers_enabled'
2408 $check->setInfo($this->
lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
2412 $this->
lng->txt(
'ps_password_special_chars_enabled'),
2413 'password_special_chars_enabled'
2416 $check->setInfo($this->
lng->txt(
'ps_password_special_chars_enabled_info'));
2420 $this->
lng->txt(
'ps_password_min_length'),
2421 'password_min_length'
2423 $text->setInfo($this->
lng->txt(
'ps_password_min_length_info'));
2425 $text->setMaxLength(2);
2426 $this->
form->addItem($text);
2429 $this->
lng->txt(
'ps_password_max_length'),
2430 'password_max_length'
2432 $text->setInfo($this->
lng->txt(
'ps_password_max_length_info'));
2434 $text->setMaxLength(3);
2435 $this->
form->addItem($text);
2438 $this->
lng->txt(
'ps_password_uppercase_chars_num'),
2439 'password_ucase_chars_num'
2441 $text->setInfo($this->
lng->txt(
'ps_password_uppercase_chars_num_info'));
2442 $text->setMinValue(0);
2444 $text->setMaxLength(3);
2445 $this->
form->addItem($text);
2448 $this->
lng->txt(
'ps_password_lowercase_chars_num'),
2449 'password_lowercase_chars_num'
2451 $text->setInfo($this->
lng->txt(
'ps_password_lowercase_chars_num_info'));
2452 $text->setMinValue(0);
2454 $text->setMaxLength(3);
2455 $this->
form->addItem($text);
2458 $this->
lng->txt(
'ps_password_max_age'),
2461 $text->setInfo($this->
lng->txt(
'ps_password_max_age_info'));
2463 $text->setMaxLength(3);
2464 $this->
form->addItem($text);
2468 $this->
lng->txt(
"enable_password_assistance"),
2469 "password_assistance"
2471 $cb->setInfo($this->
lng->txt(
"password_assistance_info"));
2472 $this->
form->addItem($cb);
2475 $pass->setTitle($this->
lng->txt(
'ps_security_protection'));
2476 $this->
form->addItem($pass);
2479 $this->
lng->txt(
'ps_login_max_attempts'),
2480 'login_max_attempts'
2482 $text->setInfo($this->
lng->txt(
'ps_login_max_attempts_info'));
2484 $text->setMaxLength(2);
2485 $this->
form->addItem($text);
2489 $this->
lng->txt(
'ps_prevent_simultaneous_logins'),
2490 'ps_prevent_simultaneous_logins'
2492 $objCb->setValue(1);
2493 $objCb->setInfo($this->
lng->txt(
'ps_prevent_simultaneous_logins_info'));
2494 $this->
form->addItem($objCb);
2497 $log->setTitle($this->
lng->txt(
'loginname_settings'));
2498 $this->
form->addItem($log);
2501 $this->
lng->txt(
'allow_change_loginname'),
2502 'allow_change_loginname'
2504 $chbChangeLogin->setValue(1);
2505 $this->
form->addItem($chbChangeLogin);
2507 $this->
lng->txt(
'history_loginname'),
2508 'create_history_loginname'
2510 $chbCreateHistory->setInfo($this->
lng->txt(
'loginname_history_info'));
2511 $chbCreateHistory->setValue(1);
2513 $chbChangeLogin->addSubItem($chbCreateHistory);
2515 $this->
lng->txt(
'reuse_of_loginnames_contained_in_history'),
2516 'reuse_of_loginnames'
2518 $chbReuseLoginnames->setValue(1);
2519 $chbReuseLoginnames->setInfo($this->
lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2521 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2523 $this->
lng->txt(
'loginname_change_blocking_time'),
2524 'loginname_change_blocking_time'
2526 $chbChangeBlockingTime->allowDecimals(
true);
2527 $chbChangeBlockingTime->setSuffix($this->
lng->txt(
'days'));
2528 $chbChangeBlockingTime->setInfo($this->
lng->txt(
'loginname_change_blocking_time_info'));
2529 $chbChangeBlockingTime->setSize(10);
2530 $chbChangeBlockingTime->setMaxLength(10);
2531 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2534 $this->
lng->txt(
'usr_letter_avatars'),
2538 $la->setInfo($this->
lng->txt(
'usr_letter_avatars_info'));
2539 $this->
form->addItem($la);
2541 $passwordPolicySettingsHash = new \ilHiddenInputGUI(
'pw_policy_hash');
2542 $this->
form->addItem($passwordPolicySettingsHash);
2544 $this->
form->addCommandButton(
2545 'saveGeneralSettings',
2546 $this->
lng->txt(
'save')
2564 $ilTabs =
$DIC[
'ilTabs'];
2566 $this->raiseErrorOnMissingWrite();
2568 $lng->loadLanguageModule(
"administration");
2569 $lng->loadLanguageModule(
"mail");
2570 $lng->loadLanguageModule(
"chatroom");
2571 $this->setSubTabs(
'settings');
2572 $ilTabs->activateTab(
'settings');
2573 $ilTabs->activateSubTab(
'standard_fields');
2579 if ($this->confirm_change) {
2580 $tab->setConfirmChange();
2582 $tpl->setContent($tab->getHTML());
2587 $this->raiseErrorOnMissingWrite();
2588 $this->saveGlobalUserSettingsObject(
'save');
2595 $ilias =
$DIC[
'ilias'];
2598 $this->raiseErrorOnMissingWrite();
2600 $checked = $this->user_request->getChecked();
2601 $selected = $this->user_request->getSelect();
2603 $user_settings_config = $this->user_settings_config;
2607 $up->skipField(
"username");
2608 $field_properties = $up->getStandardFields();
2609 $profile_fields = array_keys($field_properties);
2612 foreach ($profile_fields as $field) {
2613 if (($checked[
"required_" . $field] ??
false) &&
2614 !(
int) ($checked[
'visib_reg_' . $field] ??
null)
2625 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
'invalid_visible_required_options_selected'));
2626 $this->confirm_change = 1;
2627 $this->settingsObject();
2632 $fixed_required_fields = array(
2639 "hits_per_page" => 0,
2641 "hide_own_online_status" => 0
2645 if ($action ==
'save') {
2649 $changedFields = $this->collectChangedFields();
2650 if ($this->handleChangeListeners($changedFields, $field_properties)) {
2654 foreach ($profile_fields as $field) {
2659 (
bool) ($checked[
'searchable_' . $field] ??
false)
2663 if (!($checked[
"visible_" . $field] ??
false) && !($field_properties[$field][
"visible_hide"] ??
false)) {
2675 if (!($checked[
"changeable_" . $field] ??
false) &&
2676 !($field_properties[$field][
"changeable_hide"] ??
false)) {
2689 if (($checked[
'visib_reg_' . $field] ??
false) && !($field_properties[$field][
"visib_reg_hide"] ??
false)) {
2691 'usr_settings_visib_reg_' . $field,
2696 'usr_settings_visib_reg_' . $field,
2701 if ($checked[
'visib_lua_' . $field] ??
false) {
2703 'usr_settings_visib_lua_' . $field,
2708 'usr_settings_visib_lua_' . $field,
2713 if ((
int) ($checked[
'changeable_lua_' . $field] ??
false)) {
2715 'usr_settings_changeable_lua_' . $field,
2720 'usr_settings_changeable_lua_' . $field,
2725 if (($checked[
"export_" . $field] ??
false) && !($field_properties[$field][
"export_hide"] ??
false)) {
2727 "usr_settings_export_" . $field,
2731 $ilias->deleteSetting(
"usr_settings_export_" . $field);
2735 if (($checked[
"course_export_" . $field] ??
false) && !($field_properties[$field][
"course_export_hide"] ??
false)) {
2737 "usr_settings_course_export_" . $field,
2741 $ilias->deleteSetting(
"usr_settings_course_export_" . $field);
2745 if (($checked[
"group_export_" . $field] ??
false) && !($field_properties[$field][
"group_export_hide"] ??
false)) {
2747 "usr_settings_group_export_" . $field,
2751 $ilias->deleteSetting(
"usr_settings_group_export_" . $field);
2754 $is_fixed = array_key_exists(
2756 $fixed_required_fields
2758 if (($is_fixed && $fixed_required_fields[$field]) || (!$is_fixed && ($checked[
"required_" . $field] ??
false))) {
2760 "require_" . $field,
2764 $ilias->deleteSetting(
"require_" . $field);
2768 if (isset($selected[
'default_hits_per_page']) && $selected[
'default_hits_per_page']) {
2771 $selected[
'default_hits_per_page']
2775 if ($checked[
"export_preferences"] ??
false) {
2777 "usr_settings_export_preferences",
2778 $checked[
"export_preferences"]
2781 $ilias->deleteSetting(
"usr_settings_export_preferences");
2785 'mail_incoming_mail',
2786 $selected[
'default_mail_incoming_mail'] ??
'0'
2789 'chat_osc_accept_msg',
2790 $selected[
'default_chat_osc_accept_msg'] ??
'n'
2793 'chat_broadcast_typing',
2794 $selected[
'default_chat_broadcast_typing'] ??
'n'
2797 'bs_allow_to_contact_me',
2798 $selected[
'default_bs_allow_to_contact_me'] ??
'n'
2801 'hide_own_online_status',
2802 $selected[
'default_hide_own_online_status'] ??
'n'
2805 if ($this->usrFieldChangeListenersAccepted && count($changedFields) > 0) {
2806 $this->dic->event()->raise(
2808 "onUserFieldAttributesChanged",
2813 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"usr_settings_saved"));
2814 $this->settingsObject();
2819 $this->usrFieldChangeListenersAccepted =
true;
2820 $this->confirmSavedObject();
2827 array $interestedChangeListeners
2829 $post = $this->dic->
http()->request()->getParsedBody();
2831 $confirmDialog->setHeaderText($this->
lng->txt(
"usr_field_change_components_listening"));
2832 $confirmDialog->setFormAction($this->
ctrl->getFormActionByClass(
2836 $confirmDialog->setConfirm($this->
lng->txt(
"confirm"),
"confirmUsrFieldChangeListeners");
2837 $confirmDialog->setCancel($this->
lng->txt(
"cancel"),
"settings");
2840 "tpl.usr_field_change_listener_confirm.html",
2846 foreach ($interestedChangeListeners as $interestedChangeListener) {
2847 $tpl->setVariable(
"FIELD_NAME", $interestedChangeListener->getName());
2848 foreach ($interestedChangeListener->getAttributes() as $attribute) {
2849 $tpl->setVariable(
"ATTRIBUTE_NAME", $attribute->getName());
2850 foreach ($attribute->getComponents() as $component) {
2851 $tpl->setVariable(
"COMPONENT_NAME", $component->getComponentName());
2852 $tpl->setVariable(
"DESCRIPTION", $component->getDescription());
2853 $tpl->setCurrentBlock(
"component");
2854 $tpl->parseCurrentBlock(
"component");
2856 $tpl->setCurrentBlock(
"attribute");
2857 $tpl->parseCurrentBlock(
"attribute");
2859 $tpl->setCurrentBlock(
"field");
2860 $tpl->parseCurrentBlock(
"field");
2863 $confirmDialog->addItem(
"", 0,
$tpl->get());
2865 foreach (
$post[
"chb"] as $postVar => $value) {
2866 $confirmDialog->addHiddenItem(
"chb[$postVar]", $value);
2868 foreach (
$post[
"select"] as $postVar => $value) {
2869 $confirmDialog->addHiddenItem(
"select[$postVar]", $value);
2871 foreach (
$post[
"current"] as $postVar => $value) {
2872 $confirmDialog->addHiddenItem(
"current[$postVar]", $value);
2874 $this->tpl->setContent($confirmDialog->getHTML());
2882 public function handleChangeListeners(
2883 array $changedFields,
2884 array $fieldProperties
2886 if (count($changedFields) > 0) {
2887 $interestedChangeListeners = [];
2888 foreach ($fieldProperties as $fieldName => $properties) {
2889 if (!isset($properties[
"change_listeners"])) {
2893 foreach ($properties[
"change_listeners"] as $changeListenerClassName) {
2897 $listener =
new $changeListenerClassName($this->dic);
2898 foreach ($changedFields as $changedField) {
2899 $attributeName = $changedField->getAttributeName();
2900 $descriptionForField = $listener->getDescriptionForField($fieldName, $attributeName);
2901 if ($descriptionForField !==
null && $descriptionForField !==
"") {
2902 $interestedChangeListener =
null;
2903 foreach ($interestedChangeListeners as $interestedListener) {
2904 if ($interestedListener->getFieldName() === $fieldName) {
2905 $interestedChangeListener = $interestedListener;
2910 if ($interestedChangeListener ===
null) {
2912 $this->getTranslationForField($fieldName, $properties),
2915 $interestedChangeListeners[] = $interestedChangeListener;
2918 $interestedAttribute = $interestedChangeListener->addAttribute($attributeName);
2919 $interestedAttribute->addComponent(
2920 $listener->getComponentName(),
2921 $descriptionForField
2928 if (!$this->usrFieldChangeListenersAccepted && count($interestedChangeListeners) > 0) {
2929 $this->showFieldChangeComponentsListeningConfirmDialog($interestedChangeListeners);
2942 $changedFields = [];
2943 $post = $this->dic->http()->request()->getParsedBody();
2945 !isset(
$post[
"chb"])
2946 && !is_array(
$post[
"chb"])
2947 && !isset(
$post[
"current"])
2948 && !is_array(
$post[
"current"])
2950 return $changedFields;
2953 $old =
$post[
"current"];
2954 $new =
$post[
"chb"];
2956 foreach ($old as
$key => $oldValue) {
2957 if (!isset($new[
$key])) {
2958 $isBoolean = filter_var($oldValue, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
2959 $new[
$key] = $isBoolean ?
"0" : $oldValue;
2963 $oldToNewDiff = array_diff_assoc($old, $new);
2965 foreach ($oldToNewDiff as
$key => $oldValue) {
2969 return $changedFields;
2977 $action[-1] = $this->
lng->txt(
'all_users');
2978 $action[1] = $this->
lng->txt(
'usr_active_only');
2979 $action[0] = $this->
lng->txt(
'usr_inactive_only');
2980 $action[2] = $this->
lng->txt(
'usr_limited_access_only');
2981 $action[3] = $this->
lng->txt(
'usr_without_courses');
2982 $action[4] = $this->
lng->txt(
'usr_filter_lastlogin');
2983 $action[5] = $this->
lng->txt(
"usr_filter_coursemember");
2984 $action[6] = $this->
lng->txt(
"usr_filter_groupmember");
2985 $action[7] = $this->
lng->txt(
"usr_filter_role");
3002 $files = $this->user_request->getFiles();
3003 if (count($files) == 0) {
3004 $this->
ilias->raiseError(
3005 $this->
lng->txt(
"no_checkbox"),
3006 $this->ilias->error_obj->MESSAGE
3010 if (count($files) > 1) {
3011 $this->
ilias->raiseError(
3012 $this->
lng->txt(
"select_max_one_item"),
3013 $this->ilias->error_obj->MESSAGE
3017 $file = basename($files[0]);
3019 $export_dir = $this->
object->getExportDirectory();
3021 $export_dir .
"/" . $file,
3031 $files = $this->user_request->getFiles();
3032 if (count($files) == 0) {
3033 $this->
ilias->raiseError(
3034 $this->
lng->txt(
"no_checkbox"),
3035 $this->ilias->error_obj->MESSAGE
3041 $cgui->setFormAction($this->
ctrl->getFormAction($this));
3042 $cgui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
3044 $this->
lng->txt(
"cancel"),
3045 "cancelDeleteExportFile"
3048 $this->
lng->txt(
"confirm"),
3053 foreach ($files as $file) {
3059 $this->lng->txt(
"obj_usrf")
3063 $this->tpl->setContent($cgui->getHTML());
3071 $this->
ctrl->redirectByClass(
3072 "ilobjuserfoldergui",
3082 $this->raiseErrorOnMissingWrite();
3083 $files = $this->user_request->getFiles();
3084 $export_dir = $this->
object->getExportDirectory();
3085 foreach ($files as $file) {
3086 $file = basename($file);
3088 $exp_file = $export_dir .
"/" . $file;
3089 if (is_file($exp_file)) {
3093 $this->
ctrl->redirectByClass(
3094 "ilobjuserfoldergui",
3105 $this->checkPermission(
"write,read_users");
3107 $this->
object->buildExportFile($this->user_request->getExportType());
3108 $this->
ctrl->redirect(
3118 $this->checkPermission(
"write,read_users");
3121 $button->setCaption(
'create_export_file');
3122 $button->setCommand(
'performExport');
3123 $toolbar =
$DIC->toolbar();
3124 $toolbar->setFormAction($this->
ctrl->getFormAction($this));
3126 $export_types = array(
3127 "userfolder_export_excel_x86",
3128 "userfolder_export_csv",
3129 "userfolder_export_xml"
3132 foreach ($export_types as
$type) {
3133 $options[
$type] = $this->
lng->txt($type);
3135 $type_selection = new \ilSelectInputGUI(
3139 $type_selection->setOptions($options);
3141 $toolbar->addInputItem(
3145 $toolbar->addButtonInstance($button);
3147 $table = new \ilUserExportFileTableGUI(
3152 $table->parse($this->
object->getExportFiles());
3154 $this->tpl->setContent($table->getHTML());
3162 $ilCtrl =
$DIC[
'ilCtrl'];
3164 $lng->loadLanguageModule(
"meta");
3165 $lng->loadLanguageModule(
"mail");
3174 $langs =
$lng->getInstalledLanguages();
3175 foreach ($langs as $lang_key) {
3178 $title =
$lng->txt(
"meta_l_" . $lang_key);
3179 if ($lang_key ==
$lng->getDefaultLanguage()) {
3180 $title .=
" (" .
$lng->txt(
"default") .
")";
3184 $header->setTitle($title);
3188 $lng->txt(
"subject"),
3189 "subject_" . $lang_key
3192 $subj->setValue($amail[
"subject"] ??
"");
3196 $lng->txt(
"mail_salutation_general"),
3197 "sal_g_" . $lang_key
3200 $salg->setValue($amail[
"sal_g"] ??
"");
3204 $lng->txt(
"mail_salutation_female"),
3205 "sal_f_" . $lang_key
3208 $salf->setValue($amail[
"sal_f"] ??
"");
3212 $lng->txt(
"mail_salutation_male"),
3213 "sal_m_" . $lang_key
3216 $salm->setValue($amail[
"sal_m"] ??
"");
3220 $lng->txt(
"message_content"),
3224 $body->setValue($amail[
"body"] ??
"");
3226 $body->setCols(100);
3230 $lng->txt(
"attachment"),
3233 $att->setAllowDeletion(
true);
3234 if ($amail[
"att_file"] ??
false) {
3235 $att->setValue($amail[
"att_file"]);
3241 "saveNewAccountMail",
3245 "cancelNewAccountMail",
3261 $this->raiseErrorOnMissingWrite();
3262 $this->setSubTabs(
'settings');
3263 $this->tabs_gui->setTabActive(
'settings');
3264 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
3266 $form = $this->initNewAccountMailForm();
3269 'tpl.usrf_new_account_mail.html',
3282 "TXT_USE_PLACEHOLDERS",
3283 $lng->txt(
"mail_nacc_use_placeholder")
3286 "TXT_MAIL_SALUTATION",
3287 $lng->txt(
"mail_nacc_salutation")
3291 $lng->txt(
"firstname")
3295 $lng->txt(
"lastname")
3303 $lng->txt(
"mail_nacc_login")
3307 $lng->txt(
"password")
3310 "TXT_PASSWORD_BLOCK",
3311 $lng->txt(
"mail_nacc_pw_block")
3314 "TXT_NOPASSWORD_BLOCK",
3315 $lng->txt(
"mail_nacc_no_pw_block")
3319 $lng->txt(
"mail_nacc_admin_mail")
3323 $lng->txt(
"mail_nacc_ilias_url")
3326 "TXT_INSTALLATION_NAME",
3327 $lng->txt(
"mail_nacc_installation_name")
3331 $lng->txt(
"mail_nacc_target")
3335 $lng->txt(
"mail_nacc_target_title")
3339 $lng->txt(
"mail_nacc_target_type")
3343 $lng->txt(
"mail_nacc_target_block")
3347 $lng->txt(
"mail_nacc_if_timelimit")
3351 $lng->txt(
"mail_nacc_timelimit")
3354 $this->tpl->setContent($ftpl->get());
3359 $this->
ctrl->redirect(
3371 $this->raiseErrorOnMissingWrite();
3373 $langs =
$lng->getInstalledLanguages();
3374 foreach ($langs as $lang_key) {
3377 $this->user_request->getMailSubject($lang_key),
3378 $this->user_request->getMailSalutation(
"g", $lang_key),
3379 $this->user_request->getMailSalutation(
"f", $lang_key),
3380 $this->user_request->getMailSalutation(
"m", $lang_key),
3381 $this->user_request->getMailBody($lang_key)
3384 if ($_FILES[
"att_" . $lang_key][
"tmp_name"]) {
3387 $_FILES[
"att_" . $lang_key][
"tmp_name"],
3388 $_FILES[
"att_" . $lang_key][
"name"]
3392 if ($this->user_request->getMailAttDelete($lang_key)) {
3397 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
3398 $this->
ctrl->redirect(
3413 $rbacsystem =
$DIC[
'rbacsystem'];
3414 $access =
$DIC->access();
3416 if ($rbacsystem->checkAccess(
3418 $this->object->getRefId()
3420 $this->tabs_gui->addTarget(
3422 $this->
ctrl->getLinkTarget(
3426 array(
"view",
"delete",
"resetFilter",
"userAction",
""),
3432 if ($access->checkRbacOrPositionPermissionAccess(
3437 $this->tabs_gui->addTarget(
3438 "search_user_extended",
3439 $this->
ctrl->getLinkTargetByClass(
3440 'ilRepositorySearchGUI',
3444 "ilrepositorysearchgui",
3449 if ($rbacsystem->checkAccess(
3451 $this->object->getRefId()
3453 $this->tabs_gui->addTarget(
3455 $this->
ctrl->getLinkTarget(
3459 array(
'askForUserPasswordReset',
3460 'forceUserPasswordReset',
3463 'listUserDefinedField',
3468 $this->tabs_gui->addTarget(
3470 $this->
ctrl->getLinkTarget(
3480 if ($rbacsystem->checkAccess(
3482 $this->object->getRefId()
3484 $this->tabs_gui->addTarget(
3486 $this->
ctrl->getLinkTargetByClass(
3487 array(get_class($this),
'ilpermissiongui'),
3490 array(
"perm",
"info",
"owner"),
3502 $this->tabs_gui->addSubTabTarget(
3504 $this->
ctrl->getLinkTarget(
3511 $this->tabs_gui->addSubTabTarget(
3513 $this->
ctrl->getLinkTarget(
3517 array(
"settings",
"saveGlobalUserSettings"),
3520 $this->tabs_gui->addSubTabTarget(
3521 "user_defined_fields",
3522 $this->
ctrl->getLinkTargetByClass(
3523 "ilcustomuserfieldsgui",
3524 "listUserDefinedFields"
3526 "listUserDefinedFields",
3529 $this->tabs_gui->addSubTabTarget(
3530 "user_new_account_mail",
3531 $this->
ctrl->getLinkTarget(
3539 $this->tabs_gui->addSubTabTarget(
3541 $this->
ctrl->getLinkTargetByClass(
3542 "iluserstartingpointgui",
3549 $this->tabs_gui->addSubTabTarget(
3550 "user_profile_info",
3551 $this->
ctrl->getLinkTargetByClass(
3552 "ilUserProfileInfoSettingsGUI",
3556 "ilUserProfileInfoSettingsGUI"
3559 #$this->tabs_gui->addSubTab("account_codes", $this->lng->txt("user_account_codes"),
3560 # $this->ctrl->getLinkTargetByClass("ilaccountcodesgui"));
3571 $show_blocking_time_in_days = (
int)
$ilSetting->get(
'loginname_change_blocking_time') / 86400;
3573 $this->initLoginSettingsForm();
3574 $this->loginSettingsForm->setValuesByArray(
3576 'allow_change_loginname' => (
bool)
$ilSetting->get(
'allow_change_loginname'),
3577 'create_history_loginname' => (
bool)
$ilSetting->get(
'create_history_loginname'),
3578 'reuse_of_loginnames' => (
bool)
$ilSetting->get(
'reuse_of_loginnames'),
3579 'loginname_change_blocking_time' => (
float) $show_blocking_time_in_days
3583 $this->tpl->setVariable(
3585 $this->loginSettingsForm->getHTML()
3591 $this->setSubTabs(
'settings');
3592 $this->tabs_gui->setTabActive(
'settings');
3593 $this->tabs_gui->setSubTabActive(
'loginname_settings');
3596 $this->loginSettingsForm->setFormAction(
3597 $this->
ctrl->getFormAction(
3599 'saveLoginnameSettings'
3602 $this->loginSettingsForm->setTitle($this->
lng->txt(
'loginname_settings'));
3605 $this->
lng->txt(
'allow_change_loginname'),
3606 'allow_change_loginname'
3608 $chbChangeLogin->setValue(1);
3609 $this->loginSettingsForm->addItem($chbChangeLogin);
3611 $this->
lng->txt(
'history_loginname'),
3612 'create_history_loginname'
3614 $chbCreateHistory->setInfo($this->
lng->txt(
'loginname_history_info'));
3615 $chbCreateHistory->setValue(1);
3616 $chbChangeLogin->addSubItem($chbCreateHistory);
3618 $this->
lng->txt(
'reuse_of_loginnames_contained_in_history'),
3619 'reuse_of_loginnames'
3621 $chbReuseLoginnames->setValue(1);
3622 $chbReuseLoginnames->setInfo($this->
lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
3623 $chbChangeLogin->addSubItem($chbReuseLoginnames);
3625 $this->
lng->txt(
'loginname_change_blocking_time'),
3626 'loginname_change_blocking_time'
3628 $chbChangeBlockingTime->allowDecimals(
true);
3629 $chbChangeBlockingTime->setSuffix($this->
lng->txt(
'days'));
3630 $chbChangeBlockingTime->setInfo($this->
lng->txt(
'loginname_change_blocking_time_info'));
3631 $chbChangeBlockingTime->setSize(10);
3632 $chbChangeBlockingTime->setMaxLength(10);
3633 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
3635 $this->loginSettingsForm->addCommandButton(
3636 'saveLoginnameSettings',
3637 $this->
lng->txt(
'save')
3647 $this->initLoginSettingsForm();
3648 if ($this->loginSettingsForm->checkInput()) {
3651 if (!strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time'))) {
3653 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
3654 ->setAlert($this->
lng->txt(
'loginname_change_blocking_time_invalidity_info'));
3658 $save_blocking_time_in_seconds = (
int) $this->loginSettingsForm->getInput(
3659 'loginname_change_blocking_time'
3663 'allow_change_loginname',
3664 (
int) $this->loginSettingsForm->getInput(
'allow_change_loginname')
3667 'create_history_loginname',
3668 (
int) $this->loginSettingsForm->getInput(
'create_history_loginname')
3671 'reuse_of_loginnames',
3672 (
int) $this->loginSettingsForm->getInput(
'reuse_of_loginnames')
3675 'loginname_change_blocking_time',
3676 (
int) $save_blocking_time_in_seconds
3679 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
3681 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
3684 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
3686 $this->loginSettingsForm->setValuesByPost();
3688 $this->tpl->setVariable(
3690 $this->loginSettingsForm->getHTML()
3694 public static function _goto(
int $a_user): void
3697 $main_tpl =
$DIC->ui()->mainTemplate();
3699 $ilAccess =
$DIC[
'ilAccess'];
3702 $ctrl =
$DIC[
'ilCtrl'];
3706 if ($ilAccess->checkAccess(
3711 $ctrl->redirectToURL(
"ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $a_target .
"&jmpToUser=" . $a_user);
3714 if ($ilAccess->checkAccess(
3719 $main_tpl->setOnScreenMessage(
'failure', sprintf(
3720 $lng->txt(
"msg_no_perm_read_item"),
3727 $lng->txt(
"msg_no_perm_read"),
3739 $ilCtrl =
$DIC[
'ilCtrl'];
3741 $jmpToUser = $this->user_request->getJumpToUser();
3743 $ilCtrl->setParameterByClass(
3748 $ilCtrl->redirectByClass(
3758 $access =
$DIC->access();
3760 if (!$this->checkPermissionBool(
"read_users")) {
3761 $a_user_ids = $access->filterUserIdsByPositionOfCurrentUser(
3778 if (!count($a_usr_ids)) {
3779 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
3783 $this->requested_ids = $a_usr_ids;
3786 if (stripos($a_cmd,
"export") !==
false) {
3787 $cmd = $a_cmd .
"Object";
3788 return $this->$cmd();
3791 return $this->showActionConfirmation(
3801 $rbacsystem =
$DIC[
'rbacsystem'];
3806 if ($a_search_form) {
3807 if ($rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
3809 'activate' => $this->
lng->txt(
'activate'),
3810 'deactivate' => $this->
lng->txt(
'deactivate'),
3811 'accessRestrict' => $this->
lng->txt(
'accessRestrict'),
3812 'accessFree' => $this->
lng->txt(
'accessFree')
3816 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId())) {
3817 $cmds[
"delete"] = $this->
lng->txt(
"delete");
3821 if ($rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
3823 'activateUsers' => $this->
lng->txt(
'activate'),
3824 'deactivateUsers' => $this->
lng->txt(
'deactivate'),
3825 'restrictAccess' => $this->
lng->txt(
'accessRestrict'),
3826 'freeAccess' => $this->
lng->txt(
'accessFree')
3830 if ($rbacsystem->checkAccess(
'delete', $this->object->getRefId())) {
3831 $cmds[
"deleteUsers"] = $this->
lng->txt(
"delete");
3835 if ($rbacsystem->checkAccess(
'write', $this->object->getRefId())) {
3836 $export_types = array(
"userfolder_export_excel_x86",
"userfolder_export_csv",
"userfolder_export_xml");
3837 foreach ($export_types as
$type) {
3842 $cmd = array_pop($cmd);
3843 $cmds[
'usrExport' . ucfirst($cmd)] = $this->
lng->txt(
'export') .
' - ' .
3844 $this->
lng->txt($type);
3850 if ($rbacsystem->checkAccess(
3852 $mail->getMailObjectReferenceId()
3854 $cmds[
"mail"] = $this->
lng->txt(
"send_mail");
3857 $cmds[
'addToClipboard'] = $this->
lng->txt(
'clipboard_add_btn');
3867 $user_ids = $this->getActionUserIds();
3869 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3870 $this->
ctrl->redirect(
3876 if ($this->checkPermissionBool(
'write,read_users')) {
3877 $this->
object->buildExportFile(
3881 $this->
ctrl->redirectByClass(
3882 "ilobjuserfoldergui",
3885 } elseif ($this->checkUserManipulationAccessBool()) {
3886 $fullname = $this->
object->buildExportFile(
3892 $fullname .
'.xlsx',
3906 $user_ids = $this->getActionUserIds();
3908 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3909 $this->
ctrl->redirect(
3915 if ($this->checkPermissionBool(
"write,read_users")) {
3916 $this->
object->buildExportFile(
3920 $this->
ctrl->redirectByClass(
3921 "ilobjuserfoldergui",
3924 } elseif ($this->checkUserManipulationAccessBool()) {
3925 $fullname = $this->
object->buildExportFile(
3945 $user_ids = $this->getActionUserIds();
3947 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3948 $this->
ctrl->redirect(
3953 if ($this->checkPermissionBool(
"write,read_users")) {
3954 $this->
object->buildExportFile(
3958 $this->
ctrl->redirectByClass(
3959 "ilobjuserfoldergui",
3962 } elseif ($this->checkUserManipulationAccessBool()) {
3963 $fullname = $this->
object->buildExportFile(
3984 $user_ids = $this->getActionUserIds();
3986 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3987 $this->
ctrl->redirect(
3996 $list->deleteTemporaryLists();
4001 $list->setTitle(
"-TEMPORARY SYSTEM LIST-");
4002 $list->setDescription(
"-USER ACCOUNTS MAIL-");
4003 $list->setCreatedate(date(
"Y-m-d H:i:s"));
4005 $list_id = $list->getId();
4008 foreach ($user_ids as $user_id) {
4009 $list->assignUser($user_id);
4013 $mail_data = $umail->retrieveFromStage();
4015 $umail->persistToStage(
4016 $mail_data[
'user_id'],
4017 $mail_data[
'attachments'],
4018 '#il_ml_' . $list_id,
4019 $mail_data[
'rcp_cc'],
4020 $mail_data[
'rcp_bcc'],
4021 $mail_data[
'm_subject'],
4022 $mail_data[
'm_message'],
4023 $mail_data[
'use_placeholders'],
4024 $mail_data[
'tpl_ctx_id'],
4025 $mail_data[
'tpl_ctx_params']
4034 'type' =>
'search_res'
4044 switch ($a_form_id) {
4051 'ps_password_change_on_first_login_enabled' => array($security->isPasswordChangeOnFirstLoginEnabled(),
4054 'ps_password_must_not_contain_loginame' => array($security->getPasswordMustNotContainLoginnameStatus(
4058 'ps_password_chars_and_numbers_enabled' => array($security->isPasswordCharsAndNumbersEnabled(),
4061 'ps_password_special_chars_enabled' => array($security->isPasswordSpecialCharsEnabled(),
4064 'ps_password_min_length' => $security->getPasswordMinLength(),
4065 'ps_password_max_length' => $security->getPasswordMaxLength(),
4066 'ps_password_uppercase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
4067 'ps_password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
4068 'ps_password_max_age' => $security->getPasswordMaxAge()
4070 $fields[
'ps_password_settings'] = array(
null,
null, $subitems);
4073 'ps_login_max_attempts' => $security->getLoginMaxAttempts(),
4074 'ps_prevent_simultaneous_logins' => array($security->isPreventionOfSimultaneousLoginsEnabled(),
4078 $fields[
'ps_security_protection'] = array(
null,
null, $subitems);
4080 return array(array(
"generalSettings", $fields));
4087 'tos_withdrawal_usr_deletion' => [
4088 (bool)
$DIC->settings()->get(
4089 'tos_withdrawal_usr_deletion',
4103 if ($this->inAdministration()) {
4104 $this->
ctrl->redirect(
4110 $this->
ctrl->redirectByClass(
4118 $users = $this->getActionUserIds();
4119 if (!count($users)) {
4120 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
4121 $this->
ctrl->redirect(
4130 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
4131 $this->
ctrl->redirect(
4139 if (!$this->
access->checkRbacOrPositionPermissionAccess(
4144 $this->
ilias->raiseError(
4145 $this->
lng->txt(
'permission_denied'),
4146 $this->ilias->error_obj->MESSAGE
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Customizing of pimple-DIC for ILIAS.
Class ChangedUserFieldAttribute.
Class InterestedUserFieldChangeListener.
const IL_UPDATE_ON_CONFLICT
const IL_EXTRACT_ROLES
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_IGNORE_ON_CONFLICT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static getDataDir()
get data directory (outside webspace)
static _getUserFolderId()
static _getAllUserIds(int $a_filter=0)
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
Class ilMailRfc822AddressParserFactory.
static _reset()
Reset all.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAssignUsersStatus(int $a_role_id)
addUserObject()
Add new user.
initUserRoleAssignmentForm(string $xml_file_full_path)
setUserOwnerId(int $a_id)
ilUserSettingsConfig $user_settings_config
saveGeneralSettingsObject()
Save user account settings.
addUserAutoCompleteObject()
Show auto complete results.
confirmdeactivateObject()
Set the selected users inactive.
__construct( $a_data, int $a_id, bool $a_call_by_reference)
cancelNewAccountMailObject()
getUserMultiCommands(bool $a_search_form=false)
cancelSearchActionObject()
saveGlobalUserSettingsObject(string $action="")
usrExportCsvObject()
Export csv.
newAccountMailObject()
new account mail administration
verifyXmlData(ilUserImportParser $import_parser)
showPossibleSubObjects()
show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local...
confirmUsrFieldChangeListenersObject()
initUserImportForm()
Init user import form.
searchResultHandler(array $a_usr_ids, string $a_cmd)
Handles multi command from repository search gui.
getPasswordPolicySettingsMap(\ilSecuritySettings $security)
filterUserIdsByRbacOrPositionOfCurrentUser(array $user_ids)
initFormGeneralSettings()
init general settings form
getTranslationForField(string $fieldName, array $properties)
getAdminTabs()
administration tabs show only permissions and trash folder
usrExportXmlObject()
Export xml.
raiseErrorOnMissingWrite()
importUserFormObject()
display form for user import
showFieldChangeComponentsListeningConfirmDialog(array $interestedChangeListeners)
forceUserPasswordResetObject()
askForUserPasswordResetObject()
confirmaccessFreeObject()
importUserRoleAssignmentObject()
display form for user import with new FileSystem implementation
setSubTabs(string $a_tab)
addToExternalSettingsForm(int $a_form_id)
jumpToUserObject()
Jump to edit screen for user.
__buildUserFilterSelect()
build select form to distinguish between active and non-active users
showActionConfirmation(string $action, bool $a_from_search=false)
display activation confirmation screen
importUsersObject()
Import Users with new form implementation.
showLoginnameSettingsObject()
getActionUserIds()
Get selected items for table action.
cancelDeleteExportFileObject()
cancel deletion of export files
downloadExportFileObject()
Download selected export files Sends a selected export file for download.
bool $usrFieldChangeListenersAccepted
confirmDeleteExportFileObject()
confirmation screen for export file deletion
saveNewAccountMailObject()
settingsObject()
Global user settings Allows to define global settings for user accounts Note: The Global user setting...
usrExportX86Object()
Export excel.
const USER_FIELD_TRANSLATION_MAPPING
cancelUserFolderActionObject()
ILIAS User StandardGUIRequest $user_request
getTabs()
@abstract overwrite in derived GUI class of your object type
saveLoginnameSettingsObject()
searchUserAccessFilterCallable(array $a_user_ids)
ilPropertyFormGUI $loginSettingsForm
viewObject(bool $reset_filter=false)
list users
static _goto(int $a_user)
handleUploadedFiles()
Handles uploaded zip/xmp files with Filesystem implementation.
deleteExportFileObject()
delete export files
generalSettingsObject()
Show user account general settings.
checkUserManipulationAccessBool()
Check if current user has access to manipulate user data.
confirmaccessRestrictObject()
confirmactivateObject()
Set the selected users active.
setAccessRestrictionObject(?ilPropertyFormGUI $a_form=null, bool $a_from_search=false)
freeAccessObject()
Free access.
initAccessRestrictionForm(bool $a_from_search=false)
static _writeNewAccountMail(string $a_lang, string $a_subject, string $a_sal_g, string $a_sal_f, string $a_sal_m, string $a_body)
static _updateAccountMailAttachment(string $a_lang, string $a_tmp_name, string $a_name)
Update account mail attachment.
const ORG_OP_EDIT_USER_ACCOUNTS
static _lookupNewAccountMail(string $a_lang)
static _deleteAccountMailAttachment(string $a_lang)
Delete account mail attachment.
static getFirstLettersOfLastnames(?array $user_ids=null)
Get first letters of all lastnames.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjectGUI Basic methods of all Output classes.
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isPasswordSpecialCharsEnabled()
get boolean if the passwords have to contain special characters
getPasswordMustNotContainLoginnameStatus()
Return whether the password must not contain the loginname or not.
getPasswordMinLength()
get the minimum length for passwords
getPasswordMaxLength()
get the maximum length for passwords
getPasswordNumberOfUppercaseChars()
Returns number of uppercase characters required.
isPasswordCharsAndNumbersEnabled()
get boolean if the passwords have to contain characters and numbers
static _getInstance()
Get instance of ilSecuritySettings.
getPasswordNumberOfLowercaseChars()
Returns number of lowercase characters required.
const DEFAULT_MAX_IDLE_AFTER_FIRST_REQUEST
const DEFAULT_ALLOW_CLIENT_MAINTENANCE
const DEFAULT_MAX_COUNT
default value for settings that have not been defined in setup or administration yet
static updateLimitLog(int $a_new_value)
Log max session setting.
static get(string $a_var)
const SESSION_HANDLING_LOAD_DEPENDENT
const SESSION_HANDLING_FIXED
static getSessionExpireValue()
Returns the session expiration value.
special template class to simplify handling of ITX/PEAR
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getProtocolAsHTML(string $a_log_title)
Returns the protocol as a HTML table.
getErrorLevel()
Returns the error level.
static getInstance()
Singleton method to reduce footprint (included files, created instances)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _saveStatus(string $a_key, bool $a_enabled)
static _isSearchable(string $a_key)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVisible(string $field, bool $visible)
Set a profile field being visible.
setChangeable(string $field, bool $changeable)
Set a profile field being changeable.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd)
Class ChatMainBarProvider \MainMenu\Provider.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
header include for all ilias files.