4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
60 $a_call_by_reference =
false,
61 $a_prepare_output =
true,
80 define(
'USER_FOLDER_ID', 7);
87 $this->ctrl->saveParameter($this, array(
'obj_id',
'letter'));
88 $this->ctrl->setParameterByClass(
"ilobjuserfoldergui",
"letter",
$_GET[
"letter"]);
89 $this->ctrl->setContext($this->object->getId(),
'usr');
90 $lng->loadLanguageModule(
'user');
94 $this->gender = array(
95 'n' =>
"salutation_n",
96 'm' =>
"salutation_m",
97 'f' =>
"salutation_f",
107 $next_class = $this->ctrl->getNextClass($this);
108 $cmd = $this->ctrl->getCmd();
112 switch ($next_class) {
113 case "illearningprogressgui":
114 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
116 $this->ctrl->forwardCommand($new_gui);
119 case "ilobjectownershipmanagementgui":
120 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
122 $this->ctrl->forwardCommand($gui);
126 if ($cmd ==
"" || $cmd ==
"view") {
130 $return = $this->$cmd();
141 if (strtolower(get_class($this->
object)) ==
'ilobjuser') {
142 $this->tpl->setTitle(
'[' . $this->object->getLogin() .
'] ' . $this->
object->getTitle());
143 $this->tpl->setDescription($this->object->getLongDescription());
144 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_" . $this->object->getType() .
".svg"), $this->lng->txt(
"obj_" . $this->object->getType()));
146 parent::setTitleAndDescription();
156 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
157 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
161 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
181 $ilHelp = $DIC[
'ilHelp'];
183 $this->tabs_gui->clearTargets();
185 $ilHelp->setScreenIdComponent(
"usr");
187 if (
$_GET[
"search"]) {
188 $this->tabs_gui->setBackTarget(
189 $this->lng->txt(
"search_results"),
193 $this->tabs_gui->addTarget(
195 $this->ctrl->getLinkTarget($this,
"edit"),
196 array(
"edit",
"",
"view"),
202 $this->tabs_gui->addTarget(
204 $this->ctrl->getLinkTarget($this,
"edit"),
205 array(
"edit",
"",
"view"),
210 $this->tabs_gui->addTarget(
212 $this->ctrl->getLinkTarget($this,
"roleassignment"),
213 array(
"roleassignment"),
218 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
219 if (
$rbacsystem->checkAccess(
'read', $this->ref_id) and
222 $this->tabs_gui->addTarget(
224 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
226 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui')
230 $this->tabs_gui->addTarget(
232 $this->ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
234 'ilobjectownershipmanagementgui' 243 $this->back_target = array(
"text" => $a_text,
253 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
256 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
257 if ($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id])) {
267 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
270 if ($this->object->getType() ==
'usr') {
271 $user_defined_data = $this->
object->getUserDefinedData();
273 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
274 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
275 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
278 $this->tpl->setCurrentBlock(
"field_text");
279 $this->tpl->setVariable(
"FIELD_NAME",
'udf[' . $definition[
'field_id'] .
']');
281 $this->tpl->parseCurrentBlock();
283 $this->tpl->setCurrentBlock(
"field_select");
286 'udf[' . $definition[
'field_id'] .
']',
287 $this->user_defined_fields->fieldValuesToSelectArray(
288 $definition[
'field_values']
293 $this->tpl->parseCurrentBlock();
295 $this->tpl->setCurrentBlock(
"user_defined");
297 if ($definition[
'required']) {
298 $name = $definition[
'field_name'] .
"<span class=\"asterisk\">*</span>";
300 $name = $definition[
'field_name'];
302 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
303 $this->tpl->parseCurrentBlock();
318 $this->tabs_gui->clearTargets();
324 foreach ($obj_list as $obj_data) {
327 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
337 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
344 $this->
ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"), $this->
ilias->error_obj->MESSAGE);
347 $keys = array_keys($rol);
350 if (in_array(4,
$keys)) {
351 $this->default_role = 4;
353 if (count(
$keys) > 1 and in_array(2,
$keys)) {
355 foreach (
$keys as $key => $val) {
363 $this->default_role = array_shift(
$keys);
365 $this->selectable_roles = $rol;
380 if (!
$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id)
381 && !
$rbacsystem->checkAccess(
'cat_administrate_users', $this->usrf_ref_id)) {
382 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
386 $this->initForm(
"create");
387 return $tpl->setContent($this->form_gui->getHtml());
398 $ilAccess = $DIC[
'ilAccess'];
402 $rbacadmin = $DIC[
'rbacadmin'];
406 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
409 if (!
$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id)
410 && !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id)) {
411 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
415 $this->initForm(
"create");
418 $profileMaybeIncomplete =
false;
419 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
423 if ($this->form_gui->checkInput()) {
432 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
435 $userObj->setTitle($userObj->getFullname());
436 $userObj->setDescription($userObj->getEmail());
439 foreach (
$_POST as $k => $v) {
440 if (substr($k, 0, 4) ==
"udf_") {
441 $udf[substr($k, 4)] = $v;
444 $userObj->setUserDefinedData($udf);
448 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
450 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
455 $userObj->setLastPasswordChangeTS(time());
458 $userObj->saveAsNew();
462 $userObj->setLanguage(
$_POST[
"language"]);
467 $sknst = explode(
":",
$_POST[
"skin_style"]);
469 if ($userObj->getPref(
"style") != $sknst[1] ||
470 $userObj->getPref(
"skin") != $sknst[0]) {
471 $userObj->setPref(
"skin", $sknst[0]);
472 $userObj->setPref(
"style", $sknst[1]);
476 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
483 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
486 $userObj->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
489 $userObj->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
491 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
492 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
494 $userObj->writePrefs();
497 $rbacadmin->assignUser(
$_POST[
"default_role"], $userObj->getId(),
true);
499 $msg = $this->lng->txt(
"user_added");
501 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
504 $this->
object = $userObj;
510 if ($profileMaybeIncomplete) {
511 include_once
'Services/User/classes/class.ilUserProfile.php';
513 $this->
object->setProfileIncomplete(
true);
514 $this->
object->update();
519 if (
$_POST[
'send_mail'] ==
'y') {
520 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
522 $acc_mail->useLangVariablesAsFallback(
true);
523 $acc_mail->setAttachConfiguredFiles(
true);
524 $acc_mail->setUserPassword(
$_POST[
'passwd']);
525 $acc_mail->setUser($userObj);
527 if ($acc_mail->send()) {
528 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_sent');
529 ilUtil::sendSuccess($msg,
true);
531 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_not_sent');
535 ilUtil::sendSuccess($msg,
true);
539 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
540 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
542 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
545 $this->form_gui->setValuesByPost();
546 $tpl->setContent($this->form_gui->getHtml());
565 !
$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)
566 || !
$rbacsystem->checkAccess(
'write', $this->usrf_ref_id)
570 $this->object->getId(),
571 $access->filterUserIdsByPositionOfCurrentUser(
574 [$this->object->getId()]
579 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
583 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
589 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
590 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
595 $this->tabs_gui->clearTargets();
599 $this->initForm(
"edit");
601 $this->showAcceptedTermsOfService();
602 $this->tpl->setContent($this->form_gui->getHTML());
626 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
627 $user->setTimeLimitFrom($from
631 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
632 $user->setTimeLimitUntil($until
636 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
638 if ($a_mode ==
'create') {
639 $user->setTimeLimitOwner($this->usrf_ref_id);
644 $bd = $this->form_gui->getItemByPostVar(
'birthday');
645 $bd = $bd->getDate();
646 $user->setBirthday($bd
652 $user->setLogin($this->form_gui->getInput(
'login'));
657 $user->setGender($this->form_gui->getInput(
'gender'));
662 $user->setUTitle($this->form_gui->getInput(
'title'));
667 $user->setFirstname($this->form_gui->getInput(
'firstname'));
671 $user->setLastname($this->form_gui->getInput(
'lastname'));
673 $user->setFullname();
677 $user->setInstitution($this->form_gui->getInput(
'institution'));
682 $user->setDepartment($this->form_gui->getInput(
'department'));
686 $user->setStreet($this->form_gui->getInput(
'street'));
690 $user->setCity($this->form_gui->getInput(
'city'));
694 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
698 $user->setCountry($this->form_gui->getInput(
'country'));
702 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
706 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
710 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
714 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
718 $user->setFax($this->form_gui->getInput(
'fax'));
722 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
726 $user->setEmail($this->form_gui->getInput(
'email'));
730 $user->setSecondEmail($this->form_gui->getInput(
'second_email'));
734 $user->setHobby($this->form_gui->getInput(
'hobby'));
738 $user->setComment($this->form_gui->getInput(
'referral_comment'));
742 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
743 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
744 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
747 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
750 $user->setLatitude($this->form_gui->getInput(
'latitude'));
751 $user->setLongitude($this->form_gui->getInput(
'longitude'));
752 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
755 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
756 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
758 if ((
int)
$user->getActive() != (int) $this->form_gui->getInput(
'active')) {
759 $user->setActive($this->form_gui->getInput(
'active'),
$ilUser->getId());
773 $tpl = $DIC->ui()->mainTemplate();
784 $this->object->getId(),
785 $access->filterUserIdsByRbacOrPositionOfCurrentUser(
789 [$this->object->getId()]
794 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
800 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
801 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
804 $this->initForm(
"edit");
807 unset(
$_POST[
'approve_date']);
808 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
809 unset(
$_POST[
'last_login']);
812 $profileMaybeIncomplete =
false;
813 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
817 if ($this->form_gui->checkInput()) {
821 && trim(
$_POST[
'passwd']) !=
"" 823 || !in_array(
SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->object->getId()))
824 || in_array(
SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->user->getId())))
833 if (
$_POST[
'active'] == 1) {
837 #$this->object->assignData($_POST); 841 foreach (
$_POST as $k => $v) {
842 if (substr($k, 0, 4) ==
"udf_") {
843 $udf[substr($k, 4)] = $v;
846 $this->
object->setUserDefinedData($udf);
849 $this->
object->updateLogin(
$_POST[
'login']);
852 $this->form_gui->setValuesByPost();
853 return $tpl->setContent($this->form_gui->getHtml());
856 $this->
object->setTitle($this->object->getFullname());
857 $this->
object->setDescription($this->object->getEmail());
860 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
865 $sknst = explode(
":",
$_POST[
"skin_style"]);
867 if ($this->object->getPref(
"style") != $sknst[1] ||
868 $this->
object->getPref(
"skin") != $sknst[0]) {
869 $this->
object->setPref(
"skin", $sknst[0]);
870 $this->
object->setPref(
"style", $sknst[1]);
874 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
881 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
884 $this->
object->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
887 $this->
object->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
892 $this->
object->setLastPasswordChangeTS(time());
897 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
898 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
902 $this->
object->setProfileIncomplete(
false);
904 $this->update = $this->
object->update();
909 if (
$ilUser->getId() == $this->
object->getId()) {
912 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
915 $mail_message = $this->__sendProfileMail();
916 $msg = $this->lng->txt(
'saved_successfully') . $mail_message;
923 if ($profileMaybeIncomplete) {
924 include_once
'Services/User/classes/class.ilUserProfile.php';
926 $this->
object->setProfileIncomplete(
true);
927 $this->
object->update();
932 ilUtil::sendSuccess($msg,
true);
934 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
935 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
937 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
940 $this->form_gui->setValuesByPost();
941 $this->tabs_gui->activateTab(
'properties');
942 $tpl->setContent($this->form_gui->getHtml());
959 $data[
"auth_mode"] = $this->
object->getAuthMode();
960 $data[
"login"] = $this->
object->getLogin();
963 $data[
"ext_account"] = $this->
object->getExternalAccount();
968 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
971 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
974 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
977 $data[
"active"] = $this->
object->getActive();
978 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
980 $data[
"time_limit_from"] = $this->
object->getTimeLimitFrom()
983 $data[
"time_limit_until"] = $this->
object->getTimeLimitUntil()
988 $data[
"gender"] = $this->
object->getGender();
989 $data[
"firstname"] = $this->
object->getFirstname();
990 $data[
"lastname"] = $this->
object->getLastname();
991 $data[
"title"] = $this->
object->getUTitle();
992 $data[
'birthday'] = $this->
object->getBirthday()
995 $data[
"institution"] = $this->
object->getInstitution();
996 $data[
"department"] = $this->
object->getDepartment();
997 $data[
"street"] = $this->
object->getStreet();
998 $data[
"city"] = $this->
object->getCity();
999 $data[
"zipcode"] = $this->
object->getZipcode();
1000 $data[
"country"] = $this->
object->getCountry();
1001 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1002 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1003 $data[
"phone_home"] = $this->
object->getPhoneHome();
1004 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1005 $data[
"fax"] = $this->
object->getFax();
1006 $data[
"email"] = $this->
object->getEmail();
1007 $data[
"second_email"] = $this->
object->getSecondEmail();
1008 $data[
"hobby"] = $this->
object->getHobby();
1009 $data[
"referral_comment"] = $this->
object->getComment();
1012 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1013 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1014 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1017 $data[
"matriculation"] = $this->
object->getMatriculation();
1018 $data[
"client_ip"] = $this->
object->getClientIP();
1021 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1023 $user_defined_data = $this->
object->getUserDefinedData();
1024 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
1025 $data[
"udf_" . $field_id] = $user_defined_data[
"f_" . $field_id];
1029 $data[
"language"] = $this->
object->getLanguage();
1030 $data[
"skin_style"] = $this->
object->skin .
":" . $this->
object->prefs[
"style"];
1031 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1033 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"];
1034 $data[
'bs_allow_to_contact_me'] = $this->
object->prefs[
'bs_allow_to_contact_me'] ==
'y';
1035 $data[
'chat_osc_accept_msg'] = $this->
object->prefs[
'chat_osc_accept_msg'] ==
'y';
1036 $data[
"session_reminder_enabled"] = (int) $this->object->prefs[
"session_reminder_enabled"];
1038 $data[
"send_mail"] = ($this->object->prefs[
'send_info_mails'] ==
'y');
1041 $this->form_gui->setValuesByArray($data);
1047 public function initForm($a_mode)
1053 $styleDefinition = $DIC[
'styleDefinition'];
1055 $ilClientIniFile = $DIC[
'ilClientIniFile'];
1060 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1063 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1064 if ($a_mode ==
"create") {
1065 $this->form_gui->setTitle(
$lng->txt(
"usr_new"));
1067 $this->form_gui->setTitle(
$lng->txt(
"usr_edit"));
1072 $sec_l->setTitle(
$lng->txt(
"login_data"));
1073 $this->form_gui->addItem($sec_l);
1076 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1080 foreach ($active_auth_modes as $auth_name => $auth_key) {
1081 if ($auth_name ==
'default') {
1085 #$name = $this->lng->txt('auth_'.$auth_name); 1086 include_once
'./Services/Authentication/classes/class.ilAuthUtils.php';
1090 $option[$auth_name] =
$name;
1092 $am->setOptions($option);
1093 $this->form_gui->addItem($am);
1095 if ($a_mode ==
"edit") {
1097 $id->
setValue($this->object->getId());
1098 $this->form_gui->addItem($id);
1104 if ($a_mode ==
"edit") {
1105 $lo->setCurrentUserId($this->object->getId());
1107 include_once
'Services/Calendar/classes/class.ilDate.php';
1112 $this->lng->txt(
'usr_loginname_history_info'),
1114 $last_history_entry[0]
1121 $this->form_gui->addItem($lo);
1124 || !in_array(
SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->object->getId()))
1125 || in_array(
SYSTEM_ROLE_ID, $this->rbacreview->assignedRoles($this->user->getId()))) {
1133 $pw->setMaxLength(80);
1134 $pw->setValidateAuthPost(
"auth_mode");
1135 if ($a_mode ==
"create") {
1136 $pw->setRequiredOnAuth(
true);
1139 $this->form_gui->addItem($pw);
1144 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1148 $ext->setMaxLength(250);
1149 $ext->setInfo(
$lng->txt(
"user_ext_account_desc"));
1150 $this->form_gui->addItem($ext);
1155 $sec_si->setTitle($this->lng->txt(
"system_information"));
1156 $this->form_gui->addItem($sec_si);
1159 if ($a_mode ==
"edit") {
1160 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1161 foreach ($sia as
$a) {
1163 $this->form_gui->addItem($siai);
1170 $this->form_gui->addItem($ac);
1173 $lng->loadLanguageModule(
'crs');
1179 $radg->addOption($op1);
1181 $radg->addOption($op2);
1190 $acfrom->setShowTime(
true);
1191 $acfrom->setMinuteStepSize(1);
1192 $op2->addSubItem($acfrom);
1197 $acto->setShowTime(
true);
1198 $acto->setMinuteStepSize(1);
1199 $op2->addSubItem($acto);
1202 $this->form_gui->addItem($radg);
1214 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1215 $this->form_gui->addItem($sec_pd);
1223 $gndr->addOption($neutral);
1225 $gndr->addOption($female);
1227 $gndr->addOption($male);
1228 $this->form_gui->addItem($gndr);
1232 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1234 foreach ($fields as $field =>
$req) {
1237 $caption = ($field ==
"title")
1242 $inp->setMaxLength(32);
1243 $inp->setRequired(
$req);
1244 $this->form_gui->addItem($inp);
1251 if ($a_mode ==
"edit" || $a_mode ==
"upload") {
1253 $this->object->getId(),
1259 $this->form_gui->addItem($pi);
1265 $this->form_gui->addItem($birthday);
1272 array(
"institution", 40, 80),
1273 array(
"department", 40, 80),
1274 array(
"street", 40, 40),
1275 array(
"city", 40, 40),
1276 array(
"zipcode", 10, 10),
1277 array(
"country", 40, 40),
1278 array(
"sel_country"),
1279 array(
"phone_office", 30, 30),
1280 array(
"phone_home", 30, 30),
1281 array(
"phone_mobile", 30, 30),
1282 array(
"fax", 30, 30));
1285 foreach ($fields as $field) {
1289 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1290 $this->form_gui->addItem($sec_cd);
1293 if ($a_mode ==
"edit") {
1295 $orgus->
setValue($this->object->getOrgUnitsRepresentation());
1296 $this->form_gui->addItem($orgus);
1300 if ($field[0] !=
"sel_country") {
1302 $inp->setSize($field[1]);
1303 $inp->setMaxLength($field[2]);
1304 $inp->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1306 $this->form_gui->addItem($inp);
1309 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1313 $this->form_gui->addItem($cs);
1323 $this->form_gui->addItem($em);
1330 $this->form_gui->addItem($em);
1338 $hob->setRequired(isset(
$settings[
"require_hobby"]) &&
1340 $this->form_gui->addItem($hob);
1348 $rc->setRequired(isset(
$settings[
"require_referral_comment"]) &&
1350 $this->form_gui->addItem($rc);
1357 $sh->setTitle(
$lng->txt(
"interests"));
1358 $this->form_gui->addItem($sh);
1360 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1361 foreach ($multi_fields as $multi_field) {
1365 $ti->setMulti(
true);
1366 $ti->setMaxLength(40);
1368 $ti->setRequired(isset(
$settings[
"require_" . $multi_field]) &&
1370 $this->form_gui->addItem($ti);
1378 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1379 $this->form_gui->addItem($sec_oi);
1386 $mr->setMaxLength(40);
1387 $mr->setRequired(isset(
$settings[
"require_matriculation"]) &&
1389 $this->form_gui->addItem($mr);
1395 $ip->setMaxLength(255);
1396 $ip->setInfo($this->lng->txt(
"current_ip") .
" " .
$_SERVER[
"REMOTE_ADDR"] .
" <br />" .
1397 '<span class="warning">' . $this->lng->txt(
"current_ip_alert") .
"</span>");
1398 $this->form_gui->addItem($ip);
1401 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1405 $all_defs = $user_defined_fields->getDefinitions();
1407 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1410 foreach ($all_defs as $field_id => $definition) {
1411 include_once
'./Services/User/classes/class.ilCustomUserFieldsHelper.php';
1414 $this->form_gui->addItem($f_property);
1420 $a_mode ==
'create' or
1429 $sec_st->setTitle($this->lng->txt(
"settings"));
1430 $this->form_gui->addItem($sec_st);
1434 if ($a_mode ==
"create") {
1436 $lng->txt(
"default_role"),
1439 $role->setRequired(
true);
1440 $role->setValue($this->default_role);
1441 $role->setOptions($this->selectable_roles);
1442 $this->form_gui->addItem($role);
1448 $lng->txt(
"language"),
1451 $languages =
$lng->getInstalledLanguages();
1452 $lng->loadLanguageModule(
"meta");
1454 foreach ($languages as $l) {
1455 $options[$l] =
$lng->txt(
"meta_l_" . $l);
1457 $lang->setOptions($options);
1459 $this->form_gui->addItem(
$lang);
1465 $lng->txt(
"skin_style"),
1471 $skins = $styleDefinition->getAllSkins();
1474 if (is_array($skins)) {
1478 foreach ($skins as $skin) {
1479 foreach ($skin->getStyles() as $style) {
1480 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
1485 $options[$skin->getId() .
":" . $style->getId()] = $skin->getName() .
" / " . $style->getName();
1490 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin") .
1491 ":" . $ilClientIniFile->readVariable(
"layout",
"style"));
1493 $this->form_gui->addItem($sk);
1499 $lng->txt(
"hits_per_page"),
1502 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1503 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1504 $hpp->setOptions($options);
1505 $hpp->setValue(
$ilSetting->get(
"hits_per_page"));
1506 $this->form_gui->addItem($hpp);
1522 $lng->loadLanguageModule(
"awrn");
1524 $default = (
$ilSetting->get(
'hide_own_online_status') ==
"n")
1525 ? $this->lng->txt(
"user_awrn_show")
1526 : $this->lng->txt(
"user_awrn_hide");
1529 "" => $this->lng->txt(
"user_awrn_default") .
" (" . $default .
")",
1530 "n" => $this->lng->txt(
"user_awrn_show"),
1531 "y" => $this->lng->txt(
"user_awrn_hide"));
1533 $os->setOptions($options);
1534 $os->setDisabled(
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1535 $os->setInfo(
$lng->txt(
"awrn_hide_from_awareness_info"));
1536 $this->form_gui->addItem($os);
1545 $lng->loadLanguageModule(
'buddysystem');
1547 if ($a_mode ==
'create') {
1550 $this->form_gui->addItem($os);
1553 $lng->loadLanguageModule(
'chatroom');
1555 if ($a_mode ==
'create') {
1558 $this->form_gui->addItem($chat_osc_acm);
1561 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
1562 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1564 $this->form_gui->addItem($cb);
1570 $sec_op->setTitle($this->lng->txt(
"options"));
1571 $this->form_gui->addItem($sec_op);
1578 $se->setChecked((
$ilUser->getPref(
'send_info_mails') ==
'y'));
1579 $this->form_gui->addItem($se);
1583 $irf->
setInfo(
$lng->txt(
'ignore_required_fields_info'));
1585 $this->form_gui->addItem($irf);
1590 if ($a_mode ==
"create" || $a_mode ==
"save") {
1591 $this->form_gui->addCommandButton(
"save",
$lng->txt(
"save"));
1593 if ($a_mode ==
"edit" || $a_mode ==
"update") {
1594 $this->form_gui->addCommandButton(
"update",
$lng->txt(
"save"));
1596 $this->form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
1625 return (
bool)
$settings[
'usr_settings_changeable_lua_' . $a_field];
1643 !
$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
1644 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1650 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1651 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1655 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1657 if ($_FILES[
"userfile"][
"tmp_name"] ==
"") {
1658 if ($userfile_input->getDeletionFlag()) {
1659 $this->
object->removeUserPicture();
1663 if ($_FILES[
"userfile"][
"size"] == 0) {
1667 $image_dir = $webspace_dir .
"/usr_images";
1668 $store_file =
"usr_" . $this->
object->getId() .
"." .
"jpg";
1671 $this->
object->setPref(
"profile_image", $store_file);
1672 $this->
object->update();
1675 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1676 $uploaded_file = $image_dir .
"/upload_" . $this->
object->getId() .
"." . $pi[
"extension"];
1678 $_FILES[
"userfile"][
"tmp_name"],
1679 $_FILES[
"userfile"][
"name"],
1684 $this->ctrl->redirect($this,
"showProfile");
1686 chmod($uploaded_file, 0770);
1690 $show_file =
"$image_dir/usr_" . $this->
object->getId() .
".jpg";
1691 $thumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_small.jpg";
1692 $xthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1693 $xxthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1701 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file);
1702 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file);
1703 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file);
1704 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file);
1706 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
1707 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
1708 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
1709 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
1720 $image_dir = $webspace_dir .
"/usr_images";
1721 $file = $image_dir .
"/usr_" . $this->
object->getID() .
"." .
"jpg";
1722 $thumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_small.jpg";
1723 $xthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xsmall.jpg";
1724 $xxthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xxsmall.jpg";
1725 $upload_file = $image_dir .
"/upload_" . $this->
object->getID();
1728 $this->
object->setPref(
"profile_image",
"");
1729 $this->
object->update();
1730 ilUtil::sendSuccess($this->lng->txt(
"user_image_removed"));
1732 if (@is_file($file)) {
1735 if (@is_file($thumb_file)) {
1736 unlink($thumb_file);
1738 if (@is_file($xthumb_file)) {
1739 unlink($xthumb_file);
1741 if (@is_file($xxthumb_file)) {
1742 unlink($xxthumb_file);
1744 if (@is_file($upload_file)) {
1745 unlink($upload_file);
1761 $rbacadmin = $DIC[
'rbacadmin'];
1764 if (!
$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1765 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1768 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
1769 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
1776 $global_roles_all =
$rbacreview->getGlobalRoles();
1777 $assigned_roles_all =
$rbacreview->assignedRoles($this->object->getId());
1778 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
1779 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
1780 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
1782 $user_not_allowed_to_change_admin_role_assginements =
1785 if ($user_not_allowed_to_change_admin_role_assginements
1790 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
1792 if (empty($selected_roles) && count($assigned_roles_all) === count($assigned_roles)
1793 || empty($posted_global_roles) && count($assigned_global_roles_all) === count($assigned_global_roles)) {
1794 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role") .
"<br/>" . $this->lng->txt(
"action_aborted"),
true);
1795 $this->ctrl->redirect($this,
'roleassignment');
1798 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
1800 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
1803 $rbacadmin->deassignUser($role, $this->object->getId());
1806 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
1808 || $user_not_allowed_to_change_admin_role_assginements && $role ===
SYSTEM_ROLE_ID) {
1811 $rbacadmin->assignUser($role, $this->object->getId(),
false);
1814 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
1817 $this->
object->update();
1819 ilUtil::sendSuccess($this->lng->txt(
"msg_roleassignment_changed"),
true);
1821 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
1822 $this->ctrl->redirect($this,
'roleassignment');
1824 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1840 $ilTabs = $DIC[
'ilTabs'];
1843 $ilTabs->activateTab(
"role_assignment");
1846 || !
$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)
1847 && !
$access->isCurrentUserBasedOnPositionsAllowedTo(
"read_users", array($this->object->getId()))
1849 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1858 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
1861 $this->tpl->setCurrentBlock(
"form_filter");
1862 $this->tpl->setVariable(
"FILTER_TXT_FILTER", $this->lng->txt(
'filter'));
1864 $this->tpl->setVariable(
"FILTER_ACTION", $this->ctrl->getFormAction($this));
1865 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
1866 $this->tpl->setVariable(
"FILTER_VALUE", $this->lng->txt(
'apply_filter'));
1867 $this->tpl->parseCurrentBlock();
1871 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
1874 $tab->parse($this->object->getId());
1875 $this->tpl->setVariable(
"ROLES_TABLE", $tab->getHTML());
1883 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
1885 $table_gui->writeFilterToSession();
1886 $table_gui->resetOffset();
1895 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
1897 $table_gui->resetOffset();
1898 $table_gui->resetFilter();
1906 for (
$i = 0;
$i <= 60;
$i++) {
1907 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1912 for (
$i = 0;
$i < 24;
$i++) {
1913 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1918 for (
$i = 1;
$i < 32;
$i++) {
1919 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1924 for (
$i = 1;
$i < 13;
$i++) {
1925 $month[
$i] =
$i < 10 ?
"0" .
$i :
$i;
1930 if ($a_selected < date(
'Y', time())) {
1931 $start = $a_selected;
1933 $start = date(
'Y', time());
1936 for (
$i = $start;
$i < date(
"Y", time()) + 11;++
$i) {
1946 $a_time_arr[
"hour"],
1947 $a_time_arr[
"minute"],
1948 $a_time_arr[
"second"],
1949 $a_time_arr[
"month"],
1965 $action[0] = $this->lng->txt(
'assigned_roles');
1966 $action[1] = $this->lng->txt(
'all_roles');
1967 $action[2] = $this->lng->txt(
'all_global_roles');
1968 $action[3] = $this->lng->txt(
'all_local_roles');
1969 $action[4] = $this->lng->txt(
'internal_local_roles_only');
1970 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
1977 parent::hitsperpageObject();
1989 $ilLocator = $DIC[
'ilLocator'];
1991 $ilLocator->clearItems();
1993 if (
$_GET[
"admin_mode"] ==
"settings") {
1994 $this->ctrl->setParameterByClass(
1995 "ilobjsystemfoldergui",
1999 $ilLocator->addItem(
2000 $this->lng->txt(
"administration"),
2001 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2006 $ilLocator->addItem(
2010 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view")
2013 $ilLocator->addItem(
2017 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view")
2021 if (
$_GET[
"obj_id"] > 0) {
2022 $ilLocator->addItem(
2023 $this->object->getTitle(),
2024 $this->ctrl->getLinkTarget($this,
"view")
2036 public function __sendProfileMail()
2041 $ilias = $DIC[
'ilias'];
2043 if (
$_POST[
'send_mail'] !=
'y') {
2046 if (!strlen($this->object->getEmail())) {
2051 $usr_lang =
new ilLanguage($this->object->getLanguage());
2052 $usr_lang->loadLanguageModule(
'crs');
2053 $usr_lang->loadLanguageModule(
'registration');
2055 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2058 $senderFactory =
$GLOBALS[
'DIC'][
"mail.mime.sender.factory"];
2061 $mmail->From($senderFactory->system());
2063 $mailOptions = new \ilMailOptions($this->object->getId());
2064 $mmail->To($mailOptions->getExternalEmailAddresses());
2067 $subject = $usr_lang->txt(
"profile_changed");
2071 $body = $usr_lang->txt(
"reg_mail_body_salutation")
2072 .
" " . $this->
object->getFullname() .
",\n\n";
2074 $date = $this->
object->getApproveDate();
2076 if ((time() - strtotime($date)) < 10) {
2077 $body .= $usr_lang->txt(
'reg_mail_body_approve') .
"\n\n";
2079 $body .= $usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n";
2083 if (
$_POST[
'passwd'] !=
'') {
2084 $body .= $usr_lang->txt(
"reg_mail_body_text2") .
"\n" .
2085 ILIAS_HTTP_PATH .
"/login.php?client_id=" . $ilias->client_id .
"\n" .
2086 $usr_lang->txt(
"login") .
": " . $this->
object->getLogin() .
"\n" .
2087 $usr_lang->txt(
"passwd") .
": " .
$_POST[
'passwd'] .
"\n\n";
2089 $body .= $usr_lang->txt(
"reg_mail_body_text3") .
"\n";
2090 $body .= $this->
object->getProfileAsString($usr_lang);
2094 $mmail->Subject($subject,
true);
2095 $mmail->Body($body);
2099 return "<br/>" . $this->lng->txt(
"mail_sent");
2105 public static function _goto($a_target)
2116 $class = ilPersonalProfileGUI::class;
2118 $ilCtrl->clearParametersByClass($class);
2119 $ilCtrl->setParameterByClass($class,
'token', str_replace($cmd,
'', $a_target));
2120 $ilCtrl->redirectByClass([
'ildashboardgui', $class], $cmd);
2124 if ($a_target == md5(
"usrdelown")) {
2127 $ilCtrl->initBaseClass(
"ildashboardgui");
2128 $ilCtrl->redirectByClass([
'ildashboardgui',
'ilpersonalsettingsgui'],
"deleteOwnAccount3");
2130 exit(
"This account is not flagged for deletion.");
2134 if (substr($a_target, -4) ==
"_bdg") {
2135 $_GET[
"baseClass"] =
"ilDashboardGUI";
2136 $_GET[
"cmd"] =
"jumpToBadges";
2137 include(
"ilias.php");
2141 if (
'registration' == $a_target) {
2142 $_GET[
"baseClass"] =
'ilStartUpGUI';
2143 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilAccountRegistrationGUI'),
'');
2144 } elseif (
'nameassist' == $a_target) {
2145 $_GET[
"baseClass"] =
'ilStartUpGUI';
2146 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'showUsernameAssistanceForm');
2147 } elseif (
'pwassist' == $a_target) {
2148 $_GET[
"baseClass"] =
'ilStartUpGUI';
2149 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'');
2150 } elseif (
'agreement' == $a_target) {
2152 $ilCtrl->setTargetScript(
'ilias.php');
2153 $ilCtrl->initBaseClass(
'ildashboardgui');
2154 $ilCtrl->redirectByClass(array(
'ildashboardgui',
'ilpersonalprofilegui'),
'showUserAgreement');
2156 $_GET[
'baseClass'] =
'ilStartUpGUI';
2157 $ilCtrl->setTargetScript(
'ilias.php');
2158 $ilCtrl->redirectByClass(array(
'ilStartUpGUI'),
'showTermsOfService');
2162 if (substr($a_target, 0, 1) ==
"n") {
2166 if (strpos($a_target,
'contact_approved') !==
false) {
2167 $_GET[
'cmd'] =
'approveContactRequest';
2168 } elseif (strpos($a_target,
'contact_ignored') !==
false) {
2169 $_GET[
'cmd'] =
'ignoreContactRequest';
2171 $_GET[
'cmd'] =
'view';
2174 $_GET[
"user_id"] = (int) $a_target;
2175 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2176 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2177 include(
"ilias.php");
2191 $profile_maybe_incomplete =
false;
2193 require_once
'Services/User/classes/class.ilUserProfile.php';
2196 $elm = $this->form_gui->getItemByPostVar($fieldName);
2202 if ($elm->getRequired()) {
2203 $profile_maybe_incomplete =
true;
2206 $elm->setRequired(
false);
2210 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2212 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
2213 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $definition[
'field_id']);
2218 if ($elm->getRequired() && $definition[
'required']) {
2219 $profile_maybe_incomplete =
true;
2222 $elm->setRequired(
false);
2226 return $profile_maybe_incomplete;
2232 protected function showAcceptedTermsOfService()
2235 $agreeDate = $this->form_gui->getItemByPostVar(
'agree_date');
2236 if ($agreeDate && $agreeDate->getValue()) {
2237 $this->lng->loadLanguageModule(
'tos');
2238 $helper = new \ilTermsOfServiceHelper();
2240 $entity = $helper->getCurrentAcceptanceForUser($this->
object);
2241 if ($entity->getId()) {
2242 $modal = $this->uiFactory
2245 $this->uiFactory->modal()->lightboxTextPage($entity->getText(), $entity->getTitle())
2248 $titleLink = $this->uiFactory
2250 ->shy($entity->getTitle(),
'#')
2251 ->withOnClick($modal->getShowSignal());
2254 $this->lng->txt(
'tos_agreement_document'),
2258 $agreementDocument->
setValue($this->uiRenderer->render([$titleLink, $modal]));
2259 $agreeDate->addSubItem($agreementDocument);
2261 } elseif ($agreeDate) {
2262 $agreeDate->setValue($this->lng->txt(
'tos_not_accepted_yet'));
__showUserDefinedFields()
static isConvertVersionAtLeast($a_version)
Compare convert version numbers.
static _lookupLogin($a_user_id)
lookup login
static isProfileIncomplete($a_user, $a_include_udf=true, $a_personal_data_only=true)
Check if all required personal data fields are set.
Class for user related exception handling in ILIAS.
__construct( $a_data, $a_id, $a_call_by_reference=false, $a_prepare_output=true, ILIAS\UI\Factory $uiFactory=null, ILIAS\UI\Renderer $uiRenderer=null)
ilObjUserGUI constructor.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
getAdminTabs()
admin and normal tabs are equal for roles
addAdminLocatorItems($a_do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded) ...
assignSaveObject()
assign users to role
getValues()
Get values from user object and put them into form.
createObject()
Display user create form.
setValue($a_value)
Set Value.
static _getInstance()
Get instance.
handleIgnoredRequiredFields()
Handles ignored required fields by changing the required flag of form elements.
loadValuesFromForm($a_mode='create')
uploadUserPictureObject()
upload user image
Class ChatMainBarProvider .
removeUserPictureObject()
remove user image
const SYSTEM_USER_ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getLastHistoryDataByUserId($a_usr_id)
Returns the last used loginname and the changedate of the passed user_id.
static _lookupId($a_user_str)
Lookup id by login.
static getIgnorableRequiredSettings()
Returns an array of all ignorable profiel fields.
static _getActiveAuthModes()
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
__unsetSessionVariables()
static getAuthModeTranslation($a_auth_key, $auth_name='')
Class ilObjectOwnershipManagementGUI.
static _resetLoginAttempts($a_usr_id)
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getAuthModeName($a_auth_key)
const LP_CONTEXT_USER_FOLDER
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _getAssignUsersStatus($a_role_id)
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getInstance()
Get instance.
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
isSettingChangeable($a_field)
Check if setting is visible This is the case when called from user folder.
prepareOutput($a_show_subobjects=true)
prepare output
static _enabledLearningProgress()
check wether learing progress is enabled or not
__checkUserDefinedRequiredFields()
display user create form
const ORG_OP_EDIT_USER_ACCOUNTS
static execConvert($args)
execute convert command
__getDateSelect($a_type, $a_varname, $a_selected)
resetFilterObject()
Reset filter.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false, $html_export=false)
Get path to personal picture.
redirection script todo: (a better solution should control the processing via a xml file) ...
static clear($a_var)
Unset a value.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static _isExternalAccountEnabled()
Check if an external account name is required.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
TableGUI class for role assignment in user administration.
This class represents a non editable value in a property form.
setRows($a_rows)
Set Rows.
static escapeShellArg($a_arg)
__construct(Container $dic, ilPlugin $plugin)
applyFilterObject()
Apply filter.
This class represents a text area property in a property form.
saveObject()
save user data public
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
setBackTarget($a_text, $a_link)
set back tab target
updateObject()
Update user.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static getWebspaceDir($mode="filesystem")
get webspace directory
Class ilObjUserTrackingGUI.
static _getInstallationSignature()
roleassignmentObject()
display roleassignment panel