ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjUserGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24use ILIAS\User\Settings\Settings as UserSettings;
25use ILIAS\User\Settings\SettingsImplementation as UserSettingsImplementation;
31use ILIAS\ResourceStorage\Services as ResourceStorageServices;
36use ILIAS\Repository\ExternalGUIService as RepositoryGUIs;
37
45{
50 private RepositoryGUIs $repository_guis;
52
54 private ResourceStorageServices $irss;
56
57 private UserSettingsImplementation $user_settings;
59
60 private string $requested_letter = '';
61 private string $requested_baseClass = '';
62 private string $requested_search = '';
63 private array $selectable_roles;
64 private int $default_role;
66
67 private int $usrf_ref_id;
68 private Context $context;
70
71 public function __construct(
72 $a_data,
73 int $a_id,
74 bool $a_call_by_reference = false,
75 bool $a_prepare_output = true
76 ) {
78 global $DIC;
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();
84
85 $local_dic = LocalDIC::dic();
86 $this->user_settings = $local_dic[UserSettings::class];
87 $this->user_profile = $local_dic[Profile::class];
88
89 $this->default_layout_and_style = $DIC['ilClientIniFile']->readVariable('layout', 'skin') .
90 ':' . $DIC['ilClientIniFile']->readVariable('layout', 'style');
91
92 $this->type = 'usr';
93 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
94 $this->usrf_ref_id = $this->ref_id;
95 $this->context = $this->usrf_ref_id === USER_FOLDER_ID
96 ? Context::UserAdministration
97 : Context::LocalUserAdministration;
98
99 $this->uploads = $DIC->upload();
100 $this->irss = $DIC->resourceStorage();
101 $this->stakeholder = new ilUserProfilePictureStakeholder();
102
103 $this->ctrl->saveParameter($this, ['obj_id', 'letter']);
104 $this->ctrl->setParameterByClass('ilobjuserfoldergui', 'letter', $this->requested_letter);
105 $this->lng->loadLanguageModule('user');
106
107 $this->user_request = new UserGUIRequest(
108 $DIC->http(),
109 $DIC->refinery()
110 );
111
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'];
116
117 $this->lng->loadLanguageModule('crs');
118 }
119
120 public function executeCommand(): void
121 {
122 $next_class = $this->ctrl->getNextClass($this);
123 $cmd = $this->ctrl->getCmd();
124
125 $this->prepareOutput();
126
127 switch ($next_class) {
128 case 'illearningprogressgui':
129 $new_gui = new ilLearningProgressGUI(
132 $this->object->getId()
133 );
134 $this->ctrl->forwardCommand($new_gui);
135 break;
136
137 case strtolower(ilObjectOwnershipManagementGUI::class):
138 $this->ctrl->forwardCommand(
139 $this->repository_guis->ownershipManagementGUI(
140 $this->object->getId()
141 )
142 );
143 break;
144
145 default:
146 if ($cmd == '' || $cmd == 'view') {
147 $cmd = 'edit';
148 }
149 $cmd .= 'Object';
150 $this->$cmd();
151 break;
152 }
153 }
154
155 protected function setTitleAndDescription(): void
156 {
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(
161 ilUtil::getImagePath('standard/icon_' . $this->object->getType() . '.svg'),
162 $this->lng->txt('obj_' . $this->object->getType())
163 );
164 } else {
165 parent::setTitleAndDescription();
166 }
167 }
168
169 public function cancelObject(): void
170 {
171 ilSession::clear('saved_post');
172
173 if (strtolower($this->requested_baseClass) == 'iladministrationgui') {
174 $this->ctrl->redirectByClass('ilobjuserfoldergui', 'view');
175 } else {
176 $this->ctrl->redirectByClass('ilobjcategorygui', 'listUsers');
177 }
178 }
179
180 public function getAdminTabs(): void
181 {
182 $this->getTabs();
183 }
184
185 protected function getTabs(): void
186 {
187 $this->tabs_gui->clearTargets();
188
189 $this->help->setScreenIdComponent('usr');
190
191 if ($this->requested_search) {
192 $this->tabs_gui->setBackTarget(
193 $this->lng->txt('search_results'),
194 ilSession::get('usr_search_link')
195 );
196
197 $this->tabs_gui->addTarget(
198 'properties',
199 $this->ctrl->getLinkTarget($this, 'edit'),
200 ['edit', '', 'view'],
201 get_class($this),
202 '',
203 true
204 );
205 } else {
206 $this->tabs_gui->addTarget(
207 'properties',
208 $this->ctrl->getLinkTarget($this, 'edit'),
209 ['edit', '', 'view'],
210 get_class($this)
211 );
212 }
213
214 if ($this->checkAccessToRolesTab()) {
215 $this->tabs_gui->addTarget(
216 'role_assignment',
217 $this->ctrl->getLinkTarget($this, 'roleassignment'),
218 ['roleassignment'],
219 get_class($this)
220 );
221 }
222
223 // learning progress
224 if ($this->rbac_system->checkAccess('read', $this->ref_id) and
227 $this->tabs_gui->addTarget(
228 'learning_progress',
229 $this->ctrl->getLinkTargetByClass('illearningprogressgui', ''),
230 '',
231 ['illplistofobjectsgui', 'illplistofsettingsgui', 'illearningprogressgui', 'illplistofprogressgui']
232 );
233 }
234
235 $this->tabs_gui->addTarget(
236 'user_ownership',
237 $this->ctrl->getLinkTargetByClass('ilobjectownershipmanagementgui', ''),
238 '',
239 'ilobjectownershipmanagementgui'
240 );
241 }
242
243 private function initCreate(): void
244 {
245 if ($this->usrf_ref_id !== USER_FOLDER_ID) {
246 $this->tabs_gui->clearTargets();
247 }
248
249 // role selection
250 $obj_list = $this->rbac_review->getRoleListByObject(ROLE_FOLDER_ID);
251 $rol = [];
252 foreach ($obj_list as $obj_data) {
253 // allow only 'assign_users' marked roles if called from category
254 if ($this->object->getRefId() !== USER_FOLDER_ID && !in_array(
256 $this->rbac_review->assignedRoles($this->user->getId())
257 )) {
258 if (!ilObjRole::_getAssignUsersStatus($obj_data['obj_id'])) {
259 continue;
260 }
261 }
262 // exclude anonymous role from list
263 if ($obj_data['obj_id'] !== ANONYMOUS_ROLE_ID) {
264 // do not allow to assign users to administrator role if current user does not has SYSTEM_ROLE_ID
265 if ($obj_data['obj_id'] !== SYSTEM_ROLE_ID || in_array(
267 $this->rbac_review->assignedRoles($this->user->getId())
268 )) {
269 $rol[$obj_data['obj_id']] = $obj_data['title'];
270 }
271 }
272 }
273
274 if ($rol === null) {
275 $this->tpl->setOnScreenMessage(
276 'failure',
277 $this->lng->txt('msg_no_roles_users_can_be_assigned_to')
278 );
280 }
281
282 $keys = array_keys($rol);
283
284 // set pre defined user role to default
285 if (in_array(4, $keys)) {
286 $this->default_role = 4;
287 } elseif (count($keys) > 1 && in_array(2, $keys)) {
288 // remove admin role as preselectable role
289 foreach ($keys as $key => $val) {
290 if ($val == 2) {
291 unset($keys[$key]);
292 break;
293 }
294 }
295
296 $this->default_role = array_shift($keys);
297 }
298 $this->selectable_roles = $rol;
299 }
300
304 public function createObject(): void
305 {
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(
309 'failure',
310 $this->lng->txt('permission_denied')
311 );
313 }
314
315 $this->initCreate();
316 $this->initForm(true, null);
317 $this->renderForm();
318 }
319
323 public function saveObject(): void
324 {
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(
328 'failure',
329 $this->lng->txt('msg_no_perm_modify_user')
330 );
331 $this->redirectToRefId($this->usrf_ref_id);
332 }
333
334 $this->initCreate();
335 $profile_maybe_incomplete = $this->retrieveAllowIncompleteProfileFromPost();
336 $this->initForm(!$profile_maybe_incomplete, null);
337
338 if (!$this->form_gui->checkInput()) {
339 $this->form_gui->setValuesByPost();
340 $this->renderForm();
341 return;
342 }
343
344 $user_object = $this->user_profile->addFormValuesToUser(
345 $this->form_gui,
346 $this->context,
347 new ilObjUser()
348 );
349
350 $user_object->setLogin($this->form_gui->getInput('username'));
351 if ($this->user->getId() === (int) SYSTEM_USER_ID
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()))) {
354 $user_object->setPasswd($this->form_gui->getInput('passwd'), ilObjUser::PASSWD_PLAIN);
355 }
357 $user_object->setExternalAccount($this->form_gui->getInput('ext_account'));
358 }
359 $user_object->setLastPasswordChangeTS(time());
360
361 $user_object->setTitle($user_object->getFullname());
362 $user_object->setDescription($user_object->getEmail());
363 $user_object->create();
364 $user_object->saveAsNew();
365
366 $this->object = $this->user_settings->saveForm(
367 $this->form_gui,
368 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
369 $this->context,
370 $this->addValuesFromSystemInformationToUserSection($user_object, true)
371 );
372
373 //set role entries
374 $this->rbac_admin->assignUser(
375 (int) $this->form_gui->getInput('default_role'),
376 $user_object->getId(),
377 true
378 );
379
380 $msg = $this->lng->txt('user_added');
381
382 $this->user->setPref(
383 'send_info_mails',
384 ($this->form_gui->getInput('send_mail') == 'y') ? 'y' : 'n'
385 );
386 $this->user->writePrefs();
387
388 if ($profile_maybe_incomplete
389 && $this->user_profile->isProfileIncomplete($this->object)) {
390 $this->object->setProfileIncomplete(true);
391 $this->object->update();
392 }
393
394 // send new account mail
395 if ($this->form_gui->getInput('send_mail') == 'y') {
396 $acc_mail = new ilAccountMail();
397 $acc_mail->useLangVariablesAsFallback(true);
398 $acc_mail->setUserPassword($this->form_gui->getInput('passwd'));
399 $acc_mail->setUser($user_object);
400
401 if ($acc_mail->send()) {
402 $msg .= '<br />' . $this->lng->txt('mail_sent');
403 $this->tpl->setOnScreenMessage('success', $msg, true);
404 } else {
405 $msg .= '<br />' . $this->lng->txt('mail_not_sent');
406 $this->tpl->setOnScreenMessage('info', $msg, true);
407 }
408 } else {
409 $this->tpl->setOnScreenMessage('success', $msg, true);
410 }
411
412 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
413 $this->ctrl->redirectByClass('ilobjuserfoldergui', 'view');
414 return;
415 }
416
417 $this->ctrl->redirectByClass('ilobjcategorygui', 'listUsers');
418 }
419
420 public function updateObject(): void
421 {
423
424 $profile_maybe_incomplete = $this->retrieveAllowIncompleteProfileFromPost();
425 $this->initForm(!$profile_maybe_incomplete, $this->object);
426
427 if (!$this->form_gui->checkInput()) {
428 $this->form_gui->setValuesByPost();
429 $this->tabs_gui->activateTab('properties');
430 $this->renderForm();
431 return;
432 }
433
434 try {
435 $this->object->updateLogin($this->form_gui->getInput('username'));
436 } catch (ilUserException $e) {
437 $this->tpl->setOnScreenMessage('failure', $e->getMessage());
438 $this->form_gui->setValuesByPost();
439 $this->renderForm();
440 return;
441 }
442
443 $this->object = $this->user_profile->addFormValuesToUser(
444 $this->form_gui,
445 $this->context,
446 $this->object
447 );
448
449 if ($this->user->getId() === (int) SYSTEM_USER_ID
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()))) {
452 $this->object->setPasswd($this->form_gui->getInput('passwd'), ilObjUser::PASSWD_PLAIN);
453 }
455 $this->object->setExternalAccount($this->form_gui->getInput('ext_account'));
456 }
457
458 $this->object->setTitle($this->object->getFullname());
459 $this->object->setDescription($this->object->getEmail());
460
461 $this->object = $this->user_settings->saveForm(
462 $this->form_gui,
463 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
464 $this->context,
465 $this->addValuesFromSystemInformationToUserSection($this->object, false)
466 );
467
468 $this->object->setLastPasswordChangeTS(time());
469 $this->object->setProfileIncomplete(false);
470
471 // If the current user is editing its own user account,
472 // we update his preferences.
473 if ($this->user->getId() === $this->object->getId()) {
474 $this->user = $this->object;
475 }
476 $this->user->setPref(
477 'send_info_mails',
478 ($this->form_gui->getInput('send_mail') === 'y') ? 'y' : 'n'
479 );
480 $this->user->writePrefs();
481
482 $mail_message = $this->__sendProfileMail();
483 $msg = $this->lng->txt('saved_successfully') . $mail_message;
484
485 if ($profile_maybe_incomplete
486 && $this->user_profile->isProfileIncomplete($this->object)) {
487 $this->object->setProfileIncomplete(true);
488 $this->object->update();
489 }
490
491 // feedback
492 $this->tpl->setOnScreenMessage('success', $msg, true);
493
494 if (strtolower($this->requested_baseClass) === strtolower(ilAdministrationGUI::class)) {
495 $this->ctrl->redirectByClass('ilobjuserfoldergui', 'view');
496 return;
497 }
498
499 $this->ctrl->redirectByClass('ilobjcategorygui', 'listUsers');
500 }
501
502 public function editObject(): void
503 {
505
506 if ($this->usrf_ref_id != USER_FOLDER_ID) {
507 $this->tabs_gui->clearTargets();
508 }
509
510 // get form
511 $this->initForm(true, $this->object);
512 $this->renderForm();
513 }
514
518 private function initForm(
519 bool $do_require,
521 ): void {
522 $this->form_gui = new ilPropertyFormGUI();
523 $this->form_gui->setFormAction(
524 $this->ctrl->getFormActionByClass(self::class)
525 );
526
527 $this->form_gui->setTitle($this->lng->txt('usr_new'));
528 if ($user !== null) {
529 $this->form_gui->setTitle($this->lng->txt('usr_edit'));
530 }
531
532 $this->form_gui->addItem(
533 $this->buildSectionHeader('login_data')
534 );
535
536 $this->form_gui->addItem(
537 $this->buildAuthModeInput($user)
538 );
539
540 if ($user !== null) {
541 $id = $this->buildNonEditableInput('usr_id', (string) $user->getId());
542 $this->form_gui->addItem($id);
543 }
544
545 $this->form_gui->addItem(
546 $this->buildLoginInput($user)
547 );
548
549 if ($this->user->getId() === (int) SYSTEM_USER_ID
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(
553 $this->buildPasswordInput($user)
554 );
555 }
556
558 $this->form_gui->addItem(
559 $this->buildExternalAccountInput($user)
560 );
561 }
562
564
565 $this->form_gui = $this->user_profile->addFieldsToForm(
566 $this->form_gui,
567 $this->context,
568 $do_require,
569 $user,
570 [Alias::class]
571 );
572
573 $this->form_gui->addItem(
574 $this->buildSectionHeader('settings')
575 );
576
577 $this->form_gui = $this->user_settings->addSectionsToLegacyForm(
578 $this->form_gui,
579 [AvailablePages::MainSettings, AvailablePages::PrivacySettings],
580 $this->context,
581 $user
582 );
583
585
586 if ($user === null) {
587 $this->form_gui->addCommandButton('save', $this->lng->txt('save'));
588 } else {
589 $this->form_gui->addCommandButton('update', $this->lng->txt('save'));
590 }
591 $this->form_gui->addCommandButton('cancel', $this->lng->txt('cancel'));
592 }
593
594 private function buildSectionHeader(string $title_lang_var): ilFormSectionHeaderGUI
595 {
596 $section = new ilFormSectionHeaderGUI();
597 $section->setTitle($this->lng->txt($title_lang_var));
598 return $section;
599 }
600
601 private function buildNonEditableInput(
602 string $identifier,
603 string $value
605 $input = new ilNonEditableValueGUI($this->lng->txt($identifier), $identifier);
606 $input->setValue($value);
607 return $input;
608 }
609
610 private function buildAuthModeInput(
611 ?\ilObjUser $user
613 $input = new ilSelectInputGUI($this->lng->txt('auth_mode'), 'auth_mode');
614 $option = [];
615 foreach (ilAuthUtils::_getActiveAuthModes() as $auth_name => $auth_key) {
616 if ($auth_name == 'default') {
617 $name = $this->lng->txt('auth_' . $auth_name)
618 . ' (' . $this->lng->txt('auth_' . ilAuthUtils::_getAuthModeName((string) $auth_key)) . ')';
619 } else {
620 $name = ilAuthUtils::getAuthModeTranslation((string) $auth_key, $auth_name);
621 }
622 $option[$auth_name] = $name;
623 }
624 $input->setOptions($option);
625 if ($user === null) {
626 return $input;
627 }
628
629 $input->setValue($this->object->getAuthMode());
630 return $input;
631 }
632
633 private function buildLoginInput(
634 ?\ilObjUser $user
636 $field = $this->user_profile->getFieldByIdentifier('username');
637 $input = $field->getLegacyInput(
638 $this->lng,
639 $this->context,
640 $user
641 );
642 $input->setDisabled(!$this->context->isFieldChangeableInType($field, $user));
643 $input->setRequired($this->context->isFieldChangeableInType($field, $user));
644 return $input;
645 }
646
647 private function buildPasswordInput(
648 ?\ilObjUser $user
650 $input = new ilPasswordInputGUI($this->lng->txt('passwd'), 'passwd');
651 $input->setUseStripSlashes(false);
652 $input->setSize(32);
653 $input->setMaxLength(80);
654 $input->setValidateAuthPost('auth_mode');
655 if ($user === null) {
656 $input->setRequiredOnAuth(true);
657 }
658 if ($this->user->getId() !== (int) SYSTEM_USER_ID
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);
662 }
664 return $input;
665 }
666
668 ?\ilObjUser $user
669 ): ilTextInputGUI {
670 $input = new ilTextInputGUI($this->lng->txt('user_ext_account'), 'ext_account');
671 $input->setSize(40);
672 $input->setMaxLength(250);
673 $input->setInfo($this->lng->txt('user_ext_account_desc'));
674 if ($user === null) {
675 return $input;
676 }
677 $input->setValue($user->getExternalAccount());
678 return $input;
679 }
680
681 private function buildTimeLimitInput(
682 ?\ilObjUser $user
683 ) {
684 $radg = new ilRadioGroupInputGUI($this->lng->txt('time_limit'), 'time_limit_unlimited');
685 $radg->setRequired(true);
686 $op1 = new ilRadioOption($this->lng->txt('user_access_unlimited'), '1');
687 $radg->addOption($op1);
688 $op2 = new ilRadioOption($this->lng->txt('user_access_limited'), '0');
689 foreach ($this->buildTimeLimitDateInputs($user) as $input) {
690 $op2->addSubItem($input);
691 }
692 $radg->addOption($op2);
693 $radg->setValue(
694 $user?->getTimeLimitUnlimited() ?? false ? '1' : '0'
695 );
696
697 return $radg;
698 }
699
704 private function buildTimeLimitDateInputs(
705 ?\ilObjUser $user
706 ): Generator {
707 $from = new ilDateTimeInputGUI($this->lng->txt('crs_from'), 'time_limit_from');
708 $from->setRequired(true);
709 $from->setShowTime(true);
710 $from->setMinuteStepSize(1);
711 $from->setDate(
712 new ilDateTime($user?->getTimeLimitFrom(), IL_CAL_UNIX)
713 );
714 yield $from;
715
716 $to = new ilDateTimeInputGUI($this->lng->txt('crs_to'), 'time_limit_until');
717 $to->setRequired(true);
718 $to->setShowTime(true);
719 $to->setMinuteStepSize(1);
720 $to->setDate(
721 new ilDateTime($user?->getTimeLimitUntil(), IL_CAL_UNIX)
722 );
723 yield $to;
724 }
725
726 private function buildStatisticalInputs(
727 ?\ilObjUser $user
728 ): Generator {
729 yield $this->buildNonEditableInput(
730 'create_date',
731 ilDatePresentation::formatDate(new ilDateTime(
732 $user->getCreateDate(),
734 ))
735 );
736
737 yield $this->buildNonEditableInput(
738 'approve_date',
740 $user->getApproveDate(),
742 ))
743 );
744
745 yield $this->buildNonEditableInput(
746 'last_login',
748 $user->getLastLogin(),
750 ))
751 );
752
753 yield $this->buildNonEditableInput('owner', $user->getOwnerName());
754 }
755
757 ?\ilObjUser $user
758 ): void {
759 $this->form_gui->addItem(
760 $this->buildSectionHeader('system_information')
761 );
762
763 $this->addStatisticalInformationToForm($user);
764
765 $ac = new ilCheckboxInputGUI($this->lng->txt('active'), 'active');
766 $ac->setChecked(
767 $user === null
768 ? true
769 : $user->getActive()
770 );
771 $this->form_gui->addItem($ac);
772
773 $this->form_gui->addItem($this->buildTimeLimitInput($user));
774 }
775
777 \ilObjUser $user,
778 bool $user_creation
779 ): \ilObjUser {
780 $from = $this->form_gui->getItemByPostVar('time_limit_from')->getDate();
781 $user->setTimeLimitFrom($from ? $from->get(IL_CAL_UNIX) : null);
782 $until = $this->form_gui->getItemByPostVar('time_limit_until')->getDate();
783 $user->setTimeLimitUntil($until ? $until->get(IL_CAL_UNIX) : null);
784 $user->setTimeLimitUnlimited($this->form_gui->getInput('time_limit_unlimited') === '1');
785
786 if ($user_creation) {
787 $user->setTimeLimitOwner($this->usrf_ref_id);
788 }
789
790 $active_from_input = $this->form_gui->getInput('active') === '1';
791 if ($user->getActive() !== $active_from_input) {
792 $user->setActive($active_from_input, $this->user->getId());
793 }
794
795 return $user;
796 }
797
799 ?\ilObjUser $user
800 ): void {
801 if ($user === null) {
802 return;
803 }
804
805 foreach ($this->buildStatisticalInputs($user) as $input) {
806 $this->form_gui->addItem($input);
807 }
808
809 foreach ($this->legal_documents->userManagementFields($this->object) as $input) {
810 $this->form_gui->addItem($input);
811 }
812 }
813
814 private function addOptionsSectionToForm(): void
815 {
816 $this->form_gui->addItem(
817 $this->buildSectionHeader('user_admin_options')
818 );
819
820 $se = new ilCheckboxInputGUI($this->lng->txt('inform_user_mail'), 'send_mail');
821 $se->setInfo($this->lng->txt('inform_user_mail_info'));
822 $se->setValue('y');
823 $se->setChecked(($this->user->getPref('send_info_mails') == 'y'));
824 $this->form_gui->addItem($se);
825
826 $irf = new ilCheckboxInputGUI($this->lng->txt('ignore_required_fields'), 'ignore_rf');
827 $irf->setInfo($this->lng->txt('ignore_required_fields_info'));
828 $irf->setValue('1');
829 $this->form_gui->addItem($irf);
830 }
831
833 {
834 $uploads = $this->uploads->getResults();
835 $upload_tmp_name = $_FILES['userfile']['tmp_name'];
836 $avatar_upload_result = $uploads[$upload_tmp_name] ?? null;
837
838 $existing_rid = $this->object->getAvatarRid();
839 $revision_title = 'Avatar for user ' . $this->object->getLogin();
840 $this->stakeholder->setOwner($this->object->getId()); // The Resource is owned by the user we are editing
841
842 if ($avatar_upload_result === null && file_exists($upload_tmp_name)) {
843 $stream = Streams::ofResource(
844 fopen($upload_tmp_name, 'r')
845 );
846
847 if ($existing_rid === null) {
848 return $this->irss->manage()->stream($stream, $this->stakeholder, $revision_title);
849 }
850
851 $this->irss->manage()->appendNewRevisionFromStream(
852 $existing_rid,
853 $stream,
854 $this->stakeholder,
855 $revision_title
856 );
857 return $existing_rid;
858 }
859
860 if ($avatar_upload_result === null) {
861 return null;
862 }
863
864 if ($existing_rid === null) {
865 return $this->irss->manage()->upload(
866 $avatar_upload_result,
867 $this->stakeholder,
868 $revision_title
869 );
870 }
871
872 $this->irss->manage()->replaceWithUpload(
873 $existing_rid,
874 $avatar_upload_result,
875 $this->stakeholder,
876 $revision_title
877 );
878 return $existing_rid;
879 }
880
881 public function removeUserPictureObject(): void
882 {
883 $webspace_dir = ilFileUtils::getWebspaceDir();
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();
890
891 // remove user pref file name
892 $this->object->setPref('profile_image', '');
893 $this->object->update();
894 $this->tpl->setOnScreenMessage('success', $this->lng->txt('user_image_removed'));
895
896 if (is_file($file)) {
897 unlink($file);
898 }
899 if (is_file($thumb_file)) {
900 unlink($thumb_file);
901 }
902 if (is_file($xthumb_file)) {
903 unlink($xthumb_file);
904 }
905 if (is_file($xxthumb_file)) {
906 unlink($xxthumb_file);
907 }
908 if (is_file($upload_file)) {
909 unlink($upload_file);
910 }
911
912 $this->editObject();
913 }
914
915 public function assignSaveObject(): void
916 {
917 if (!$this->rbac_system->checkAccess('edit_roleassignment', $this->usrf_ref_id)) {
918 $this->tpl->setOnScreenMessage(
919 'failure',
920 $this->lng->txt('msg_no_perm_assign_role_to_user')
921 );
922 $this->redirectDependingOnParent();
923 }
924
925 $selected_roles = $this->user_request->getRoleIds();
926 $posted_roles = $this->user_request->getPostedRoleIds();
927
928 // prevent unassignment of system role from system user
929 if ($this->object->getId() == SYSTEM_USER_ID && in_array(SYSTEM_ROLE_ID, $posted_roles)) {
930 $selected_roles[] = SYSTEM_ROLE_ID;
931 }
932
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);
938
939 $user_not_allowed_to_change_admin_role_assginements =
940 !in_array(SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()));
941
942 if ($user_not_allowed_to_change_admin_role_assginements
943 && in_array(SYSTEM_ROLE_ID, $assigned_roles_all)) {
944 $selected_roles[] = SYSTEM_ROLE_ID;
945 }
946
947 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
948
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(
952 'failure',
953 $this->lng->txt('msg_min_one_role') . '<br/>' . $this->lng->txt('action_aborted'),
954 true
955 );
956 $this->ctrl->redirect($this, 'roleassignment');
957 }
958
959 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
960 if ($this->object->getId() === (int) SYSTEM_USER_ID && $role === SYSTEM_ROLE_ID
961 || $user_not_allowed_to_change_admin_role_assginements && $role === SYSTEM_ROLE_ID) {
962 continue;
963 }
964 $this->rbac_admin->deassignUser($role, $this->object->getId());
965 }
966
967 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
968 if ($this->object->getId() === (int) SYSTEM_USER_ID && $role === SYSTEM_ROLE_ID
969 || $user_not_allowed_to_change_admin_role_assginements && $role === SYSTEM_ROLE_ID) {
970 continue;
971 }
972 $this->rbac_admin->assignUser($role, $this->object->getId(), false);
973 }
974
975 $this->object->update();
976
977 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_roleassignment_changed'), true);
978
979 if (strtolower($this->requested_baseClass) == 'iladministrationgui') {
980 $this->ctrl->redirect($this, 'roleassignment');
981 } else {
982 $this->ctrl->redirectByClass('ilobjcategorygui', 'listUsers');
983 }
984 }
985
986 public function roleassignmentObject(): void
987 {
988 $this->tabs->activateTab('role_assignment');
989
990 if (!$this->checkAccessToRolesTab()) {
991 $this->tpl->setOnScreenMessage(
992 'failure',
993 $this->lng->txt('msg_no_perm_view_roles_of_user'),
994 true
995 );
996 $this->ctrl->redirectByClass(self::class, 'edit');
997 }
998
999 $req_filtered_roles = $this->user_request->getFilteredRoles();
1001 'filtered_roles',
1002 ($req_filtered_roles > 0) ? $req_filtered_roles : ilSession::get('filtered_roles')
1003 );
1004
1005 $filtered_roles = ilSession::get('filtered_roles');
1006 if ($filtered_roles > 5) {
1007 ilSession::set('filtered_roles', 0);
1008 }
1009
1010 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.usr_role_assignment.html', 'components/ILIAS/User');
1011
1012 // init table
1013 $tab = new ilRoleAssignmentTableGUI($this, 'roleassignment');
1014
1015 $tab->parse($this->object->getId());
1016 $this->tpl->setVariable('ROLES_TABLE', $tab->getHTML());
1017 }
1018
1019 public function applyFilterObject(): void
1020 {
1021 $table_gui = new ilRoleAssignmentTableGUI($this, 'roleassignment');
1022 $table_gui->writeFilterToSession();
1023 $table_gui->resetOffset();
1024 $this->roleassignmentObject();
1025 }
1026
1027 public function resetFilterObject(): void
1028 {
1029 $table_gui = new ilRoleAssignmentTableGUI($this, 'roleassignment');
1030 $table_gui->resetOffset();
1031 $table_gui->resetFilter();
1032 $this->roleassignmentObject();
1033 }
1034
1035 public function __getDateSelect(
1036 string $a_type,
1037 string $a_varname,
1038 string $a_selected
1039 ): string {
1040 $year = null;
1041 switch ($a_type) {
1042 case 'minute':
1043 for ($i = 0; $i <= 60; $i++) {
1044 $days[$i] = $i < 10 ? '0' . $i : $i;
1045 }
1046 return ilLegacyFormElementsUtil::formSelect($a_selected, $a_varname, $days, false, true);
1047
1048 case 'hour':
1049 for ($i = 0; $i < 24; $i++) {
1050 $days[$i] = $i < 10 ? '0' . $i : $i;
1051 }
1052 return ilLegacyFormElementsUtil::formSelect($a_selected, $a_varname, $days, false, true);
1053
1054 case 'day':
1055 for ($i = 1; $i < 32; $i++) {
1056 $days[$i] = $i < 10 ? '0' . $i : $i;
1057 }
1058 return ilLegacyFormElementsUtil::formSelect($a_selected, $a_varname, $days, false, true);
1059
1060 case 'month':
1061 for ($i = 1; $i < 13; $i++) {
1062 $month[$i] = $i < 10 ? '0' . $i : $i;
1063 }
1064 return ilLegacyFormElementsUtil::formSelect($a_selected, $a_varname, $month, false, true);
1065
1066 case 'year':
1067 if ($a_selected < date('Y')) {
1068 $start = $a_selected;
1069 } else {
1070 $start = date('Y');
1071 }
1072
1073 for ($i = $start; $i < ((int) date('Y') + 11); ++$i) {
1074 $year[$i] = $i;
1075 }
1076 return ilLegacyFormElementsUtil::formSelect($a_selected, $a_varname, $year, false, true);
1077 }
1078 return '';
1079 }
1080
1081 public function __toUnix(array $a_time_arr): int // Missing array type.
1082 {
1083 return mktime(
1084 $a_time_arr['hour'],
1085 $a_time_arr['minute'],
1086 $a_time_arr['second'],
1087 $a_time_arr['month'],
1088 $a_time_arr['day'],
1089 $a_time_arr['year']
1090 );
1091 }
1092
1093 public function __unsetSessionVariables(): void
1094 {
1095 ilSession::clear('filtered_roles');
1096 }
1097
1098 public function __buildFilterSelect(): string
1099 {
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');
1106
1108 ilSession::get('filtered_roles'),
1109 'filter',
1110 $action,
1111 false,
1112 true
1113 );
1114 }
1115
1120 protected function addAdminLocatorItems(bool $do_not_add_object = false): void
1121 {
1122 $this->locator->clearItems();
1123
1124 if ($this->admin_mode == 'settings') { // system settings
1125 $this->ctrl->setParameterByClass(
1126 'ilobjsystemfoldergui',
1127 'ref_id',
1129 );
1130 $this->locator->addItem(
1131 $this->lng->txt('administration'),
1132 $this->ctrl->getLinkTargetByClass(['iladministrationgui', 'ilobjsystemfoldergui'], ''),
1133 ilFrameTargetInfo::_getFrame('MainContent')
1134 );
1135
1136 if ($this->requested_ref_id == USER_FOLDER_ID) {
1137 $this->locator->addItem(
1138 $this->lng->txt('obj_' . ilObject::_lookupType(
1139 ilObject::_lookupObjId($this->requested_ref_id)
1140 )),
1141 $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'view')
1142 );
1143 } elseif ($this->requested_ref_id == ROLE_FOLDER_ID) {
1144 $this->locator->addItem(
1145 $this->lng->txt('obj_' . ilObject::_lookupType(
1146 ilObject::_lookupObjId($this->requested_ref_id)
1147 )),
1148 $this->ctrl->getLinkTargetByClass('ilobjrolefoldergui', 'view')
1149 );
1150 }
1151
1152 if ($this->obj_id > 0) {
1153 $this->locator->addItem(
1154 $this->object->getTitle(),
1155 $this->ctrl->getLinkTarget($this, 'view')
1156 );
1157 }
1158 }
1159 }
1160
1161 public function __sendProfileMail(): string
1162 {
1163 if ($this->user_request->getSendMail() != 'y') {
1164 return '';
1165 }
1166 if (!strlen($this->object->getEmail())) {
1167 return '';
1168 }
1169
1170 $usr_lang = new ilLanguage($this->object->getLanguage());
1171 $usr_lang->loadLanguageModule('crs');
1172 $usr_lang->loadLanguageModule('registration');
1173
1174 $mmail = new ilMimeMail();
1175 $mmail->From($this->mail_sender_factory->system());
1176
1177 $mailOptions = new ilMailOptions($this->object->getId());
1178 $mmail->To($mailOptions->getExternalEmailAddresses());
1179
1180 $subject = $usr_lang->txt('profile_changed');
1181 $body = $usr_lang->txt('reg_mail_body_salutation')
1182 . ' ' . $this->object->getFullname() . ",\n\n";
1183
1184 $date = $this->object->getApproveDate();
1185
1186 if ($date !== null && (time() - strtotime($date)) < 10) {
1187 $body .= $usr_lang->txt('reg_mail_body_approve') . "\n\n";
1188 } else {
1189 $body .= $usr_lang->txt('reg_mail_body_profile_changed') . "\n\n";
1190 }
1191
1192 // Append login info only if password has been changed
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";
1198 }
1199 $body .= $usr_lang->txt('reg_mail_body_text3') . "\n";
1200 $body .= $this->object->getProfileAsString($usr_lang);
1202
1203
1204 $mmail->Subject($subject, true);
1205 $mmail->Body($body);
1206 $mmail->Send();
1207
1208 return '<br/>' . $this->lng->txt('mail_sent');
1209 }
1210
1214 public static function _goto(string $a_target): void
1215 {
1216 global $DIC;
1217
1218 $ilUser = $DIC['ilUser'];
1219
1221 $ilCtrl = $DIC['ilCtrl'];
1222
1223 // #10888
1224 if ($a_target == md5('usrdelown')) {
1225 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1226 $ilUser->hasDeletionFlag()) {
1227 $ilCtrl->setTargetScript('ilias.php');
1228 $ilCtrl->redirectByClass(['ildashboardgui', 'ilpersonalsettingsgui'], 'deleteOwnAccountStep2');
1229 }
1230 exit('This account is not flagged for deletion.'); // #12160
1231 }
1232
1233 // badges
1234 if (substr($a_target, -4) == '_bdg') {
1235 $ilCtrl->redirectByClass('ilDashboardGUI', 'jumpToBadges');
1236 }
1237
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'], '');
1244 } else {
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);
1250 }
1251 $ilCtrl->redirectByClass($target->value()->guiPath(), $target->value()->command());
1252 }
1253 }
1254
1255 if (strpos($a_target, 'n') === 0) {
1256 $a_target = ilObjUser::_lookupId(ilUtil::stripSlashes(substr($a_target, 1)));
1257 }
1258
1259 $target_user = 0;
1260 $target_cmd = '';
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];
1266 }
1267
1268 if ($target_user > 0) {
1269 $ilCtrl->setParameterByClass(PublicProfileGUI::class, 'user_id', $target_user);
1270 }
1271
1272 $cmd = 'view';
1273 if ($target_cmd === 'contact_approved') {
1274 $cmd = 'approveContactRequest';
1275 } elseif ($target_cmd === 'contact_ignored') {
1276 $cmd = 'ignoreContactRequest';
1277 }
1278 $ilCtrl->setParameterByClass(PublicProfileGUI::class, 'user_id', (int) $a_target);
1279 $ilCtrl->redirectByClass([PublicProfileGUI::class], $cmd);
1280 }
1281
1286 private function handleIgnoredRequiredFields(): bool
1287 {
1288 $profile_maybe_incomplete = false;
1289
1290 foreach ($this->user_profile->getIgnorableRequiredFields() as $fieldName) {
1291 $elm = $this->form_gui->getItemByPostVar($fieldName);
1292
1293 if (!$elm) {
1294 continue;
1295 }
1296
1297 if ($elm->getRequired()) {
1298 $profile_maybe_incomplete = true;
1299
1300 // Flag as optional
1301 $elm->setRequired(false);
1302 }
1303 }
1304
1305 foreach ($this->user_profile->getAllUserDefinedFields() as $field) {
1306 $elm = $this->form_gui->getItemByPostVar('udf_' . $field->getIdentifier());
1307
1308 if (!$elm) {
1309 continue;
1310 }
1311
1312 if ($elm->getRequired() && $field->isRequired()) {
1313 $profile_maybe_incomplete = true;
1314
1315 // Flag as optional
1316 $elm->setRequired(false);
1317 }
1318 }
1319
1320 return $profile_maybe_incomplete;
1321 }
1322
1323 private function checkUserWritePermission(): void
1324 {
1325 if ($this->usrf_ref_id === USER_FOLDER_ID
1326 && (
1327 !$this->rbac_system->checkAccess('visible,read', $this->usrf_ref_id)
1328 || !$this->rbac_system->checkAccess('write', $this->usrf_ref_id)
1329 && (
1330 !$this->access->checkPositionAccess(\ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS, $this->usrf_ref_id)
1331 || $this->access->checkPositionAccess(\ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS, $this->usrf_ref_id)
1332 && !in_array(
1333 $this->object->getId(),
1334 $this->access->filterUserIdsByPositionOfCurrentUser(
1337 [$this->object->getId()]
1338 )
1339 )
1340 )
1341 )
1342 ) {
1343 $this->tpl->setOnScreenMessage(
1344 'failure',
1345 $this->lng->txt('msg_no_perm_modify_user')
1346 );
1347 $this->ctrl->redirectByClass(ilObjUserFolderAccess::class);
1348 }
1349
1350 // if called from local administration $this->usrf_ref_id is category id
1351 // Todo: this has to be fixed. Do not mix user folder id and category id
1352 if ($this->usrf_ref_id !== USER_FOLDER_ID
1353 && !$this->rbac_system->checkAccess('cat_administrate_users', $this->object->getTimeLimitOwner())) {
1354 $this->tpl->setOnScreenMessage(
1355 'failure',
1356 $this->lng->txt('msg_no_perm_modify_user')
1357 );
1358 $this->redirectToRefId($this->usrf_ref_id);
1359 }
1360 }
1361
1362 private function renderForm(): void
1363 {
1364 $this->tpl->setContent($this->legal_documents->userManagementModals() . $this->form_gui->getHTML());
1365 }
1366
1367 private function checkAccessToRolesTab(): bool
1368 {
1369 return $this->object->getId() !== (int) ANONYMOUS_USER_ID
1370 && (
1371 $this->rbac_system->checkAccess('edit_roleassignment', $this->usrf_ref_id)
1372 || $this->access->checkPositionAccess(\ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS, $this->usrf_ref_id)
1373 && in_array(
1374 $this->object->getId(),
1375 $this->access->filterUserIdsByPositionOfCurrentUser(
1378 [$this->object->getId()]
1379 )
1380 )
1381 );
1382 }
1383
1385 {
1386 return $this->post_wrapper->retrieve(
1387 'ignore_rf',
1388 $this->refinery->byTrying([
1389 $this->refinery->kindlyTo()->bool(),
1390 $this->refinery->always(false)
1391 ])
1392 );
1393 }
1394
1395 private function redirectDependingOnParent(): void
1396 {
1397 if ($this->usrf_ref_id === USER_FOLDER_ID) {
1398 $this->ctrl->redirectByClass(ilObjUserFolderAccess::class);
1399 }
1400
1401 $this->redirectToRefId($this->usrf_ref_id);
1402 }
1403}
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
GUI class for public user profile presentation.
const IL_CAL_UNIX
const IL_CAL_DATETIME
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)
This class represents a checkbox property in a property form.
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,)
This class represents a date/time property in a property form.
@classDescription Date and time handling
static getWebspaceDir(string $mode="filesystem")
get webspace directory
setFormAction(string $a_formaction)
setRequired(bool $a_required)
setDisabled(bool $a_disabled)
This class represents a section header in a property form.
static _getFrame(string $a_class)
Help GUI class.
language handling
Class ilObjUserTrackingGUI.
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
static _getInstallationSignature()
This class represents a non editable value in a property form.
static _getAssignUsersStatus(int $a_role_id)
Class ilObjUserGUI.
ilPropertyFormGUI $form_gui
Conductor $legal_documents
FileUpload $uploads
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)
buildPasswordInput(?\ilObjUser $user)
ilMailMimeSenderFactory $mail_sender_factory
string $default_layout_and_style
createObject()
Display user create form.
addSystemInformationSectionToForm(?\ilObjUser $user)
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.
User class.
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)
const PASSWD_PLAIN
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 a password property in a property form.
setUseStripSlashes(bool $a_stat)
En/disable use of stripslashes.
This class represents a property form user interface.
This class represents a property in a property form.
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()
This class represents a selection list property in a property form.
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.
This class represents a user login 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 CLIENT_ID
Definition: constants.php:41
const SYSTEM_ROLE_ID
Definition: constants.php:29
const ANONYMOUS_ROLE_ID
Definition: constants.php:28
const USER_FOLDER_ID
Definition: constants.php:33
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
const ANONYMOUS_USER_ID
Definition: constants.php:27
const SYSTEM_FOLDER_ID
Definition: constants.php:35
const ROLE_FOLDER_ID
Definition: constants.php:34
exit
getResults()
Returns the results of the processing and moving operation of the uploaded files.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26