50 bool $a_call_by_reference =
false,
51 bool $a_prepare_output =
true,
75 $this->
ctrl->saveParameter($this, array(
'obj_id',
'letter'));
76 $this->
ctrl->setParameterByClass(
"ilobjuserfoldergui",
"letter", $this->requested_letter);
82 $this->gender = array(
83 'n' =>
"salutation_n",
84 'm' =>
"salutation_m",
85 'f' =>
"salutation_f",
88 $this->user_request = new \ILIAS\User\StandardGUIRequest(
93 $this->requested_letter = $this->user_request->getLetter();
94 $this->requested_baseClass = $this->user_request->getBaseClass();
95 $this->requested_search = $this->user_request->getSearch();
100 $next_class = $this->
ctrl->getNextClass($this);
101 $cmd = $this->
ctrl->getCmd();
105 switch ($next_class) {
106 case "illearningprogressgui":
112 $this->
ctrl->forwardCommand($new_gui);
115 case "ilobjectownershipmanagementgui":
117 $this->
ctrl->forwardCommand($gui);
121 if ($cmd ==
"" || $cmd ==
"view") {
132 if (strtolower(get_class($this->
object)) ==
'ilobjuser') {
133 $this->tpl->setTitle(
'[' . $this->
object->getLogin() .
'] ' . $this->object->getTitle());
134 $this->tpl->setDescription($this->
object->getLongDescription());
135 $this->tpl->setTitleIcon(
137 $this->lng->txt(
"obj_" . $this->object->getType())
140 parent::setTitleAndDescription();
148 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
149 $this->
ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
151 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
164 $rbacsystem =
$DIC[
'rbacsystem'];
165 $ilHelp =
$DIC[
'ilHelp'];
167 $this->tabs_gui->clearTargets();
169 $ilHelp->setScreenIdComponent(
"usr");
171 if ($this->requested_search) {
172 $this->tabs_gui->setBackTarget(
173 $this->
lng->txt(
"search_results"),
177 $this->tabs_gui->addTarget(
179 $this->
ctrl->getLinkTarget($this,
"edit"),
180 array(
"edit",
"",
"view"),
186 $this->tabs_gui->addTarget(
188 $this->
ctrl->getLinkTarget($this,
"edit"),
189 array(
"edit",
"",
"view"),
194 $this->tabs_gui->addTarget(
196 $this->
ctrl->getLinkTarget($this,
"roleassignment"),
197 array(
"roleassignment"),
202 if ($rbacsystem->checkAccess(
'read', $this->ref_id) and
205 $this->tabs_gui->addTarget(
207 $this->
ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
209 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui')
213 $this->tabs_gui->addTarget(
215 $this->
ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
217 'ilobjectownershipmanagementgui'
228 $this->back_target = array(
"text" => $a_text,
237 $udfs = $this->user_request->getUDFs();
238 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
239 if ($definition[
'required'] and !strlen($udfs[$field_id])) {
248 $user_defined_data =
null;
251 if ($this->
object->getType() ==
'usr') {
252 $user_defined_data = $this->
object->getUserDefinedData();
254 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
256 $old = $error_post_vars[
"udf"][$field_id] ?? $user_defined_data[$field_id];
259 $this->tpl->setCurrentBlock(
"field_text");
260 $this->tpl->setVariable(
"FIELD_NAME",
'udf[' . $definition[
'field_id'] .
']');
263 $this->tpl->setCurrentBlock(
"field_select");
264 $this->tpl->setVariable(
268 'udf[' . $definition[
'field_id'] .
']',
269 $this->user_defined_fields->fieldValuesToSelectArray(
270 $definition[
'field_values']
277 $this->tpl->parseCurrentBlock();
278 $this->tpl->setCurrentBlock(
"user_defined");
280 if ($definition[
'required']) {
281 $name = $definition[
'field_name'] .
"<span class=\"asterisk\">*</span>";
283 $name = $definition[
'field_name'];
285 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
286 $this->tpl->parseCurrentBlock();
294 $rbacreview =
$DIC[
'rbacreview'];
298 $this->tabs_gui->clearTargets();
304 foreach ($obj_list as $obj_data) {
308 $rbacreview->assignedRoles(
$ilUser->getId())
319 $rbacreview->assignedRoles(
$ilUser->getId())
321 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
328 $this->
ilias->raiseError(
329 $this->
lng->txt(
"msg_no_roles_users_can_be_assigned_to"),
330 $this->ilias->error_obj->MESSAGE
334 $keys = array_keys($rol);
337 if (in_array(4,
$keys)) {
338 $this->default_role = 4;
340 if (count(
$keys) > 1 and in_array(2,
$keys)) {
350 $this->default_role = array_shift(
$keys);
352 $this->selectable_roles = $rol;
363 $rbacsystem =
$DIC[
'rbacsystem'];
365 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id)
366 && !$rbacsystem->checkAccess(
'cat_administrate_users', $this->usrf_ref_id)) {
367 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
371 $this->initForm(
"create");
372 $tpl->setContent($this->form_gui->getHTML());
382 $ilAccess =
$DIC[
'ilAccess'];
386 $rbacadmin =
$DIC[
'rbacadmin'];
387 $rbacsystem =
$DIC[
'rbacsystem'];
390 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id)
391 && !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id)) {
392 $this->
ilias->raiseError($this->
lng->txt(
"permission_denied"), $this->ilias->error_obj->MESSAGE);
396 $this->initForm(
"create");
399 $profileMaybeIncomplete =
false;
400 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
401 $profileMaybeIncomplete = $this->handleIgnoredRequiredFields();
404 if ($this->form_gui->checkInput()) {
408 $userObj = $this->loadValuesFromForm();
410 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
411 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
414 $userObj->setTitle($userObj->getFullname());
415 $userObj->setDescription($userObj->getEmail());
417 $this->loadUserDefinedDataFromForm($userObj);
422 $userObj->setExternalAccount($this->form_gui->getInput(
"ext_account"));
427 $userObj->setLastPasswordChangeTS(time());
430 $userObj->saveAsNew();
433 if ($this->isSettingChangeable(
'language')) {
434 $userObj->setLanguage($this->form_gui->getInput(
"language"));
437 if ($this->isSettingChangeable(
'skin_style')) {
439 $sknst = explode(
":", $this->form_gui->getInput(
"skin_style"));
441 if ($userObj->getPref(
"style") != $sknst[1] ||
442 $userObj->getPref(
"skin") != $sknst[0]) {
443 $userObj->setPref(
"skin", $sknst[0]);
444 $userObj->setPref(
"style", $sknst[1]);
447 if ($this->isSettingChangeable(
'hits_per_page')) {
448 $userObj->setPref(
"hits_per_page", $this->form_gui->getInput(
"hits_per_page"));
450 if ($this->isSettingChangeable(
'hide_own_online_status')) {
452 "hide_own_online_status",
453 $this->form_gui->getInput(
"hide_own_online_status")
456 if ($this->isSettingChangeable(
'bs_allow_to_contact_me')) {
458 'bs_allow_to_contact_me',
459 $this->form_gui->getInput(
"bs_allow_to_contact_me") ?
'y' :
'n'
462 if ($this->isSettingChangeable(
'chat_osc_accept_msg')) {
464 'chat_osc_accept_msg',
465 $this->form_gui->getInput(
"chat_osc_accept_msg") ?
'y' :
'n'
468 if ($this->isSettingChangeable(
'chat_broadcast_typing')) {
470 'chat_broadcast_typing',
471 $this->form_gui->getInput(
"chat_broadcast_typing") ?
'y' :
'n'
474 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
476 'session_reminder_enabled',
477 (
int) $this->form_gui->getInput(
"session_reminder_enabled")
480 $userObj->writePrefs();
483 $rbacadmin->assignUser(
484 $this->form_gui->getInput(
"default_role"),
489 $msg = $this->
lng->txt(
"user_added");
493 ($this->form_gui->getInput(
"send_mail") ==
'y') ?
'y' :
'n'
497 $this->
object = $userObj;
499 if ($this->isSettingChangeable(
'upload')) {
500 $this->uploadUserPictureObject();
503 if ($profileMaybeIncomplete) {
505 $this->
object->setProfileIncomplete(
true);
506 $this->
object->update();
511 if ($this->form_gui->getInput(
"send_mail") ==
'y') {
513 $acc_mail->useLangVariablesAsFallback(
true);
514 $acc_mail->setAttachConfiguredFiles(
true);
515 $acc_mail->setUserPassword($this->form_gui->getInput(
"passwd"));
516 $acc_mail->setUser($userObj);
518 if ($acc_mail->send()) {
519 $msg .=
'<br />' . $this->
lng->txt(
'mail_sent');
520 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
522 $msg .=
'<br />' . $this->
lng->txt(
'mail_not_sent');
523 $this->tpl->setOnScreenMessage(
'info', $msg,
true);
526 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
529 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
530 $this->
ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
532 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
535 $this->form_gui->setValuesByPost();
536 $tpl->setContent($this->form_gui->getHTML());
545 $this->checkUserWriteRight();
548 $this->tabs_gui->clearTargets();
552 $this->initForm(
"edit");
554 $this->showAcceptedTermsOfService();
555 $this->tpl->setContent($this->form_gui->getHTML());
571 $user = $this->object;
575 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
576 $user->setTimeLimitFrom($from
580 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
581 $user->setTimeLimitUntil($until
585 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
587 if ($a_mode ==
'create') {
588 $user->setTimeLimitOwner($this->usrf_ref_id);
592 if ($this->isSettingChangeable(
'birthday')) {
593 $bd = $this->form_gui->getItemByPostVar(
'birthday');
594 $bd = $bd->getDate();
595 $user->setBirthday($bd
601 $user->setLogin($this->form_gui->getInput(
'login'));
604 if ($this->isSettingChangeable(
'gender')) {
605 $user->setGender($this->form_gui->getInput(
'gender'));
609 if ($this->isSettingChangeable(
'title')) {
610 $user->setUTitle($this->form_gui->getInput(
'title'));
614 if ($this->isSettingChangeable(
'firstname')) {
615 $user->setFirstname($this->form_gui->getInput(
'firstname'));
618 if ($this->isSettingChangeable(
'lastname')) {
619 $user->setLastname($this->form_gui->getInput(
'lastname'));
621 $user->setFullname();
624 if ($this->isSettingChangeable(
'institution')) {
625 $user->setInstitution($this->form_gui->getInput(
'institution'));
629 if ($this->isSettingChangeable(
'department')) {
630 $user->setDepartment($this->form_gui->getInput(
'department'));
633 if ($this->isSettingChangeable(
'street')) {
634 $user->setStreet($this->form_gui->getInput(
'street'));
637 if ($this->isSettingChangeable(
'city')) {
638 $user->setCity($this->form_gui->getInput(
'city'));
641 if ($this->isSettingChangeable(
'zipcode')) {
642 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
645 if ($this->isSettingChangeable(
'country')) {
646 $user->setCountry($this->form_gui->getInput(
'country'));
649 if ($this->isSettingChangeable(
'sel_country')) {
650 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
653 if ($this->isSettingChangeable(
'phone_office')) {
654 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
657 if ($this->isSettingChangeable(
'phone_home')) {
658 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
661 if ($this->isSettingChangeable(
'phone_mobile')) {
662 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
665 if ($this->isSettingChangeable(
'fax')) {
666 $user->setFax($this->form_gui->getInput(
'fax'));
669 if ($this->isSettingChangeable(
'matriculation')) {
670 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
673 if ($this->isSettingChangeable(
'email')) {
674 $user->setEmail($this->form_gui->getInput(
'email'));
677 if ($this->isSettingChangeable(
'second_email')) {
678 $user->setSecondEmail($this->form_gui->getInput(
'second_email'));
681 if ($this->isSettingChangeable(
'hobby')) {
682 $user->setHobby($this->form_gui->getInput(
'hobby'));
685 if ($this->isSettingChangeable(
'referral_comment')) {
686 $user->setComment($this->form_gui->getInput(
'referral_comment'));
689 $general_interests = is_array($this->form_gui->getInput(
'interests_general'))
690 ? $this->form_gui->getInput(
'interests_general')
692 $user->setGeneralInterests($general_interests);
694 $offering_help = is_array($this->form_gui->getInput(
'interests_help_offered'))
695 ? $this->form_gui->getInput(
'interests_help_offered')
697 $user->setOfferingHelp($offering_help);
699 $looking_for_help = is_array($this->form_gui->getInput(
'interests_help_looking'))
700 ? $this->form_gui->getInput(
'interests_help_looking')
702 $user->setLookingForHelp($looking_for_help);
705 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
708 $user->setLatitude($this->form_gui->getInput(
'latitude'));
709 $user->setLongitude($this->form_gui->getInput(
'longitude'));
710 $zoom = (
int) $this->form_gui->getInput(
'loc_zoom');
714 $user->setLocationZoom($zoom);
717 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
718 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
720 if ((
int) $user->getActive() != (
int) $this->form_gui->getInput(
'active')) {
721 $user->setActive($this->form_gui->getInput(
'active'),
$ilUser->getId());
730 $user = $this->object;
740 foreach ($all_defs as $definition) {
741 $f =
"udf_" . $definition[
'field_id'];
742 $item = $this->form_gui->getItemByPostVar(
$f);
743 if ($item && !$item->getDisabled()) {
744 $udf[$definition[
'field_id']] = $this->form_gui->getInput(
$f);
747 $user->setUserDefinedData($udf);
750 public function updateObject(): void
752 $this->checkUserWriteRight();
753 $this->initForm(
'edit');
756 $profileMaybeIncomplete =
false;
757 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
758 $profileMaybeIncomplete = $this->handleIgnoredRequiredFields();
761 if ($this->form_gui->checkInput()) {
766 ) && trim($this->form_gui->getInput(
'passwd')) !==
''
768 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
769 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId())))
777 if ((
int) $this->form_gui->getInput(
"active") == 1) {
778 $this->
object->setLoginAttempts(0);
781 #$this->object->assignData($_POST);
782 $this->loadValuesFromForm(
'update');
784 $this->loadUserDefinedDataFromForm();
787 $this->
object->updateLogin($this->form_gui->getInput(
"login"));
789 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage());
790 $this->form_gui->setValuesByPost();
791 $this->tpl->setContent($this->form_gui->getHTML());
795 $this->
object->setTitle($this->
object->getFullname());
796 $this->
object->setDescription($this->
object->getEmail());
798 if ($this->isSettingChangeable(
'language')) {
799 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
802 if ($this->isSettingChangeable(
'skin_style')) {
804 $sknst = explode(
":", $this->form_gui->getInput(
"skin_style"));
806 if ($this->
object->getPref(
"style") != $sknst[1] ||
807 $this->object->getPref(
"skin") != $sknst[0]) {
808 $this->
object->setPref(
"skin", $sknst[0]);
809 $this->
object->setPref(
"style", $sknst[1]);
812 if ($this->isSettingChangeable(
'hits_per_page')) {
813 $this->
object->setPref(
"hits_per_page", $this->form_gui->getInput(
"hits_per_page"));
815 if ($this->isSettingChangeable(
'hide_own_online_status')) {
816 $this->
object->setPref(
817 "hide_own_online_status",
818 ($this->form_gui->getInput(
"hide_own_online_status") ??
false)
821 if ($this->isSettingChangeable(
'bs_allow_to_contact_me')) {
822 $this->
object->setPref(
823 'bs_allow_to_contact_me',
824 ($this->form_gui->getInput(
"bs_allow_to_contact_me") ??
false) ?
'y' :
'n'
827 if ($this->isSettingChangeable(
'chat_osc_accept_msg')) {
828 $this->
object->setPref(
829 'chat_osc_accept_msg',
830 ($this->form_gui->getInput(
"chat_osc_accept_msg") ??
false) ?
'y' :
'n'
833 if ($this->isSettingChangeable(
'chat_broadcast_typing')) {
834 $this->
object->setPref(
835 'chat_broadcast_typing',
836 ($this->form_gui->getInput(
"chat_broadcast_typing") ??
false) ?
'y' :
'n'
842 $this->
object->setLastPasswordChangeTS(time());
847 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
848 $this->
object->setPref(
849 'session_reminder_enabled',
850 (
int) $this->form_gui->getInput(
"session_reminder_enabled")
855 $this->
object->setProfileIncomplete(
false);
857 $this->update = $this->
object->update();
861 if ($this->
user->getId() == $this->object->getId()) {
862 $this->
user->readPrefs();
864 $this->
user->setPref(
866 ($this->form_gui->getInput(
"send_mail") ==
'y') ?
'y' :
'n'
868 $this->
user->writePrefs();
870 $mail_message = $this->__sendProfileMail();
871 $msg = $this->
lng->txt(
'saved_successfully') . $mail_message;
874 if ($this->isSettingChangeable(
'upload')) {
875 $this->uploadUserPictureObject();
878 if ($profileMaybeIncomplete) {
880 $user = $this->object;
882 $this->
object->setProfileIncomplete(
true);
883 $this->
object->update();
888 $this->tpl->setOnScreenMessage(
'success', $msg,
true);
890 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
891 $this->
ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
893 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
896 $this->form_gui->setValuesByPost();
897 $this->tabs_gui->activateTab(
'properties');
898 $this->tpl->setContent($this->form_gui->getHtml());
910 $data[
"auth_mode"] = $this->
object->getAuthMode();
911 $data[
"login"] = $this->
object->getLogin();
914 $data[
"ext_account"] = $this->
object->getExternalAccount();
918 $this->
object->getCreateDate(),
922 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
925 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
928 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
931 $data[
"active"] = $this->
object->getActive();
932 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited() ?
'1' :
'0';
934 $data[
"time_limit_from"] = $this->
object->getTimeLimitFrom()
937 $data[
"time_limit_until"] = $this->
object->getTimeLimitUntil()
942 $data[
"gender"] = $this->
object->getGender();
943 $data[
"firstname"] = $this->
object->getFirstname();
944 $data[
"lastname"] = $this->
object->getLastname();
945 $data[
"title"] = $this->
object->getUTitle();
946 $data[
'birthday'] = $this->
object->getBirthday()
949 $data[
"institution"] = $this->
object->getInstitution();
950 $data[
"department"] = $this->
object->getDepartment();
951 $data[
"street"] = $this->
object->getStreet();
952 $data[
"city"] = $this->
object->getCity();
953 $data[
"zipcode"] = $this->
object->getZipcode();
954 $data[
"country"] = $this->
object->getCountry();
955 $data[
"sel_country"] = $this->
object->getSelectedCountry();
956 $data[
"phone_office"] = $this->
object->getPhoneOffice();
957 $data[
"phone_home"] = $this->
object->getPhoneHome();
958 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
959 $data[
"fax"] = $this->
object->getFax();
960 $data[
"email"] = $this->
object->getEmail();
961 $data[
"second_email"] = $this->
object->getSecondEmail();
962 $data[
"hobby"] = $this->
object->getHobby();
963 $data[
"referral_comment"] = $this->
object->getComment();
966 $data[
"interests_general"] = $this->
object->getGeneralInterests();
967 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
968 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
971 $data[
"matriculation"] = $this->
object->getMatriculation();
972 $data[
"client_ip"] = $this->
object->getClientIP();
976 $user_defined_data = $this->
object->getUserDefinedData();
977 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
978 $data[
"udf_" . $field_id] = $user_defined_data[
"f_" . $field_id] ??
"";
982 $data[
"language"] = $this->
object->getLanguage();
983 $data[
"skin_style"] = $this->
object->skin .
":" . $this->
object->prefs[
"style"];
984 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"] ??
"";
985 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ??
"";
986 $data[
'bs_allow_to_contact_me'] = ($this->
object->prefs[
'bs_allow_to_contact_me'] ??
"") ==
'y';
987 $data[
'chat_osc_accept_msg'] = ($this->
object->prefs[
'chat_osc_accept_msg'] ??
"") ==
'y';
988 $data[
'chat_broadcast_typing'] = ($this->
object->prefs[
'chat_broadcast_typing'] ??
"") ==
'y';
989 $data[
"session_reminder_enabled"] = (
int) ($this->
object->prefs[
"session_reminder_enabled"] ?? 0);
991 $data[
"send_mail"] = (($this->
object->prefs[
'send_info_mails'] ??
"") ==
'y');
993 $this->form_gui->setValuesByArray(
$data);
1004 $ilCtrl =
$DIC[
'ilCtrl'];
1006 $ilClientIniFile =
$DIC[
'ilClientIniFile'];
1012 $this->form_gui->setFormAction($ilCtrl->
getFormAction($this));
1013 if ($a_mode ==
"create") {
1014 $this->form_gui->setTitle(
$lng->txt(
"usr_new"));
1016 $this->form_gui->setTitle(
$lng->txt(
"usr_edit"));
1021 $sec_l->setTitle(
$lng->txt(
"login_data"));
1022 $this->form_gui->addItem($sec_l);
1028 foreach ($active_auth_modes as $auth_name => $auth_key) {
1029 if ($auth_name ==
'default') {
1033 #$name = $this->lng->txt('auth_'.$auth_name);
1037 $option[$auth_name] =
$name;
1039 $am->setOptions($option);
1040 $this->form_gui->addItem($am);
1042 if ($a_mode ==
"edit") {
1045 $this->form_gui->addItem(
$id);
1050 $lo->setRequired(
true);
1051 if ($a_mode ==
"edit") {
1052 $lo->setCurrentUserId($this->
object->getId());
1057 $this->
lng->txt(
'usr_loginname_history_info'),
1059 $last_history_entry[0]
1066 $this->form_gui->addItem($lo);
1069 || !in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->object->getId()))
1070 || in_array(
SYSTEM_ROLE_ID, $this->rbac_review->assignedRoles($this->user->getId()))) {
1076 $pw->setUseStripSlashes(
false);
1078 $pw->setMaxLength(80);
1079 $pw->setValidateAuthPost(
"auth_mode");
1080 if ($a_mode ==
"create") {
1081 $pw->setRequiredOnAuth(
true);
1084 $this->form_gui->addItem($pw);
1092 $ext->setMaxLength(250);
1093 $ext->setInfo(
$lng->txt(
"user_ext_account_desc"));
1094 $this->form_gui->addItem($ext);
1099 $sec_si->setTitle($this->
lng->txt(
"system_information"));
1100 $this->form_gui->addItem($sec_si);
1103 if ($a_mode ==
"edit") {
1104 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1105 foreach ($sia as
$a) {
1107 $this->form_gui->addItem($siai);
1113 $ac->setChecked(
true);
1114 $this->form_gui->addItem($ac);
1117 $lng->loadLanguageModule(
'crs');
1122 $radg->setRequired(
true);
1124 $radg->addOption($op1);
1126 $radg->addOption($op2);
1130 $acfrom->setRequired(
true);
1131 $acfrom->setShowTime(
true);
1132 $acfrom->setMinuteStepSize(1);
1133 $op2->addSubItem($acfrom);
1137 $acto->setRequired(
true);
1138 $acto->setShowTime(
true);
1139 $acto->setMinuteStepSize(1);
1140 $op2->addSubItem($acto);
1143 $this->form_gui->addItem($radg);
1147 $this->isSettingChangeable(
'gender') or
1148 $this->isSettingChangeable(
'firstname') or
1149 $this->isSettingChangeable(
'lastname') or
1150 $this->isSettingChangeable(
'title') or
1151 $this->isSettingChangeable(
'personal_image') or
1152 $this->isSettingChangeable(
'birhtday')
1155 $sec_pd->setTitle($this->
lng->txt(
"personal_data"));
1156 $this->form_gui->addItem($sec_pd);
1160 if ($this->isSettingChangeable(
'gender')) {
1162 $gndr->setRequired(isset(
$settings[
"require_gender"]) &&
$settings[
"require_gender"]);
1164 $gndr->addOption($neutral);
1166 $gndr->addOption($female);
1168 $gndr->addOption($male);
1169 $this->form_gui->addItem($gndr);
1174 "firstname" =>
true,
1178 foreach ($fields as $field =>
$req) {
1179 $max_len = $field ===
'title' ? 32 : 128;
1180 if ($this->isSettingChangeable($field)) {
1182 $caption = ($field ==
"title")
1187 $inp->setMaxLength($max_len);
1188 $inp->setRequired(
$req);
1189 $this->form_gui->addItem($inp);
1194 if ($this->isSettingChangeable(
'upload')) {
1196 if ($a_mode ==
"edit" || $a_mode ==
"upload") {
1204 $this->form_gui->addItem($pi);
1207 if ($this->isSettingChangeable(
'birthday')) {
1209 $birthday->setRequired(isset(
$settings[
"require_birthday"]) &&
$settings[
"require_birthday"]);
1210 $this->form_gui->addItem($birthday);
1216 array(
"institution", 40, 80),
1217 array(
"department", 40, 80),
1218 array(
"street", 40, 40),
1219 array(
"city", 40, 40),
1220 array(
"zipcode", 10, 10),
1221 array(
"country", 40, 40),
1222 array(
"sel_country"),
1223 array(
"phone_office", 30, 30),
1224 array(
"phone_home", 30, 30),
1225 array(
"phone_mobile", 30, 30),
1226 array(
"fax", 30, 30)
1230 foreach ($fields as $field) {
1231 if (!$counter++ and $this->isSettingChangeable($field[0])) {
1234 $sec_cd->setTitle($this->
lng->txt(
"contact_data"));
1235 $this->form_gui->addItem($sec_cd);
1238 if ($a_mode ==
"edit") {
1240 $orgus->setValue($this->
object->getOrgUnitsRepresentation());
1241 $this->form_gui->addItem($orgus);
1244 if ($this->isSettingChangeable($field[0])) {
1245 if ($field[0] !=
"sel_country") {
1247 $inp->setSize($field[1]);
1248 $inp->setMaxLength($field[2]);
1249 $inp->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1251 $this->form_gui->addItem($inp);
1255 $cs->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1257 $this->form_gui->addItem($cs);
1263 if ($this->isSettingChangeable(
'email')) {
1265 $em->setRequired(isset(
$settings[
"require_email"]) &&
1267 $em->setMaxLength(128);
1268 $this->form_gui->addItem($em);
1272 if ($this->isSettingChangeable(
'second_email')) {
1275 $this->form_gui->addItem($em);
1279 if ($this->isSettingChangeable(
'hobby')) {
1283 $hob->setRequired(isset(
$settings[
"require_hobby"]) &&
1285 $this->form_gui->addItem($hob);
1289 if ($this->isSettingChangeable(
'referral_comment')) {
1293 $rc->setRequired(isset(
$settings[
"require_referral_comment"]) &&
1295 $this->form_gui->addItem($rc);
1301 $sh->setTitle(
$lng->txt(
"interests"));
1302 $this->form_gui->addItem($sh);
1304 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1305 foreach ($multi_fields as $multi_field) {
1306 if ($this->isSettingChangeable($multi_field)) {
1309 $ti->setMulti(
true);
1310 $ti->setMaxLength(40);
1312 $ti->setRequired(isset(
$settings[
"require_" . $multi_field]) &&
1314 $this->form_gui->addItem($ti);
1319 if ($this->isSettingChangeable(
'user_profile_other')) {
1321 $sec_oi->setTitle($this->
lng->txt(
"user_profile_other"));
1322 $this->form_gui->addItem($sec_oi);
1326 if ($this->isSettingChangeable(
'matriculation')) {
1329 $mr->setMaxLength(40);
1330 $mr->setRequired(isset(
$settings[
"require_matriculation"]) &&
1332 $this->form_gui->addItem($mr);
1338 $ip->setMaxLength(255);
1339 $ip->setInfo($this->
lng->txt(
"current_ip") .
" " .
$_SERVER[
"REMOTE_ADDR"] .
" <br />" .
1340 '<span class="warning">' . $this->lng->txt(
"current_ip_alert") .
"</span>");
1341 $this->form_gui->addItem($ip);
1352 foreach ($all_defs as $definition) {
1355 $this->form_gui->addItem($f_property);
1361 $a_mode ==
'create' or
1362 $this->isSettingChangeable(
'language') or
1363 $this->isSettingChangeable(
'skin_style') or
1364 $this->isSettingChangeable(
'hits_per_page') or
1365 $this->isSettingChangeable(
'hide_own_online_status') or
1366 $this->isSettingChangeable(
'bs_allow_to_contact_me') or
1367 $this->isSettingChangeable(
'chat_osc_accept_msg') or
1368 $this->isSettingChangeable(
'chat_broadcast_typing')
1371 $sec_st->setTitle($this->
lng->txt(
"settings"));
1372 $this->form_gui->addItem($sec_st);
1376 if ($a_mode ==
"create") {
1378 $lng->txt(
"default_role"),
1381 $role->setRequired(
true);
1382 $role->setValue($this->default_role);
1383 $role->setOptions($this->selectable_roles);
1384 $this->form_gui->addItem($role);
1388 if ($this->isSettingChangeable(
'language')) {
1389 $languages = $this->
lng->getInstalledLanguages();
1390 $this->
lng->loadLanguageModule(
'meta');
1392 foreach ($languages as $l) {
1393 $options[$l] =
$lng->txt(
"meta_l_" . $l);
1396 $this->
lng->txt(
'language'),
1399 $lang->setOptions($options);
1401 if (count($options) <= 1) {
1402 $lang->setDisabled(
true);
1404 $this->form_gui->addItem(
$lang);
1408 if ($this->isSettingChangeable(
'skin_style')) {
1410 $lng->txt(
"skin_style"),
1414 $skins = ilStyleDefinition::getAllSkins();
1417 if (is_array($skins)) {
1421 foreach ($skins as $skin) {
1422 foreach ($skin->getStyles() as $style) {
1427 $options[$skin->getId() .
":" . $style->getId()] = $skin->getName() .
" / " . $style->getName();
1431 $sk->setOptions($options);
1432 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin") .
1433 ":" . $ilClientIniFile->readVariable(
"layout",
"style"));
1435 $this->form_gui->addItem($sk);
1439 if ($this->isSettingChangeable(
'hits_per_page')) {
1441 $lng->txt(
"hits_per_page"),
1444 $options = array(10 => 10,
1451 9999 => $this->
lng->txt(
"no_limit")
1453 $hpp->setOptions($options);
1454 $hpp->setValue(
$ilSetting->get(
"hits_per_page"));
1455 $this->form_gui->addItem($hpp);
1459 if ($this->isSettingChangeable(
'hide_own_online_status')) {
1460 $lng->loadLanguageModule(
"awrn");
1462 $default = (
$ilSetting->get(
'hide_own_online_status') ==
"n")
1463 ? $this->
lng->txt(
"user_awrn_show")
1464 : $this->
lng->txt(
"user_awrn_hide");
1467 "" => $this->
lng->txt(
"user_awrn_default") .
" (" . $default .
")",
1468 "n" => $this->lng->txt(
"user_awrn_show"),
1469 "y" => $this->lng->txt(
"user_awrn_hide")
1472 $os->setOptions($options);
1473 $os->setDisabled((
bool)
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1474 $os->setInfo(
$lng->txt(
"awrn_hide_from_awareness_info"));
1475 $this->form_gui->addItem($os);
1482 if ($this->isSettingChangeable(
'bs_allow_to_contact_me')) {
1483 $lng->loadLanguageModule(
'buddysystem');
1485 if ($a_mode ==
'create') {
1488 $this->form_gui->addItem($os);
1490 if ($this->isSettingChangeable(
'chat_osc_accept_msg')) {
1491 $lng->loadLanguageModule(
'chatroom');
1493 if ($a_mode ==
'create') {
1496 $this->form_gui->addItem($chat_osc_acm);
1499 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
1502 $this->form_gui->addItem($cb);
1506 if ($this->isSettingChangeable(
'send_mail')) {
1508 $sec_op->setTitle($this->
lng->txt(
"options"));
1509 $this->form_gui->addItem($sec_op);
1514 $se->setInfo(
$lng->txt(
'inform_user_mail_info'));
1516 $se->setChecked((
$ilUser->getPref(
'send_info_mails') ==
'y'));
1517 $this->form_gui->addItem($se);
1521 $irf->setInfo(
$lng->txt(
'ignore_required_fields_info'));
1523 $this->form_gui->addItem($irf);
1528 if ($a_mode ==
"create" || $a_mode ==
"save") {
1529 $this->form_gui->addCommandButton(
"save",
$lng->txt(
"save"));
1531 if ($a_mode ==
"edit" || $a_mode ==
"update") {
1532 $this->form_gui->addCommandButton(
"update",
$lng->txt(
"save"));
1534 $this->form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
1551 return (
bool) (
$settings[
'usr_settings_changeable_lua_' . $a_field] ??
false);
1562 $rbacsystem =
$DIC[
'rbacsystem'];
1566 !$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
1567 $this->
ilias->raiseError($this->
lng->txt(
"msg_no_perm_modify_user"), $this->ilias->error_obj->MESSAGE);
1573 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1574 $this->
ilias->raiseError($this->
lng->txt(
"msg_no_perm_modify_user"), $this->ilias->error_obj->MESSAGE);
1578 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1580 if ($_FILES[
"userfile"][
"tmp_name"] ==
"") {
1581 if ($userfile_input->getDeletionFlag()) {
1582 $this->
object->removeUserPicture();
1586 if ($_FILES[
"userfile"][
"size"] == 0) {
1587 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_file"));
1590 $image_dir = $webspace_dir .
"/usr_images";
1591 $store_file =
"usr_" . $this->
object->getId() .
"." .
"jpg";
1594 $this->
object->setPref(
"profile_image", $store_file);
1595 $this->
object->update();
1598 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1599 $uploaded_file = $image_dir .
"/upload_" . $this->
object->getId() .
"." . $pi[
"extension"];
1601 $_FILES[
"userfile"][
"tmp_name"],
1602 $_FILES[
"userfile"][
"name"],
1606 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"upload_error",
true));
1607 $this->
ctrl->redirect($this,
"showProfile");
1609 chmod($uploaded_file, 0770);
1613 $show_file =
"$image_dir/usr_" . $this->
object->getId() .
".jpg";
1614 $thumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_small.jpg";
1615 $xthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1616 $xxthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1625 $uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file
1628 $uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file
1631 $uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file
1634 $uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file
1651 $image_dir = $webspace_dir .
"/usr_images";
1652 $file = $image_dir .
"/usr_" . $this->
object->getId() .
"." .
"jpg";
1653 $thumb_file = $image_dir .
"/usr_" . $this->
object->getId() .
"_small.jpg";
1654 $xthumb_file = $image_dir .
"/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1655 $xxthumb_file = $image_dir .
"/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1656 $upload_file = $image_dir .
"/upload_" . $this->
object->getId();
1659 $this->
object->setPref(
"profile_image",
"");
1660 $this->
object->update();
1661 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"user_image_removed"));
1663 if (is_file($file)) {
1666 if (is_file($thumb_file)) {
1667 unlink($thumb_file);
1669 if (is_file($xthumb_file)) {
1670 unlink($xthumb_file);
1672 if (is_file($xxthumb_file)) {
1673 unlink($xxthumb_file);
1675 if (is_file($upload_file)) {
1676 unlink($upload_file);
1679 $this->editObject();
1689 $rbacsystem =
$DIC[
'rbacsystem'];
1690 $rbacadmin =
$DIC[
'rbacadmin'];
1691 $rbacreview =
$DIC[
'rbacreview'];
1693 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1694 $this->
ilias->raiseError(
1695 $this->
lng->txt(
"msg_no_perm_assign_role_to_user"),
1696 $this->ilias->error_obj->MESSAGE
1700 $selected_roles = $this->user_request->getRoleIds();
1701 $posted_roles = $this->user_request->getPostedRoleIds();
1708 $global_roles_all = $rbacreview->getGlobalRoles();
1709 $assigned_roles_all = $rbacreview->assignedRoles($this->
object->getId());
1710 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
1711 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
1712 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
1714 $user_not_allowed_to_change_admin_role_assginements =
1715 !in_array(
SYSTEM_ROLE_ID, $rbacreview->assignedRoles($this->user->getId()));
1717 if ($user_not_allowed_to_change_admin_role_assginements
1722 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
1724 if (empty($selected_roles) && count($assigned_roles_all) === count($assigned_roles)
1725 || empty($posted_global_roles) && count($assigned_global_roles_all) === count($assigned_global_roles)) {
1726 $this->tpl->setOnScreenMessage(
1728 $this->
lng->txt(
'msg_min_one_role') .
'<br/>' . $this->lng->txt(
'action_aborted'),
1731 $this->
ctrl->redirect($this,
'roleassignment');
1734 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
1736 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
1739 $rbacadmin->deassignUser($role, $this->
object->getId());
1742 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
1744 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
1747 $rbacadmin->assignUser($role, $this->
object->getId(),
false);
1751 $this->
object->update();
1753 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_roleassignment_changed"),
true);
1755 if (strtolower($this->requested_baseClass) ==
'iladministrationgui') {
1756 $this->
ctrl->redirect($this,
'roleassignment');
1758 $this->
ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1769 $rbacsystem =
$DIC[
'rbacsystem'];
1770 $ilTabs =
$DIC[
'ilTabs'];
1771 $access =
$DIC->access();
1773 $ilTabs->activateTab(
"role_assignment");
1776 || !$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)
1777 && !$access->isCurrentUserBasedOnPositionsAllowedTo(
"read_users", array($this->
object->getId()))
1779 $this->
ilias->raiseError(
1780 $this->
lng->txt(
"msg_no_perm_assign_role_to_user"),
1781 $this->ilias->error_obj->MESSAGE
1786 $req_filtered_roles = $this->user_request->getFilteredRoles();
1789 ($req_filtered_roles > 0) ? $req_filtered_roles : $filtered_roles
1793 if ($filtered_roles > 5) {
1797 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
1802 $tab->parse($this->
object->getId());
1803 $this->tpl->setVariable(
"ROLES_TABLE", $tab->getHTML());
1812 $table_gui->writeFilterToSession();
1813 $table_gui->resetOffset();
1814 $this->roleassignmentObject();
1823 $table_gui->resetOffset();
1824 $table_gui->resetFilter();
1825 $this->roleassignmentObject();
1836 for (
$i = 0;
$i <= 60;
$i++) {
1837 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1842 for (
$i = 0;
$i < 24;
$i++) {
1843 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1848 for (
$i = 1;
$i < 32;
$i++) {
1849 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1854 for (
$i = 1;
$i < 13;
$i++) {
1855 $month[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1860 if ($a_selected < date(
'Y')) {
1861 $start = $a_selected;
1866 for (
$i = $start;
$i < ((
int) date(
"Y") + 11); ++
$i) {
1877 $a_time_arr[
"hour"],
1878 $a_time_arr[
"minute"],
1879 $a_time_arr[
"second"],
1880 $a_time_arr[
"month"],
1893 $action[0] = $this->
lng->txt(
'assigned_roles');
1894 $action[1] = $this->
lng->txt(
'all_roles');
1895 $action[2] = $this->
lng->txt(
'all_global_roles');
1896 $action[3] = $this->
lng->txt(
'all_local_roles');
1897 $action[4] = $this->
lng->txt(
'internal_local_roles_only');
1898 $action[5] = $this->
lng->txt(
'non_internal_local_roles_only');
1917 $ilLocator =
$DIC[
'ilLocator'];
1919 $ilLocator->clearItems();
1921 if ($this->admin_mode ==
"settings") {
1922 $this->
ctrl->setParameterByClass(
1923 "ilobjsystemfoldergui",
1927 $ilLocator->addItem(
1928 $this->
lng->txt(
"administration"),
1929 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
1934 $ilLocator->addItem(
1938 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view")
1941 $ilLocator->addItem(
1945 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view")
1949 if ($this->obj_id > 0) {
1950 $ilLocator->addItem(
1951 $this->
object->getTitle(),
1952 $this->ctrl->getLinkTarget($this,
"view")
1958 public function __sendProfileMail(): string
1962 $ilias =
$DIC[
'ilias'];
1964 if ($this->user_request->getSendMail() !=
'y') {
1967 if (!strlen($this->
object->getEmail())) {
1973 $usr_lang->loadLanguageModule(
'crs');
1974 $usr_lang->loadLanguageModule(
'registration');
1977 $senderFactory =
$GLOBALS[
'DIC'][
"mail.mime.sender.factory"];
1980 $mmail->From($senderFactory->system());
1982 $mailOptions = new \ilMailOptions($this->
object->getId());
1983 $mmail->To($mailOptions->getExternalEmailAddresses());
1986 $subject = $usr_lang->txt(
"profile_changed");
1989 $body = $usr_lang->txt(
"reg_mail_body_salutation")
1990 .
" " . $this->
object->getFullname() .
",\n\n";
1992 $date = $this->
object->getApproveDate();
1994 if ((time() - strtotime($date)) < 10) {
1995 $body .= $usr_lang->txt(
'reg_mail_body_approve') .
"\n\n";
1997 $body .= $usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n";
2001 if ($this->user_request->getPassword() !=
'') {
2002 $body .= $usr_lang->txt(
"reg_mail_body_text2") .
"\n" .
2003 ILIAS_HTTP_PATH .
"/login.php?client_id=" . $ilias->client_id .
"\n" .
2004 $usr_lang->txt(
"login") .
": " . $this->
object->getLogin() .
"\n" .
2005 $usr_lang->txt(
"passwd") .
": " . $this->user_request->getPassword() .
"\n\n";
2007 $body .= $usr_lang->txt(
"reg_mail_body_text3") .
"\n";
2008 $body .= $this->
object->getProfileAsString($usr_lang);
2012 $mmail->Subject($subject,
true);
2013 $mmail->Body($body);
2016 return "<br/>" . $this->
lng->txt(
"mail_sent");
2022 public static function _goto(
string $a_target): void
2029 $ilCtrl =
$DIC[
'ilCtrl'];
2033 $class = ilPersonalProfileGUI::class;
2041 if ($a_target == md5(
"usrdelown")) {
2045 $ilCtrl->
redirectByClass([
'ildashboardgui',
'ilpersonalsettingsgui'],
"deleteOwnAccount3");
2047 exit(
"This account is not flagged for deletion.");
2051 if (substr($a_target, -4) ==
"_bdg") {
2055 if (
'registration' == $a_target) {
2056 $ilCtrl->
redirectByClass(array(
'ilStartUpGUI',
'ilAccountRegistrationGUI'),
'');
2057 } elseif (
'nameassist' == $a_target) {
2058 $ilCtrl->
redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'showUsernameAssistanceForm');
2059 } elseif (
'pwassist' == $a_target) {
2060 $ilCtrl->
redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'');
2061 } elseif (
'agreement' == $a_target) {
2064 $ilCtrl->
redirectByClass(array(
'ildashboardgui',
'ilpersonalprofilegui'),
'showUserAgreement');
2066 $ilCtrl->
redirectByClass(array(
'ilStartUpGUI'),
'showTermsOfService');
2070 if (strpos($a_target,
"n") === 0) {
2075 if (strpos($a_target,
'contact_approved') !==
false) {
2076 $cmd =
'approveContactRequest';
2077 } elseif (strpos($a_target,
'contact_ignored') !==
false) {
2078 $cmd =
'ignoreContactRequest';
2091 $profile_maybe_incomplete =
false;
2094 $elm = $this->form_gui->getItemByPostVar($fieldName);
2100 if ($elm->getRequired()) {
2101 $profile_maybe_incomplete =
true;
2104 $elm->setRequired(
false);
2109 foreach ($user_defined_fields->
getDefinitions() as $definition) {
2110 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $definition[
'field_id']);
2115 if ($elm->getRequired() && $definition[
'required']) {
2116 $profile_maybe_incomplete =
true;
2119 $elm->setRequired(
false);
2123 return $profile_maybe_incomplete;
2126 protected function showAcceptedTermsOfService(): void
2129 $agreeDate = $this->form_gui->getItemByPostVar(
'agree_date');
2130 if ($agreeDate && $agreeDate->getValue()) {
2131 $this->
lng->loadLanguageModule(
'tos');
2132 $helper = new \ilTermsOfServiceHelper();
2134 $user = $this->object;
2135 $entity = $helper->getCurrentAcceptanceForUser($user);
2136 if ($entity->getId()) {
2137 $modal = $this->uiFactory
2140 $this->uiFactory->modal()->lightboxTextPage($entity->getText(), $entity->getTitle())
2143 $titleLink = $this->uiFactory
2145 ->shy($entity->getTitle(),
'#')
2146 ->withOnClick($modal->getShowSignal());
2149 $this->
lng->txt(
'tos_agreement_document'),
2153 $agreementDocument->setValue($this->uiRenderer->render([$titleLink, $modal]));
2154 $agreeDate->addSubItem($agreementDocument);
2156 } elseif ($agreeDate) {
2157 $agreeDate->setValue($this->
lng->txt(
'tos_not_accepted_yet'));
2165 !$this->rbac_system->checkAccess(
'visible,read', $this->usrf_ref_id)
2166 || !$this->rbac_system->checkAccess(
'write', $this->usrf_ref_id)
2172 $this->access->filterUserIdsByPositionOfCurrentUser(
2175 [$this->object->getId()]
2181 $this->
ilias->raiseError($this->
lng->txt(
'msg_no_perm_modify_user'), $this->ilias->error_obj->MESSAGE);
2187 && !$this->rbac_system->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
2188 $this->
ilias->raiseError($this->
lng->txt(
'msg_no_perm_modify_user'), $this->ilias->error_obj->MESSAGE);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
const UDF_TYPE_TEXT
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static _getActiveAuthModes()
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
static _getAuthMode(?string $a_auth_mode)
static _getAuthModeName($a_auth_key)
Class ilCtrl provides processing control methods.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setTargetScript(string $a_target_script)
@inheritDoc
clearParametersByClass(string $a_class)
@inheritDoc
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
loadLanguageModule(string $a_module)
Load language module.
const LP_CONTEXT_USER_FOLDER
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstallationSignature()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAssignUsersStatus(int $a_role_id)
const ORG_OP_EDIT_USER_ACCOUNTS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPropertyFormGUI $form_gui
initForm(string $a_mode)
Init user form.
string $requested_baseClass
__toUnix(array $a_time_arr)
saveObject()
save user data
loadUserDefinedDataFromForm(?ilObjUser $user=null)
editObject()
Display user edit form.
getAdminTabs()
administration tabs show only permissions and trash folder
ILIAS UI Factory $uiFactory
setBackTarget(string $a_text, string $a_link)
set back tab target
isSettingChangeable(string $a_field)
handleIgnoredRequiredFields()
Handles ignored required fields by changing the required flag of form elements.
ILIAS UI Renderer $uiRenderer
applyFilterObject()
Apply filter.
cancelObject()
cancel action and go back to previous page
resetFilterObject()
Reset filter.
roleassignmentObject()
display role assignment panel
ILIAS User StandardGUIRequest $user_request
ilUserDefinedFields $user_defined_fields
uploadUserPictureObject()
upload user image (original method by ratana ty)
__construct( $a_data, int $a_id, bool $a_call_by_reference=false, bool $a_prepare_output=true, ILIAS\UI\Factory $uiFactory=null, ILIAS\UI\Renderer $uiRenderer=null)
loadValuesFromForm(string $a_mode='create')
__showUserDefinedFields()
removeUserPictureObject()
remove user image
__unsetSessionVariables()
createObject()
Display user create form.
getValues()
Get values from user object and put them into form.
assignSaveObject()
assign users to role
__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)
getTabs()
@abstract overwrite in derived GUI class of your object type
__checkUserDefinedRequiredFields()
static _enabledLearningProgress()
static _enabledUserRelatedData()
static _getLastHistoryDataByUserId(int $a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
static _lookupId($a_user_str)
static _getPersonalPicturePath(int $a_usr_id, string $a_size="small", bool $a_force_pic=false, bool $a_prevent_no_photo_image=false, bool $html_export=false)
static _lookupLogin(int $a_user_id)
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static 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.
static escapeShellArg(string $a_arg)
static isConvertVersionAtLeast(string $a_version)
Compare convert version numbers.
static execConvert(string $args)
execute convert command
static _lookupActivatedStyle(string $a_skin, string $a_style)
lookup if a style is activated
This class represents a text area property in a property form.
This class represents a text property in a property form.
Additional user data fields definition.
getChangeableLocalUserAdministrationDefinitions()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isProfileIncomplete(ilObjUser $a_user, bool $a_include_udf=true, bool $a_personal_data_only=true)
Check if all required personal data fields are set.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
static getImagePath(string $img, 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="")
static yn2tf(string $a_yn)
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
This is how the factory for UI elements looks.
An entity that renders components to a string output.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
catch(\Exception $e) $req
header include for all ilias files.