19 declare(strict_types=1);
45 'visible' =>
'user_visible_in_profile',
46 'changeable' =>
'changeable',
47 'searchable' =>
'header_searchable',
48 'required' =>
'required_field',
50 'course_export' =>
'course_export',
51 'group_export' =>
'group_export',
52 'prg_export' =>
'prg_export',
53 'visib_reg' =>
'header_visible_registration',
54 'visib_lua' =>
'usr_settings_visib_lua',
55 'changeable_lua' =>
'usr_settings_changeable_lua' 82 bool $a_call_by_reference
87 $this->
event = $DIC[
'ilAppEventHandler'];
88 $this->
filesystem = $DIC->filesystem()->storage();
89 $this->
upload = $DIC[
'upload'];
100 $this->
lng->loadLanguageModule(
'search');
101 $this->
lng->loadLanguageModule(
'user');
102 $this->
lng->loadLanguageModule(
'tos');
103 $this->
ctrl->saveParameter(
117 $this->requested_ids = $this->user_request->getIds();
124 $translation = (!isset($properties[
'lang_var']) || $properties[
'lang_var'] ===
'')
126 : $properties[
'lang_var'];
128 if ($field_name ===
'country') {
129 $translation =
'country_free_text';
131 if ($field_name ===
'sel_country') {
132 $translation =
'country_selection';
135 return $this->
lng->txt($translation);
140 $this->user_owner_id = $a_id;
150 $next_class = $this->
ctrl->getNextClass($this);
151 $cmd = $this->
ctrl->getCmd();
154 switch ($next_class) {
155 case 'ilusertablegui':
160 $u_table->initFilter();
161 $this->
ctrl->setReturn(
165 $this->
ctrl->forwardCommand($u_table);
168 case 'ilpermissiongui':
170 $this->
ctrl->forwardCommand($perm_gui);
173 case 'ilrepositorysearchgui':
174 if (!$this->
access->checkRbacOrPositionPermissionAccess(
179 $this->
ilias->raiseError(
180 $this->
lng->txt(
'permission_denied'),
181 $this->
ilias->error_obj->MESSAGE
186 $user_search->setTitle($this->
lng->txt(
'search_user_extended'));
187 $user_search->enableSearchableCheck(
false);
188 $user_search->setUserLimitations(
false);
189 $user_search->setCallback(
191 'searchResultHandler',
194 $user_search->addUserAccessFilterCallable([$this,
'searchUserAccessFilterCallable']);
195 $this->tabs_gui->setTabActive(
'search_user_extended');
196 $this->
ctrl->setReturn(
200 $this->
ctrl->forwardCommand($user_search);
203 case 'ilcustomuserfieldsgui':
205 $this->tabs_gui->setTabActive(
'settings');
207 $this->tabs_gui->activateSubTab(
'user_defined_fields');
209 $this->requested_ref_id,
210 $this->user_request->getFieldId()
212 $this->
ctrl->forwardCommand($cf);
215 case 'iluserstartingpointgui':
217 $this->tabs_gui->setTabActive(
'settings');
219 $this->tabs_gui->activateSubTab(
'starting_points');
221 $this->
ctrl->forwardCommand($cf);
224 case 'iluserprofileinfosettingsgui':
226 $this->tabs_gui->setTabActive(
'settings');
228 $this->tabs_gui->activateSubTab(
'user_profile_info');
230 $this->
ctrl->forwardCommand($ps);
249 $utab->resetOffset();
250 $utab->resetFilter();
259 $this->
ctrl->setParameterByClass(
264 $this->
ctrl->redirectByClass(
265 [
'iladministrationgui',
'ilobjusergui'],
276 $utab->resetOffset();
277 $utab->writeFilterToSession();
279 $this->tabs_gui->activateTab(
'usrf');
287 if ($this->rbac_system->checkAccess(
'create_usr', $this->object->getRefId())
288 || $this->rbac_system->checkAccess(
'cat_administrate_users', $this->object->getRefId())) {
290 $this->ui_factory->link()->standard(
291 $this->
lng->txt(
'usr_add'),
292 $this->
ctrl->getLinkTarget($this,
'addUser')
297 $this->ui_factory->link()->standard(
298 $this->
lng->txt(
'import_users'),
299 $this->
ctrl->getLinkTarget($this,
'importUserForm')
304 $list_of_users = null;
306 && $this->
access->checkRbacOrPositionPermissionAccess(
311 $list_of_users = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
325 $utab->addFilterItemValue(
331 $this->tpl->setContent($utab->getHTML());
337 $auto->addUserAccessFilterCallable(\Closure::fromCallable([$this,
'filterUserIdsByRbacOrPositionOfCurrentUser']));
338 $auto->setSearchFields([
'login',
'firstname',
'lastname',
'email',
'second_email']);
339 $auto->enableFieldSearchableCheck(
false);
340 $auto->setMoreLinkAvailable(
true);
342 if ($this->user_request->getFetchAll()) {
346 echo $auto->getList($this->user_request->getTerm());
355 return $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
365 $this->
ctrl->redirect(
379 $d = $this->obj_definition->getCreatableSubObjects($this->
object->getType());
381 if (!$this->rbac_system->checkAccess(
383 $this->object->getRefId()
389 foreach (
$d as $row) {
391 if ($row[
'max'] > 0) {
393 for ($i = 0, $iMax = count($this->data[
'ctrl']); $i < $iMax; $i++) {
394 if ($this->data[
'ctrl'][$i][
'type'] == $row[
'name']) {
399 if ($row[
'max'] ==
'' || $count < $row[
'max']) {
400 $subobj[] = $row[
'name'];
405 if (is_array($subobj)) {
412 $this->tpl->setCurrentBlock(
'add_object');
413 $this->tpl->setVariable(
417 $this->tpl->setVariable(
421 $this->tpl->setVariable(
423 $this->
lng->txt(
'add')
425 $this->tpl->parseCurrentBlock();
431 $this->
ctrl->redirect(
439 $this->
ctrl->redirectByClass(
440 'ilrepositorysearchgui',
448 $this->
ilias->raiseError(
449 $this->
lng->txt(
'msg_no_perm_write'),
450 $this->
ilias->error_obj->WARNING
461 if (!$obj->getActive()) {
462 $obj->setLoginAttempts(0);
472 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_activated'),
true);
474 if ($this->user_request->getFrSearch()) {
475 $this->
ctrl->redirectByClass(
476 'ilRepositorySearchGUI',
480 $this->
ctrl->redirect(
490 $this->
ilias->raiseError(
491 $this->
lng->txt(
'msg_no_perm_write'),
492 $this->
ilias->error_obj->WARNING
511 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_deactivated'),
true);
513 if ($this->user_request->getFrSearch()) {
514 $this->
ctrl->redirectByClass(
515 'ilRepositorySearchGUI',
519 $this->
ctrl->redirect(
529 $this->
ilias->raiseError(
530 $this->
lng->txt(
'msg_no_perm_write'),
531 $this->
ilias->error_obj->WARNING
541 $obj->setTimeLimitUnlimited(
true);
542 $obj->setTimeLimitFrom(null);
543 $obj->setTimeLimitUntil(null);
544 $obj->setTimeLimitMessage(
'');
550 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'access_free_granted'),
true);
552 if ($this->user_request->getFrSearch()) {
553 $this->
ctrl->redirectByClass(
554 'ilRepositorySearchGUI',
558 $this->
ctrl->redirect(
567 bool $a_from_search =
false 572 $this->tpl->setContent($a_form->getHTML());
579 bool $a_from_search =
false 583 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
589 $form->
setTitle($this->
lng->txt(
'time_limit_add_time_limit_for_selected'));
591 $this->
ctrl->getFormAction(
593 'confirmaccessRestrict' 598 $this->
lng->txt(
'access_from'),
602 $from->setRequired(
true);
606 $this->
lng->txt(
'access_until'),
610 $to->setShowTime(
true);
614 'confirmaccessRestrict',
615 $this->
lng->txt(
'confirm')
619 $this->
lng->txt(
'cancel')
622 foreach ($user_ids as $user_id) {
624 $ufield->setValue((
string) $user_id);
629 if ($a_from_search || $this->user_request->getFrSearch()) {
631 $field->setValue(
'1');
652 if ($timeuntil <= $timefrom) {
653 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'time_limit_not_valid'));
658 $this->
ilias->raiseError(
659 $this->
lng->txt(
'msg_no_perm_write'),
660 $this->
ilias->error_obj->WARNING
669 $obj->setTimeLimitUnlimited(
false);
670 $obj->setTimeLimitFrom((
int) $timefrom);
671 $obj->setTimeLimitUntil((
int) $timeuntil);
672 $obj->setTimeLimitMessage(
'');
676 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'access_restricted'),
true);
678 if ($this->user_request->getFrSearch()) {
679 $this->
ctrl->redirectByClass(
680 'ilRepositorySearchGUI',
684 $this->
ctrl->redirect(
694 if (!$this->rbac_system->checkAccess(
696 $this->object->getRefId()
698 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_delete'),
true);
699 $this->
ctrl->redirect(
705 $ids = $this->user_request->getIds();
707 $this->
user->getId(),
710 $this->
ilias->raiseError(
711 $this->
lng->txt(
'msg_no_delete_yourself'),
712 $this->
ilias->error_obj->WARNING
717 foreach ($ids as
$id) {
724 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_deleted'),
true);
726 if ($this->user_request->getFrSearch()) {
727 $this->
ctrl->redirectByClass(
728 'ilRepositorySearchGUI',
732 $this->
ctrl->redirect(
745 if ($this->getSelectAllPostArray()[
'select_cmd_all']) {
753 if (!$this->
access->checkAccess(
758 $this->
access->checkRbacOrPositionPermissionAccess(
764 $filtered_users = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
771 $utab->addFilterItemValue(
777 return $utab->getUserIdsForFilter();
779 return $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
793 return $this->
access->checkRbacOrPositionPermissionAccess(
802 bool $a_from_search =
false 806 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'));
811 if (!$a_from_search) {
812 $this->tabs_gui->activateTab(
'obj_usrf');
814 $this->tabs_gui->activateTab(
'search_user_extended');
833 if (strcmp($action,
'addToClipboard') === 0) {
840 if (!$a_from_search) {
841 $cancel =
'cancelUserFolderAction';
843 $cancel =
'cancelSearchAction';
848 $cgui->setFormAction($this->
ctrl->getFormAction($this));
849 $cgui->setHeaderText($this->
lng->txt(
'info_' . $action .
'_sure'));
851 $this->
lng->txt(
'cancel'),
855 $this->
lng->txt(
'confirm'),
859 if ($a_from_search) {
860 $cgui->addHiddenItem(
866 foreach ($user_ids as
$id) {
871 $login = $this->
lng->txt(
'never');
891 $this->tpl->setContent($cgui->getHTML());
898 if (!$this->
access->checkRbacOrPositionPermissionAccess(
903 $this->
ilias->raiseError(
904 $this->
lng->txt(
'permission_denied'),
905 $this->
ilias->error_obj->MESSAGE
910 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_delete_yourself'));
927 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_deactivate_yourself'));
954 $this->tabs_gui->clearTargets();
955 $this->tabs_gui->setBackTarget(
956 $this->
lng->txt(
'usrf'),
957 $this->
ctrl->getLinkTarget(
963 !$this->rbac_system->checkAccess(
'create_usr', $this->object->getRefId())
964 && !$this->
access->checkAccess(
'cat_administrate_users',
'', $this->object->getRefId())
966 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'));
970 $this->tpl->setContent($this->
form->getHTML());
979 $this->
lng->txt(
'import_file'),
983 $fi->setRequired(
true);
984 $this->
form->addItem($fi);
986 $this->
form->addCommandButton(
987 'importUserRoleAssignment',
988 $this->
lng->txt(
'import')
990 $this->
form->addCommandButton(
992 $this->
lng->txt(
'cancel')
995 $this->
form->setTitle($this->
lng->txt(
'import_users'));
996 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1001 return (strtolower($this->user_request->getBaseClass()) ===
'iladministrationgui');
1007 if ($this->
filesystem->hasDir($import_dir)) {
1012 $this->
ctrl->redirect(
1017 $this->
ctrl->redirectByClass(
1030 $importDir =
'user_import/usr_' . $this->
user->getId() .
'_' . mb_substr(session_id(), 0, 8);
1040 $this->tabs_gui->clearTargets();
1041 $this->tabs_gui->setBackTarget(
1042 $this->
lng->txt(
'usrf'),
1043 $this->
ctrl->getLinkTarget(
1050 if ($this->
form->checkInput()) {
1056 $this->tpl->setContent(
$message . $this->ui_renderer->render($form));
1058 $this->
form->setValuesByPost();
1059 $this->tpl->setContent($this->
form->getHTML());
1069 $global_roles_assignment_info = null;
1070 $local_roles_assignment_info = null;
1073 $xml_file_full_path,
1076 $import_parser->startParsing();
1080 $xml_file_name = explode(
1084 $roles_import_filename = $this->ui_factory->input()->field()
1085 ->text($this->
lng->txt(
'import_file'))
1086 ->withDisabled(
true)
1087 ->withValue(end($xml_file_name));
1089 $roles_import_count = $this->ui_factory->input()->field()
1090 ->numeric($this->
lng->txt(
'num_users'))
1091 ->withDisabled(
true)
1092 ->withValue($import_parser->getUserCount());
1095 $xml_file_full_path,
1098 $import_parser->startParsing();
1100 $roles = $import_parser->getCollectedRoles();
1101 $all_gl_roles = $this->rbac_review->getRoleListByObject(
ROLE_FOLDER_ID);
1103 $roles_of_user = $this->rbac_review->assignedRoles($this->
user->getId());
1104 foreach ($all_gl_roles as $obj_data) {
1117 $gl_roles[$obj_data[
'obj_id']] = $obj_data[
'title'];
1122 $got_globals =
false;
1123 $global_selects = [];
1124 foreach ($roles as $role_id => $role) {
1125 if ($role[
'type'] ===
'Global') {
1126 $select_options = [];
1127 if (!$got_globals) {
1128 $global_roles_assignment_info = $this->ui_factory->input()->field()
1129 ->text($this->
lng->txt(
'roles_of_import_global'))
1130 ->withDisabled(
true)
1131 ->withValue($this->
lng->txt(
'assign_global_role'));
1133 $select_options[] = $this->
lng->txt(
'usrimport_ignore_role');
1136 foreach ($gl_roles as
$key => $value) {
1137 $select_options[$role_id .
'-' .
$key] = $value;
1141 $pre_select = array_search(
1146 switch ($role[
'name']) {
1147 case 'Administrator':
1148 $pre_select = array_search(
1155 $pre_select = array_search(
1162 $pre_select = array_search(
1169 $pre_select = array_search(
1176 $pre_select = array_search(
1184 $select = $this->ui_factory->input()->field()
1189 ->withValue($pre_select);
1191 if (!$got_globals) {
1192 $got_globals =
true;
1193 $global_selects[] = $select->withRequired(
true);
1195 $global_selects[] = $select;
1201 $got_locals =
false;
1202 foreach ($roles as $role_id => $role) {
1203 if ($role[
'type'] ==
'Local') {
1210 $local_roles_assignment_info = $this->ui_factory->input()->field()
1211 ->text($this->
lng->txt(
'roles_of_import_local'))
1212 ->withDisabled(
true)
1213 ->withValue($this->
lng->txt(
'assign_local_role'));
1225 foreach ($roles as $role_id => $role) {
1226 if ($role[
'type'] ==
'Local') {
1227 $searchName = (strpos($role[
'name'],
'#') === 0) ? $role[
'name'] :
'#' . $role[
'name'];
1228 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1229 foreach ($matching_role_ids as $mid) {
1234 $loc_roles[] = $mid;
1243 $loc_roles = $this->rbac_review->getAssignableRolesInSubtree($this->
object->getRefId());
1248 foreach ($loc_roles as
$key => $loc_role) {
1250 $rolf = $this->rbac_review->getFoldersAssignedToRole(
1260 !$this->rbac_review->isDeleted($rolf[0]) &&
1261 $this->rbac_system->checkAccess(
1278 if ($this->tree->isInTree($rolf[0])) {
1281 $tmpPath = $this->tree->getPathFull($rolf[0]);
1282 $tmpPath[] = $rolf[0];
1284 for ($i = 1, $n = count($tmpPath) - 1; $i < $n; $i++) {
1285 if ($i < 3 || $i > $n - 3) {
1286 $path_array[] = $tmpPath[$i][
'title'];
1287 } elseif ($i == 3 || $i == $n - 3) {
1288 $path_array[] =
'...';
1291 $is_in_subtree |= $tmpPath[$i][
'obj_id'] == $this->
object->getId();
1296 array_reverse($path_array)
1299 $path =
'<b>Rolefolder ' . $rolf[0] .
' not found in tree! (Role ' . $loc_role .
')</b>';
1301 $roleMailboxAddress = (new \ilRoleMailboxAddress($loc_role))->value();
1302 $l_roles[$loc_role] = $roleMailboxAddress .
', ' .
$path;
1306 natcasesort($l_roles);
1307 $l_roles[
'ignore'] = $this->
lng->txt(
'usrimport_ignore_role');
1310 $local_selects = [];
1311 foreach ($roles as $role_id => $role) {
1312 if ($role[
'type'] ==
'Local') {
1313 $searchName = (strpos($role[
'name'],
'#') === 0) ? $role[
'name'] :
'#' . $role[
'name'];
1314 $matching_role_ids = $roleMailboxSearch->searchRoleIdsByAddressString($searchName);
1315 $pre_select = count($matching_role_ids) == 1 ? $role_id .
'-' . $matching_role_ids[0] :
'ignore';
1317 $selectable_roles = [];
1322 $selectable_roles[
'ignore'] = $this->
lng->txt(
'usrimport_ignore_role');
1323 foreach ($matching_role_ids as
$id) {
1324 $selectable_roles[$role_id .
'-' .
$id] = $l_roles[
$id];
1327 foreach ($l_roles as $local_role_id => $value) {
1328 if ($local_role_id !==
'ignore') {
1329 $selectable_roles[$role_id .
'-' . $local_role_id] = $value;
1334 if (count($selectable_roles) > 0) {
1335 $select = $this->ui_factory->input()->field()
1336 ->select($role[
'name'], $selectable_roles)
1337 ->withRequired(
true);
1338 if (array_key_exists($pre_select, $selectable_roles)) {
1339 $select = $select->withValue($pre_select);
1341 $local_selects[] = $select;
1352 $conflict_action_select = $this->ui_factory->input()->field()
1354 $this->
lng->txt(
'conflict_handling'),
1359 $this->
lng->txt(
'usrimport_conflict_handling_info')
1363 ->withRequired(
true);
1366 $this->
lng->loadLanguageModule(
'mail');
1368 $mail_section = null;
1369 if (trim($amail[
'body'] ??
'') !=
'' && trim($amail[
'subject'] ??
'') !=
'') {
1370 $send_checkbox = $this->ui_factory->input()->field()->checkbox($this->
lng->txt(
'user_send_new_account_mail'))
1373 $mail_section = $this->ui_factory->input()->field()->section(
1375 $this->
lng->txt(
'mail_account_mail')
1379 $file_info_section = $this->ui_factory->input()->field()->section(
1381 'filename' => $roles_import_filename,
1382 'import_count' => $roles_import_count,
1384 $this->
lng->txt(
'file_info')
1387 $form_action = $this->
ctrl->getFormActionByClass(self::class,
'importUsers');
1390 'file_info' => $file_info_section
1393 if (!empty($global_selects)) {
1394 $global_role_info_section = $this->ui_factory->input()
1396 ->section([$global_roles_assignment_info], $this->
lng->txt(
'global_role_assignment'));
1397 $global_role_selection_section = $this->ui_factory->input()->field()->section($global_selects,
'');
1398 $form_elements[
'global_role_info'] = $global_role_info_section;
1399 $form_elements[
'global_role_selection'] = $global_role_selection_section;
1402 if (!empty($local_selects)) {
1403 $local_role_info_section = $this->ui_factory->input()->field()->section(
1404 [$local_roles_assignment_info],
1405 $this->
lng->txt(
'local_role_assignment')
1407 $local_role_selection_section = $this->ui_factory->input()->field()->section(
1412 $form_elements[
'local_role_info'] = $local_role_info_section;
1413 $form_elements[
'local_role_selection'] = $local_role_selection_section;
1416 $form_elements[
'conflict_action'] = $this->ui_factory->input()->field()->section([$conflict_action_select],
'');
1418 if ($mail_section !== null) {
1419 $form_elements[
'send_mail'] = $mail_section;
1422 return [$this->ui_factory->input()->container()->form()->standard(
1435 if (!$this->
upload->hasBeenProcessed()) {
1436 $this->
upload->process();
1440 if ($this->
filesystem->hasDir($import_dir)) {
1445 foreach ($this->
upload->getResults() as $single_file_upload) {
1446 $file_name = $single_file_upload->getName();
1447 $parts = pathinfo($file_name);
1450 if (!$single_file_upload->isOK()) {
1452 $this->
ilias->raiseError(
1453 $this->
lng->txt(
'no_import_file_found'),
1454 $this->
ilias->error_obj->MESSAGE
1459 $this->
upload->moveFilesTo(
1465 if ($single_file_upload->getMimeType() ==
'application/zip') {
1468 . $this->
user->getId() .
'_' . session_id() .
'/' . $file_name;
1469 $this->dic->legacyArchives()->unzip($full_path);
1472 $file_list = $this->
filesystem->listContents($import_dir);
1474 foreach ($file_list as
$key => $a_file) {
1479 unset($file_list[
$key]);
1480 $xml_file = $a_file->getPath();
1486 foreach ($file_list as $a_file) {
1487 $this->
filesystem->delete($a_file->getPath());
1490 if (is_null($xml_file)) {
1493 '.' .
$parts[
'extension']
1495 $xml_file = $import_dir .
'/' . $subdir .
'/' . $subdir .
'.xml';
1501 $xml_file = $file->getPath();
1507 $this->
ilias->raiseError(
1508 $this->
lng->txt(
'no_xml_file_found_in_zip')
1509 .
' ' . $subdir .
'/' . $subdir .
'.xml',
1510 $this->
ilias->error_obj->MESSAGE
1528 $this->tpl->setOnScreenMessage(
1531 $this->
lng->txt(
'verification_failure_log')
1535 $this->
ctrl->redirectByClass(self::class,
'importUserForm');
1548 $file_list = $this->
filesystem->listContents($import_dir);
1550 if (count($file_list) > 1) {
1552 $this->tpl->setOnScreenMessage($this->
lng->txt(
'usrimport_wrong_file_count'),
true);
1555 $xml_file = $file_list[0]->getPath();
1560 if (!$this->user_request->isPost()) {
1561 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'usrimport_form_not_evaluabe'),
true);
1566 $result = $form->getData();
1568 if ($result === null) {
1569 $this->tpl->setContent($this->ui_renderer->render($form));
1573 $rule = $result[
'conflict_action'][0] ?? 1;
1576 $local_role_selection = (array) ($result[
'local_role_selection'] ?? []);
1577 $global_role_selection = (array) ($result[
'global_role_selection'] ?? []);
1578 $roles = array_merge(
1579 $local_role_selection,
1580 $global_role_selection
1583 $role_assignment = [];
1584 foreach ($roles as $value) {
1589 if (count($keys) === 2) {
1590 $role_assignment[$keys[0]] = $keys[1];
1604 if (!empty($role_assignment)) {
1605 $global_roles = $this->rbac_review->getGlobalRoles();
1606 $roles_of_user = $this->rbac_review->assignedRoles($this->
user->getId());
1607 foreach ($role_assignment as $role_id_string) {
1608 $role_id = $this->
refinery->byTrying([
1609 $this->
refinery->kindlyTo()->int(),
1611 ])->transform($role_id_string);
1612 if ($role_id === null) {
1624 if (isset($result[
'send_mail'])) {
1625 $import_parser->setSendMail($result[
'send_mail'][0]);
1628 $import_parser->setRoleAssignment($role_assignment);
1629 $import_parser->startParsing();
1634 switch ($import_parser->getErrorLevel()) {
1636 $this->tpl->setOnScreenMessage(
1638 $this->
lng->txt(
'user_imported'),
1643 $this->tpl->setOnScreenMessage(
1645 $this->
lng->txt(
'user_imported_with_warnings')
1646 . $import_parser->getProtocolAsHTML(
1647 $this->
lng->txt(
'import_warning_log')
1653 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'user_import_failed'),
true);
1659 $this->
ctrl->redirect(
1664 $this->
ctrl->redirectByClass(
1673 array $roles_of_user,
1674 array $global_roles,
1693 $this->tpl->setOnScreenMessage(
1695 $this->
lng->txt(
'usrimport_with_specified_role_not_permitted'),
1703 $rolf = $this->rbac_review->getFoldersAssignedToRole(
1707 if ($this->rbac_review->isDeleted($rolf[0])
1708 || !$this->rbac_system->checkAccess(
1714 $this->tpl->setOnScreenMessage(
1716 $this->
lng->txt(
'usrimport_with_specified_role_not_permitted'),
1733 $show_blocking_time_in_days = $this->
settings->get(
'loginname_change_blocking_time') / 86400;
1734 $show_blocking_time_in_days = (float) $show_blocking_time_in_days;
1739 'lua' => $aset->isLocalUserAdministrationEnabled(),
1740 'lrua' => $aset->isUserAccessRestricted(),
1741 'allow_change_loginname' => (bool) $this->
settings->get(
'allow_change_loginname'),
1742 'create_history_loginname' => (bool) $this->
settings->get(
'create_history_loginname'),
1743 'reuse_of_loginnames' => (bool) $this->
settings->get(
'reuse_of_loginnames'),
1744 'loginname_change_blocking_time' => $show_blocking_time_in_days,
1745 'user_reactivate_code' => (
int) $this->
settings->get(
'user_reactivate_code'),
1746 'user_own_account' => (
int) $this->
settings->get(
'user_delete_own_account'),
1747 'user_own_account_email' => $this->
settings->get(
'user_delete_own_account_email'),
1748 'dpro_withdrawal_usr_deletion' => (bool) $this->
settings->get(
'dpro_withdrawal_usr_deletion'),
1749 'tos_withdrawal_usr_deletion' => (bool) $this->
settings->get(
'tos_withdrawal_usr_deletion'),
1751 'session_handling_type' => $this->
settings->get(
1752 'session_handling_type',
1755 'session_reminder_enabled' => $this->
settings->get(
'session_reminder_enabled'),
1756 'session_max_count' => $this->
settings->get(
1757 'session_max_count',
1760 'session_min_idle' => $this->
settings->get(
1764 'session_max_idle' => $this->
settings->get(
1768 'session_max_idle_after_first_request' => $this->
settings->get(
1769 'session_max_idle_after_first_request',
1773 'login_max_attempts' => $security->getLoginMaxAttempts() > 0 ? $security->getLoginMaxAttempts() :
'',
1774 'ps_prevent_simultaneous_logins' => (
int) $security->isPreventionOfSimultaneousLoginsEnabled(),
1775 'password_assistance' => (bool) $this->
settings->get(
'password_assistance'),
1776 'letter_avatars' => (
int) $this->
settings->get(
'letter_avatars'),
1777 'password_change_on_first_login_enabled' => $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0,
1778 'password_max_age' => $security->getPasswordMaxAge()
1782 $this->
form->setValuesByArray(
1785 $passwordPolicySettings,
1786 [
'pw_policy_hash' => md5(
1789 $passwordPolicySettings
1796 $this->tpl->setContent($this->
form->getHTML());
1819 if ($this->
form->checkInput()) {
1821 if ($this->
form->getInput(
'allow_change_loginname') ===
'1' &&
1822 !is_numeric($this->
form->getInput(
'loginname_change_blocking_time'))) {
1824 $this->
form->getItemByPostVar(
'loginname_change_blocking_time')
1825 ->setAlert($this->
lng->txt(
'loginname_change_blocking_time_invalidity_info'));
1831 $security->setPasswordCharsAndNumbersEnabled(
1832 (
bool) $this->
form->getInput(
'password_chars_and_numbers_enabled')
1834 $security->setPasswordSpecialCharsEnabled(
1835 (
bool) $this->
form->getInput(
'password_special_chars_enabled')
1837 $security->setPasswordMinLength(
1838 (
int) $this->
form->getInput(
'password_min_length')
1840 $security->setPasswordMaxLength(
1841 (
int) $this->
form->getInput(
'password_max_length')
1843 $security->setPasswordNumberOfUppercaseChars(
1844 (
int) $this->
form->getInput(
'password_ucase_chars_num')
1846 $security->setPasswordNumberOfLowercaseChars(
1847 (
int) $this->
form->getInput(
'password_lowercase_chars_num')
1849 $security->setPasswordMaxAge(
1850 (
int) $this->
form->getInput(
'password_max_age')
1852 $security->setLoginMaxAttempts(
1853 (
int) $this->
form->getInput(
'login_max_attempts')
1855 $security->setPreventionOfSimultaneousLogins(
1856 (
bool) $this->
form->getInput(
'ps_prevent_simultaneous_logins')
1858 $security->setPasswordChangeOnFirstLoginEnabled(
1859 (
bool) $this->
form->getInput(
'password_change_on_first_login_enabled')
1861 $security->setPasswordMustNotContainLoginnameStatus(
1862 (
bool) $this->
form->getInput(
'password_must_not_contain_loginame')
1865 if ($security->validate($this->form) !== null) {
1877 'allow_change_loginname',
1878 $this->
form->getInput(
'allow_change_loginname')
1881 'create_history_loginname',
1882 $this->
form->getInput(
'create_history_loginname')
1885 'reuse_of_loginnames',
1886 $this->
form->getInput(
'reuse_of_loginnames')
1888 $save_blocking_time_in_seconds = (string) ((
int) $this->
form->getInput(
1889 'loginname_change_blocking_time' 1892 'loginname_change_blocking_time',
1893 $save_blocking_time_in_seconds
1896 'user_reactivate_code',
1897 $this->
form->getInput(
'user_reactivate_code')
1901 'user_delete_own_account',
1902 $this->
form->getInput(
'user_own_account')
1905 'user_delete_own_account_email',
1906 $this->
form->getInput(
'user_own_account_email')
1909 'dpro_withdrawal_usr_deletion',
1910 $this->
form->getInput(
'dpro_withdrawal_usr_deletion') ===
'1' ?
'1' :
'0' 1913 'tos_withdrawal_usr_deletion',
1914 $this->
form->getInput(
'tos_withdrawal_usr_deletion') ===
'1' ?
'1' :
'0' 1918 'password_assistance',
1919 $this->
form->getInput(
'password_assistance')
1924 'session_handling_type',
1925 $this->
form->getInput(
'session_handling_type')
1930 'session_reminder_enabled',
1931 $this->
form->getInput(
'session_reminder_enabled')
1933 } elseif ($this->
form->getInput(
1934 'session_handling_type' 1938 'session_allow_client_maintenance',
1946 'session_max_count',
1947 $this->
form->getInput(
'session_max_count')
1951 $this->
form->getInput(
'session_min_idle')
1955 $this->
form->getInput(
'session_max_idle')
1958 'session_max_idle_after_first_request',
1959 $this->
form->getInput(
'session_max_idle_after_first_request')
1966 $this->
form->getInput(
'letter_avatars')
1969 $requestPasswordReset =
false;
1970 if ($this->
form->getInput(
'pw_policy_hash')) {
1971 $oldSettingsHash = $this->
form->getInput(
'pw_policy_hash');
1972 $currentSettingsHash = md5(
1978 $requestPasswordReset = ($oldSettingsHash !== $currentSettingsHash);
1981 if ($requestPasswordReset) {
1982 $this->
ctrl->redirect(
1984 'askForUserPasswordReset' 1987 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
1990 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
1993 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
1995 $this->
form->setValuesByPost();
1996 $this->tpl->setContent($this->
form->getHTML());
2002 $this->
lng->loadLanguageModule(
'ps');
2004 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ps_passwd_policy_change_force_user_reset_succ'),
true);
2005 $this->
ctrl->redirect(
2013 $this->
lng->loadLanguageModule(
'ps');
2015 $this->tpl->setOnScreenMessage(
2017 $this->
lng->txt(
'ps_passwd_policy_changed_force_user_reset')
2021 $this->ui_factory->button()->standard(
2022 $this->
lng->txt(
'yes'),
2023 $this->
ctrl->getLinkTargetByClass(self::class,
'forceUserPasswordReset')
2028 $this->ui_factory->button()->standard(
2029 $this->
lng->txt(
'no'),
2030 $this->
ctrl->getLinkTargetByClass(self::class,
'generalSettings')
2038 $this->tabs_gui->setTabActive(
'settings');
2039 $this->tabs_gui->setSubTabActive(
'general_settings');
2042 $this->
form->setFormAction(
2043 $this->
ctrl->getFormAction(
2045 'saveGeneralSettings' 2049 $this->
form->setTitle($this->
lng->txt(
'general_settings'));
2052 $this->
lng->txt(
'enable_local_user_administration'),
2055 $lua->setInfo($this->
lng->txt(
'enable_local_user_administration_info'));
2056 $lua->setValue(
'1');
2057 $this->
form->addItem($lua);
2060 $this->
lng->txt(
'restrict_user_access'),
2063 $lrua->setInfo($this->
lng->txt(
'restrict_user_access_info'));
2064 $lrua->setValue(
'1');
2065 $this->
form->addItem($lrua);
2068 $this->
lng->txt(
'user_account_code_setting'),
2069 'user_reactivate_code' 2071 $code->setInfo($this->
lng->txt(
'user_account_code_setting_info'));
2072 $this->
form->addItem($code);
2075 $this->
lng->txt(
'user_allow_delete_own_account'),
2078 $this->
form->addItem($own);
2080 $this->
lng->txt(
'user_delete_own_account_notification_email'),
2081 'user_own_account_email' 2083 $own->addSubItem($own_email);
2085 $this->
lng->loadLanguageModule(
'tos');
2086 $this->
lng->loadLanguageModule(
'dpro');
2087 $this->
form->addItem($this->
checkbox(
'tos_withdrawal_usr_deletion'));
2088 $this->
form->addItem($this->
checkbox(
'dpro_withdrawal_usr_deletion'));
2090 $allow_client_maintenance = $this->
settings->get(
2091 'session_allow_client_maintenance',
2096 $this->
lng->txt(
'sess_mode'),
2097 'session_handling_type' 2102 $this->
lng->txt(
'sess_fixed_duration'),
2108 $this->
lng->txt(
'session_reminder'),
2109 'session_reminder_enabled' 2117 $this->
lng->txt(
'session_reminder_info') .
'<br />' .
2119 $this->
lng->txt(
'session_reminder_session_duration'),
2126 $ssettings->addOption($fixed);
2130 $this->
lng->txt(
'sess_load_dependent_session_handling'),
2139 $this->
lng->txt(
'session_max_count'),
2142 $sub_ti->setMaxLength(5);
2143 $sub_ti->setSize(5);
2144 $sub_ti->setInfo($this->
lng->txt(
'session_max_count_info'));
2145 if (!$allow_client_maintenance) {
2146 $sub_ti->setDisabled(
true);
2148 $ldsh->addSubItem($sub_ti);
2154 $this->
lng->txt(
'session_min_idle'),
2157 $sub_ti->setMaxLength(5);
2158 $sub_ti->setSize(5);
2159 $sub_ti->setInfo($this->
lng->txt(
'session_min_idle_info'));
2160 if (!$allow_client_maintenance) {
2161 $sub_ti->setDisabled(
true);
2163 $ldsh->addSubItem($sub_ti);
2169 $this->
lng->txt(
'session_max_idle'),
2172 $sub_ti->setMaxLength(5);
2173 $sub_ti->setSize(5);
2174 $sub_ti->setInfo($this->
lng->txt(
'session_max_idle_info'));
2175 if (!$allow_client_maintenance) {
2176 $sub_ti->setDisabled(
true);
2178 $ldsh->addSubItem($sub_ti);
2183 $this->
lng->txt(
'session_max_idle_after_first_request'),
2184 'session_max_idle_after_first_request' 2186 $sub_ti->setMaxLength(5);
2187 $sub_ti->setSize(5);
2188 $sub_ti->setInfo($this->
lng->txt(
'session_max_idle_after_first_request_info'));
2189 if (!$allow_client_maintenance) {
2190 $sub_ti->setDisabled(
true);
2192 $ldsh->addSubItem($sub_ti);
2195 $ssettings->addOption($ldsh);
2198 if ($allow_client_maintenance) {
2201 $this->
form->addItem($ssettings);
2206 $this->
lng->txt(
'session_config'),
2209 $ti->setValue($this->
lng->txt(
'session_config_maintenance_disabled'));
2210 $ssettings->setDisabled(
true);
2211 $ti->addSubItem($ssettings);
2212 $this->
form->addItem($ti);
2217 $this->
lng->loadLanguageModule(
'ps');
2220 $pass->setTitle($this->
lng->txt(
'ps_password_settings'));
2221 $this->
form->addItem($pass);
2224 $this->
lng->txt(
'ps_password_change_on_first_login_enabled'),
2225 'password_change_on_first_login_enabled' 2227 $check->setInfo($this->
lng->txt(
'ps_password_change_on_first_login_enabled_info'));
2231 $this->
lng->txt(
'ps_password_must_not_contain_loginame'),
2232 'password_must_not_contain_loginame' 2234 $check->setInfo($this->
lng->txt(
'ps_password_must_not_contain_loginame_info'));
2238 $this->
lng->txt(
'ps_password_chars_and_numbers_enabled'),
2239 'password_chars_and_numbers_enabled' 2242 $check->setInfo($this->
lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
2246 $this->
lng->txt(
'ps_password_special_chars_enabled'),
2247 'password_special_chars_enabled' 2250 $check->setInfo($this->
lng->txt(
'ps_password_special_chars_enabled_info'));
2254 $this->
lng->txt(
'ps_password_min_length'),
2255 'password_min_length' 2257 $text->setInfo($this->
lng->txt(
'ps_password_min_length_info'));
2259 $text->setMaxLength(2);
2260 $this->
form->addItem($text);
2263 $this->
lng->txt(
'ps_password_max_length'),
2264 'password_max_length' 2266 $text->setInfo($this->
lng->txt(
'ps_password_max_length_info'));
2268 $text->setMaxLength(3);
2269 $this->
form->addItem($text);
2272 $this->
lng->txt(
'ps_password_uppercase_chars_num'),
2273 'password_ucase_chars_num' 2275 $text->setInfo($this->
lng->txt(
'ps_password_uppercase_chars_num_info'));
2276 $text->setMinValue(0);
2278 $text->setMaxLength(3);
2279 $this->
form->addItem($text);
2282 $this->
lng->txt(
'ps_password_lowercase_chars_num'),
2283 'password_lowercase_chars_num' 2285 $text->setInfo($this->
lng->txt(
'ps_password_lowercase_chars_num_info'));
2286 $text->setMinValue(0);
2288 $text->setMaxLength(3);
2289 $this->
form->addItem($text);
2292 $this->
lng->txt(
'ps_password_max_age'),
2295 $text->setInfo($this->
lng->txt(
'ps_password_max_age_info'));
2297 $text->setMaxLength(3);
2298 $this->
form->addItem($text);
2302 $this->
lng->txt(
'enable_password_assistance'),
2303 'password_assistance' 2305 $cb->setInfo($this->
lng->txt(
'password_assistance_info'));
2306 $this->
form->addItem($cb);
2309 $pass->setTitle($this->
lng->txt(
'ps_security_protection'));
2310 $this->
form->addItem($pass);
2313 $this->
lng->txt(
'ps_login_max_attempts'),
2314 'login_max_attempts' 2316 $text->setInfo($this->
lng->txt(
'ps_login_max_attempts_info'));
2317 $text->allowDecimals(
false);
2318 $text->setMinValue(1);
2321 $text->setMaxLength(2);
2322 $this->
form->addItem($text);
2326 $this->
lng->txt(
'ps_prevent_simultaneous_logins'),
2327 'ps_prevent_simultaneous_logins' 2329 $objCb->setValue(
'1');
2330 $objCb->setInfo($this->
lng->txt(
'ps_prevent_simultaneous_logins_info'));
2331 $this->
form->addItem($objCb);
2334 $log->setTitle($this->
lng->txt(
'loginname_settings'));
2335 $this->
form->addItem($log);
2338 $this->
lng->txt(
'allow_change_loginname'),
2339 'allow_change_loginname' 2341 $chbChangeLogin->setValue(
'1');
2342 $this->
form->addItem($chbChangeLogin);
2344 $this->
lng->txt(
'history_loginname'),
2345 'create_history_loginname' 2347 $chbCreateHistory->setInfo($this->
lng->txt(
'loginname_history_info'));
2348 $chbCreateHistory->setValue(
'1');
2350 $chbChangeLogin->addSubItem($chbCreateHistory);
2352 $this->
lng->txt(
'reuse_of_loginnames_contained_in_history'),
2353 'reuse_of_loginnames' 2355 $chbReuseLoginnames->setValue(
'1');
2356 $chbReuseLoginnames->setInfo($this->
lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
2358 $chbChangeLogin->addSubItem($chbReuseLoginnames);
2360 $this->
lng->txt(
'loginname_change_blocking_time'),
2361 'loginname_change_blocking_time' 2363 $chbChangeBlockingTime->allowDecimals(
true);
2364 $chbChangeBlockingTime->setSuffix($this->
lng->txt(
'days'));
2365 $chbChangeBlockingTime->setInfo($this->
lng->txt(
'loginname_change_blocking_time_info'));
2366 $chbChangeBlockingTime->setSize(10);
2367 $chbChangeBlockingTime->setMaxLength(10);
2368 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
2371 $this->
lng->txt(
'usr_letter_avatars'),
2375 $la->setInfo($this->
lng->txt(
'usr_letter_avatars_info'));
2376 $this->
form->addItem($la);
2378 $passwordPolicySettingsHash = new \ilHiddenInputGUI(
'pw_policy_hash');
2379 $this->
form->addItem($passwordPolicySettingsHash);
2381 $this->
form->addCommandButton(
2382 'saveGeneralSettings',
2383 $this->
lng->txt(
'save')
2399 $this->
lng->loadLanguageModule(
'administration');
2400 $this->
lng->loadLanguageModule(
'mail');
2401 $this->
lng->loadLanguageModule(
'chatroom');
2403 $this->tabs_gui->activateTab(
'settings');
2404 $this->tabs_gui->activateSubTab(
'standard_fields');
2410 if ($this->confirm_change) {
2411 $tab->setConfirmChange();
2413 $this->tpl->setContent($tab->getHTML());
2426 $checked = $this->user_request->getChecked();
2427 $selected = $this->user_request->getSelect();
2433 $up->skipField(
'username');
2434 $field_properties = $up->getStandardFields();
2435 $profile_fields = array_keys($field_properties);
2438 foreach ($profile_fields as $field) {
2439 if (($checked[
'required_' . $field] ??
false) &&
2440 !(
int) ($checked[
'visib_reg_' . $field] ?? null)
2448 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'invalid_visible_required_options_selected'));
2449 $this->confirm_change = 1;
2455 $fixed_required_fields = [
2462 'hits_per_page' => 0,
2463 'hide_own_online_status' => 0
2467 if ($action ==
'save') {
2472 if ($this->handleChangeListeners($changed_fields, $field_properties)) {
2476 foreach ($profile_fields as $field) {
2481 (
bool) ($checked[
'searchable_' . $field] ??
false)
2485 if (!($checked[
'visible_' . $field] ??
false) && !($field_properties[$field][
'visible_hide'] ??
false)) {
2497 if (!($checked[
'changeable_' . $field] ??
false) &&
2498 !($field_properties[$field][
'changeable_hide'] ??
false)) {
2511 if (($checked[
'visib_reg_' . $field] ??
false) && !($field_properties[$field][
'visib_reg_hide'] ??
false)) {
2513 'usr_settings_visib_reg_' . $field,
2518 'usr_settings_visib_reg_' . $field,
2523 if ($checked[
'visib_lua_' . $field] ??
false) {
2525 'usr_settings_visib_lua_' . $field,
2530 'usr_settings_visib_lua_' . $field,
2535 if ((
int) ($checked[
'changeable_lua_' . $field] ??
false)) {
2537 'usr_settings_changeable_lua_' . $field,
2542 'usr_settings_changeable_lua_' . $field,
2547 if (($checked[
'export_' . $field] ??
false) && !($field_properties[$field][
'export_hide'] ??
false)) {
2548 $this->
ilias->setSetting(
2549 'usr_settings_export_' . $field,
2553 $this->
ilias->deleteSetting(
'usr_settings_export_' . $field);
2557 if (($checked[
'course_export_' . $field] ??
false) && !($field_properties[$field][
'course_export_hide'] ??
false)) {
2558 $this->
ilias->setSetting(
2559 'usr_settings_course_export_' . $field,
2563 $this->
ilias->deleteSetting(
'usr_settings_course_export_' . $field);
2567 if (($checked[
'group_export_' . $field] ??
false) && !($field_properties[$field][
'group_export_hide'] ??
false)) {
2568 $this->
ilias->setSetting(
2569 'usr_settings_group_export_' . $field,
2573 $this->
ilias->deleteSetting(
'usr_settings_group_export_' . $field);
2576 if (($checked[
'prg_export_' . $field] ??
false) && !($field_properties[$field][
'prg_export_hide'] ??
false)) {
2577 $this->
ilias->setSetting(
2578 'usr_settings_prg_export_' . $field,
2582 $this->
ilias->deleteSetting(
'usr_settings_prg_export_' . $field);
2585 $is_fixed = array_key_exists(
2587 $fixed_required_fields
2589 if (($is_fixed && $fixed_required_fields[$field]) || (!$is_fixed && ($checked[
'required_' . $field] ??
false))) {
2590 $this->
ilias->setSetting(
2591 'require_' . $field,
2595 $this->
ilias->deleteSetting(
'require_' . $field);
2599 if (isset($selected[
'default_hits_per_page']) && $selected[
'default_hits_per_page']) {
2600 $this->
ilias->setSetting(
2602 $selected[
'default_hits_per_page']
2606 if (isset($checked[
'export_preferences']) && $checked[
'export_preferences'] === 1) {
2607 $this->
ilias->setSetting(
2608 'usr_settings_export_preferences',
2612 $this->
ilias->deleteSetting(
'usr_settings_export_preferences');
2615 $this->
ilias->setSetting(
2616 'mail_incoming_mail',
2617 $selected[
'default_mail_incoming_mail'] ??
'0' 2619 $this->
ilias->setSetting(
2620 'chat_osc_accept_msg',
2621 $selected[
'default_chat_osc_accept_msg'] ??
'n' 2623 $this->
ilias->setSetting(
2624 'chat_broadcast_typing',
2625 $selected[
'default_chat_broadcast_typing'] ??
'n' 2627 $this->
ilias->setSetting(
2628 'bs_allow_to_contact_me',
2629 $selected[
'default_bs_allow_to_contact_me'] ??
'n' 2631 $this->
ilias->setSetting(
2632 'hide_own_online_status',
2633 $selected[
'default_hide_own_online_status'] ??
'n' 2636 if ($this->usrFieldChangeListenersAccepted && count($changed_fields) > 0) {
2637 $this->
event->raise(
2639 'onUserFieldAttributesChanged',
2644 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'usr_settings_saved'));
2650 $this->usrFieldChangeListenersAccepted =
true;
2658 array $interested_change_listeners
2660 $post = $this->user_request->getParsedBody();
2662 $confirmDialog->setHeaderText($this->
lng->txt(
'usr_field_change_components_listening'));
2663 $confirmDialog->setFormAction($this->
ctrl->getFormActionByClass(
2667 $confirmDialog->setConfirm($this->
lng->txt(
'confirm'),
'confirmUsrFieldChangeListeners');
2668 $confirmDialog->setCancel($this->
lng->txt(
'cancel'),
'settings');
2671 'tpl.usr_field_change_listener_confirm.html',
2677 foreach ($interested_change_listeners as $interested_change_listener) {
2678 $tpl->
setVariable(
'FIELD_NAME', $interested_change_listener->getName());
2679 foreach ($interested_change_listener->getAttributes() as $attribute) {
2681 foreach ($attribute->getComponents() as $component) {
2694 $confirmDialog->addItem(
'',
'0',
$tpl->
get());
2696 foreach (
$post[
'chb'] as $postVar => $value) {
2697 $confirmDialog->addHiddenItem(
"chb[{$postVar}]", $value);
2699 foreach (
$post[
'select'] as $postVar => $value) {
2700 $confirmDialog->addHiddenItem(
"select[{$postVar}]", $value);
2702 foreach (
$post[
'current'] as $postVar => $value) {
2703 $confirmDialog->addHiddenItem(
"current[{$postVar}]", $value);
2705 $this->tpl->setContent($confirmDialog->getHTML());
2713 public function handleChangeListeners(
2714 array $changed_fields,
2715 array $field_properties
2717 if (count($changed_fields) > 0) {
2718 $interested_change_listeners = [];
2719 foreach ($field_properties as $field_name => $properties) {
2720 if (!isset($properties[
'change_listeners'])) {
2724 foreach ($properties[
'change_listeners'] as $change_listener_class_name) {
2728 $listener =
new $change_listener_class_name($this->dic);
2729 foreach ($changed_fields as $changed_field) {
2730 $attribute_name = $changed_field->getAttributeName();
2731 $description_for_field = $listener->getDescriptionForField($field_name, $attribute_name);
2732 if ($description_for_field !== null && $description_for_field !==
'') {
2733 $interested_change_listener = null;
2734 foreach ($interested_change_listeners as $interested_listener) {
2735 if ($interested_listener->getFieldName() === $field_name) {
2736 $interested_change_listener = $interested_listener;
2741 if ($interested_change_listener === null) {
2746 $interested_change_listeners[] = $interested_change_listener;
2749 $interested_attribute = $interested_change_listener->addAttribute($attribute_name);
2750 $interested_attribute->addComponent(
2751 $listener->getComponentName(),
2752 $description_for_field
2759 if (!$this->usrFieldChangeListenersAccepted && count($interested_change_listeners) > 0) {
2773 $changed_fields = [];
2774 $post = $this->user_request->getParsedBody();
2776 !isset(
$post[
'chb'])
2777 && !is_array(
$post[
'chb'])
2778 && !isset(
$post[
'current'])
2779 && !is_array(
$post[
'current'])
2781 return $changed_fields;
2784 $old =
$post[
'current'];
2785 $new =
$post[
'chb'];
2787 foreach ($old as
$key => $oldValue) {
2788 if (!isset($new[
$key])) {
2789 $isBoolean = filter_var($oldValue, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
2790 $new[
$key] = $isBoolean ?
'0' : $oldValue;
2794 $oldToNewDiff = array_diff_assoc($old, $new);
2796 foreach ($oldToNewDiff as
$key => $oldValue) {
2800 return $changed_fields;
2808 $action[-1] = $this->
lng->txt(
'all_users');
2809 $action[1] = $this->
lng->txt(
'usr_active_only');
2810 $action[0] = $this->
lng->txt(
'usr_inactive_only');
2811 $action[2] = $this->
lng->txt(
'usr_limited_access_only');
2812 $action[3] = $this->
lng->txt(
'usr_without_courses');
2813 $action[4] = $this->
lng->txt(
'usr_filter_lastlogin');
2814 $action[5] = $this->
lng->txt(
'usr_filter_coursemember');
2815 $action[6] = $this->
lng->txt(
'usr_filter_groupmember');
2816 $action[7] = $this->
lng->txt(
'usr_filter_role');
2833 $files = $this->user_request->getFiles();
2834 if (count($files) == 0) {
2835 $this->
ilias->raiseError(
2836 $this->
lng->txt(
'no_checkbox'),
2837 $this->
ilias->error_obj->MESSAGE
2841 if (count($files) > 1) {
2842 $this->
ilias->raiseError(
2843 $this->
lng->txt(
'select_max_one_item'),
2844 $this->
ilias->error_obj->MESSAGE
2848 $file = basename($files[0]);
2850 $export_dir = $this->
object->getExportDirectory();
2852 $export_dir .
'/' . $file,
2859 $files = $this->user_request->getFiles();
2860 if (count($files) == 0) {
2861 $this->
ilias->raiseError(
2862 $this->
lng->txt(
'no_checkbox'),
2863 $this->
ilias->error_obj->MESSAGE
2868 $cgui->setFormAction($this->
ctrl->getFormAction($this));
2869 $cgui->setHeaderText($this->
lng->txt(
'info_delete_sure'));
2871 $this->
lng->txt(
'cancel'),
2872 'cancelDeleteExportFile' 2875 $this->
lng->txt(
'confirm'),
2880 foreach ($files as $file) {
2886 $this->
lng->txt(
'obj_usrf')
2890 $this->tpl->setContent($cgui->getHTML());
2895 $this->
ctrl->redirectByClass(
2896 'ilobjuserfoldergui',
2904 $files = $this->user_request->getFiles();
2905 $export_dir = $this->
object->getExportDirectory();
2906 foreach ($files as $file) {
2907 $file = basename($file);
2909 $exp_file = $export_dir .
'/' . $file;
2910 if (is_file($exp_file)) {
2914 $this->
ctrl->redirectByClass(
2915 'ilobjuserfoldergui',
2928 $this->
object->buildExportFile($this->user_request->getExportType());
2929 $this->
ctrl->redirect(
2940 'userfolder_export_excel_x86',
2941 'userfolder_export_csv',
2942 'userfolder_export_xml' 2945 foreach ($export_types as
$type) {
2946 $this->
ctrl->setParameterByClass(self::class,
'export_type', $type);
2947 $options[] = $this->ui_factory->button()->shy(
2948 $this->
lng->txt($type),
2949 $this->
ctrl->getLinkTargetByClass(self::class,
'performExport')
2952 $type_selection = $this->ui_factory->dropdown()->standard($options)
2953 ->withLabel($this->
lng->txt(
'create_export_file'));
2960 $table = new \ilUserExportFileTableGUI(
2965 $table->parse($this->
object->getExportFiles());
2967 $this->tpl->setContent($table->getHTML());
2972 $this->
lng->loadLanguageModule(
'meta');
2973 $this->
lng->loadLanguageModule(
'mail');
2979 $form->
setTitle($this->
lng->txt(
'user_new_account_mail'));
2982 $langs = $this->
lng->getInstalledLanguages();
2983 foreach ($langs as $lang_key) {
2986 $title = $this->
lng->txt(
'meta_l_' . $lang_key);
2987 if ($lang_key == $this->
lng->getDefaultLanguage()) {
2988 $title .=
' (' . $this->
lng->txt(
'default') .
')';
2992 $header->setTitle($title);
2996 $this->
lng->txt(
'subject'),
2997 'subject_' . $lang_key
2999 $subj->setValue($amail[
'subject'] ??
'');
3003 $this->
lng->txt(
'mail_salutation_general'),
3004 'sal_g_' . $lang_key
3006 $salg->setValue($amail[
'sal_g'] ??
'');
3010 $this->
lng->txt(
'mail_salutation_female'),
3011 'sal_f_' . $lang_key
3013 $salf->setValue($amail[
'sal_f'] ??
'');
3017 $this->
lng->txt(
'mail_salutation_male'),
3018 'sal_m_' . $lang_key
3020 $salm->setValue($amail[
'sal_m'] ??
'');
3024 $this->
lng->txt(
'message_content'),
3027 $body->
setValue($amail[
'body'] ??
'');
3029 $body->setCols(100);
3033 $this->
lng->txt(
'attachment'),
3037 if ($amail[
'att_file'] ??
false) {
3038 $att->setValue($amail[
'att_file']);
3044 'saveNewAccountMail',
3045 $this->
lng->txt(
'save')
3048 'cancelNewAccountMail',
3049 $this->
lng->txt(
'cancel')
3059 $this->tabs_gui->setTabActive(
'settings');
3060 $this->tabs_gui->setSubTabActive(
'user_new_account_mail');
3062 if ($form === null) {
3067 'tpl.usrf_new_account_mail.html',
3079 'TXT_USE_PLACEHOLDERS',
3080 $this->
lng->txt(
'mail_nacc_use_placeholder')
3083 'TXT_MAIL_SALUTATION',
3084 $this->
lng->txt(
'mail_nacc_salutation')
3088 $this->
lng->txt(
'firstname')
3092 $this->
lng->txt(
'lastname')
3096 $this->
lng->txt(
'email')
3100 $this->
lng->txt(
'mail_nacc_login')
3104 $this->
lng->txt(
'password')
3107 'TXT_PASSWORD_BLOCK',
3108 $this->
lng->txt(
'mail_nacc_pw_block')
3111 'TXT_NOPASSWORD_BLOCK',
3112 $this->
lng->txt(
'mail_nacc_no_pw_block')
3116 $this->
lng->txt(
'mail_nacc_admin_mail')
3120 $this->
lng->txt(
'mail_nacc_ilias_url')
3123 'TXT_INSTALLATION_NAME',
3124 $this->
lng->txt(
'mail_nacc_installation_name')
3128 $this->
lng->txt(
'mail_nacc_target')
3132 $this->
lng->txt(
'mail_nacc_target_title')
3136 $this->
lng->txt(
'mail_nacc_target_type')
3140 $this->
lng->txt(
'mail_nacc_target_block')
3144 $this->
lng->txt(
'mail_nacc_if_timelimit')
3148 $this->
lng->txt(
'mail_nacc_timelimit')
3151 $this->tpl->setContent($ftpl->get());
3156 $this->
ctrl->redirect(
3168 $is_valid_template_syntax = $this->dic->refinery()->custom()->constraint(
function ($value):
bool {
3170 $this->dic->mail()->mustacheFactory()->getBasicEngine()->render((
string) $value, []);
3175 }, $this->dic->language()->txt(
'mail_template_invalid_tpl_syntax'));
3177 $valid_templates =
true;
3178 $langs = $this->
lng->getInstalledLanguages();
3179 foreach ($langs as $lang_key) {
3180 $subject = $this->user_request->getMailSubject($lang_key);
3182 $is_valid_template_syntax->check($subject);
3185 $is_valid_template_syntax->problemWith($subject)
3187 $valid_templates =
false;
3190 $body = $this->user_request->getMailBody($lang_key);
3192 $is_valid_template_syntax->check($body);
3195 $is_valid_template_syntax->problemWith($body)
3197 $valid_templates =
false;
3200 if (!$valid_templates) {
3201 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
3206 foreach ($langs as $lang_key) {
3209 $this->user_request->getMailSubject($lang_key),
3210 $this->user_request->getMailSalutation(
'g', $lang_key),
3211 $this->user_request->getMailSalutation(
'f', $lang_key),
3212 $this->user_request->getMailSalutation(
'm', $lang_key),
3213 $this->user_request->getMailBody($lang_key)
3216 if ($_FILES[
'att_' . $lang_key][
'tmp_name']) {
3219 $_FILES[
'att_' . $lang_key][
'tmp_name'],
3220 $_FILES[
'att_' . $lang_key][
'name']
3224 if ($this->user_request->getMailAttDelete($lang_key)) {
3229 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
3230 $this->
ctrl->redirect(
3243 if ($this->
access->checkRbacOrPositionPermissionAccess(
3246 $this->object->getRefId()
3248 $this->tabs_gui->addTarget(
3250 $this->
ctrl->getLinkTarget(
3254 [
'view',
'delete',
'resetFilter',
'userAction',
''],
3260 if ($this->
access->checkRbacOrPositionPermissionAccess(
3265 $this->tabs_gui->addTarget(
3266 'search_user_extended',
3267 $this->
ctrl->getLinkTargetByClass(
3268 'ilRepositorySearchGUI',
3272 'ilrepositorysearchgui',
3277 if ($this->rbac_system->checkAccess(
3279 $this->object->getRefId()
3281 $this->tabs_gui->addTarget(
3283 $this->
ctrl->getLinkTarget(
3288 'askForUserPasswordReset',
3289 'forceUserPasswordReset',
3292 'listUserDefinedField',
3297 $this->tabs_gui->addTarget(
3299 $this->
ctrl->getLinkTarget(
3309 if ($this->rbac_system->checkAccess(
3311 $this->object->getRefId()
3313 $this->tabs_gui->addTarget(
3315 $this->
ctrl->getLinkTargetByClass(
3316 [get_class($this),
'ilpermissiongui'],
3319 [
'perm',
'info',
'owner'],
3329 $this->tabs_gui->addSubTabTarget(
3331 $this->
ctrl->getLinkTarget(
3338 $this->tabs_gui->addSubTabTarget(
3340 $this->
ctrl->getLinkTarget(
3344 [
'settings',
'saveGlobalUserSettings'],
3347 $this->tabs_gui->addSubTabTarget(
3348 'user_defined_fields',
3349 $this->
ctrl->getLinkTargetByClass(
3350 'ilcustomuserfieldsgui',
3351 'listUserDefinedFields' 3353 'listUserDefinedFields',
3356 $this->tabs_gui->addSubTabTarget(
3357 'user_new_account_mail',
3358 $this->
ctrl->getLinkTarget(
3366 $this->tabs_gui->addSubTabTarget(
3368 $this->
ctrl->getLinkTargetByClass(
3369 'iluserstartingpointgui',
3376 $this->tabs_gui->addSubTabTarget(
3377 'user_profile_info',
3378 $this->
ctrl->getLinkTargetByClass(
3379 'ilUserProfileInfoSettingsGUI',
3383 'ilUserProfileInfoSettingsGUI' 3392 $show_blocking_time_in_days = (
int) $this->
settings->get(
'loginname_change_blocking_time') / 86400;
3395 $this->loginSettingsForm->setValuesByArray(
3397 'allow_change_loginname' => (
bool) $this->
settings->get(
'allow_change_loginname'),
3398 'create_history_loginname' => (bool) $this->
settings->get(
'create_history_loginname'),
3399 'reuse_of_loginnames' => (bool) $this->
settings->get(
'reuse_of_loginnames'),
3400 'loginname_change_blocking_time' => (float) $show_blocking_time_in_days
3404 $this->tpl->setVariable(
3406 $this->loginSettingsForm->getHTML()
3413 $this->tabs_gui->setTabActive(
'settings');
3414 $this->tabs_gui->setSubTabActive(
'loginname_settings');
3417 $this->loginSettingsForm->setFormAction(
3418 $this->
ctrl->getFormAction(
3420 'saveLoginnameSettings' 3423 $this->loginSettingsForm->setTitle($this->
lng->txt(
'loginname_settings'));
3426 $this->
lng->txt(
'allow_change_loginname'),
3427 'allow_change_loginname' 3429 $chbChangeLogin->setValue(
'1');
3430 $this->loginSettingsForm->addItem($chbChangeLogin);
3432 $this->
lng->txt(
'history_loginname'),
3433 'create_history_loginname' 3435 $chbCreateHistory->setInfo($this->
lng->txt(
'loginname_history_info'));
3436 $chbCreateHistory->setValue(
'1');
3437 $chbChangeLogin->addSubItem($chbCreateHistory);
3439 $this->
lng->txt(
'reuse_of_loginnames_contained_in_history'),
3440 'reuse_of_loginnames' 3442 $chbReuseLoginnames->setValue(
'1');
3443 $chbReuseLoginnames->setInfo($this->
lng->txt(
'reuse_of_loginnames_contained_in_history_info'));
3444 $chbChangeLogin->addSubItem($chbReuseLoginnames);
3446 $this->
lng->txt(
'loginname_change_blocking_time'),
3447 'loginname_change_blocking_time' 3449 $chbChangeBlockingTime->allowDecimals(
true);
3450 $chbChangeBlockingTime->setSuffix($this->
lng->txt(
'days'));
3451 $chbChangeBlockingTime->setInfo($this->
lng->txt(
'loginname_change_blocking_time_info'));
3452 $chbChangeBlockingTime->setSize(10);
3453 $chbChangeBlockingTime->setMaxLength(10);
3454 $chbChangeLogin->addSubItem($chbChangeBlockingTime);
3456 $this->loginSettingsForm->addCommandButton(
3457 'saveLoginnameSettings',
3458 $this->
lng->txt(
'save')
3465 if ($this->loginSettingsForm->checkInput()) {
3468 if (!strlen($this->loginSettingsForm->getInput(
'loginname_change_blocking_time'))) {
3470 $this->loginSettingsForm->getItemByPostVar(
'loginname_change_blocking_time')
3471 ->setAlert($this->
lng->txt(
'loginname_change_blocking_time_invalidity_info'));
3475 $save_blocking_time_in_seconds = (
int) $this->loginSettingsForm->getInput(
3476 'loginname_change_blocking_time' 3480 'allow_change_loginname',
3481 (
string) $this->loginSettingsForm->getInput(
'allow_change_loginname')
3484 'create_history_loginname',
3485 (
string) $this->loginSettingsForm->getInput(
'create_history_loginname')
3488 'reuse_of_loginnames',
3489 (
string) $this->loginSettingsForm->getInput(
'reuse_of_loginnames')
3492 'loginname_change_blocking_time',
3493 (
string) $save_blocking_time_in_seconds
3496 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'saved_successfully'));
3498 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
3501 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
3503 $this->loginSettingsForm->setValuesByPost();
3505 $this->tpl->setVariable(
3507 $this->loginSettingsForm->getHTML()
3511 public static function _goto(
string $a_user): void
3515 $a_user = (
int) $a_user;
3516 $main_tpl = $DIC->ui()->mainTemplate();
3518 $ilAccess = $DIC[
'ilAccess'];
3521 $ctrl = $DIC[
'ilCtrl'];
3525 if ($ilAccess->checkAccess(
3530 $ctrl->
redirectToURL(
'ilias.php?baseClass=ilAdministrationGUI&ref_id=' . $a_target .
'&jmpToUser=' . $a_user);
3533 if ($ilAccess->checkAccess(
3538 $main_tpl->setOnScreenMessage(
'failure', sprintf(
3539 $lng->
txt(
'msg_no_perm_read_item'),
3546 $lng->
txt(
'msg_no_perm_read'),
3556 $jump_to_user = $this->user_request->getJumpToUser();
3558 $this->
ctrl->setParameterByClass(
3563 $this->
ctrl->redirectByClass(
3573 $a_user_ids = $this->
access->filterUserIdsByPositionOfCurrentUser(
3590 if (!count($a_usr_ids)) {
3591 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
3595 $this->requested_ids = $a_usr_ids;
3598 if (stripos($a_cmd,
'export') !==
false) {
3599 $cmd = $a_cmd .
'Object';
3600 return $this->$cmd();
3613 if ($a_search_form) {
3614 if ($this->rbac_system->checkAccess(
'write', $this->object->getRefId())) {
3616 'activate' => $this->
lng->txt(
'activate'),
3617 'deactivate' => $this->
lng->txt(
'deactivate'),
3618 'accessRestrict' => $this->
lng->txt(
'accessRestrict'),
3619 'accessFree' => $this->
lng->txt(
'accessFree')
3623 if ($this->rbac_system->checkAccess(
'delete', $this->object->getRefId())) {
3624 $cmds[
'delete'] = $this->
lng->txt(
'delete');
3627 if ($this->rbac_system->checkAccess(
'write', $this->object->getRefId())) {
3629 'activateUsers' => $this->
lng->txt(
'activate'),
3630 'deactivateUsers' => $this->
lng->txt(
'deactivate'),
3631 'restrictAccess' => $this->
lng->txt(
'accessRestrict'),
3632 'freeAccess' => $this->
lng->txt(
'accessFree')
3636 if ($this->rbac_system->checkAccess(
'delete', $this->object->getRefId())) {
3637 $cmds[
'deleteUsers'] = $this->
lng->txt(
'delete');
3641 if ($this->rbac_system->checkAccess(
'write', $this->object->getRefId())) {
3643 'userfolder_export_excel_x86',
3644 'userfolder_export_csv',
3645 'userfolder_export_xml' 3647 foreach ($export_types as
$type) {
3652 $cmd = array_pop($cmd);
3653 $cmds[
'usrExport' . ucfirst($cmd)] = $this->
lng->txt(
'export') .
' - ' .
3654 $this->
lng->txt($type);
3660 if ($this->rbac_system->checkAccess(
3662 $mail->getMailObjectReferenceId()
3664 $cmds[
'mail'] = $this->
lng->txt(
'send_mail');
3667 $cmds[
'addToClipboard'] = $this->
lng->txt(
'clipboard_add_btn');
3676 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3677 $this->
ctrl->redirect(
3684 $this->
object->buildExportFile(
3688 $this->
ctrl->redirectByClass(
3689 'ilobjuserfoldergui',
3693 $fullname = $this->
object->buildExportFile(
3699 $fullname .
'.xlsx',
3712 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3713 $this->
ctrl->redirect(
3720 $this->
object->buildExportFile(
3724 $this->
ctrl->redirectByClass(
3725 'ilobjuserfoldergui',
3729 $fullname = $this->
object->buildExportFile(
3748 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3749 $this->
ctrl->redirect(
3755 $this->
object->buildExportFile(
3759 $this->
ctrl->redirectByClass(
3760 'ilobjuserfoldergui',
3764 $fullname = $this->
object->buildExportFile(
3783 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3784 $this->
ctrl->redirect(
3793 $list->deleteTemporaryLists();
3798 $list->setTitle(
'-TEMPORARY SYSTEM LIST-');
3799 $list->setDescription(
'-USER ACCOUNTS MAIL-');
3800 $list->setCreatedate(date(
'Y-m-d H:i:s'));
3802 $list_id = $list->getId();
3805 foreach ($user_ids as $user_id) {
3806 $list->assignUser((
int) $user_id);
3812 $umail->persistToStage(
3813 $mail_data[
'user_id'],
3814 $mail_data[
'attachments'],
3815 '#il_ml_' . $list_id,
3816 $mail_data[
'rcp_cc'],
3817 $mail_data[
'rcp_bcc'],
3818 $mail_data[
'm_subject'],
3819 $mail_data[
'm_message'],
3820 $mail_data[
'use_placeholders'],
3821 $mail_data[
'tpl_ctx_id'],
3822 $mail_data[
'tpl_ctx_params']
3825 $this->
ctrl->redirectToURL(
3830 [
'type' =>
'search_res']
3837 switch ($a_form_id) {
3844 'ps_password_change_on_first_login_enabled' => [
3845 $security->isPasswordChangeOnFirstLoginEnabled(),
3848 'ps_password_must_not_contain_loginame' => [
3849 $security->getPasswordMustNotContainLoginnameStatus(),
3852 'ps_password_chars_and_numbers_enabled' => [
3853 $security->isPasswordCharsAndNumbersEnabled(),
3856 'ps_password_special_chars_enabled' => [
3857 $security->isPasswordSpecialCharsEnabled(),
3860 'ps_password_min_length' => $security->getPasswordMinLength(),
3861 'ps_password_max_length' => $security->getPasswordMaxLength(),
3862 'ps_password_uppercase_chars_num' => $security->getPasswordNumberOfUppercaseChars(),
3863 'ps_password_lowercase_chars_num' => $security->getPasswordNumberOfLowercaseChars(),
3864 'ps_password_max_age' => $security->getPasswordMaxAge()
3866 $fields[
'ps_password_settings'] = [null, null, $subitems];
3869 'ps_login_max_attempts' => $security->getLoginMaxAttempts(),
3870 'ps_prevent_simultaneous_logins' => [
3871 $security->isPreventionOfSimultaneousLoginsEnabled(),
3875 $fields[
'ps_security_protection'] = [null, null, $subitems];
3877 return [[
'generalSettings', $fields]];
3885 $this->
ctrl->redirect(
3891 $this->
ctrl->redirectByClass(
3900 if (!count($users)) {
3901 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
3902 $this->
ctrl->redirect(
3911 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
3912 $this->
ctrl->redirect(
3921 $checkbox->setInfo($this->
lng->txt($name .
'_desc'));
3922 $checkbox->setValue(
'1');
3929 if (!$this->
access->checkRbacOrPositionPermissionAccess(
3934 $this->
ilias->raiseError(
3935 $this->
lng->txt(
'permission_denied'),
3936 $this->
ilias->error_obj->MESSAGE
static _getAllUserIds(int $a_filter=0)
showLoginnameSettingsObject()
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.
showFieldChangeComponentsListeningConfirmDialog(array $interested_change_listeners)
static get(string $a_var)
askForUserPasswordResetObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
searchUserAccessFilterCallable(array $a_user_ids)
static _writeNewAccountMail(string $a_lang, string $a_subject, string $a_sal_g, string $a_sal_f, string $a_sal_m, string $a_body)
importUsersObject()
Import Users with new form implementation.
__buildUserFilterSelect()
build select form to distinguish between active and non-active users
static _saveStatus(string $a_key, bool $a_enabled)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static getLogger(string $a_component_id)
Get component logger.
raiseErrorOnMissingWrite()
const ilPropertyFormGUI $loginSettingsForm
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
forceUserPasswordResetObject()
setUserOwnerId(int $a_id)
static _isSearchable(string $a_key)
Singleton class that stores all security settings.
prepareOutput(bool $show_sub_objects=true)
Class ChatMainBarProvider .
cancelSearchActionObject()
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
importUserRoleAssignmentObject()
display form for user import with new FileSystem implementation
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
UserGUIRequest $user_request
initFormGeneralSettings()
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
isPasswordCharsAndNumbersEnabled()
get boolean if the passwords have to contain characters and numbers
settingsObject()
Global user settings Allows to define global settings for user accounts Note: The Global user setting...
getFullname(int $a_max_strlen=0)
getUserMultiCommands(bool $a_search_form=false)
getPasswordPolicySettingsMap(\ilSecuritySettings $security)
static _updateAccountMailAttachment(string $a_lang, string $a_tmp_name, string $a_name)
Update account mail attachment.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
Class ilRoleMailboxSearch.
filterUserIdsByRbacOrPositionOfCurrentUser(array $user_ids)
const SESSION_HANDLING_FIXED
checkUserManipulationAccessBool()
Check if current user has access to manipulate user data.
static _reset()
Reset all.
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
showActionConfirmation(string $action, bool $a_from_search=false)
generalSettingsObject()
Show user account general settings.
confirmaccessRestrictObject()
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 _lookupObjId(int $ref_id)
getPasswordMaxLength()
get the maximum length for passwords
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
newAccountMailObject(ilPropertyFormGUI $form=null)
setValue(string $a_value)
getActionUserIds()
Get selected items for table action.
final const MODE_TEMPORARY
confirmaccessFreeObject()
getPasswordNumberOfLowercaseChars()
Returns number of lowercase characters required.
TableGUI class for user administration.
Class ilMailRfc822AddressParserFactory.
initUserRoleAssignmentForm(string $xml_file_full_path)
Class ilCustomUserFieldsGUI.
const ORG_OP_EDIT_USER_ACCOUNTS
confirmUsrFieldChangeListenersObject()
getPasswordNumberOfUppercaseChars()
Returns number of uppercase characters required.
static _goto(string $a_user)
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
saveGeneralSettingsObject()
Save user account settings.
static _lookupNewAccountMail(string $a_lang)
searchResultHandler(array $a_usr_ids, string $a_cmd)
Handles multi command from repository search gui.
static _getUserFolderId()
Class ilUserStartingPointGUI.
confirmDeleteExportFileObject()
setVisible(string $field, bool $visible)
Set a profile field being visible.
saveGlobalUserSettingsObject(string $action='')
getTranslationForField(string $field_name, array $properties)
isPasswordSpecialCharsEnabled()
get boolean if the passwords have to contain special characters
getPasswordMinLength()
get the minimum length for passwords
Class ilObjectGUI Basic methods of all Output classes.
cancelDeleteExportFileObject()
setSubTabs(string $a_tab)
header include for all ilias files.
Class InterestedUserFieldChangeListener.
const USER_FIELD_TRANSLATION_MAPPING
static _deleteAccountMailAttachment(string $a_lang)
Delete account mail attachment.
static getDataDir()
get data directory (outside webspace)
addToExternalSettingsForm(int $a_form_id)
confirmdeactivateObject()
jumpToUserObject()
Jump to edit screen for user.
setChangeable(string $field, bool $changeable)
Set a profile field being changeable.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
downloadExportFileObject()
Download selected export files Sends a selected export file for download.
saveLoginnameSettingsObject()
showPossibleSubObjects()
show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
getProtocolAsHTML(string $a_log_title)
Returns the protocol as a HTML table.
getErrorLevel()
Returns the error level.
form( $class_path, string $cmd, string $submit_caption="")
This class represents a text area property in a property form.
addUserObject()
Add new user.
cancelNewAccountMailObject()
verifyXmlData(ilUserImportParser $import_parser)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_UPDATE_ON_CONFLICT
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
__construct( $a_data, int $a_id, bool $a_call_by_reference)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
const SESSION_HANDLING_LOAD_DEPENDENT
redirectToURL(string $target_url)
initAccessRestrictionForm(bool $a_from_search=false)
const DEFAULT_ALLOW_CLIENT_MAINTENANCE
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static _getAssignUsersStatus(int $a_role_id)
static _lookupType(int $id, bool $reference=false)
cancelUserFolderActionObject()
bool $usrFieldChangeListenersAccepted
static getSessionExpireValue()
Returns the session expiration value.
static _getInstance()
Get instance of ilSecuritySettings.
saveNewAccountMailObject()
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstance()
Singleton method to reduce footprint (included files, created instances)
getPasswordMustNotContainLoginnameStatus()
Return whether the password must not contain the loginname or not.
static getInstance(int $a_usr_id)
const DEFAULT_MAX_IDLE_AFTER_FIRST_REQUEST
redirectOnRoleWithMissingWrite(int $role_id, array $roles_of_user, array $global_roles, string $import_dir)
Class ChangedUserFieldAttribute.
setAccessRestrictionObject(?ilPropertyFormGUI $a_form=null, bool $a_from_search=false)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
const IL_IGNORE_ON_CONFLICT
ilUserSettingsConfig $user_settings_config
addUserAutoCompleteObject()