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 $this->context === Context::LocalUserAdministration
225 && $this->rbac_system->checkAccess(
'read', $this->ref_id)
226 || $this->context === Context::UserAdministration
230 $this->tabs_gui->addTarget(
232 $this->
ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
234 [
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui']
238 $this->tabs_gui->addTarget(
240 $this->
ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
242 'ilobjectownershipmanagementgui'
249 $this->tabs_gui->clearTargets();
253 $obj_list = $this->rbac_review->getRoleListByObject(
ROLE_FOLDER_ID);
255 foreach ($obj_list as $obj_data) {
259 $this->rbac_review->assignedRoles($this->user->getId())
270 $this->rbac_review->assignedRoles($this->user->getId())
272 $rol[$obj_data[
'obj_id']] = $obj_data[
'title'];
278 $this->tpl->setOnScreenMessage(
280 $this->
lng->txt(
'msg_no_roles_users_can_be_assigned_to')
285 $keys = array_keys($rol);
288 if (in_array(4, $keys)) {
289 $this->default_role = 4;
290 } elseif (count($keys) > 1 && in_array(2, $keys)) {
292 foreach ($keys as $key => $val) {
299 $this->default_role = array_shift($keys);
301 $this->selectable_roles = $rol;
309 if (!$this->rbac_system->checkAccess(
'create_usr', $this->usrf_ref_id)
310 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->usrf_ref_id)) {
311 $this->tpl->setOnScreenMessage(
313 $this->
lng->txt(
'permission_denied')
328 if (!$this->rbac_system->checkAccess(
'create_usr', $this->usrf_ref_id)
329 && !$this->access->checkAccess(
'cat_administrate_users',
'', $this->usrf_ref_id)) {
330 $this->tpl->setOnScreenMessage(
332 $this->
lng->txt(
'msg_no_perm_modify_user')
339 $this->
initForm(!$profile_maybe_incomplete,
null);
341 if (!$this->form_gui->checkInput()) {
342 $this->form_gui->setValuesByPost();
351 $user_object = $this->user_profile->addFormValuesToUser(
357 $user_object->setLogin($this->form_gui->getInput(
'username'));
359 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
360 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
364 $user_object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
366 $user_object->setLastPasswordChangeTS(time());
368 $user_object->setTitle($user_object->getFullname());
369 $user_object->setDescription($user_object->getEmail());
370 $user_object->update();
372 $this->
object = $this->user_settings->saveForm(
374 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
380 $this->rbac_admin->assignUser(
381 (
int) $this->form_gui->getInput(
'default_role'),
382 $user_object->getId(),
386 $msg = $this->
lng->txt(
'user_added');
388 $this->
user->writePref(
390 $this->form_gui->getInput(
'send_mail') ===
'y' ?
'y' :
'n'
393 if ($profile_maybe_incomplete
394 && $this->user_profile->isProfileIncomplete($this->object)) {
395 $this->
object->setProfileIncomplete(
true);
396 $this->
object->update();
400 if ($this->form_gui->getInput(
'send_mail') ==
'y') {
402 $acc_mail->useLangVariablesAsFallback(
true);
403 $acc_mail->setUserPassword($this->form_gui->getInput(
'passwd'));
404 $acc_mail->setUser($user_object);
406 if ($acc_mail->send()) {
407 $msg .=
'<br />' . $this->
lng->txt(
'mail_sent');
408 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
410 $msg .=
'<br />' . $this->
lng->txt(
'mail_not_sent');
411 $this->tpl->setOnScreenMessage(
'info', $msg,
true);
414 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
417 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
418 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
422 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
430 $this->
initForm(!$profile_maybe_incomplete, $this->
object);
432 if (!$this->form_gui->checkInput()
433 || !$this->isAccessRangeInputValid()) {
434 $this->form_gui->setValuesByPost();
435 $this->tabs_gui->activateTab(
'properties');
441 $this->
object->updateLogin($this->form_gui->getInput(
'username'), $this->context);
443 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage());
444 $this->form_gui->setValuesByPost();
449 $this->
object->setAuthMode($this->form_gui->getInput(
'auth_mode'));
451 $this->
object = $this->user_profile->addFormValuesToUser(
457 $passwd = $this->form_gui->getInput(
'passwd');
459 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
460 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId())))
461 && !empty($passwd)) {
465 $this->
object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
468 $this->
object->setTitle($this->
object->getFullname());
469 $this->
object->setDescription($this->
object->getEmail());
471 $this->
object = $this->user_settings->saveForm(
473 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
478 $this->
object->setLastPasswordChangeTS(time());
479 $this->
object->setProfileIncomplete(
false);
483 if ($this->
user->getId() === $this->object->getId()) {
486 $this->
user->writePref(
488 ($this->form_gui->getInput(
'send_mail') ===
'y') ?
'y' :
'n'
492 $msg = $this->
lng->txt(
'saved_successfully') . $mail_message;
494 if ($profile_maybe_incomplete
495 && $this->user_profile->isProfileIncomplete($this->object)) {
496 $this->
object->setProfileIncomplete(
true);
497 $this->
object->update();
501 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
503 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
504 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
508 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
516 $this->tabs_gui->clearTargets();
520 $this->
initForm(
true, $this->
object);
533 $this->
ctrl->getFormActionByClass(self::class)
536 $this->form_gui->setTitle($this->
lng->txt(
'usr_new'));
537 if ($user !==
null) {
538 $this->form_gui->setTitle($this->
lng->txt(
'usr_edit'));
541 $this->form_gui->addItem(
545 $this->form_gui->addItem(
549 if (
$user !==
null) {
551 $this->form_gui->addItem(
$id);
554 $this->form_gui->addItem(
559 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
560 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
561 $this->form_gui->addItem(
567 $this->form_gui->addItem(
574 $this->form_gui = $this->user_profile->addFieldsToForm(
582 $this->form_gui->addItem(
586 $this->form_gui = $this->user_settings->addSectionsToLegacyForm(
588 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
595 if ($user ===
null) {
596 $this->form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
598 $this->form_gui->addCommandButton(
'update', $this->
lng->txt(
'save'));
600 $this->form_gui->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
606 $section->setTitle($this->
lng->txt($title_lang_var));
625 if ($auth_name ==
'default') {
626 $name = $this->
lng->txt(
'auth_' . $auth_name)
631 $option[$auth_name] = $name;
633 $input->setOptions($option);
634 if ($user ===
null) {
638 $input->setValue($this->
object->getAuthMode());
645 $field = $this->user_profile->getFieldByIdentifier(
'username');
646 $input = $field->getLegacyInput(
651 $input->
setDisabled(!$this->context->isFieldChangeable($field, $user));
652 $input->setRequired($this->context->isFieldChangeable($field, $user));
662 $input->setMaxLength(80);
663 $input->setValidateAuthPost(
'auth_mode');
664 if ($user ===
null) {
665 $input->setRequiredOnAuth(
true);
668 && in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))
669 && !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
670 $input->setDisabled(
true);
681 $input->setMaxLength(250);
682 $input->setInfo($this->
lng->txt(
'user_ext_account_desc'));
683 if ($user ===
null) {
694 $radg->setRequired(
true);
696 $radg->addOption($op1);
698 foreach ($this->buildTimeLimitDateInputs($user) as $input) {
699 $op2->addSubItem($input);
701 $radg->addOption($op2);
703 $user?->getTimeLimitUnlimited() ??
true ?
'1' :
'0'
718 $from->setShowTime(
true);
719 $from->setMinuteStepSize(1);
726 $to->setRequired(
true);
727 $to->setShowTime(
true);
728 $to->setMinuteStepSize(1);
738 yield $this->buildNonEditableInput(
741 $user->getCreateDate(),
746 yield $this->buildNonEditableInput(
754 yield $this->buildNonEditableInput(
762 yield $this->buildNonEditableInput(
'owner', $user->
getOwnerName());
768 $this->form_gui->addItem(
769 $this->buildSectionHeader(
'system_information')
772 $this->addStatisticalInformationToForm($user);
780 $this->form_gui->addItem($ac);
782 $this->form_gui->addItem($this->buildTimeLimitInput($user));
789 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
791 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
795 if ($user_creation) {
799 $active_from_input = $this->form_gui->getInput(
'active') ===
'1';
800 if ($user->
getActive() !== $active_from_input) {
810 if ($user === null) {
814 foreach ($this->buildStatisticalInputs($user) as $input) {
815 $this->form_gui->addItem($input);
818 foreach ($this->legal_documents->userManagementFields($this->object) as $identifier => $value) {
819 if (is_string($value)) {
820 $value = $this->buildNonEditableInput($identifier, $value);
822 $this->form_gui->addItem($value);
828 $this->form_gui->addItem(
829 $this->buildSectionHeader(
'user_admin_options')
833 $se->setInfo($this->
lng->txt(
'inform_user_mail_info'));
835 $se->setChecked(($this->
user->getPref(
'send_info_mails') ==
'y'));
836 $this->form_gui->addItem($se);
839 $irf->setInfo($this->
lng->txt(
'ignore_required_fields_info'));
841 $this->form_gui->addItem($irf);
847 $upload_tmp_name = $_FILES[
'userfile'][
'tmp_name'];
848 $avatar_upload_result = $uploads[$upload_tmp_name] ??
null;
850 $existing_rid = $this->
object->getAvatarRid();
851 $revision_title =
'Avatar for user ' . $this->
object->getLogin();
852 $this->stakeholder->setOwner($this->
object->getId());
854 if ($avatar_upload_result ===
null && file_exists($upload_tmp_name)) {
855 $stream = Streams::ofResource(
856 fopen($upload_tmp_name,
'r')
859 if ($existing_rid ===
null) {
860 return $this->irss->manage()->stream($stream, $this->stakeholder, $revision_title);
863 $this->irss->manage()->appendNewRevisionFromStream(
869 return $existing_rid;
872 if ($avatar_upload_result ===
null) {
876 if ($existing_rid ===
null) {
877 return $this->irss->manage()->upload(
878 $avatar_upload_result,
884 $this->irss->manage()->replaceWithUpload(
886 $avatar_upload_result,
890 return $existing_rid;
896 $image_dir = $webspace_dir .
'/usr_images';
897 $file = $image_dir .
'/usr_' . $this->
object->getId() .
'.' .
'jpg';
898 $thumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_small.jpg';
899 $xthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xsmall.jpg';
900 $xxthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xxsmall.jpg';
901 $upload_file = $image_dir .
'/upload_' . $this->
object->getId();
904 $this->
object->setPref(
'profile_image',
'');
905 $this->
object->update();
906 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_image_removed'));
908 if (is_file($file)) {
911 if (is_file($thumb_file)) {
914 if (is_file($xthumb_file)) {
915 unlink($xthumb_file);
917 if (is_file($xxthumb_file)) {
918 unlink($xxthumb_file);
920 if (is_file($upload_file)) {
921 unlink($upload_file);
929 if (!$this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)) {
930 $this->tpl->setOnScreenMessage(
932 $this->
lng->txt(
'msg_no_perm_assign_role_to_user')
934 $this->redirectDependingOnParent();
937 $selected_roles = $this->user_request->getRoleIds();
938 $posted_roles = $this->user_request->getPostedRoleIds();
945 $global_roles_all = $this->rbac_review->getGlobalRoles();
946 $assigned_roles_all = $this->rbac_review->assignedRoles($this->
object->getId());
947 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
948 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
949 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
951 $user_not_allowed_to_change_admin_role_assginements =
952 !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()));
954 if ($user_not_allowed_to_change_admin_role_assginements
959 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
961 if (empty($selected_roles) && count($assigned_roles_all) === count($assigned_roles)
962 || empty($posted_global_roles) && count($assigned_global_roles_all) === count($assigned_global_roles)) {
963 $this->tpl->setOnScreenMessage(
965 "{$this->lng->txt('action_aborted')}: {$this->lng->txt('msg_min_one_role')}",
968 $this->
ctrl->redirect($this,
'roleassignment');
971 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
973 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
976 $this->rbac_admin->deassignUser($role, $this->
object->getId());
979 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
981 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
984 $this->rbac_admin->assignUser($role, $this->
object->getId(),
false);
987 $this->
object->update();
989 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_roleassignment_changed'),
true);
991 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
992 $this->
ctrl->redirect($this,
'roleassignment');
994 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1000 $this->
tabs->activateTab(
'role_assignment');
1002 if (!$this->checkAccessToRolesTab()) {
1003 $this->tpl->setOnScreenMessage(
1005 $this->
lng->txt(
'msg_no_perm_view_roles_of_user'),
1008 $this->
ctrl->redirectByClass(self::class,
'edit');
1011 $req_filtered_roles = $this->user_request->getFilteredRoles();
1014 ($req_filtered_roles > 0) ? $req_filtered_roles :
ilSession::get(
'filtered_roles')
1018 if ($filtered_roles > 5) {
1022 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'components/ILIAS/User');
1027 $tab->parse($this->
object->getId());
1028 $this->tpl->setVariable(
'ROLES_TABLE', $tab->getHTML());
1034 $table_gui->writeFilterToSession();
1035 $table_gui->resetOffset();
1036 $this->roleassignmentObject();
1042 $table_gui->resetOffset();
1043 $table_gui->resetFilter();
1044 $this->roleassignmentObject();
1055 for ($i = 0; $i <= 60; $i++) {
1056 $days[$i] = $i < 10 ?
'0' . $i : $i;
1061 for ($i = 0; $i < 24; $i++) {
1062 $days[$i] = $i < 10 ?
'0' . $i : $i;
1067 for ($i = 1; $i < 32; $i++) {
1068 $days[$i] = $i < 10 ?
'0' . $i : $i;
1073 for ($i = 1; $i < 13; $i++) {
1074 $month[$i] = $i < 10 ?
'0' . $i : $i;
1079 if ($a_selected < date(
'Y')) {
1080 $start = $a_selected;
1085 for ($i = $start; $i < ((
int) date(
'Y') + 11); ++$i) {
1096 $a_time_arr[
'hour'],
1097 $a_time_arr[
'minute'],
1098 $a_time_arr[
'second'],
1099 $a_time_arr[
'month'],
1112 $action[0] = $this->
lng->txt(
'assigned_roles');
1113 $action[1] = $this->
lng->txt(
'all_roles');
1114 $action[2] = $this->
lng->txt(
'all_global_roles');
1115 $action[3] = $this->
lng->txt(
'all_local_roles');
1116 $action[4] = $this->
lng->txt(
'internal_local_roles_only');
1117 $action[5] = $this->
lng->txt(
'non_internal_local_roles_only');
1136 if ($this->admin_mode ==
'settings') {
1137 $this->
ctrl->setParameterByClass(
1138 'ilobjsystemfoldergui',
1143 $this->
lng->txt(
'administration'),
1144 $this->ctrl->getLinkTargetByClass([
'iladministrationgui',
'ilobjsystemfoldergui'],
''),
1153 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'view')
1160 $this->ctrl->getLinkTargetByClass(
'ilobjrolefoldergui',
'view')
1164 if ($this->obj_id > 0) {
1166 $this->
object->getTitle(),
1167 $this->ctrl->getLinkTarget($this,
'view')
1175 if ($this->user_request->getSendMail() !=
'y') {
1178 if (!strlen($this->
object->getEmail())) {
1183 $usr_lang->loadLanguageModule(
'crs');
1184 $usr_lang->loadLanguageModule(
'registration');
1187 $mmail->From($this->mail_sender_factory->system());
1190 $mmail->To($mailOptions->getExternalEmailAddresses());
1192 $subject = $usr_lang->txt(
'profile_changed');
1193 $body = $usr_lang->txt(
'reg_mail_body_salutation')
1194 .
' ' . $this->
object->getFullname() .
",\n\n";
1196 $date = $this->
object->getApproveDate();
1198 if ($date !==
null && (time() - strtotime($date)) < 10) {
1199 $body .= $usr_lang->txt(
'reg_mail_body_approve') .
"\n\n";
1201 $body .= $usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n";
1205 if ($this->user_request->getPassword() !=
'') {
1206 $body .= $usr_lang->txt(
'reg_mail_body_text2') .
"\n" .
1207 ILIAS_HTTP_PATH .
'/login.php?client_id=' .
CLIENT_ID .
"\n" .
1208 $usr_lang->txt(
'login') .
': ' . $this->
object->getLogin() .
"\n" .
1209 $usr_lang->txt(
'passwd') .
': ' . $this->user_request->getPassword() .
"\n\n";
1211 $body .= $usr_lang->txt(
'reg_mail_body_text3') .
"\n";
1212 $body .= $this->
object->getProfileAsString($usr_lang);
1216 $mmail->Subject($subject,
true);
1217 $mmail->Body($body);
1220 return '<br/>' . $this->
lng->txt(
'mail_sent');
1226 public static function _goto(
string $a_target): void
1230 $ilUser =
$DIC[
'ilUser'];
1233 $ilCtrl =
$DIC[
'ilCtrl'];
1236 if ($a_target == md5(
'usrdelown')) {
1238 $ilUser->hasDeletionFlag()) {
1239 $ilCtrl->setTargetScript(
'ilias.php');
1240 $ilCtrl->redirectByClass([
'ildashboardgui',
'ilpersonalsettingsgui'],
'deleteOwnAccountStep2');
1242 exit(
'This account is not flagged for deletion.');
1246 if (substr($a_target, -4) ==
'_bdg') {
1247 $ilCtrl->redirectByClass(
'ilDashboardGUI',
'jumpToBadges');
1250 if (
'registration' == $a_target) {
1251 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilAccountRegistrationGUI'],
'');
1252 } elseif (
'nameassist' == $a_target) {
1253 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'showUsernameAssistanceForm');
1254 } elseif (
'pwassist' == $a_target) {
1255 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'');
1257 $target =
$DIC[
'legalDocuments']->findGotoLink($a_target);
1258 if ($target->isOK()) {
1259 $ilCtrl->setTargetScript(
'ilias.php');
1260 foreach ($target->value()->queryParams() as $key => $value) {
1261 $ilCtrl->setParameterByClass($target->value()->guiName(), (
string) $key, $value);
1263 $ilCtrl->redirectByClass($target->value()->guiPath(), $target->value()->command());
1267 if (strpos($a_target,
'n') === 0) {
1273 if (is_numeric($a_target)) {
1274 $target_user = (
int) $a_target;
1275 } elseif (($target_array = explode(
'_', $a_target, 3))) {
1276 $target_cmd = $target_array[2];
1277 $target_user = (
int) $target_array[0];
1280 if ($target_user > 0) {
1281 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', $target_user);
1285 if ($target_cmd ===
'contact_approved') {
1286 $cmd =
'approveContactRequest';
1287 } elseif ($target_cmd ===
'contact_ignored') {
1288 $cmd =
'ignoreContactRequest';
1290 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', (
int) $a_target);
1291 $ilCtrl->redirectByClass([PublicProfileGUI::class], $cmd);
1300 $profile_maybe_incomplete =
false;
1302 foreach ($this->user_profile->getIgnorableRequiredFields() as $fieldName) {
1303 $elm = $this->form_gui->getItemByPostVar($fieldName);
1309 if ($elm->getRequired()) {
1310 $profile_maybe_incomplete =
true;
1313 $elm->setRequired(
false);
1317 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
1318 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $field->getIdentifier());
1324 if ($elm->getRequired() && $field->isRequired()) {
1325 $profile_maybe_incomplete =
true;
1328 $elm->setRequired(
false);
1332 return $profile_maybe_incomplete;
1337 if ($this->context === Context::UserAdministration
1343 $this->access->filterUserIdsByPositionOfCurrentUser(
1346 [$this->object->getId()]
1350 $this->tpl->setOnScreenMessage(
1352 $this->
lng->txt(
'msg_no_perm_modify_user'),
1355 $this->
ctrl->redirectByClass(ilObjUserFolderGUI::class);
1361 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1362 $this->tpl->setOnScreenMessage(
1364 $this->
lng->txt(
'msg_no_perm_modify_user')
1366 $this->redirectToRefId($this->usrf_ref_id);
1372 $this->tpl->setContent($this->legal_documents->userManagementModals() . $this->form_gui->getHTML());
1379 $this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)
1383 $this->access->filterUserIdsByPositionOfCurrentUser(
1386 [$this->object->getId()]
1394 return $this->post_wrapper->retrieve(
1397 $this->refinery->kindlyTo()->bool(),
1398 $this->refinery->always(
false)
1406 $this->
ctrl->redirectByClass(ilObjUserFolderAccess::class);
1409 $this->redirectToRefId($this->usrf_ref_id);
1414 if ($this->form_gui->getInput(
'time_limit_unlimited') ===
'1') {
1417 $timefrom = $this->form_gui->getItemByPostVar(
'time_limit_from');
1418 $timeuntil = $this->form_gui->getItemByPostVar(
'time_limit_until');
1420 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
1421 $timeuntil->setAlert($this->
lng->txt(
'time_limit_not_valid'));
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
const string PERM_READ_ALL_AND_WRITE
const string PERM_READ_ALL
ilPropertyFormGUI $form_gui
Conductor $legal_documents
addOptionsSectionToForm()
string $requested_baseClass
__toUnix(array $a_time_arr)
saveObject()
save user data
ResourceStakeholder $stakeholder
UserGUIRequest $user_request
isAccessRangeInputValid()
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'))