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->user_settings->performAdditionalChecks(
347 $this->form_gui->setValuesByPost();
356 $user_object = $this->user_profile->addFormValuesToUser(
362 $user_object->setLogin($this->form_gui->getInput(
'username'));
364 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
365 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
369 $user_object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
371 $user_object->setLastPasswordChangeTS(time());
373 $user_object->setTitle($user_object->getFullname());
374 $user_object->setDescription($user_object->getEmail());
375 $user_object->update();
377 $this->
object = $this->user_settings->saveForm(
379 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
385 $this->rbac_admin->assignUser(
386 (
int) $this->form_gui->getInput(
'default_role'),
387 $user_object->getId(),
391 $msg = $this->
lng->txt(
'user_added');
393 $this->
user->writePref(
395 $this->form_gui->getInput(
'send_mail') ===
'y' ?
'y' :
'n'
398 if ($profile_maybe_incomplete
399 && $this->user_profile->isProfileIncomplete($this->object)) {
400 $this->
object->setProfileIncomplete(
true);
401 $this->
object->update();
405 if ($this->form_gui->getInput(
'send_mail') ==
'y') {
407 $acc_mail->useLangVariablesAsFallback(
true);
408 $acc_mail->setUserPassword($this->form_gui->getInput(
'passwd'));
409 $acc_mail->setUser($user_object);
411 if ($acc_mail->send()) {
412 $msg .=
'<br />' . $this->
lng->txt(
'mail_sent');
413 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
415 $msg .=
'<br />' . $this->
lng->txt(
'mail_not_sent');
416 $this->tpl->setOnScreenMessage(
'info', $msg,
true);
419 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
422 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
423 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
427 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
435 $this->
initForm(!$profile_maybe_incomplete, $this->
object);
437 if (!$this->form_gui->checkInput()
438 || !$this->user_settings->performAdditionalChecks(
441 ) || !$this->isAccessRangeInputValid()) {
442 $this->form_gui->setValuesByPost();
443 $this->tabs_gui->activateTab(
'properties');
449 $this->
object->updateLogin($this->form_gui->getInput(
'username'), $this->context);
451 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage());
452 $this->form_gui->setValuesByPost();
457 $this->
object->setAuthMode($this->form_gui->getInput(
'auth_mode'));
459 $this->
object = $this->user_profile->addFormValuesToUser(
465 $passwd = $this->form_gui->getInput(
'passwd');
467 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
468 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId())))
469 && !empty($passwd)) {
473 $this->
object->setExternalAccount($this->form_gui->getInput(
'ext_account'));
476 $this->
object->setTitle($this->
object->getFullname());
477 $this->
object->setDescription($this->
object->getEmail());
479 $this->
object = $this->user_settings->saveForm(
481 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
486 $this->
object->setLastPasswordChangeTS(time());
487 $this->
object->setProfileIncomplete(
false);
491 if ($this->
user->getId() === $this->object->getId()) {
494 $this->
user->writePref(
496 ($this->form_gui->getInput(
'send_mail') ===
'y') ?
'y' :
'n'
500 $msg = $this->
lng->txt(
'saved_successfully') . $mail_message;
502 if ($profile_maybe_incomplete
503 && $this->user_profile->isProfileIncomplete($this->object)) {
504 $this->
object->setProfileIncomplete(
true);
505 $this->
object->update();
509 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
511 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
512 $this->
ctrl->redirectByClass(
'ilobjuserfoldergui',
'view');
516 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
524 $this->tabs_gui->clearTargets();
528 $this->
initForm(
true, $this->
object);
541 $this->
ctrl->getFormActionByClass(self::class)
544 $this->form_gui->setTitle($this->
lng->txt(
'usr_new'));
545 if ($user !==
null) {
546 $this->form_gui->setTitle($this->
lng->txt(
'usr_edit'));
549 $this->form_gui->addItem(
553 $this->form_gui->addItem(
557 if (
$user !==
null) {
559 $this->form_gui->addItem(
$id);
562 $this->form_gui->addItem(
567 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
568 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
569 $this->form_gui->addItem(
575 $this->form_gui->addItem(
582 $this->form_gui = $this->user_profile->addFieldsToForm(
590 $this->form_gui->addItem(
594 $this->form_gui = $this->user_settings->addSectionsToLegacyForm(
596 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
603 if ($user ===
null) {
604 $this->form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
606 $this->form_gui->addCommandButton(
'update', $this->
lng->txt(
'save'));
608 $this->form_gui->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
614 $section->setTitle($this->
lng->txt($title_lang_var));
633 if ($auth_name ==
'default') {
634 $name = $this->
lng->txt(
'auth_' . $auth_name)
639 $option[$auth_name] = $name;
641 $input->setOptions($option);
642 if ($user ===
null) {
646 $input->setValue($this->
object->getAuthMode());
653 $field = $this->user_profile->getFieldByIdentifier(
'username');
654 $input = $field->getLegacyInput(
659 $input->
setDisabled(!$this->context->isFieldChangeable($field, $user));
660 $input->setRequired($this->context->isFieldChangeable($field, $user));
670 $input->setMaxLength(80);
671 $input->setValidateAuthPost(
'auth_mode');
672 if ($user ===
null) {
673 $input->setRequiredOnAuth(
true);
676 && in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))
677 && !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
678 $input->setDisabled(
true);
689 $input->setMaxLength(250);
690 $input->setInfo($this->
lng->txt(
'user_ext_account_desc'));
691 if ($user ===
null) {
702 $radg->setRequired(
true);
704 $radg->addOption($op1);
706 foreach ($this->buildTimeLimitDateInputs($user) as $input) {
707 $op2->addSubItem($input);
709 $radg->addOption($op2);
711 $user?->getTimeLimitUnlimited() ??
true ?
'1' :
'0'
726 $from->setShowTime(
true);
727 $from->setMinuteStepSize(1);
734 $to->setRequired(
true);
735 $to->setShowTime(
true);
736 $to->setMinuteStepSize(1);
746 yield $this->buildNonEditableInput(
749 $user->getCreateDate(),
754 yield $this->buildNonEditableInput(
762 yield $this->buildNonEditableInput(
770 yield $this->buildNonEditableInput(
'owner', $user->
getOwnerName());
776 $this->form_gui->addItem(
777 $this->buildSectionHeader(
'system_information')
780 $this->addStatisticalInformationToForm($user);
788 $this->form_gui->addItem($ac);
790 $this->form_gui->addItem($this->buildTimeLimitInput($user));
797 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
799 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
803 if ($user_creation) {
807 $active_from_input = $this->form_gui->getInput(
'active') ===
'1';
808 if ($user->
getActive() !== $active_from_input) {
818 if ($user === null) {
822 foreach ($this->buildStatisticalInputs($user) as $input) {
823 $this->form_gui->addItem($input);
826 foreach ($this->legal_documents->userManagementFields($this->object) as $identifier => $value) {
827 if (is_string($value)) {
828 $value = $this->buildNonEditableInput($identifier, $value);
830 $this->form_gui->addItem($value);
836 $this->form_gui->addItem(
837 $this->buildSectionHeader(
'user_admin_options')
841 $se->setInfo($this->
lng->txt(
'inform_user_mail_info'));
843 $se->setChecked(($this->
user->getPref(
'send_info_mails') ==
'y'));
844 $this->form_gui->addItem($se);
847 $irf->setInfo($this->
lng->txt(
'ignore_required_fields_info'));
849 $this->form_gui->addItem($irf);
855 $upload_tmp_name = $_FILES[
'userfile'][
'tmp_name'];
856 $avatar_upload_result = $uploads[$upload_tmp_name] ??
null;
858 $existing_rid = $this->
object->getAvatarRid();
859 $revision_title =
'Avatar for user ' . $this->
object->getLogin();
860 $this->stakeholder->setOwner($this->
object->getId());
862 if ($avatar_upload_result ===
null && file_exists($upload_tmp_name)) {
863 $stream = Streams::ofResource(
864 fopen($upload_tmp_name,
'r')
867 if ($existing_rid ===
null) {
868 return $this->irss->manage()->stream($stream, $this->stakeholder, $revision_title);
871 $this->irss->manage()->appendNewRevisionFromStream(
877 return $existing_rid;
880 if ($avatar_upload_result ===
null) {
884 if ($existing_rid ===
null) {
885 return $this->irss->manage()->upload(
886 $avatar_upload_result,
892 $this->irss->manage()->replaceWithUpload(
894 $avatar_upload_result,
898 return $existing_rid;
904 $image_dir = $webspace_dir .
'/usr_images';
905 $file = $image_dir .
'/usr_' . $this->
object->getId() .
'.' .
'jpg';
906 $thumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_small.jpg';
907 $xthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xsmall.jpg';
908 $xxthumb_file = $image_dir .
'/usr_' . $this->
object->getId() .
'_xxsmall.jpg';
909 $upload_file = $image_dir .
'/upload_' . $this->
object->getId();
912 $this->
object->setPref(
'profile_image',
'');
913 $this->
object->update();
914 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'user_image_removed'));
916 if (is_file($file)) {
919 if (is_file($thumb_file)) {
922 if (is_file($xthumb_file)) {
923 unlink($xthumb_file);
925 if (is_file($xxthumb_file)) {
926 unlink($xxthumb_file);
928 if (is_file($upload_file)) {
929 unlink($upload_file);
937 if (!$this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)) {
938 $this->tpl->setOnScreenMessage(
940 $this->
lng->txt(
'msg_no_perm_assign_role_to_user')
942 $this->redirectDependingOnParent();
945 $selected_roles = $this->user_request->getRoleIds();
946 $posted_roles = $this->user_request->getPostedRoleIds();
953 $global_roles_all = $this->rbac_review->getGlobalRoles();
954 $assigned_roles_all = $this->rbac_review->assignedRoles($this->
object->getId());
955 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
956 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
957 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
959 $user_not_allowed_to_change_admin_role_assginements =
960 !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()));
962 if ($user_not_allowed_to_change_admin_role_assginements
967 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
969 if (empty($selected_roles) && count($assigned_roles_all) === count($assigned_roles)
970 || empty($posted_global_roles) && count($assigned_global_roles_all) === count($assigned_global_roles)) {
971 $this->tpl->setOnScreenMessage(
973 "{$this->lng->txt('action_aborted')}: {$this->lng->txt('msg_min_one_role')}",
976 $this->
ctrl->redirect($this,
'roleassignment');
979 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
981 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
984 $this->rbac_admin->deassignUser($role, $this->
object->getId());
987 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
989 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
992 $this->rbac_admin->assignUser($role, $this->
object->getId(),
false);
995 $this->
object->update();
997 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_roleassignment_changed'),
true);
999 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
1000 $this->
ctrl->redirect($this,
'roleassignment');
1002 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1008 $this->
tabs->activateTab(
'role_assignment');
1010 if (!$this->checkAccessToRolesTab()) {
1011 $this->tpl->setOnScreenMessage(
1013 $this->
lng->txt(
'msg_no_perm_view_roles_of_user'),
1016 $this->
ctrl->redirectByClass(self::class,
'edit');
1019 $req_filtered_roles = $this->user_request->getFilteredRoles();
1022 ($req_filtered_roles > 0) ? $req_filtered_roles :
ilSession::get(
'filtered_roles')
1026 if ($filtered_roles > 5) {
1030 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'components/ILIAS/User');
1035 $tab->parse($this->
object->getId());
1036 $this->tpl->setVariable(
'ROLES_TABLE', $tab->getHTML());
1042 $table_gui->writeFilterToSession();
1043 $table_gui->resetOffset();
1044 $this->roleassignmentObject();
1050 $table_gui->resetOffset();
1051 $table_gui->resetFilter();
1052 $this->roleassignmentObject();
1063 for ($i = 0; $i <= 60; $i++) {
1064 $days[$i] = $i < 10 ?
'0' . $i : $i;
1069 for ($i = 0; $i < 24; $i++) {
1070 $days[$i] = $i < 10 ?
'0' . $i : $i;
1075 for ($i = 1; $i < 32; $i++) {
1076 $days[$i] = $i < 10 ?
'0' . $i : $i;
1081 for ($i = 1; $i < 13; $i++) {
1082 $month[$i] = $i < 10 ?
'0' . $i : $i;
1087 if ($a_selected < date(
'Y')) {
1088 $start = $a_selected;
1093 for ($i = $start; $i < ((
int) date(
'Y') + 11); ++$i) {
1104 $a_time_arr[
'hour'],
1105 $a_time_arr[
'minute'],
1106 $a_time_arr[
'second'],
1107 $a_time_arr[
'month'],
1120 $action[0] = $this->
lng->txt(
'assigned_roles');
1121 $action[1] = $this->
lng->txt(
'all_roles');
1122 $action[2] = $this->
lng->txt(
'all_global_roles');
1123 $action[3] = $this->
lng->txt(
'all_local_roles');
1124 $action[4] = $this->
lng->txt(
'internal_local_roles_only');
1125 $action[5] = $this->
lng->txt(
'non_internal_local_roles_only');
1144 if ($this->admin_mode ==
'settings') {
1145 $this->
ctrl->setParameterByClass(
1146 'ilobjsystemfoldergui',
1151 $this->
lng->txt(
'administration'),
1152 $this->ctrl->getLinkTargetByClass([
'iladministrationgui',
'ilobjsystemfoldergui'],
''),
1161 $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'view')
1168 $this->ctrl->getLinkTargetByClass(
'ilobjrolefoldergui',
'view')
1172 if ($this->obj_id > 0) {
1174 $this->
object->getTitle(),
1175 $this->ctrl->getLinkTarget($this,
'view')
1183 if ($this->user_request->getSendMail() !=
'y') {
1186 if (!strlen($this->
object->getEmail())) {
1191 $usr_lang->loadLanguageModule(
'crs');
1192 $usr_lang->loadLanguageModule(
'registration');
1195 $mmail->From($this->mail_sender_factory->system());
1198 $mmail->To($mailOptions->getExternalEmailAddresses());
1200 $subject = $usr_lang->txt(
'profile_changed');
1201 $body = $usr_lang->txt(
'reg_mail_body_salutation')
1202 .
' ' . $this->
object->getFullname() .
",\n\n";
1204 $date = $this->
object->getApproveDate();
1206 if ($date !==
null && (time() - strtotime($date)) < 10) {
1207 $body .= $usr_lang->txt(
'reg_mail_body_approve') .
"\n\n";
1209 $body .= $usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n";
1213 if ($this->user_request->getPassword() !=
'') {
1214 $body .= $usr_lang->txt(
'reg_mail_body_text2') .
"\n" .
1215 ILIAS_HTTP_PATH .
'/login.php?client_id=' .
CLIENT_ID .
"\n" .
1216 $usr_lang->txt(
'login') .
': ' . $this->
object->getLogin() .
"\n" .
1217 $usr_lang->txt(
'passwd') .
': ' . $this->user_request->getPassword() .
"\n\n";
1219 $body .= $usr_lang->txt(
'reg_mail_body_text3') .
"\n";
1220 $body .= $this->
object->getProfileAsString($usr_lang);
1224 $mmail->Subject($subject,
true);
1225 $mmail->Body($body);
1228 return '<br/>' . $this->
lng->txt(
'mail_sent');
1234 public static function _goto(
string $a_target): void
1238 $ilUser =
$DIC[
'ilUser'];
1241 $ilCtrl =
$DIC[
'ilCtrl'];
1244 if ($a_target == md5(
'usrdelown')) {
1246 $ilUser->hasDeletionFlag()) {
1247 $ilCtrl->setTargetScript(
'ilias.php');
1248 $ilCtrl->redirectByClass([
'ildashboardgui',
'ilpersonalsettingsgui'],
'deleteOwnAccountStep2');
1250 exit(
'This account is not flagged for deletion.');
1254 if (substr($a_target, -4) ==
'_bdg') {
1255 $ilCtrl->redirectByClass(
'ilDashboardGUI',
'jumpToBadges');
1258 if (
'registration' == $a_target) {
1259 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilAccountRegistrationGUI'],
'');
1260 } elseif (
'nameassist' == $a_target) {
1261 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'showUsernameAssistanceForm');
1262 } elseif (
'pwassist' == $a_target) {
1263 $ilCtrl->redirectByClass([
'ilStartUpGUI',
'ilPasswordAssistanceGUI'],
'');
1265 $target =
$DIC[
'legalDocuments']->findGotoLink($a_target);
1266 if ($target->isOK()) {
1267 $ilCtrl->setTargetScript(
'ilias.php');
1268 foreach ($target->value()->queryParams() as $key => $value) {
1269 $ilCtrl->setParameterByClass($target->value()->guiName(), (
string) $key, $value);
1271 $ilCtrl->redirectByClass($target->value()->guiPath(), $target->value()->command());
1275 if (strpos($a_target,
'n') === 0) {
1281 if (is_numeric($a_target)) {
1282 $target_user = (
int) $a_target;
1283 } elseif (($target_array = explode(
'_', $a_target, 3))) {
1284 $target_cmd = $target_array[2];
1285 $target_user = (
int) $target_array[0];
1288 if ($target_user > 0) {
1289 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', $target_user);
1293 if ($target_cmd ===
'contact_approved') {
1294 $cmd =
'approveContactRequest';
1295 } elseif ($target_cmd ===
'contact_ignored') {
1296 $cmd =
'ignoreContactRequest';
1298 $ilCtrl->setParameterByClass(PublicProfileGUI::class,
'user_id', (
int) $a_target);
1299 $ilCtrl->redirectByClass([PublicProfileGUI::class], $cmd);
1308 $profile_maybe_incomplete =
false;
1310 foreach ($this->user_profile->getIgnorableRequiredFields() as $fieldName) {
1311 $elm = $this->form_gui->getItemByPostVar($fieldName);
1317 if ($elm->getRequired()) {
1318 $profile_maybe_incomplete =
true;
1321 $elm->setRequired(
false);
1325 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
1326 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $field->getIdentifier());
1332 if ($elm->getRequired() && $field->isRequired()) {
1333 $profile_maybe_incomplete =
true;
1336 $elm->setRequired(
false);
1340 return $profile_maybe_incomplete;
1345 if ($this->context === Context::UserAdministration
1351 $this->access->filterUserIdsByPositionOfCurrentUser(
1354 [$this->object->getId()]
1358 $this->tpl->setOnScreenMessage(
1360 $this->
lng->txt(
'msg_no_perm_modify_user'),
1363 $this->
ctrl->redirectByClass(ilObjUserFolderGUI::class);
1369 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1370 $this->tpl->setOnScreenMessage(
1372 $this->
lng->txt(
'msg_no_perm_modify_user')
1374 $this->redirectToRefId($this->usrf_ref_id);
1380 $this->tpl->setContent($this->legal_documents->userManagementModals() . $this->form_gui->getHTML());
1387 $this->rbac_system->checkAccess(
'edit_roleassignment', $this->usrf_ref_id)
1391 $this->access->filterUserIdsByPositionOfCurrentUser(
1394 [$this->object->getId()]
1402 return $this->post_wrapper->retrieve(
1405 $this->refinery->kindlyTo()->bool(),
1406 $this->refinery->always(
false)
1414 $this->
ctrl->redirectByClass(ilObjUserFolderAccess::class);
1417 $this->redirectToRefId($this->usrf_ref_id);
1422 if ($this->form_gui->getInput(
'time_limit_unlimited') ===
'1') {
1425 $timefrom = $this->form_gui->getItemByPostVar(
'time_limit_from');
1426 $timeuntil = $this->form_gui->getItemByPostVar(
'time_limit_until');
1428 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'form_input_not_valid'));
1429 $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'))