19declare(strict_types=1);
54 private ResourceStorageServices
$irss;
74 bool $a_call_by_reference =
false,
75 bool $a_prepare_output =
true
79 $this->
ctrl = $DIC[
'ilCtrl'];
80 $this->
tabs = $DIC[
'ilTabs'];
81 $this->
help = $DIC[
'ilHelp'];
82 $this->repository_guis =
$DIC->repository()->gui();
83 $this->mail_sender_factory =
$DIC->mail()->mime()->senderFactory();
85 $local_dic = LocalDIC::dic();
86 $this->user_settings = $local_dic[UserSettings::class];
87 $this->user_profile = $local_dic[Profile::class];
89 $this->default_layout_and_style =
$DIC[
'ilClientIniFile']->readVariable(
'layout',
'skin') .
90 ':' .
$DIC[
'ilClientIniFile']->readVariable(
'layout',
'style');
96 ? Context::UserAdministration
97 : Context::LocalUserAdministration;
99 $this->uploads =
$DIC->upload();
100 $this->irss =
$DIC->resourceStorage();
103 $this->
ctrl->saveParameter($this, [
'obj_id',
'letter']);
104 $this->
ctrl->setParameterByClass(
'ilobjuserfoldergui',
'letter', $this->requested_letter);
105 $this->
lng->loadLanguageModule(
'user');
112 $this->requested_letter = $this->user_request->getLetter();
113 $this->requested_baseClass = $this->user_request->getBaseClass();
114 $this->requested_search = $this->user_request->getSearch();
115 $this->legal_documents =
$DIC[
'legalDocuments'];
117 $this->
lng->loadLanguageModule(
'crs');
122 $next_class = $this->
ctrl->getNextClass($this);
123 $cmd = $this->
ctrl->getCmd();
127 switch ($next_class) {
128 case 'illearningprogressgui':
134 $this->
ctrl->forwardCommand($new_gui);
137 case strtolower(ilObjectOwnershipManagementGUI::class):
138 $this->
ctrl->forwardCommand(
139 $this->repository_guis->ownershipManagementGUI(
140 $this->object->getId()
146 if ($cmd ==
'' || $cmd ==
'view') {
157 if (strtolower(get_class($this->
object)) ==
'ilobjuser') {
158 $this->tpl->setTitle(
'[' . $this->
object->getLogin() .
'] ' . $this->object->getTitle());
159 $this->tpl->setDescription($this->
object->getLongDescription());
160 $this->tpl->setTitleIcon(
162 $this->lng->txt(
'obj_' . $this->object->getType())
165 parent::setTitleAndDescription();
173 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
174 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
176 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
187 $this->tabs_gui->clearTargets();
189 $this->
help->setScreenIdComponent(
'usr');
191 if ($this->requested_search) {
192 $this->tabs_gui->setBackTarget(
193 $this->
lng->txt(
'search_results'),
197 $this->tabs_gui->addTarget(
199 $this->
ctrl->getLinkTarget($this,
'edit'),
200 [
'edit',
'',
'view'],
206 $this->tabs_gui->addTarget(
208 $this->
ctrl->getLinkTarget($this,
'edit'),
209 [
'edit',
'',
'view'],
215 $this->tabs_gui->addTarget(
217 $this->
ctrl->getLinkTarget($this,
'roleassignment'),
224 if ($this->rbac_system->checkAccess(
'read', $this->ref_id) and
227 $this->tabs_gui->addTarget(
229 $this->
ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
231 [
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui']
235 $this->tabs_gui->addTarget(
237 $this->
ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
239 'ilobjectownershipmanagementgui'
246 $this->tabs_gui->clearTargets();
250 $obj_list = $this->rbac_review->getRoleListByObject(
ROLE_FOLDER_ID);
252 foreach ($obj_list as $obj_data) {
256 $this->rbac_review->assignedRoles($this->user->getId())
267 $this->rbac_review->assignedRoles($this->user->getId())
269 $rol[$obj_data[
'obj_id']] = $obj_data[
'title'];
275 $this->tpl->setOnScreenMessage(
277 $this->
lng->txt(
'msg_no_roles_users_can_be_assigned_to')
282 $keys = array_keys($rol);
285 if (in_array(4, $keys)) {
286 $this->default_role = 4;
287 } elseif (count($keys) > 1 && in_array(2, $keys)) {
289 foreach ($keys as $key => $val) {
296 $this->default_role = array_shift($keys);
298 $this->selectable_roles = $rol;
306 if (!$this->rbac_system->checkAccess(
'create_usr', $this->usrf_ref_id)
307 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->usrf_ref_id)) {
308 $this->tpl->setOnScreenMessage(
310 $this->
lng->txt(
'permission_denied')
325 if (!$this->rbac_system->checkAccess(
'create_usr', $this->usrf_ref_id)
326 && !$this->access->checkAccess(
'cat_administrate_users',
'', $this->usrf_ref_id)) {
327 $this->tpl->setOnScreenMessage(
329 $this->
lng->txt(
'msg_no_perm_modify_user')
336 $this->
initForm(!$profile_maybe_incomplete,
null);
338 if (!$this->form_gui->checkInput()) {
339 $this->form_gui->setValuesByPost();
344 $user_object = $this->user_profile->addFormValuesToUser(
350 $user_object->setLogin($this->form_gui->getInput(
'username'));
352 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
353 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
357 $user_object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
359 $user_object->setLastPasswordChangeTS(time());
361 $user_object->setTitle($user_object->getFullname());
362 $user_object->setDescription($user_object->getEmail());
363 $user_object->create();
364 $user_object->saveAsNew();
366 $this->
object = $this->user_settings->saveForm(
368 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
374 $this->rbac_admin->assignUser(
375 (
int) $this->form_gui->getInput(
'default_role'),
376 $user_object->getId(),
380 $msg = $this->
lng->txt(
'user_added');
382 $this->
user->setPref(
384 ($this->form_gui->getInput(
'send_mail') ==
'y') ?
'y' :
'n'
386 $this->
user->writePrefs();
388 if ($profile_maybe_incomplete
389 && $this->user_profile->isProfileIncomplete($this->object)) {
390 $this->
object->setProfileIncomplete(
true);
391 $this->
object->update();
395 if ($this->form_gui->getInput(
'send_mail') ==
'y') {
397 $acc_mail->useLangVariablesAsFallback(
true);
398 $acc_mail->setUserPassword($this->form_gui->getInput(
'passwd'));
399 $acc_mail->setUser($user_object);
401 if ($acc_mail->send()) {
402 $msg .=
'<br />' . $this->
lng->txt(
'mail_sent');
403 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
405 $msg .=
'<br />' . $this->
lng->txt(
'mail_not_sent');
406 $this->tpl->setOnScreenMessage(
'info', $msg,
true);
409 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
412 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
413 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
417 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
425 $this->
initForm(!$profile_maybe_incomplete, $this->
object);
427 if (!$this->form_gui->checkInput()) {
428 $this->form_gui->setValuesByPost();
429 $this->tabs_gui->activateTab(
'properties');
435 $this->
object->updateLogin($this->form_gui->getInput(
'username'));
437 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage());
438 $this->form_gui->setValuesByPost();
443 $this->
object = $this->user_profile->addFormValuesToUser(
450 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
451 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
455 $this->
object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
458 $this->
object->setTitle($this->
object->getFullname());
459 $this->
object->setDescription($this->
object->getEmail());
461 $this->
object = $this->user_settings->saveForm(
463 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
468 $this->
object->setLastPasswordChangeTS(time());
469 $this->
object->setProfileIncomplete(
false);
473 if ($this->
user->getId() === $this->object->getId()) {
476 $this->
user->setPref(
478 ($this->form_gui->getInput(
'send_mail') ===
'y') ?
'y' :
'n'
480 $this->
user->writePrefs();
483 $msg = $this->
lng->txt(
'saved_successfully') . $mail_message;
485 if ($profile_maybe_incomplete
486 && $this->user_profile->isProfileIncomplete($this->object)) {
487 $this->
object->setProfileIncomplete(
true);
488 $this->
object->update();
492 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
494 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
495 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
499 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
507 $this->tabs_gui->clearTargets();
511 $this->
initForm(
true, $this->
object);
524 $this->
ctrl->getFormActionByClass(self::class)
527 $this->form_gui->setTitle($this->
lng->txt(
'usr_new'));
528 if ($user !==
null) {
529 $this->form_gui->setTitle($this->
lng->txt(
'usr_edit'));
532 $this->form_gui->addItem(
536 $this->form_gui->addItem(
540 if (
$user !==
null) {
542 $this->form_gui->addItem(
$id);
545 $this->form_gui->addItem(
550 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
551 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
552 $this->form_gui->addItem(
558 $this->form_gui->addItem(
565 $this->form_gui = $this->user_profile->addFieldsToForm(
573 $this->form_gui->addItem(
577 $this->form_gui = $this->user_settings->addSectionsToLegacyForm(
579 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
586 if ($user ===
null) {
587 $this->form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
589 $this->form_gui->addCommandButton(
'update', $this->
lng->txt(
'save'));
591 $this->form_gui->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
597 $section->setTitle($this->
lng->txt($title_lang_var));
616 if ($auth_name ==
'default') {
617 $name = $this->
lng->txt(
'auth_' . $auth_name)
622 $option[$auth_name] = $name;
624 $input->setOptions($option);
625 if ($user ===
null) {
629 $input->setValue($this->
object->getAuthMode());
636 $field = $this->user_profile->getFieldByIdentifier(
'username');
637 $input = $field->getLegacyInput(
642 $input->
setDisabled(!$this->context->isFieldChangeableInType($field, $user));
643 $input->setRequired($this->context->isFieldChangeableInType($field, $user));
653 $input->setMaxLength(80);
654 $input->setValidateAuthPost(
'auth_mode');
655 if ($user ===
null) {
656 $input->setRequiredOnAuth(
true);
659 && in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))
660 && !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
661 $input->setDisabled(
true);
672 $input->setMaxLength(250);
673 $input->setInfo($this->
lng->txt(
'user_ext_account_desc'));
674 if ($user ===
null) {
685 $radg->setRequired(
true);
687 $radg->addOption($op1);
689 foreach ($this->buildTimeLimitDateInputs($user) as $input) {
690 $op2->addSubItem($input);
692 $radg->addOption($op2);
694 $user?->getTimeLimitUnlimited() ??
false ?
'1' :
'0'
709 $from->setShowTime(
true);
710 $from->setMinuteStepSize(1);
717 $to->setRequired(
true);
718 $to->setShowTime(
true);
719 $to->setMinuteStepSize(1);
729 yield $this->buildNonEditableInput(
732 $user->getCreateDate(),
737 yield $this->buildNonEditableInput(
745 yield $this->buildNonEditableInput(
753 yield $this->buildNonEditableInput(
'owner', $user->
getOwnerName());
759 $this->form_gui->addItem(
760 $this->buildSectionHeader(
'system_information')
763 $this->addStatisticalInformationToForm($user);
771 $this->form_gui->addItem($ac);
773 $this->form_gui->addItem($this->buildTimeLimitInput($user));
780 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
782 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
786 if ($user_creation) {
790 $active_from_input = $this->form_gui->getInput(
'active') ===
'1';
791 if ($user->
getActive() !== $active_from_input) {
801 if ($user === null) {
805 foreach ($this->buildStatisticalInputs($user) as $input) {
806 $this->form_gui->addItem($input);
809 foreach ($this->legal_documents->userManagementFields($this->object) as $input) {
810 $this->form_gui->addItem($input);
816 $this->form_gui->addItem(
817 $this->buildSectionHeader(
'user_admin_options')
821 $se->setInfo($this->
lng->txt(
'inform_user_mail_info'));
823 $se->setChecked(($this->
user->getPref(
'send_info_mails') ==
'y'));
824 $this->form_gui->addItem($se);
827 $irf->setInfo($this->
lng->txt(
'ignore_required_fields_info'));
829 $this->form_gui->addItem($irf);
835 $upload_tmp_name = $_FILES[
'userfile'][
'tmp_name'];
836 $avatar_upload_result = $uploads[$upload_tmp_name] ??
null;
838 $existing_rid = $this->
object->getAvatarRid();
839 $revision_title =
'Avatar for user ' . $this->
object->getLogin();
840 $this->stakeholder->setOwner($this->
object->getId());
842 if ($avatar_upload_result ===
null && file_exists($upload_tmp_name)) {
843 $stream = Streams::ofResource(
844 fopen($upload_tmp_name,
'r')
847 if ($existing_rid ===
null) {
848 return $this->irss->manage()->stream($stream, $this->stakeholder, $revision_title);
851 $this->irss->manage()->appendNewRevisionFromStream(
857 return $existing_rid;
860 if ($avatar_upload_result ===
null) {
864 if ($existing_rid ===
null) {
865 return $this->irss->manage()->upload(
866 $avatar_upload_result,
872 $this->irss->manage()->replaceWithUpload(
874 $avatar_upload_result,
878 return $existing_rid;
884 $image_dir = $webspace_dir .
'/usr_images';
885 $file = $image_dir .
'/usr_' . $this->
object->getId() .
'.' .
'jpg';
886 $thumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_small.jpg';
887 $xthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xsmall.jpg';
888 $xxthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xxsmall.jpg';
889 $upload_file = $image_dir .
'/upload_' . $this->
object->getId();
892 $this->
object->setPref(
'profile_image',
'');
893 $this->
object->update();
894 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_image_removed'));
896 if (is_file($file)) {
899 if (is_file($thumb_file)) {
902 if (is_file($xthumb_file)) {
903 unlink($xthumb_file);
905 if (is_file($xxthumb_file)) {
906 unlink($xxthumb_file);
908 if (is_file($upload_file)) {
909 unlink($upload_file);
917 if (!$this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)) {
918 $this->tpl->setOnScreenMessage(
920 $this->
lng->txt(
'msg_no_perm_assign_role_to_user')
922 $this->redirectDependingOnParent();
925 $selected_roles = $this->user_request->getRoleIds();
926 $posted_roles = $this->user_request->getPostedRoleIds();
933 $global_roles_all = $this->rbac_review->getGlobalRoles();
934 $assigned_roles_all = $this->rbac_review->assignedRoles($this->
object->getId());
935 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
936 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
937 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
939 $user_not_allowed_to_change_admin_role_assginements =
940 !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()));
942 if ($user_not_allowed_to_change_admin_role_assginements
947 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
949 if (empty($selected_roles) && count($assigned_roles_all) === count($assigned_roles)
950 || empty($posted_global_roles) && count($assigned_global_roles_all) === count($assigned_global_roles)) {
951 $this->tpl->setOnScreenMessage(
953 $this->
lng->txt(
'msg_min_one_role') .
'<br/>' . $this->lng->txt(
'action_aborted'),
956 $this->
ctrl->redirect($this,
'roleassignment');
959 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
961 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
964 $this->rbac_admin->deassignUser($role, $this->
object->getId());
967 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
969 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
972 $this->rbac_admin->assignUser($role, $this->
object->getId(),
false);
975 $this->
object->update();
977 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_roleassignment_changed'),
true);
979 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
980 $this->
ctrl->redirect($this,
'roleassignment');
982 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
988 $this->
tabs->activateTab(
'role_assignment');
990 if (!$this->checkAccessToRolesTab()) {
991 $this->tpl->setOnScreenMessage(
993 $this->
lng->txt(
'msg_no_perm_view_roles_of_user'),
996 $this->
ctrl->redirectByClass(self::class,
'edit');
999 $req_filtered_roles = $this->user_request->getFilteredRoles();
1002 ($req_filtered_roles > 0) ? $req_filtered_roles :
ilSession::get(
'filtered_roles')
1006 if ($filtered_roles > 5) {
1010 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'components/ILIAS/User');
1015 $tab->parse($this->
object->getId());
1016 $this->tpl->setVariable(
'ROLES_TABLE', $tab->getHTML());
1022 $table_gui->writeFilterToSession();
1023 $table_gui->resetOffset();
1024 $this->roleassignmentObject();
1030 $table_gui->resetOffset();
1031 $table_gui->resetFilter();
1032 $this->roleassignmentObject();
1043 for ($i = 0; $i <= 60; $i++) {
1044 $days[$i] = $i < 10 ?
'0' . $i : $i;
1049 for ($i = 0; $i < 24; $i++) {
1050 $days[$i] = $i < 10 ?
'0' . $i : $i;
1055 for ($i = 1; $i < 32; $i++) {
1056 $days[$i] = $i < 10 ?
'0' . $i : $i;
1061 for ($i = 1; $i < 13; $i++) {
1062 $month[$i] = $i < 10 ?
'0' . $i : $i;
1067 if ($a_selected < date(
'Y')) {
1068 $start = $a_selected;
1073 for ($i = $start; $i < ((
int) date(
'Y') + 11); ++$i) {
1084 $a_time_arr[
'hour'],
1085 $a_time_arr[
'minute'],
1086 $a_time_arr[
'second'],
1087 $a_time_arr[
'month'],
1100 $action[0] = $this->
lng->txt(
'assigned_roles');
1101 $action[1] = $this->
lng->txt(
'all_roles');
1102 $action[2] = $this->
lng->txt(
'all_global_roles');
1103 $action[3] = $this->
lng->txt(
'all_local_roles');
1104 $action[4] = $this->
lng->txt(
'internal_local_roles_only');
1105 $action[5] = $this->
lng->txt(
'non_internal_local_roles_only');
1124 if ($this->admin_mode ==
'settings') {
1125 $this->
ctrl->setParameterByClass(
1126 'ilobjsystemfoldergui',
1131 $this->
lng->txt(
'administration'),
1132 $this->ctrl->getLinkTargetByClass([
'iladministrationgui',
'ilobjsystemfoldergui'],
''),
1141 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'view')
1148 $this->ctrl->getLinkTargetByClass(
'ilobjrolefoldergui',
'view')
1152 if ($this->obj_id > 0) {
1154 $this->
object->getTitle(),
1155 $this->ctrl->getLinkTarget($this,
'view')
1163 if ($this->user_request->getSendMail() !=
'y') {
1166 if (!strlen($this->
object->getEmail())) {
1171 $usr_lang->loadLanguageModule(
'crs');
1172 $usr_lang->loadLanguageModule(
'registration');
1175 $mmail->From($this->mail_sender_factory->system());
1178 $mmail->To($mailOptions->getExternalEmailAddresses());
1180 $subject = $usr_lang->txt(
'profile_changed');
1181 $body = $usr_lang->txt(
'reg_mail_body_salutation')
1182 .
' ' . $this->
object->getFullname() .
",\n\n";
1184 $date = $this->
object->getApproveDate();
1186 if ($date !==
null && (time() - strtotime($date)) < 10) {
1187 $body .= $usr_lang->txt(
'reg_mail_body_approve') .
"\n\n";
1189 $body .= $usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n";
1193 if ($this->user_request->getPassword() !=
'') {
1194 $body .= $usr_lang->txt(
'reg_mail_body_text2') .
"\n" .
1195 ILIAS_HTTP_PATH .
'/login.php?client_id=' .
CLIENT_ID .
"\n" .
1196 $usr_lang->txt(
'login') .
': ' . $this->
object->getLogin() .
"\n" .
1197 $usr_lang->txt(
'passwd') .
': ' . $this->user_request->getPassword() .
"\n\n";
1199 $body .= $usr_lang->txt(
'reg_mail_body_text3') .
"\n";
1200 $body .= $this->
object->getProfileAsString($usr_lang);
1204 $mmail->Subject($subject,
true);
1205 $mmail->Body($body);
1208 return '<br/>' . $this->
lng->txt(
'mail_sent');
1214 public static function _goto(
string $a_target): void
1218 $ilUser =
$DIC[
'ilUser'];
1221 $ilCtrl =
$DIC[
'ilCtrl'];
1224 if ($a_target == md5(
'usrdelown')) {
1226 $ilUser->hasDeletionFlag()) {
1227 $ilCtrl->setTargetScript(
'ilias.php');
1228 $ilCtrl->redirectByClass([
'ildashboardgui',
'ilpersonalsettingsgui'],
'deleteOwnAccountStep2');
1230 exit(
'This account is not flagged for deletion.');
1234 if (substr($a_target, -4) ==
'_bdg') {
1235 $ilCtrl->redirectByClass(
'ilDashboardGUI',
'jumpToBadges');
1238 if (
'registration' == $a_target) {
1239 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilAccountRegistrationGUI'],
'');
1240 } elseif (
'nameassist' == $a_target) {
1241 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'showUsernameAssistanceForm');
1242 } elseif (
'pwassist' == $a_target) {
1243 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'');
1245 $target =
$DIC[
'legalDocuments']->findGotoLink($a_target);
1246 if ($target->isOK()) {
1247 $ilCtrl->setTargetScript(
'ilias.php');
1248 foreach ($target->value()->queryParams() as $key => $value) {
1249 $ilCtrl->setParameterByClass($target->value()->guiName(), (
string) $key, $value);
1251 $ilCtrl->redirectByClass($target->value()->guiPath(), $target->value()->command());
1255 if (strpos($a_target,
'n') === 0) {
1261 if (is_numeric($a_target)) {
1262 $target_user = (
int) $a_target;
1263 } elseif (($target_array = explode(
'_', $a_target, 3))) {
1264 $target_cmd = $target_array[2];
1265 $target_user = (
int) $target_array[0];
1268 if ($target_user > 0) {
1269 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', $target_user);
1273 if ($target_cmd ===
'contact_approved') {
1274 $cmd =
'approveContactRequest';
1275 } elseif ($target_cmd ===
'contact_ignored') {
1276 $cmd =
'ignoreContactRequest';
1278 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', (
int) $a_target);
1279 $ilCtrl->redirectByClass([PublicProfileGUI::class], $cmd);
1288 $profile_maybe_incomplete =
false;
1290 foreach ($this->user_profile->getIgnorableRequiredFields() as $fieldName) {
1291 $elm = $this->form_gui->getItemByPostVar($fieldName);
1297 if ($elm->getRequired()) {
1298 $profile_maybe_incomplete =
true;
1301 $elm->setRequired(
false);
1305 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
1306 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $field->getIdentifier());
1312 if ($elm->getRequired() && $field->isRequired()) {
1313 $profile_maybe_incomplete =
true;
1316 $elm->setRequired(
false);
1320 return $profile_maybe_incomplete;
1327 !$this->rbac_system->checkAccess(
'visible,read', $this->usrf_ref_id)
1328 || !$this->rbac_system->checkAccess(
'write', $this->usrf_ref_id)
1334 $this->access->filterUserIdsByPositionOfCurrentUser(
1337 [$this->object->getId()]
1343 $this->tpl->setOnScreenMessage(
1345 $this->
lng->txt(
'msg_no_perm_modify_user')
1347 $this->
ctrl->redirectByClass(ilObjUserFolderAccess::class);
1353 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1354 $this->tpl->setOnScreenMessage(
1356 $this->
lng->txt(
'msg_no_perm_modify_user')
1358 $this->redirectToRefId($this->usrf_ref_id);
1364 $this->tpl->setContent($this->legal_documents->userManagementModals() . $this->form_gui->getHTML());
1371 $this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)
1375 $this->access->filterUserIdsByPositionOfCurrentUser(
1378 [$this->object->getId()]
1386 return $this->post_wrapper->retrieve(
1389 $this->refinery->kindlyTo()->bool(),
1390 $this->refinery->always(
false)
1398 $this->
ctrl->redirectByClass(ilObjUserFolderAccess::class);
1401 $this->redirectToRefId($this->usrf_ref_id);
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Class ResourceIdentification.
GUI class for public user profile presentation.
static _getActiveAuthModes()
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
static _getAuthModeName($a_auth_key)
Class for date presentation.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
static getWebspaceDir(string $mode="filesystem")
get webspace directory
const LP_CONTEXT_USER_FOLDER
Class ilObjUserTrackingGUI.
static _getInstallationSignature()
This class represents a non editable value in a property form.
static _getAssignUsersStatus(int $a_role_id)
const ORG_OP_EDIT_USER_ACCOUNTS
ilPropertyFormGUI $form_gui
Conductor $legal_documents
addOptionsSectionToForm()
string $requested_baseClass
__toUnix(array $a_time_arr)
saveObject()
save user data
ResourceStakeholder $stakeholder
UserGUIRequest $user_request
buildNonEditableInput(string $identifier, string $value)
getAdminTabs()
administration tabs show only permissions and trash folder
UserSettingsImplementation $user_settings
RepositoryGUIs $repository_guis
handleIgnoredRequiredFields()
Handles ignored required fields by changing the required flag of form elements.
cancelObject()
cancel action and go back to previous page
updateObject()
updates object entry in object_data
addStatisticalInformationToForm(?\ilObjUser $user)
buildLoginInput(?\ilObjUser $user)
addValuesFromSystemInformationToUserSection(\ilObjUser $user, bool $user_creation)
buildTimeLimitInput(?\ilObjUser $user)
removeUserPictureObject()
buildPasswordInput(?\ilObjUser $user)
__unsetSessionVariables()
ilMailMimeSenderFactory $mail_sender_factory
string $default_layout_and_style
createObject()
Display user create form.
addSystemInformationSectionToForm(?\ilObjUser $user)
redirectDependingOnParent()
buildTimeLimitDateInputs(?\ilObjUser $user)
buildExternalAccountInput(?\ilObjUser $user)
ResourceStorageServices $irss
__getDateSelect(string $a_type, string $a_varname, string $a_selected)
addAdminLocatorItems(bool $do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded)
buildSectionHeader(string $title_lang_var)
buildStatisticalInputs(?\ilObjUser $user)
buildAuthModeInput(?\ilObjUser $user)
retrieveAllowIncompleteProfileFromPost()
getTabs()
@abstract overwrite in derived GUI class of your object type
initForm(bool $do_require, ?\ilObjUser $user)
Init user form.
checkUserWritePermission()
static _enabledLearningProgress()
static _enabledUserRelatedData()
setTimeLimitUntil(?int $a_until)
setTimeLimitFrom(?int $a_from)
setActive(bool $active, int $owner=0)
set user active state and updates system fields appropriately
setTimeLimitOwner(int $a_owner)
static _lookupId(string|array $a_user_str)
setTimeLimitUnlimited(bool $unlimited)
Class ilObjectGUI Basic methods of all Output classes.
redirectToRefId(int $ref_id, string $cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
prepareOutput(bool $show_sub_objects=true)
static _lookupType(int $id, bool $reference=false)
getOwnerName()
get full name of object owner
static _lookupObjId(int $ref_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
getResults()
Returns the results of the processing and moving operation of the uploaded files.
Interface ResourceStakeholder.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))