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();
322 $obj_list =
$rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
324 foreach ($obj_list as $obj_data) {
327 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
334 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID) {
336 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,
$rbacreview->assignedRoles(
$ilUser->getId()))) {
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) and
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'];
405 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
408 if (!
$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) &&
409 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id)) {
410 $this->
ilias->raiseError($this->lng->txt(
"permission_denied"), $this->
ilias->error_obj->MESSAGE);
414 $this->initForm(
"create");
417 $profileMaybeIncomplete =
false;
418 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
422 if ($this->form_gui->checkInput()) {
428 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
429 $userObj->setTitle($userObj->getFullname());
430 $userObj->setDescription($userObj->getEmail());
433 foreach (
$_POST as $k => $v) {
434 if (substr($k, 0, 4) ==
"udf_") {
435 $udf[substr($k, 4)] = $v;
438 $userObj->setUserDefinedData($udf);
442 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
444 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
449 $userObj->setLastPasswordChangeTS(time());
452 $userObj->saveAsNew();
456 $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());
559 $ilias = $DIC[
'ilias'];
567 !
$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id) ||
570 $this->object->getId(),
571 $access->filterUserIdsByRbacOrPositionOfCurrentUser(
575 [$this->object->getId()]
580 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
584 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
590 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
591 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
596 $this->tabs_gui->clearTargets();
600 $this->initForm(
"edit");
602 $this->showAcceptedTermsOfService();
603 $this->tpl->setContent($this->form_gui->getHTML());
627 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
628 $user->setTimeLimitFrom($from
632 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
633 $user->setTimeLimitUntil($until
637 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
639 if ($a_mode ==
'create') {
640 $user->setTimeLimitOwner($this->usrf_ref_id);
645 $bd = $this->form_gui->getItemByPostVar(
'birthday');
646 $bd = $bd->getDate();
647 $user->setBirthday($bd
653 $user->setLogin($this->form_gui->getInput(
'login'));
658 $user->setGender($this->form_gui->getInput(
'gender'));
663 $user->setUTitle($this->form_gui->getInput(
'title'));
668 $user->setFirstname($this->form_gui->getInput(
'firstname'));
672 $user->setLastname($this->form_gui->getInput(
'lastname'));
674 $user->setFullname();
678 $user->setInstitution($this->form_gui->getInput(
'institution'));
683 $user->setDepartment($this->form_gui->getInput(
'department'));
687 $user->setStreet($this->form_gui->getInput(
'street'));
691 $user->setCity($this->form_gui->getInput(
'city'));
695 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
699 $user->setCountry($this->form_gui->getInput(
'country'));
703 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
707 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
711 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
715 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
719 $user->setFax($this->form_gui->getInput(
'fax'));
723 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
727 $user->setEmail($this->form_gui->getInput(
'email'));
731 $user->setSecondEmail($this->form_gui->getInput(
'second_email'));
735 $user->setHobby($this->form_gui->getInput(
'hobby'));
739 $user->setComment($this->form_gui->getInput(
'referral_comment'));
743 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
744 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
745 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
748 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
751 $user->setLatitude($this->form_gui->getInput(
'latitude'));
752 $user->setLongitude($this->form_gui->getInput(
'longitude'));
753 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
756 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
757 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
759 if ((
int)
$user->getActive() != (int) $this->form_gui->getInput(
'active')) {
760 $user->setActive($this->form_gui->getInput(
'active'),
$ilUser->getId());
774 $tpl = $DIC->ui()->mainTemplate();
785 $this->object->getId(),
786 $access->filterUserIdsByRbacOrPositionOfCurrentUser(
790 [$this->object->getId()]
795 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
801 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
802 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
805 $this->initForm(
"edit");
808 unset(
$_POST[
'approve_date']);
809 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
810 unset(
$_POST[
'last_login']);
813 $profileMaybeIncomplete =
false;
814 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
818 if ($this->form_gui->checkInput()) {
822 && trim(
$_POST[
'passwd']) !=
"") {
830 if (
$_POST[
'active'] == 1) {
834 #$this->object->assignData($_POST); 838 foreach (
$_POST as $k => $v) {
839 if (substr($k, 0, 4) ==
"udf_") {
840 $udf[substr($k, 4)] = $v;
843 $this->
object->setUserDefinedData($udf);
846 $this->
object->updateLogin(
$_POST[
'login']);
849 $this->form_gui->setValuesByPost();
850 return $tpl->setContent($this->form_gui->getHtml());
853 $this->
object->setTitle($this->object->getFullname());
854 $this->
object->setDescription($this->object->getEmail());
857 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
871 $sknst = explode(
":",
$_POST[
"skin_style"]);
873 if ($this->object->getPref(
"style") != $sknst[1] ||
874 $this->
object->getPref(
"skin") != $sknst[0]) {
875 $this->
object->setPref(
"skin", $sknst[0]);
876 $this->
object->setPref(
"style", $sknst[1]);
880 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
887 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
890 $this->
object->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
893 $this->
object->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
898 $this->
object->setLastPasswordChangeTS(time());
903 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
904 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
908 $this->
object->setProfileIncomplete(
false);
910 $this->update = $this->
object->update();
915 if (
$ilUser->getId() == $this->
object->getId()) {
918 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
921 $mail_message = $this->__sendProfileMail();
922 $msg = $this->lng->txt(
'saved_successfully') . $mail_message;
929 if ($profileMaybeIncomplete) {
930 include_once
'Services/User/classes/class.ilUserProfile.php';
932 $this->
object->setProfileIncomplete(
true);
933 $this->
object->update();
938 ilUtil::sendSuccess($msg,
true);
940 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
941 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
943 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
946 $this->form_gui->setValuesByPost();
947 $tpl->setContent($this->form_gui->getHtml());
964 $data[
"auth_mode"] = $this->
object->getAuthMode();
965 $data[
"login"] = $this->
object->getLogin();
968 $data[
"ext_account"] = $this->
object->getExternalAccount();
973 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
976 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
979 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
982 $data[
"active"] = $this->
object->getActive();
983 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
985 $data[
"time_limit_from"] = $this->
object->getTimeLimitFrom()
988 $data[
"time_limit_until"] = $this->
object->getTimeLimitUntil()
998 $data[
"wsp_disk_quota"] =
ilUtil::Bytes2MB($this->object->getPersonalWorkspaceDiskQuota());
1020 $data[
"gender"] = $this->
object->getGender();
1021 $data[
"firstname"] = $this->
object->getFirstname();
1022 $data[
"lastname"] = $this->
object->getLastname();
1023 $data[
"title"] = $this->
object->getUTitle();
1024 $data[
'birthday'] = $this->
object->getBirthday()
1027 $data[
"institution"] = $this->
object->getInstitution();
1028 $data[
"department"] = $this->
object->getDepartment();
1029 $data[
"street"] = $this->
object->getStreet();
1030 $data[
"city"] = $this->
object->getCity();
1031 $data[
"zipcode"] = $this->
object->getZipcode();
1032 $data[
"country"] = $this->
object->getCountry();
1033 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1034 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1035 $data[
"phone_home"] = $this->
object->getPhoneHome();
1036 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1037 $data[
"fax"] = $this->
object->getFax();
1038 $data[
"email"] = $this->
object->getEmail();
1039 $data[
"second_email"] = $this->
object->getSecondEmail();
1040 $data[
"hobby"] = $this->
object->getHobby();
1041 $data[
"referral_comment"] = $this->
object->getComment();
1044 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1045 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1046 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1049 $data[
"matriculation"] = $this->
object->getMatriculation();
1050 $data[
"client_ip"] = $this->
object->getClientIP();
1053 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1055 $user_defined_data = $this->
object->getUserDefinedData();
1056 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
1057 $data[
"udf_" . $field_id] = $user_defined_data[
"f_" . $field_id];
1061 $data[
"language"] = $this->
object->getLanguage();
1062 $data[
"skin_style"] = $this->
object->skin .
":" . $this->
object->prefs[
"style"];
1063 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1065 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"];
1066 $data[
'bs_allow_to_contact_me'] = $this->
object->prefs[
'bs_allow_to_contact_me'] ==
'y';
1067 $data[
'chat_osc_accept_msg'] = $this->
object->prefs[
'chat_osc_accept_msg'] ==
'y';
1068 $data[
"session_reminder_enabled"] = (int) $this->object->prefs[
"session_reminder_enabled"];
1070 $data[
"send_mail"] = ($this->object->prefs[
'send_info_mails'] ==
'y');
1073 $this->form_gui->setValuesByArray($data);
1079 public function initForm($a_mode)
1085 $styleDefinition = $DIC[
'styleDefinition'];
1087 $ilClientIniFile = $DIC[
'ilClientIniFile'];
1092 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1095 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1096 if ($a_mode ==
"create") {
1097 $this->form_gui->setTitle(
$lng->txt(
"usr_new"));
1099 $this->form_gui->setTitle(
$lng->txt(
"usr_edit"));
1104 $sec_l->setTitle(
$lng->txt(
"login_data"));
1105 $this->form_gui->addItem($sec_l);
1108 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1112 foreach ($active_auth_modes as $auth_name => $auth_key) {
1113 if ($auth_name ==
'default') {
1117 #$name = $this->lng->txt('auth_'.$auth_name); 1118 include_once
'./Services/Authentication/classes/class.ilAuthUtils.php';
1122 $option[$auth_name] =
$name;
1124 $am->setOptions($option);
1125 $this->form_gui->addItem($am);
1127 if ($a_mode ==
"edit") {
1129 $id->
setValue($this->object->getId());
1130 $this->form_gui->addItem($id);
1136 if ($a_mode ==
"edit") {
1137 $lo->setCurrentUserId($this->object->getId());
1139 include_once
'Services/Calendar/classes/class.ilDate.php';
1144 $this->lng->txt(
'usr_loginname_history_info'),
1146 $last_history_entry[0]
1153 $this->form_gui->addItem($lo);
1162 $pw->setMaxLength(80);
1163 $pw->setValidateAuthPost(
"auth_mode");
1164 if ($a_mode ==
"create") {
1165 $pw->setRequiredOnAuth(
true);
1168 $this->form_gui->addItem($pw);
1173 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1177 $ext->setMaxLength(250);
1178 $ext->setInfo(
$lng->txt(
"user_ext_account_desc"));
1179 $this->form_gui->addItem($ext);
1184 $sec_si->setTitle($this->lng->txt(
"system_information"));
1185 $this->form_gui->addItem($sec_si);
1188 if ($a_mode ==
"edit") {
1189 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1190 foreach ($sia as
$a) {
1192 $this->form_gui->addItem($siai);
1199 $this->form_gui->addItem($ac);
1202 $lng->loadLanguageModule(
'crs');
1208 $radg->addOption($op1);
1210 $radg->addOption($op2);
1219 $acfrom->setShowTime(
true);
1221 $op2->addSubItem($acfrom);
1226 $acto->setShowTime(
true);
1228 $op2->addSubItem($acto);
1231 $this->form_gui->addItem($radg);
1234 $lng->loadLanguageModule(
"file");
1237 $quota_head->setTitle(
$lng->txt(
"repository_disk_quota"));
1238 $this->form_gui->addItem($quota_head);
1242 $disk_quota->setSize(10);
1243 $disk_quota->setMaxLength(11);
1244 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1245 $this->form_gui->addItem($disk_quota);
1247 if ($a_mode ==
"edit") {
1250 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota']) {
1251 $info_text = sprintf(
1252 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1255 $dq_info[
'role_title']
1257 } elseif (is_infinite($dq_info[
'role_disk_quota'])) {
1258 $info_text = sprintf(
$lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1260 $info_text = sprintf(
1261 $lng->txt(
'disk_quota_is_1_by_2'),
1263 $dq_info[
'role_title']
1266 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1272 if ($du_info[
'last_update'] === null) {
1276 $info =
'<table class="il_user_quota_disk_usage_overview">';
1278 foreach ($du_info[
'details'] as $detail_data) {
1280 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1281 '<td class="std">' .
$lng->txt($detail_data[
'type']) .
'</td>' .
1286 $info .=
'</table>';
1287 $info .=
'<br>' . $this->lng->txt(
'last_update') .
': ' .
1289 $disk_usage->setInfo($info);
1291 $this->form_gui->addItem($disk_usage);
1294 if (
true || $dq_info[
'last_reminder']) {
1299 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1300 $this->form_gui->addItem($reminder);
1306 $lng->loadLanguageModule(
"file");
1309 $quota_head->setTitle(
$lng->txt(
"personal_resources_disk_quota"));
1310 $this->form_gui->addItem($quota_head);
1314 $wsp_disk_quota->setSize(10);
1315 $wsp_disk_quota->setMaxLength(11);
1316 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1317 $this->form_gui->addItem($wsp_disk_quota);
1319 if ($a_mode ==
"edit") {
1322 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota']) {
1323 $info_text = sprintf(
1324 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1327 $dq_info[
'role_title']
1329 } elseif (is_infinite($dq_info[
'role_wsp_disk_quota'])) {
1330 $info_text = sprintf(
$lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1332 $info_text = sprintf(
1333 $lng->txt(
'disk_quota_is_1_by_2'),
1335 $dq_info[
'role_title']
1338 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1342 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1345 if (!
sizeof($du_info)) {
1349 $info =
'<table class="il_user_quota_disk_usage_overview">';
1351 foreach ($du_info as $detail_data) {
1353 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1354 '<td class="std">' .
$lng->txt(
"obj_" . $detail_data[
"src_type"]) .
'</td>' .
1355 '<td class="std">' .
ilUtil::formatSize($detail_data[
'filesize'],
'short') .
'</td>' .
1359 $info .=
'</table>';
1360 $disk_usage->setInfo($info);
1362 $this->form_gui->addItem($disk_usage);
1375 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1376 $this->form_gui->addItem($sec_pd);
1384 $gndr->addOption($neutral);
1386 $gndr->addOption($female);
1388 $gndr->addOption($male);
1389 $this->form_gui->addItem($gndr);
1393 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1395 foreach ($fields as $field =>
$req) {
1398 $caption = ($field ==
"title")
1403 $inp->setMaxLength(32);
1404 $inp->setRequired(
$req);
1405 $this->form_gui->addItem($inp);
1412 if ($a_mode ==
"edit" || $a_mode ==
"upload") {
1414 $this->object->getId(),
1420 $this->form_gui->addItem($pi);
1426 $this->form_gui->addItem($birthday);
1433 array(
"institution", 40, 80),
1434 array(
"department", 40, 80),
1435 array(
"street", 40, 40),
1436 array(
"city", 40, 40),
1437 array(
"zipcode", 10, 10),
1438 array(
"country", 40, 40),
1439 array(
"sel_country"),
1440 array(
"phone_office", 30, 30),
1441 array(
"phone_home", 30, 30),
1442 array(
"phone_mobile", 30, 30),
1443 array(
"fax", 30, 30));
1446 foreach ($fields as $field) {
1450 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1451 $this->form_gui->addItem($sec_cd);
1454 if ($a_mode ==
"edit") {
1456 $orgus->
setValue($this->object->getOrgUnitsRepresentation());
1457 $this->form_gui->addItem($orgus);
1461 if ($field[0] !=
"sel_country") {
1463 $inp->setSize($field[1]);
1464 $inp->setMaxLength($field[2]);
1465 $inp->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1467 $this->form_gui->addItem($inp);
1470 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1474 $this->form_gui->addItem($cs);
1484 $this->form_gui->addItem($em);
1491 $this->form_gui->addItem($em);
1499 $hob->setRequired(isset(
$settings[
"require_hobby"]) &&
1501 $this->form_gui->addItem($hob);
1509 $rc->setRequired(isset(
$settings[
"require_referral_comment"]) &&
1511 $this->form_gui->addItem($rc);
1518 $sh->setTitle(
$lng->txt(
"interests"));
1519 $this->form_gui->addItem($sh);
1521 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1522 foreach ($multi_fields as $multi_field) {
1526 $ti->setMulti(
true);
1527 $ti->setMaxLength(40);
1529 $ti->setRequired(isset(
$settings[
"require_" . $multi_field]) &&
1531 $this->form_gui->addItem($ti);
1539 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1540 $this->form_gui->addItem($sec_oi);
1547 $mr->setMaxLength(40);
1548 $mr->setRequired(isset(
$settings[
"require_matriculation"]) &&
1550 $this->form_gui->addItem($mr);
1556 $ip->setMaxLength(255);
1557 $ip->setInfo($this->lng->txt(
"current_ip") .
" " .
$_SERVER[
"REMOTE_ADDR"] .
" <br />" .
1558 '<span class="warning">' . $this->lng->txt(
"current_ip_alert") .
"</span>");
1559 $this->form_gui->addItem($ip);
1562 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1566 $all_defs = $user_defined_fields->getDefinitions();
1568 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1571 foreach ($all_defs as $field_id => $definition) {
1572 include_once
'./Services/User/classes/class.ilCustomUserFieldsHelper.php';
1575 $this->form_gui->addItem($f_property);
1581 $a_mode ==
'create' or
1590 $sec_st->setTitle($this->lng->txt(
"settings"));
1591 $this->form_gui->addItem($sec_st);
1595 if ($a_mode ==
"create") {
1597 $lng->txt(
"default_role"),
1600 $role->setRequired(
true);
1601 $role->setValue($this->default_role);
1602 $role->setOptions($this->selectable_roles);
1603 $this->form_gui->addItem($role);
1609 $lng->txt(
"language"),
1612 $languages =
$lng->getInstalledLanguages();
1613 $lng->loadLanguageModule(
"meta");
1615 foreach ($languages as $l) {
1616 $options[$l] =
$lng->txt(
"meta_l_" . $l);
1618 $lang->setOptions($options);
1620 $this->form_gui->addItem(
$lang);
1626 $lng->txt(
"skin_style"),
1632 $skins = $styleDefinition->getAllSkins();
1635 if (is_array($skins)) {
1639 foreach ($skins as $skin) {
1640 foreach ($skin->getStyles() as $style) {
1641 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
1646 $options[$skin->getId() .
":" . $style->getId()] = $skin->getName() .
" / " . $style->getName();
1651 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin") .
1652 ":" . $ilClientIniFile->readVariable(
"layout",
"style"));
1654 $this->form_gui->addItem($sk);
1660 $lng->txt(
"hits_per_page"),
1663 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1664 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1665 $hpp->setOptions($options);
1666 $hpp->setValue(
$ilSetting->get(
"hits_per_page"));
1667 $this->form_gui->addItem($hpp);
1683 $lng->loadLanguageModule(
"awrn");
1685 $default = (
$ilSetting->get(
'hide_own_online_status') ==
"n")
1686 ? $this->lng->txt(
"user_awrn_show")
1687 : $this->lng->txt(
"user_awrn_hide");
1690 "" => $this->lng->txt(
"user_awrn_default").
" (".$default.
")",
1691 "n" => $this->lng->txt(
"user_awrn_show"),
1692 "y" => $this->lng->txt(
"user_awrn_hide"));
1694 $os->setOptions($options);
1695 $os->setDisabled(
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1696 $os->setInfo(
$lng->txt(
"awrn_hide_from_awareness_info"));
1697 $this->form_gui->addItem($os);
1706 $lng->loadLanguageModule(
'buddysystem');
1708 if ($a_mode ==
'create') {
1711 $this->form_gui->addItem($os);
1714 $lng->loadLanguageModule(
'chatroom');
1716 if ($a_mode ==
'create') {
1719 $this->form_gui->addItem($chat_osc_acm);
1722 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
1723 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1725 $this->form_gui->addItem($cb);
1731 $sec_op->setTitle($this->lng->txt(
"options"));
1732 $this->form_gui->addItem($sec_op);
1739 $se->setChecked((
$ilUser->getPref(
'send_info_mails') ==
'y'));
1740 $this->form_gui->addItem($se);
1744 $irf->
setInfo(
$lng->txt(
'ignore_required_fields_info'));
1746 $this->form_gui->addItem($irf);
1751 if ($a_mode ==
"create" || $a_mode ==
"save") {
1752 $this->form_gui->addCommandButton(
"save",
$lng->txt(
"save"));
1754 if ($a_mode ==
"edit" || $a_mode ==
"update") {
1755 $this->form_gui->addCommandButton(
"update",
$lng->txt(
"save"));
1757 $this->form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
1786 return (
bool)
$settings[
'usr_settings_changeable_lua_' . $a_field];
1805 !
$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
1806 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1812 if (!
$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1813 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1817 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1819 if ($_FILES[
"userfile"][
"tmp_name"] ==
"") {
1820 if ($userfile_input->getDeletionFlag()) {
1821 $this->
object->removeUserPicture();
1825 if ($_FILES[
"userfile"][
"size"] == 0) {
1829 $image_dir = $webspace_dir .
"/usr_images";
1830 $store_file =
"usr_" . $this->
object->getId() .
"." .
"jpg";
1833 $this->
object->setPref(
"profile_image", $store_file);
1834 $this->
object->update();
1837 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1838 $uploaded_file = $image_dir .
"/upload_" . $this->
object->getId() .
"." . $pi[
"extension"];
1840 $_FILES[
"userfile"][
"tmp_name"],
1841 $_FILES[
"userfile"][
"name"],
1846 $this->ctrl->redirect($this,
"showProfile");
1848 chmod($uploaded_file, 0770);
1852 $show_file =
"$image_dir/usr_" . $this->
object->getId() .
".jpg";
1853 $thumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_small.jpg";
1854 $xthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1855 $xxthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1863 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file);
1864 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file);
1865 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file);
1866 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file);
1868 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
1869 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
1870 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
1871 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
1882 $image_dir = $webspace_dir .
"/usr_images";
1883 $file = $image_dir .
"/usr_" . $this->
object->getID() .
"." .
"jpg";
1884 $thumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_small.jpg";
1885 $xthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xsmall.jpg";
1886 $xxthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xxsmall.jpg";
1887 $upload_file = $image_dir .
"/upload_" . $this->
object->getID();
1890 $this->
object->setPref(
"profile_image",
"");
1891 $this->
object->update();
1892 ilUtil::sendSuccess($this->lng->txt(
"user_image_removed"));
1894 if (@is_file($file)) {
1897 if (@is_file($thumb_file)) {
1898 unlink($thumb_file);
1900 if (@is_file($xthumb_file)) {
1901 unlink($xthumb_file);
1903 if (@is_file($xxthumb_file)) {
1904 unlink($xxthumb_file);
1906 if (@is_file($upload_file)) {
1907 unlink($upload_file);
1924 $rbacadmin = $DIC[
'rbacadmin'];
1927 if (!
$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1928 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1931 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
1932 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
1935 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles)) {
1936 array_push($selected_roles, SYSTEM_ROLE_ID);
1939 $global_roles_all =
$rbacreview->getGlobalRoles();
1940 $assigned_roles_all =
$rbacreview->assignedRoles($this->object->getId());
1941 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
1942 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
1943 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
1944 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
1946 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
1947 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles))) {
1950 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role") .
"<br/>" . $this->lng->txt(
"action_aborted"),
true);
1951 $this->ctrl->redirect($this,
'roleassignment');
1954 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
1955 $rbacadmin->deassignUser($role, $this->object->getId());
1958 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
1959 $rbacadmin->assignUser($role, $this->object->getId(),
false);
1962 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
1965 $this->
object->update();
1967 ilUtil::sendSuccess($this->lng->txt(
"msg_roleassignment_changed"),
true);
1969 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
1970 $this->ctrl->redirect($this,
'roleassignment');
1972 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1988 $ilTabs = $DIC[
'ilTabs'];
1991 $ilTabs->activateTab(
"role_assignment");
1993 if (!
$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id) &&
1994 !
$access->isCurrentUserBasedOnPositionsAllowedTo(
"read_users", array($this->object->getId()))
1996 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
2005 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
2008 $this->tpl->setCurrentBlock(
"form_filter");
2009 $this->tpl->setVariable(
"FILTER_TXT_FILTER", $this->lng->txt(
'filter'));
2011 $this->tpl->setVariable(
"FILTER_ACTION", $this->ctrl->getFormAction($this));
2012 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
2013 $this->tpl->setVariable(
"FILTER_VALUE", $this->lng->txt(
'apply_filter'));
2014 $this->tpl->parseCurrentBlock();
2018 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2022 $role_list =
$rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"], $this->object->getId());
2023 $assigned_roles =
$rbacreview->assignedRoles($this->object->getId());
2027 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
2030 foreach ($role_list as $role) {
2032 $rolf =
$rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2042 if ($this->tree->isInTree($rolf[0])) {
2043 if ($rolf[0] == ROLE_FOLDER_ID) {
2044 $path = $this->lng->txt(
"global");
2046 $tmpPath = $this->tree->getPathFull($rolf[0]);
2059 $path = $tmpPath[count($tmpPath) - 1][
"title"];
2062 $path =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $role[
"obj_id"] .
")</b>";
2068 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
2069 or (!in_array(SYSTEM_ROLE_ID,
$rbacreview->assignedRoles(
$ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID)) {
2074 if ($role[
'obj_id'] == SYSTEM_ROLE_ID && !
$rbacreview->isAssigned(
$ilUser->getId(), SYSTEM_ROLE_ID)) {
2075 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
2081 if (substr($role[
"title"], 0, 3) ==
"il_") {
2083 $rolf_arr =
$rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2084 $rolf2 = $rolf_arr[0];
2089 $parent_node = $this->tree->getNodeData($rolf2);
2091 $role[
"description"] = $this->lng->txt(
"obj_" . $parent_node[
"type"]) .
" (#" . $parent_node[
"obj_id"] .
")";
2094 $role_ids[$counter] = $role[
"obj_id"];
2096 $result_set[$counter][] = $checkbox = ilUtil::formCheckBox(in_array($role[
"obj_id"], $assigned_roles),
"role_id[]", $role[
"obj_id"], $disabled) .
"<input type=\"hidden\" name=\"role_id_ctrl[]\" value=\"" . $role[
"obj_id"] .
"\"/>";
2097 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2098 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2099 $result_set[$counter][] = $link =
"<a href=\"" . $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm") .
"\">" .
ilObjRole::_getTranslation($role[
"title"]) .
"</a>";
2101 $result_set[$counter][] = $role[
"description"];
2104 if ($role[
"role_type"] ==
"local") {
2112 foreach ($ref_ids as
$ref_id) {
2115 require_once(
"./Services/Link/classes/class.ilLink.php");
2119 $result_set[$counter][] = $path;
2123 $records[] = array(
"path" => $path,
"description" => $role[
"description"],
2124 "context" =>
$context,
"checkbox" => $checkbox,
2125 "role" => $link,
"title" => $title);
2130 $tab->setData($records);
2131 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2141 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2143 $table_gui->writeFilterToSession();
2144 $table_gui->resetOffset();
2153 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2155 $table_gui->resetOffset();
2156 $table_gui->resetFilter();
2164 for (
$i = 0;
$i <= 60;
$i++) {
2165 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2170 for (
$i = 0;
$i < 24;
$i++) {
2171 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2176 for (
$i = 1;
$i < 32;
$i++) {
2177 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2182 for (
$i = 1;
$i < 13;
$i++) {
2183 $month[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2188 if ($a_selected < date(
'Y', time())) {
2189 $start = $a_selected;
2191 $start = date(
'Y', time());
2194 for (
$i = $start;
$i < date(
"Y", time()) + 11;++
$i) {
2204 $a_time_arr[
"hour"],
2205 $a_time_arr[
"minute"],
2206 $a_time_arr[
"second"],
2207 $a_time_arr[
"month"],
2223 $action[0] = $this->lng->txt(
'assigned_roles');
2224 $action[1] = $this->lng->txt(
'all_roles');
2225 $action[2] = $this->lng->txt(
'all_global_roles');
2226 $action[3] = $this->lng->txt(
'all_local_roles');
2227 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2228 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2235 parent::hitsperpageObject();
2247 $ilLocator = $DIC[
'ilLocator'];
2249 $ilLocator->clearItems();
2251 if (
$_GET[
"admin_mode"] ==
"settings") {
2252 $this->ctrl->setParameterByClass(
2253 "ilobjsystemfoldergui",
2257 $ilLocator->addItem(
2258 $this->lng->txt(
"administration"),
2259 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2264 $ilLocator->addItem(
2268 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view")
2270 } elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID) {
2271 $ilLocator->addItem(
2275 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view")
2279 if (
$_GET[
"obj_id"] > 0) {
2280 $ilLocator->addItem(
2281 $this->object->getTitle(),
2282 $this->ctrl->getLinkTarget($this,
"view")
2294 public function __sendProfileMail()
2299 $ilias = $DIC[
'ilias'];
2301 if (
$_POST[
'send_mail'] !=
'y') {
2304 if (!strlen($this->object->getEmail())) {
2309 $usr_lang =
new ilLanguage($this->object->getLanguage());
2311 $usr_lang->loadLanguageModule(
'registration');
2313 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2316 $senderFactory =
$GLOBALS[
'DIC'][
"mail.mime.sender.factory"];
2319 $mmail->From($senderFactory->system());
2321 $mailOptions = new \ilMailOptions($this->object->getId());
2322 $mmail->To($mailOptions->getExternalEmailAddresses());
2325 $subject = $usr_lang->txt(
"profile_changed");
2329 $body = ($usr_lang->txt(
"reg_mail_body_salutation") .
" " . $this->
object->getFullname() .
",\n\n");
2331 $date = $this->
object->getApproveDate();
2333 if ((time() - strtotime($date)) < 10) {
2334 $body .= ($usr_lang->txt(
'reg_mail_body_approve') .
"\n\n");
2336 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n");
2340 if (
$_POST[
'passwd'] !=
'') {
2341 $body .= $usr_lang->txt(
"reg_mail_body_text2") .
"\n" .
2342 ILIAS_HTTP_PATH .
"/login.php?client_id=" . $ilias->client_id .
"\n" .
2343 $usr_lang->txt(
"login") .
": " . $this->
object->getLogin() .
"\n" .
2344 $usr_lang->txt(
"passwd") .
": " .
$_POST[
'passwd'] .
"\n\n";
2346 $body .= ($usr_lang->txt(
"reg_mail_body_text3") .
"\n");
2347 $body .= $this->
object->getProfileAsString($usr_lang);
2349 $mmail->Subject($subject,
true);
2350 $mmail->Body($body);
2354 return "<br/>" . $this->lng->txt(
"mail_sent");
2368 if ($a_target == md5(
"usrdelown")) {
2369 if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
2371 $ilCtrl->initBaseClass(
"ildashboardgui");
2372 $ilCtrl->redirectByClass(array(
"ildashboardgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2374 exit(
"This account is not flagged for deletion.");
2378 if (substr($a_target, -4) ==
"_bdg") {
2379 $_GET[
"baseClass"] =
"ilDashboardGUI";
2380 $_GET[
"cmd"] =
"jumpToBadges";
2381 include(
"ilias.php");
2385 if (
'registration' == $a_target) {
2386 $_GET[
"baseClass"] =
'ilStartUpGUI';
2387 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilAccountRegistrationGUI'),
'');
2388 } elseif (
'nameassist' == $a_target) {
2389 $_GET[
"baseClass"] =
'ilStartUpGUI';
2390 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'showUsernameAssistanceForm');
2391 } elseif (
'pwassist' == $a_target) {
2392 $_GET[
"baseClass"] =
'ilStartUpGUI';
2393 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'');
2394 } elseif (
'agreement' == $a_target) {
2396 $ilCtrl->setTargetScript(
'ilias.php');
2397 $ilCtrl->initBaseClass(
'ildashboardgui');
2398 $ilCtrl->redirectByClass(array(
'ildashboardgui',
'ilpersonalprofilegui'),
'showUserAgreement');
2400 $_GET[
'baseClass'] =
'ilStartUpGUI';
2401 $ilCtrl->setTargetScript(
'ilias.php');
2402 $ilCtrl->redirectByClass(array(
'ilStartUpGUI'),
'showTermsOfService');
2406 if (substr($a_target, 0, 1) ==
"n") {
2410 if (strpos($a_target,
'contact_approved') !==
false) {
2411 $_GET[
'cmd'] =
'approveContactRequest';
2412 } elseif (strpos($a_target,
'contact_ignored') !==
false) {
2413 $_GET[
'cmd'] =
'ignoreContactRequest';
2415 $_GET[
'cmd'] =
'view';
2418 $_GET[
"user_id"] = (int) $a_target;
2419 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2420 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2421 include(
"ilias.php");
2435 $profileMaybeIncomplete =
false;
2437 require_once
'Services/User/classes/class.ilUserProfile.php';
2440 $elm = $this->form_gui->getItemByPostVar($fieldName);
2446 if ($elm->getRequired()) {
2447 $profileMaybeIncomplete =
true;
2450 $elm->setRequired(
false);
2454 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2456 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
2457 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $definition[
'field_id']);
2463 if ($elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible']) {
2464 $profileMaybeIncomplete =
true;
2467 $elm->setRequired(
false);
2471 return $profileMaybeIncomplete;
2477 protected function showAcceptedTermsOfService()
2480 $agreeDate = $this->form_gui->getItemByPostVar(
'agree_date');
2481 if ($agreeDate && $agreeDate->getValue()) {
2482 $this->lng->loadLanguageModule(
'tos');
2483 $helper = new \ilTermsOfServiceHelper();
2485 $entity = $helper->getCurrentAcceptanceForUser($this->
object);
2486 if ($entity->getId()) {
2487 $modal = $this->uiFactory
2490 $this->uiFactory->modal()->lightboxTextPage($entity->getText(), $entity->getTitle())
2493 $titleLink = $this->uiFactory
2495 ->shy($entity->getTitle(),
'#')
2496 ->withOnClick($modal->getShowSignal());
2499 $this->lng->txt(
'tos_agreement_document'),
2503 $agreementDocument->
setValue($this->uiRenderer->render([$titleLink, $modal]));
2504 $agreeDate->addSubItem($agreementDocument);
2506 } elseif ($agreeDate) {
2507 $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
static _isActive()
Static getter.
Class ChatMainBarProvider .
removeUserPictureObject()
remove user image
static MB2Bytes($a_value)
static _lookupPersonalWorkspaceDiskQuota($a_user_id)
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 _isPersonalWorkspaceActive()
Static getter.
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 _getAllReferences($a_id)
get all reference ids of object
static _goto($a_target)
Goto user profile screen.
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 _lookupDiskQuota($a_user_id)
Gets the disk quota info for the specified user account.
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)
static Bytes2MB($a_value)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
redirection script todo: (a better solution should control the processing via a xml file) ...
static clear($a_var)
Unset a value.
editObject()
Display user edit form.
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 getFilesizeByOwner($a_owner_id)
Get current storage size for owner.
static _getTranslation($a_role_title)
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _lookupDiskUsage($a_user_id)
Gets the disk usage info for the specified user account.
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.
static _getPersonalPicturePath( $a_usr_id, $a_size="small", $a_force_pic=false, $a_prevent_no_photo_image=false)
Get path to personal picture.
loadLanguageModule($a_module)
saveObject()
save user data public
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
const USER_FOLDER_ID
Class ilObjUserFolder.
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
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
static _getInstance()
Get instance of ilSecuritySettings.
Class ilObjUserTrackingGUI.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
roleassignmentObject()
display roleassignment panel
static getFilesizeByTypeAndOwner($a_owner_id)
Get current storage size for owner (grouped by type)