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);
83 parent::__construct($a_data, $a_id, $a_call_by_reference,
false);
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",
105 $rbacsystem = $DIC[
'rbacsystem'];
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');
180 $rbacsystem = $DIC[
'rbacsystem'];
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();
313 $rbacsystem = $DIC[
'rbacsystem'];
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;
363 $this->default_role = array_shift(
$keys);
365 $this->selectable_roles = $rol;
376 $rbacsystem = $DIC[
'rbacsystem'];
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'];
403 $rbacsystem = $DIC[
'rbacsystem'];
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"]);
460 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
468 $sknst = explode(
":",
$_POST[
"skin_style"]);
470 if ($userObj->getPref(
"style") != $sknst[1] ||
471 $userObj->getPref(
"skin") != $sknst[0]) {
472 $userObj->setPref(
"skin", $sknst[0]);
473 $userObj->setPref(
"style", $sknst[1]);
477 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
484 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
487 $userObj->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
490 $userObj->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
492 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
493 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
495 $userObj->writePrefs();
498 $rbacadmin->assignUser(
$_POST[
"default_role"], $userObj->getId(),
true);
500 $msg = $this->lng->txt(
"user_added");
502 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
505 $this->
object = $userObj;
511 if ($profileMaybeIncomplete) {
512 include_once
'Services/User/classes/class.ilUserProfile.php';
514 $this->
object->setProfileIncomplete(
true);
515 $this->
object->update();
520 if (
$_POST[
'send_mail'] ==
'y') {
521 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
523 $acc_mail->useLangVariablesAsFallback(
true);
524 $acc_mail->setAttachConfiguredFiles(
true);
525 $acc_mail->setUserPassword(
$_POST[
'passwd']);
526 $acc_mail->setUser($userObj);
528 if ($acc_mail->send()) {
529 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_sent');
530 ilUtil::sendSuccess($msg,
true);
532 $msg = $msg .
'<br />' . $this->lng->txt(
'mail_not_sent');
536 ilUtil::sendSuccess($msg,
true);
540 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
541 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
543 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
546 $this->form_gui->setValuesByPost();
547 $tpl->setContent($this->form_gui->getHtml());
561 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
567 if ($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
568 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
574 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
575 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
580 $this->tabs_gui->clearTargets();
584 $this->initForm(
"edit");
586 $this->showAcceptedTermsOfService();
587 $this->tpl->setContent($this->form_gui->getHTML());
611 $from = $this->form_gui->getItemByPostVar(
'time_limit_from')->getDate();
616 $until = $this->form_gui->getItemByPostVar(
'time_limit_until')->getDate();
617 $user->setTimeLimitUntil($until
621 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
623 if ($a_mode ==
'create') {
624 $user->setTimeLimitOwner($this->usrf_ref_id);
629 $bd = $this->form_gui->getItemByPostVar(
'birthday');
630 $bd = $bd->getDate();
631 $user->setBirthday($bd
637 $user->setLogin($this->form_gui->getInput(
'login'));
642 $user->setGender($this->form_gui->getInput(
'gender'));
647 $user->setUTitle($this->form_gui->getInput(
'title'));
652 $user->setFirstname($this->form_gui->getInput(
'firstname'));
656 $user->setLastname($this->form_gui->getInput(
'lastname'));
658 $user->setFullname();
662 $user->setInstitution($this->form_gui->getInput(
'institution'));
667 $user->setDepartment($this->form_gui->getInput(
'department'));
671 $user->setStreet($this->form_gui->getInput(
'street'));
675 $user->setCity($this->form_gui->getInput(
'city'));
679 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
683 $user->setCountry($this->form_gui->getInput(
'country'));
687 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
691 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
695 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
699 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
703 $user->setFax($this->form_gui->getInput(
'fax'));
707 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
711 $user->setEmail($this->form_gui->getInput(
'email'));
715 $user->setSecondEmail($this->form_gui->getInput(
'second_email'));
719 $user->setHobby($this->form_gui->getInput(
'hobby'));
723 $user->setComment($this->form_gui->getInput(
'referral_comment'));
727 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
728 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
729 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
732 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
735 $user->setLatitude($this->form_gui->getInput(
'latitude'));
736 $user->setLongitude($this->form_gui->getInput(
'longitude'));
737 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
740 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
741 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
743 if ((
int)
$user->getActive() != (int) $this->form_gui->getInput(
'active')) {
744 $user->setActive($this->form_gui->getInput(
'active'),
$ilUser->getId());
759 $rbacsystem = $DIC[
'rbacsystem'];
760 $ilias = $DIC[
'ilias'];
765 if ($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write', $this->usrf_ref_id)) {
766 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
772 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
773 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
776 $this->initForm(
"edit");
779 unset(
$_POST[
'approve_date']);
780 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
781 unset(
$_POST[
'last_login']);
784 $profileMaybeIncomplete =
false;
785 if ($this->form_gui->getInput(
'ignore_rf',
false)) {
789 if ($this->form_gui->checkInput()) {
793 && trim(
$_POST[
'passwd']) !=
"") {
801 if (
$_POST[
'active'] == 1) {
805 #$this->object->assignData($_POST); 809 foreach (
$_POST as $k => $v) {
810 if (substr($k, 0, 4) ==
"udf_") {
811 $udf[substr($k, 4)] = $v;
814 $this->
object->setUserDefinedData($udf);
817 $this->
object->updateLogin(
$_POST[
'login']);
820 $this->form_gui->setValuesByPost();
821 return $tpl->setContent($this->form_gui->getHtml());
824 $this->
object->setTitle($this->object->getFullname());
825 $this->
object->setDescription($this->object->getEmail());
828 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
831 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
843 $sknst = explode(
":",
$_POST[
"skin_style"]);
845 if ($this->object->getPref(
"style") != $sknst[1] ||
846 $this->
object->getPref(
"skin") != $sknst[0]) {
847 $this->
object->setPref(
"skin", $sknst[0]);
848 $this->
object->setPref(
"style", $sknst[1]);
852 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
859 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"]);
862 $this->
object->setPref(
'bs_allow_to_contact_me',
$_POST[
'bs_allow_to_contact_me'] ?
'y' :
'n');
865 $this->
object->setPref(
'chat_osc_accept_msg',
$_POST[
'chat_osc_accept_msg'] ?
'y' :
'n');
870 $this->
object->setLastPasswordChangeTS(time());
875 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
876 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
880 $this->
object->setProfileIncomplete(
false);
882 $this->
update = $this->
object->update();
887 if (
$ilUser->getId() == $this->
object->getId()) {
890 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
893 $mail_message = $this->__sendProfileMail();
894 $msg = $this->lng->txt(
'saved_successfully') . $mail_message;
901 if ($profileMaybeIncomplete) {
902 include_once
'Services/User/classes/class.ilUserProfile.php';
904 $this->
object->setProfileIncomplete(
true);
905 $this->
object->update();
910 ilUtil::sendSuccess($msg,
true);
912 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
913 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
915 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
918 $this->form_gui->setValuesByPost();
919 $tpl->setContent($this->form_gui->getHtml());
936 $data[
"auth_mode"] = $this->
object->getAuthMode();
937 $data[
"login"] = $this->
object->getLogin();
940 $data[
"ext_account"] = $this->
object->getExternalAccount();
945 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
948 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
951 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
954 $data[
"active"] = $this->
object->getActive();
955 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
957 $data[
"time_limit_from"] = $this->
object->getTimeLimitFrom()
960 $data[
"time_limit_until"] = $this->
object->getTimeLimitUntil()
966 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
971 $data[
"wsp_disk_quota"] =
ilUtil::Bytes2MB($this->object->getPersonalWorkspaceDiskQuota());
993 $data[
"gender"] = $this->
object->getGender();
994 $data[
"firstname"] = $this->
object->getFirstname();
995 $data[
"lastname"] = $this->
object->getLastname();
996 $data[
"title"] = $this->
object->getUTitle();
997 $data[
'birthday'] = $this->
object->getBirthday()
1000 $data[
"institution"] = $this->
object->getInstitution();
1001 $data[
"department"] = $this->
object->getDepartment();
1002 $data[
"street"] = $this->
object->getStreet();
1003 $data[
"city"] = $this->
object->getCity();
1004 $data[
"zipcode"] = $this->
object->getZipcode();
1005 $data[
"country"] = $this->
object->getCountry();
1006 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1007 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1008 $data[
"phone_home"] = $this->
object->getPhoneHome();
1009 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1010 $data[
"fax"] = $this->
object->getFax();
1011 $data[
"email"] = $this->
object->getEmail();
1012 $data[
"second_email"] = $this->
object->getSecondEmail();
1013 $data[
"hobby"] = $this->
object->getHobby();
1014 $data[
"referral_comment"] = $this->
object->getComment();
1017 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1018 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1019 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1022 $data[
"matriculation"] = $this->
object->getMatriculation();
1023 $data[
"client_ip"] = $this->
object->getClientIP();
1026 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1028 $user_defined_data = $this->
object->getUserDefinedData();
1029 foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
1030 $data[
"udf_" . $field_id] = $user_defined_data[
"f_" . $field_id];
1034 $data[
"language"] = $this->
object->getLanguage();
1035 $data[
"skin_style"] = $this->
object->skin .
":" . $this->
object->prefs[
"style"];
1036 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1038 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"];
1039 $data[
'bs_allow_to_contact_me'] = $this->
object->prefs[
'bs_allow_to_contact_me'] ==
'y';
1040 $data[
'chat_osc_accept_msg'] = $this->
object->prefs[
'chat_osc_accept_msg'] ==
'y';
1041 $data[
"session_reminder_enabled"] = (int) $this->object->prefs[
"session_reminder_enabled"];
1043 $data[
"send_mail"] = ($this->object->prefs[
'send_info_mails'] ==
'y');
1046 $this->form_gui->setValuesByArray($data);
1052 public function initForm($a_mode)
1058 $styleDefinition = $DIC[
'styleDefinition'];
1060 $ilClientIniFile = $DIC[
'ilClientIniFile'];
1065 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1068 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this));
1069 if ($a_mode ==
"create") {
1070 $this->form_gui->setTitle(
$lng->txt(
"usr_new"));
1072 $this->form_gui->setTitle(
$lng->txt(
"usr_edit"));
1077 $sec_l->setTitle(
$lng->txt(
"login_data"));
1078 $this->form_gui->addItem($sec_l);
1081 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1085 foreach ($active_auth_modes as $auth_name => $auth_key) {
1086 if ($auth_name ==
'default') {
1090 #$name = $this->lng->txt('auth_'.$auth_name); 1091 include_once
'./Services/Authentication/classes/class.ilAuthUtils.php';
1095 $option[$auth_name] =
$name;
1097 $am->setOptions($option);
1098 $this->form_gui->addItem($am);
1100 if ($a_mode ==
"edit") {
1102 $id->setValue($this->object->getId());
1103 $this->form_gui->addItem(
$id);
1109 if ($a_mode ==
"edit") {
1110 $lo->setCurrentUserId($this->object->getId());
1112 include_once
'Services/Calendar/classes/class.ilDate.php';
1117 $this->lng->txt(
'usr_loginname_history_info'),
1119 $last_history_entry[0]
1126 $this->form_gui->addItem($lo);
1135 $pw->setMaxLength(80);
1136 $pw->setValidateAuthPost(
"auth_mode");
1137 if ($a_mode ==
"create") {
1138 $pw->setRequiredOnAuth(
true);
1141 $this->form_gui->addItem($pw);
1146 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1150 $ext->setMaxLength(250);
1151 $ext->setInfo(
$lng->txt(
"user_ext_account_desc"));
1152 $this->form_gui->addItem($ext);
1157 $sec_si->setTitle($this->lng->txt(
"system_information"));
1158 $this->form_gui->addItem($sec_si);
1161 if ($a_mode ==
"edit") {
1162 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1163 foreach ($sia as $a) {
1165 $this->form_gui->addItem($siai);
1172 $this->form_gui->addItem($ac);
1175 $lng->loadLanguageModule(
'crs');
1181 $radg->addOption($op1);
1183 $radg->addOption($op2);
1192 $acfrom->setShowTime(
true);
1194 $op2->addSubItem($acfrom);
1199 $acto->setShowTime(
true);
1201 $op2->addSubItem($acto);
1204 $this->form_gui->addItem($radg);
1206 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1208 $lng->loadLanguageModule(
"file");
1211 $quota_head->setTitle(
$lng->txt(
"repository_disk_quota"));
1212 $this->form_gui->addItem($quota_head);
1217 $disk_quota->setMaxLength(11);
1218 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1219 $this->form_gui->addItem($disk_quota);
1221 if ($a_mode ==
"edit") {
1223 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1225 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota']) {
1226 $info_text = sprintf(
1227 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1230 $dq_info[
'role_title']
1232 } elseif (is_infinite($dq_info[
'role_disk_quota'])) {
1233 $info_text = sprintf(
$lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1235 $info_text = sprintf(
1236 $lng->txt(
'disk_quota_is_1_by_2'),
1238 $dq_info[
'role_title']
1241 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1247 if ($du_info[
'last_update'] === null) {
1251 $info =
'<table class="il_user_quota_disk_usage_overview">';
1253 foreach ($du_info[
'details'] as $detail_data) {
1255 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1256 '<td class="std">' .
$lng->txt($detail_data[
'type']) .
'</td>' .
1261 $info .=
'</table>';
1262 $info .=
'<br>' . $this->lng->txt(
'last_update') .
': ' .
1264 $disk_usage->setInfo(
$info);
1266 $this->form_gui->addItem($disk_usage);
1269 if (
true || $dq_info[
'last_reminder']) {
1274 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1275 $this->form_gui->addItem($reminder);
1281 $lng->loadLanguageModule(
"file");
1284 $quota_head->setTitle(
$lng->txt(
"personal_workspace_disk_quota"));
1285 $this->form_gui->addItem($quota_head);
1290 $wsp_disk_quota->setMaxLength(11);
1291 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1292 $this->form_gui->addItem($wsp_disk_quota);
1294 if ($a_mode ==
"edit") {
1296 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1298 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota']) {
1299 $info_text = sprintf(
1300 $lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1303 $dq_info[
'role_title']
1305 } elseif (is_infinite($dq_info[
'role_wsp_disk_quota'])) {
1306 $info_text = sprintf(
$lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1308 $info_text = sprintf(
1309 $lng->txt(
'disk_quota_is_1_by_2'),
1311 $dq_info[
'role_title']
1314 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc") .
'<br>' . $info_text);
1318 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1321 if (!
sizeof($du_info)) {
1325 $info =
'<table class="il_user_quota_disk_usage_overview">';
1327 foreach ($du_info as $detail_data) {
1329 '<td class="std">' . $detail_data[
'count'] .
'</td>' .
1330 '<td class="std">' .
$lng->txt(
"obj_" . $detail_data[
"src_type"]) .
'</td>' .
1331 '<td class="std">' .
ilUtil::formatSize($detail_data[
'filesize'],
'short') .
'</td>' .
1335 $info .=
'</table>';
1336 $disk_usage->setInfo(
$info);
1338 $this->form_gui->addItem($disk_usage);
1351 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1352 $this->form_gui->addItem($sec_pd);
1360 $gndr->addOption($neutral);
1362 $gndr->addOption($female);
1364 $gndr->addOption($male);
1365 $this->form_gui->addItem($gndr);
1369 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1371 foreach ($fields as $field =>
$req) {
1374 $caption = ($field ==
"title")
1379 $inp->setMaxLength(32);
1380 $inp->setRequired(
$req);
1381 $this->form_gui->addItem($inp);
1388 if ($a_mode ==
"edit" || $a_mode ==
"upload") {
1389 $pi->
setImage(ilObjUser::_getPersonalPicturePath(
1390 $this->object->getId(),
1396 $this->form_gui->addItem($pi);
1402 $this->form_gui->addItem($birthday);
1409 array(
"institution", 40, 80),
1410 array(
"department", 40, 80),
1411 array(
"street", 40, 40),
1412 array(
"city", 40, 40),
1413 array(
"zipcode", 10, 10),
1414 array(
"country", 40, 40),
1415 array(
"sel_country"),
1416 array(
"phone_office", 30, 30),
1417 array(
"phone_home", 30, 30),
1418 array(
"phone_mobile", 30, 30),
1419 array(
"fax", 30, 30));
1422 foreach ($fields as $field) {
1426 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1427 $this->form_gui->addItem($sec_cd);
1430 if ($a_mode ==
"edit") {
1432 $orgus->
setValue($this->object->getOrgUnitsRepresentation());
1433 $this->form_gui->addItem($orgus);
1437 if ($field[0] !=
"sel_country") {
1440 $inp->setMaxLength($field[2]);
1441 $inp->setRequired(isset(
$settings[
"require_" . $field[0]]) &&
1443 $this->form_gui->addItem($inp);
1446 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1450 $this->form_gui->addItem($cs);
1460 $this->form_gui->addItem($em);
1467 $this->form_gui->addItem($em);
1475 $hob->setRequired(isset(
$settings[
"require_hobby"]) &&
1477 $this->form_gui->addItem($hob);
1485 $rc->setRequired(isset(
$settings[
"require_referral_comment"]) &&
1487 $this->form_gui->addItem($rc);
1494 $sh->setTitle(
$lng->txt(
"interests"));
1495 $this->form_gui->addItem($sh);
1497 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1498 foreach ($multi_fields as $multi_field) {
1503 $ti->setMaxLength(40);
1505 $ti->setRequired(isset(
$settings[
"require_" . $multi_field]) &&
1507 $this->form_gui->addItem($ti);
1515 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1516 $this->form_gui->addItem($sec_oi);
1523 $mr->setMaxLength(40);
1524 $mr->setRequired(isset(
$settings[
"require_matriculation"]) &&
1526 $this->form_gui->addItem($mr);
1532 $ip->setMaxLength(255);
1533 $ip->setInfo($this->lng->txt(
"current_ip") .
" " .
$_SERVER[
"REMOTE_ADDR"] .
" <br />" .
1534 '<span class="warning">' . $this->lng->txt(
"current_ip_alert") .
"</span>");
1535 $this->form_gui->addItem($ip);
1538 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1542 $all_defs = $user_defined_fields->getDefinitions();
1544 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1547 foreach ($all_defs as $field_id => $definition) {
1548 include_once
'./Services/User/classes/class.ilCustomUserFieldsHelper.php';
1551 $this->form_gui->addItem($f_property);
1557 $a_mode ==
'create' or 1566 $sec_st->setTitle($this->lng->txt(
"settings"));
1567 $this->form_gui->addItem($sec_st);
1571 if ($a_mode ==
"create") {
1573 $lng->txt(
"default_role"),
1577 $role->setValue($this->default_role);
1578 $role->setOptions($this->selectable_roles);
1579 $this->form_gui->addItem($role);
1585 $lng->txt(
"language"),
1589 $lng->loadLanguageModule(
"meta");
1591 foreach ($languages as
$l) {
1596 $this->form_gui->addItem(
$lang);
1602 $lng->txt(
"skin_style"),
1608 $skins = $styleDefinition->getAllSkins();
1611 if (is_array($skins)) {
1615 foreach ($skins as $skin) {
1616 foreach ($skin->getStyles() as
$style) {
1617 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
1622 $options[$skin->getId() .
":" .
$style->getId()] = $skin->getName() .
" / " .
$style->getName();
1627 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin") .
1628 ":" . $ilClientIniFile->readVariable(
"layout",
"style"));
1630 $this->form_gui->addItem($sk);
1636 $lng->txt(
"hits_per_page"),
1639 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1640 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1641 $hpp->setOptions($options);
1642 $hpp->setValue(
$ilSetting->get(
"hits_per_page"));
1643 $this->form_gui->addItem($hpp);
1659 $lng->loadLanguageModule(
"awrn");
1662 ? $this->lng->txt(
"user_awrn_show")
1663 : $this->lng->txt(
"user_awrn_hide");
1666 "" => $this->lng->txt(
"user_awrn_default").
" (".
$default.
")",
1667 "n" => $this->lng->txt(
"user_awrn_show"),
1668 "y" => $this->lng->txt(
"user_awrn_hide"));
1671 $os->setDisabled(
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
1672 $os->setInfo(
$lng->txt(
"awrn_hide_from_awareness_info"));
1673 $this->form_gui->addItem($os);
1682 $lng->loadLanguageModule(
'buddysystem');
1684 if ($a_mode ==
'create') {
1687 $this->form_gui->addItem($os);
1690 $lng->loadLanguageModule(
'chatroom');
1692 if ($a_mode ==
'create') {
1695 $this->form_gui->addItem($chat_osc_acm);
1698 if ((
int)
$ilSetting->get(
'session_reminder_enabled')) {
1699 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1701 $this->form_gui->addItem($cb);
1707 $sec_op->setTitle($this->lng->txt(
"options"));
1708 $this->form_gui->addItem($sec_op);
1715 $se->setChecked((
$ilUser->getPref(
'send_info_mails') ==
'y'));
1716 $this->form_gui->addItem($se);
1720 $irf->
setInfo(
$lng->txt(
'ignore_required_fields_info'));
1722 $this->form_gui->addItem($irf);
1727 if ($a_mode ==
"create" || $a_mode ==
"save") {
1728 $this->form_gui->addCommandButton(
"save",
$lng->txt(
"save"));
1730 if ($a_mode ==
"edit" || $a_mode ==
"update") {
1731 $this->form_gui->addCommandButton(
"update",
$lng->txt(
"save"));
1733 $this->form_gui->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
1762 return (
bool)
$settings[
'usr_settings_changeable_lua_' . $a_field];
1777 $rbacsystem = $DIC[
'rbacsystem'];
1781 !$rbacsystem->checkAccess(
'visible,read', $this->usrf_ref_id)) {
1782 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1788 if (!$rbacsystem->checkAccess(
'cat_administrate_users', $this->object->getTimeLimitOwner())) {
1789 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"), $this->
ilias->error_obj->MESSAGE);
1793 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1795 if ($_FILES[
"userfile"][
"tmp_name"] ==
"") {
1796 if ($userfile_input->getDeletionFlag()) {
1797 $this->
object->removeUserPicture();
1801 if ($_FILES[
"userfile"][
"size"] == 0) {
1805 $image_dir = $webspace_dir .
"/usr_images";
1806 $store_file =
"usr_" . $this->
object->getId() .
"." .
"jpg";
1809 $this->
object->setPref(
"profile_image", $store_file);
1810 $this->
object->update();
1813 $pi = pathinfo($_FILES[
"userfile"][
"name"]);
1814 $uploaded_file = $image_dir .
"/upload_" . $this->
object->getId() .
"." . $pi[
"extension"];
1815 if (!ilUtil::moveUploadedFile(
1816 $_FILES[
"userfile"][
"tmp_name"],
1817 $_FILES[
"userfile"][
"name"],
1822 $this->ctrl->redirect($this,
"showProfile");
1824 chmod($uploaded_file, 0770);
1828 $show_file =
"$image_dir/usr_" . $this->
object->getId() .
".jpg";
1829 $thumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_small.jpg";
1830 $xthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xsmall.jpg";
1831 $xxthumb_file =
"$image_dir/usr_" . $this->
object->getId() .
"_xxsmall.jpg";
1839 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:" . $show_file);
1840 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:" . $thumb_file);
1841 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:" . $xthumb_file);
1842 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:" . $xxthumb_file);
1844 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:" . $show_file);
1845 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:" . $thumb_file);
1846 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:" . $xthumb_file);
1847 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:" . $xxthumb_file);
1858 $image_dir = $webspace_dir .
"/usr_images";
1859 $file = $image_dir .
"/usr_" . $this->
object->getID() .
"." .
"jpg";
1860 $thumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_small.jpg";
1861 $xthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xsmall.jpg";
1862 $xxthumb_file = $image_dir .
"/usr_" . $this->
object->getID() .
"_xxsmall.jpg";
1863 $upload_file = $image_dir .
"/upload_" . $this->
object->getID();
1866 $this->
object->setPref(
"profile_image",
"");
1867 $this->
object->update();
1868 ilUtil::sendSuccess($this->lng->txt(
"user_image_removed"));
1870 if (@is_file($file)) {
1873 if (@is_file($thumb_file)) {
1874 unlink($thumb_file);
1876 if (@is_file($xthumb_file)) {
1877 unlink($xthumb_file);
1879 if (@is_file($xxthumb_file)) {
1880 unlink($xxthumb_file);
1882 if (@is_file($upload_file)) {
1883 unlink($upload_file);
1899 $rbacsystem = $DIC[
'rbacsystem'];
1900 $rbacadmin = $DIC[
'rbacadmin'];
1903 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1904 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1907 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
1908 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
1911 if ($this->object->getId() == SYSTEM_USER_ID
and in_array(SYSTEM_ROLE_ID, $posted_roles)) {
1912 array_push($selected_roles, SYSTEM_ROLE_ID);
1915 $global_roles_all =
$rbacreview->getGlobalRoles();
1916 $assigned_roles_all =
$rbacreview->assignedRoles($this->object->getId());
1917 $assigned_roles = array_intersect($assigned_roles_all, $posted_roles);
1918 $assigned_global_roles_all = array_intersect($assigned_roles_all, $global_roles_all);
1919 $assigned_global_roles = array_intersect($assigned_global_roles_all, $posted_roles);
1920 $posted_global_roles = array_intersect($selected_roles, $global_roles_all);
1922 if ((empty($selected_roles)
and count($assigned_roles_all) == count($assigned_roles))
1923 or (empty($posted_global_roles)
and count($assigned_global_roles_all) == count($assigned_global_roles))) {
1926 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role") .
"<br/>" . $this->lng->txt(
"action_aborted"),
true);
1927 $this->ctrl->redirect($this,
'roleassignment');
1930 foreach (array_diff($assigned_roles, $selected_roles) as $role) {
1931 $rbacadmin->deassignUser($role, $this->object->getId());
1934 foreach (array_diff($selected_roles, $assigned_roles) as $role) {
1935 $rbacadmin->assignUser($role, $this->object->getId(),
false);
1938 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
1941 $this->
object->update();
1943 ilUtil::sendSuccess($this->lng->txt(
"msg_roleassignment_changed"),
true);
1945 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui') {
1946 $this->ctrl->redirect($this,
'roleassignment');
1948 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
1962 $rbacsystem = $DIC[
'rbacsystem'];
1964 $ilTabs = $DIC[
'ilTabs'];
1966 $ilTabs->activateTab(
"role_assignment");
1968 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id)) {
1969 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"), $this->
ilias->error_obj->MESSAGE);
1978 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
1981 $this->tpl->setCurrentBlock(
"filter");
1982 $this->tpl->setVariable(
"FILTER_TXT_FILTER", $this->lng->txt(
'filter'));
1984 $this->tpl->setVariable(
"FILTER_ACTION", $this->ctrl->getFormAction($this));
1985 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
1986 $this->tpl->setVariable(
"FILTER_VALUE", $this->lng->txt(
'apply_filter'));
1987 $this->tpl->parseCurrentBlock();
1991 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
1995 $role_list =
$rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"], $this->object->getId());
1996 $assigned_roles =
$rbacreview->assignedRoles($this->object->getId());
2000 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
2003 foreach ($role_list as $role) {
2005 $rolf =
$rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2015 if ($this->tree->isInTree($rolf[0])) {
2016 if ($rolf[0] == ROLE_FOLDER_ID) {
2017 $path = $this->lng->txt(
"global");
2019 $tmpPath = $this->tree->getPathFull($rolf[0]);
2032 $path = $tmpPath[count($tmpPath) - 1][
"title"];
2035 $path =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $role[
"obj_id"] .
")</b>";
2041 if (($this->object->getId() == SYSTEM_USER_ID
and $role[
"obj_id"] == SYSTEM_ROLE_ID)
2042 or (!in_array(SYSTEM_ROLE_ID,
$rbacreview->assignedRoles(
$ilUser->getId()))
and $role[
"obj_id"] == SYSTEM_ROLE_ID)) {
2047 if ($role[
'obj_id'] == SYSTEM_ROLE_ID && !
$rbacreview->isAssigned(
$ilUser->getId(), SYSTEM_ROLE_ID)) {
2048 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
2054 if (substr($role[
"title"], 0, 3) ==
"il_") {
2056 $rolf_arr =
$rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2057 $rolf2 = $rolf_arr[0];
2062 $parent_node = $this->tree->getNodeData($rolf2);
2064 $role[
"description"] = $this->lng->txt(
"obj_" . $parent_node[
"type"]) .
" (#" . $parent_node[
"obj_id"] .
")";
2067 $role_ids[$counter] = $role[
"obj_id"];
2069 $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"] .
"\"/>";
2070 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2071 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2072 $result_set[$counter][] = $link =
"<a href=\"" . $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm") .
"\">" .
ilObjRole::_getTranslation($role[
"title"]) .
"</a>";
2074 $result_set[$counter][] = $role[
"description"];
2077 if ($role[
"role_type"] ==
"local") {
2085 foreach ($ref_ids as
$ref_id) {
2088 require_once(
"./Services/Link/classes/class.ilLink.php");
2092 $result_set[$counter][] =
$path;
2096 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
2097 "context" =>
$context,
"checkbox" => $checkbox,
2098 "role" => $link,
"title" =>
$title);
2104 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2114 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2116 $table_gui->writeFilterToSession();
2117 $table_gui->resetOffset();
2126 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2128 $table_gui->resetOffset();
2129 $table_gui->resetFilter();
2137 for (
$i = 0;
$i <= 60;
$i++) {
2138 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2143 for (
$i = 0;
$i < 24;
$i++) {
2144 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2149 for (
$i = 1;
$i < 32;
$i++) {
2150 $days[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2155 for (
$i = 1;
$i < 13;
$i++) {
2156 $month[
$i] =
$i < 10 ?
"0" .
$i :
$i;
2161 if ($a_selected < date(
'Y', time())) {
2164 $start = date(
'Y', time());
2177 $a_time_arr[
"hour"],
2178 $a_time_arr[
"minute"],
2179 $a_time_arr[
"second"],
2180 $a_time_arr[
"month"],
2196 $action[0] = $this->lng->txt(
'assigned_roles');
2197 $action[1] = $this->lng->txt(
'all_roles');
2198 $action[2] = $this->lng->txt(
'all_global_roles');
2199 $action[3] = $this->lng->txt(
'all_local_roles');
2200 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2201 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2208 parent::hitsperpageObject();
2220 $ilLocator = $DIC[
'ilLocator'];
2222 $ilLocator->clearItems();
2224 if (
$_GET[
"admin_mode"] ==
"settings") {
2225 $this->ctrl->setParameterByClass(
2226 "ilobjsystemfoldergui",
2230 $ilLocator->addItem(
2231 $this->lng->txt(
"administration"),
2232 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2237 $ilLocator->addItem(
2241 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view")
2243 } elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID) {
2244 $ilLocator->addItem(
2248 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view")
2252 if (
$_GET[
"obj_id"] > 0) {
2253 $ilLocator->addItem(
2254 $this->object->getTitle(),
2255 $this->ctrl->getLinkTarget($this,
"view")
2267 public function __sendProfileMail()
2272 $ilias = $DIC[
'ilias'];
2274 if (
$_POST[
'send_mail'] !=
'y') {
2277 if (!strlen($this->object->getEmail())) {
2282 $usr_lang =
new ilLanguage($this->object->getLanguage());
2284 $usr_lang->loadLanguageModule(
'registration');
2286 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2289 $senderFactory =
$GLOBALS[
'DIC'][
"mail.mime.sender.factory"];
2292 $mmail->From($senderFactory->system());
2296 $subject = $usr_lang->txt(
"profile_changed");
2300 $body = ($usr_lang->txt(
"reg_mail_body_salutation") .
" " . $this->
object->getFullname() .
",\n\n");
2302 $date = $this->
object->getApproveDate();
2304 if ((time() - strtotime($date)) < 10) {
2305 $body .= ($usr_lang->txt(
'reg_mail_body_approve') .
"\n\n");
2307 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed') .
"\n\n");
2311 if (
$_POST[
'passwd'] !=
'') {
2312 $body .= $usr_lang->txt(
"reg_mail_body_text2") .
"\n" .
2313 ILIAS_HTTP_PATH .
"/login.php?client_id=" . $ilias->client_id .
"\n" .
2314 $usr_lang->txt(
"login") .
": " . $this->
object->getLogin() .
"\n" .
2315 $usr_lang->txt(
"passwd") .
": " .
$_POST[
'passwd'] .
"\n\n";
2317 $body .= ($usr_lang->txt(
"reg_mail_body_text3") .
"\n");
2318 $body .= $this->
object->getProfileAsString($usr_lang);
2320 $mmail->Subject($subject,
true);
2321 $mmail->Body($body);
2325 return "<br/>" . $this->lng->txt(
"mail_sent");
2339 if ($a_target == md5(
"usrdelown")) {
2340 if (
$ilUser->getId() != ANONYMOUS_USER_ID &&
2342 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2343 $ilCtrl->redirectByClass(array(
"ilpersonaldesktopgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2345 exit(
"This account is not flagged for deletion.");
2349 if (substr($a_target, -4) ==
"_bdg") {
2350 $_GET[
"baseClass"] =
"ilPersonalDesktopGUI";
2351 $_GET[
"cmd"] =
"jumpToBadges";
2352 include(
"ilias.php");
2356 if (
'registration' == $a_target) {
2357 $_GET[
"baseClass"] =
'ilStartUpGUI';
2358 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilAccountRegistrationGUI'),
'');
2359 } elseif (
'nameassist' == $a_target) {
2360 $_GET[
"baseClass"] =
'ilStartUpGUI';
2361 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'showUsernameAssistanceForm');
2362 } elseif (
'pwassist' == $a_target) {
2363 $_GET[
"baseClass"] =
'ilStartUpGUI';
2364 $ilCtrl->redirectByClass(array(
'ilStartUpGUI',
'ilPasswordAssistanceGUI'),
'');
2365 } elseif (
'agreement' == $a_target) {
2367 $ilCtrl->setTargetScript(
'ilias.php');
2368 $ilCtrl->initBaseClass(
'ilpersonaldesktopgui');
2369 $ilCtrl->redirectByClass(array(
'ilpersonaldesktopgui',
'ilpersonalprofilegui'),
'showUserAgreement');
2371 $_GET[
'baseClass'] =
'ilStartUpGUI';
2372 $ilCtrl->setTargetScript(
'ilias.php');
2373 $ilCtrl->redirectByClass(array(
'ilStartUpGUI'),
'showTermsOfService');
2377 if (substr($a_target, 0, 1) ==
"n") {
2381 if (strpos($a_target,
'contact_approved') !==
false) {
2382 $_GET[
'cmd'] =
'approveContactRequest';
2383 } elseif (strpos($a_target,
'contact_ignored') !==
false) {
2384 $_GET[
'cmd'] =
'ignoreContactRequest';
2386 $_GET[
'cmd'] =
'view';
2389 $_GET[
"user_id"] = (int) $a_target;
2390 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2391 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2392 include(
"ilias.php");
2406 $profileMaybeIncomplete =
false;
2408 require_once
'Services/User/classes/class.ilUserProfile.php';
2411 $elm = $this->form_gui->getItemByPostVar($fieldName);
2417 if ($elm->getRequired()) {
2418 $profileMaybeIncomplete =
true;
2421 $elm->setRequired(
false);
2425 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2427 foreach ($user_defined_fields->getDefinitions() as $field_id => $definition) {
2428 $elm = $this->form_gui->getItemByPostVar(
'udf_' . $definition[
'field_id']);
2434 if ($elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible']) {
2435 $profileMaybeIncomplete =
true;
2438 $elm->setRequired(
false);
2442 return $profileMaybeIncomplete;
2448 protected function showAcceptedTermsOfService()
2451 $agreeDate = $this->form_gui->getItemByPostVar(
'agree_date');
2452 if ($agreeDate && $agreeDate->getValue()) {
2453 $this->lng->loadLanguageModule(
'tos');
2454 $helper = new \ilTermsOfServiceHelper();
2456 $entity = $helper->getCurrentAcceptanceForUser($this->
object);
2457 if ($entity->getId()) {
2458 $modal = $this->uiFactory
2461 $this->uiFactory->modal()->lightboxTextPage($entity->getText(), $entity->getTitle())
2464 $titleLink = $this->uiFactory
2466 ->shy($entity->getTitle(),
'#')
2467 ->withOnClick($modal->getShowSignal());
2470 $this->lng->txt(
'tos_agreement_document'),
2474 $agreementDocument->
setValue($this->uiRenderer->render([$titleLink, $modal]));
2475 $agreeDate->addSubItem($agreementDocument);
2477 } elseif ($agreeDate) {
2478 $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.
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
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.
removeUserPictureObject()
remove user image
static MB2Bytes($a_value)
static _lookupPersonalWorkspaceDiskQuota($a_user_id)
if(!array_key_exists('StateId', $_REQUEST)) $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 getExternalEmailsByUser(ilObjUser $user, ilMailOptions $mail_options=null)
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
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)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static Bytes2MB($a_value)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
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.
update($pash, $contents, Config $config)
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)
applyFilterObject()
Apply filter.
This class represents a text area property in a property form.
loadLanguageModule($a_module)
saveObject()
save user data public
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
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="")
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
roleassignmentObject()
display roleassignment panel
static getFilesizeByTypeAndOwner($a_owner_id)
Get current storage size for owner (grouped by type)