4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 include_once(
'./Services/Calendar/classes/class.ilDatePresentation.php');
47 function ilObjUserGUI($a_data,$a_id,$a_call_by_reference =
false, $a_prepare_output =
true)
51 define(
'USER_FOLDER_ID',7);
54 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
58 $this->ctrl->saveParameter($this, array(
'obj_id',
'letter'));
59 $this->ctrl->setParameterByClass(
"ilobjuserfoldergui",
"letter",
$_GET[
"letter"]);
61 $lng->loadLanguageModule(
'user');
65 $this->gender = array(
66 'm' =>
"salutation_m",
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
82 case "illearningprogressgui":
83 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
85 $this->ctrl->forwardCommand($new_gui);
88 case "ilobjectownershipmanagementgui":
89 include_once(
"Services/Object/classes/class.ilObjectOwnershipManagementGUI.php");
91 $this->ctrl->forwardCommand($gui);
100 $return = $this->
$cmd();
111 if(strtolower(get_class($this->
object)) ==
'ilobjuser')
113 $this->tpl->setTitle(
'['.$this->object->getLogin().
'] '.$this->
object->getTitle());
114 $this->tpl->setDescription($this->object->getLongDescription());
115 $this->tpl->setTitleIcon(
ilUtil::getImagePath(
"icon_".$this->object->getType().
".svg"), $this->lng->txt(
"obj_" . $this->object->getType()));
129 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
131 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
137 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
154 global $rbacsystem, $ilHelp;
156 $tabs_gui->clearTargets();
158 $ilHelp->setScreenIdComponent(
"usr");
162 $tabs_gui->setBackTarget(
163 $this->lng->txt(
"search_results"),
$_SESSION[
"usr_search_link"]);
165 $tabs_gui->addTarget(
"properties",
166 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this),
"",
true);
170 $tabs_gui->addTarget(
"properties",
171 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this));
174 $tabs_gui->addTarget(
"role_assignment",
175 $this->ctrl->getLinkTarget($this,
"roleassignment"), array(
"roleassignment"), get_class($this));
178 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
179 if($rbacsystem->checkAccess(
'read',$this->ref_id) and
184 $tabs_gui->addTarget(
'learning_progress',
185 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
187 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
190 $tabs_gui->addTarget(
'user_ownership',
191 $this->ctrl->getLinkTargetByClass(
'ilobjectownershipmanagementgui',
''),
193 'ilobjectownershipmanagementgui');
201 $this->back_target = array(
"text" => $a_text,
211 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
214 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
216 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
227 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
230 if($this->object->getType() ==
'usr')
232 $user_defined_data = $this->
object->getUserDefinedData();
234 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
236 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
237 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
241 $this->tpl->setCurrentBlock(
"field_text");
242 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
244 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
"field_select");
250 'udf['.$definition[
'field_id'].
']',
251 $this->user_defined_fields->fieldValuesToSelectArray(
252 $definition[
'field_values']),
255 $this->tpl->parseCurrentBlock();
257 $this->tpl->setCurrentBlock(
"user_defined");
259 if($definition[
'required'])
261 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
265 $name = $definition[
'field_name'];
267 $this->tpl->setVariable(
"TXT_FIELD_NAME",$name);
268 $this->tpl->parseCurrentBlock();
279 $this->tabs_gui->clearTargets();
283 $obj_list = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
285 foreach ($obj_list as $obj_data)
288 if($this->object->getRefId() !=
USER_FOLDER_ID and !in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
290 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
298 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
301 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
303 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
311 $this->ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"),$this->ilias->error_obj->MESSAGE);
314 $keys = array_keys($rol);
317 if (in_array(4,$keys))
319 $this->default_role = 4;
323 if (count($keys) > 1 and in_array(2,$keys))
326 foreach ($keys as $key => $val)
336 $this->default_role = array_shift($keys);
338 $this->selectable_roles = $rol;
348 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) and
349 !$rbacsystem->checkAccess(
'cat_administrate_users',$this->usrf_ref_id))
351 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
356 return $tpl->setContent($this->form_gui->getHtml());
367 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
370 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) &&
371 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id))
373 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
380 $profileMaybeIncomplete =
false;
381 if($this->form_gui->getInput(
'ignore_rf',
false))
386 if ($this->form_gui->checkInput())
393 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
394 $userObj->setTitle($userObj->getFullname());
395 $userObj->setDescription($userObj->getEmail());
398 foreach(
$_POST as $k => $v)
400 if (substr($k, 0, 4) ==
"udf_")
402 $udf[substr($k, 4)] = $v;
405 $userObj->setUserDefinedData($udf);
409 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
412 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
417 $userObj->setLastPasswordChangeTS( time() );
420 $userObj->saveAsNew();
425 $userObj->setLanguage(
$_POST[
"language"]);
429 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
439 $sknst = explode(
":",
$_POST[
"skin_style"]);
441 if ($userObj->getPref(
"style") != $sknst[1] ||
442 $userObj->getPref(
"skin") != $sknst[0])
444 $userObj->setPref(
"skin", $sknst[0]);
445 $userObj->setPref(
"style", $sknst[1]);
450 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
454 $userObj->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
458 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
460 if((
int)$ilSetting->get(
'session_reminder_enabled'))
462 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
464 $userObj->writePrefs();
467 $rbacadmin->assignUser(
$_POST[
"default_role"],$userObj->getId(),
true);
469 $msg = $this->lng->txt(
"user_added");
471 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
472 $ilUser->writePrefs();
474 $this->
object = $userObj;
481 if( $profileMaybeIncomplete )
483 include_once
'Services/User/classes/class.ilUserProfile.php';
486 $this->
object->setProfileIncomplete(
true );
487 $this->
object->update();
492 if(
$_POST[
'send_mail'] ==
'y')
494 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
496 $acc_mail->useLangVariablesAsFallback(
true);
497 $acc_mail->setUserPassword(
$_POST[
'passwd']);
498 $acc_mail->setUser($userObj);
500 if ($acc_mail->send())
502 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_sent');
507 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_not_sent');
517 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
519 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
523 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
528 $this->form_gui->setValuesByPost();
529 $tpl->setContent($this->form_gui->getHtml());
540 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition,
$ilUser
543 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
546 $settings = $ilias->getAllSettings();
549 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
551 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
558 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
560 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
566 $this->tabs_gui->clearTargets();
572 $this->showAcceptedTermsOfService();
573 $this->tpl->setContent($this->form_gui->getHTML());
599 $user->setTimeLimitUntil($until->get(
IL_CAL_UNIX));
601 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
603 if($a_mode ==
'create')
605 $user->setTimeLimitOwner($this->usrf_ref_id);
611 $bd = $this->form_gui->getInput(
'birthday');
614 $user->setBirthday($bd[
'date']);
618 $user->setBirthday(null);
623 $user->setLogin($this->form_gui->getInput(
'login'));
629 $user->setGender($this->form_gui->getInput(
'gender'));
635 $user->setUTitle($this->form_gui->getInput(
'title'));
641 $user->setFirstname($this->form_gui->getInput(
'firstname'));
646 $user->setLastname($this->form_gui->getInput(
'lastname'));
648 $user->setFullname();
653 $user->setInstitution($this->form_gui->getInput(
'institution'));
659 $user->setDepartment($this->form_gui->getInput(
'department'));
664 $user->setStreet($this->form_gui->getInput(
'street'));
669 $user->setCity($this->form_gui->getInput(
'city'));
674 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
679 $user->setCountry($this->form_gui->getInput(
'country'));
684 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
689 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
694 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
699 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
704 $user->setFax($this->form_gui->getInput(
'fax'));
709 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
714 $user->setEmail($this->form_gui->getInput(
'email'));
719 $user->setHobby($this->form_gui->getInput(
'hobby'));
724 $user->setComment($this->form_gui->getInput(
'referral_comment'));
728 $user->setGeneralInterests($this->form_gui->getInput(
'interests_general'));
729 $user->setOfferingHelp($this->form_gui->getInput(
'interests_help_offered'));
730 $user->setLookingForHelp($this->form_gui->getInput(
'interests_help_looking'));
733 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
737 $user->setInstantMessengerId(
'icq', $this->form_gui->getInput(
'im_icq'));
738 $user->setInstantMessengerId(
'yahoo', $this->form_gui->getInput(
'im_yahoo'));
739 $user->setInstantMessengerId(
'msn', $this->form_gui->getInput(
'im_msn'));
740 $user->setInstantMessengerId(
'aim', $this->form_gui->getInput(
'im_aim'));
741 $user->setInstantMessengerId(
'skype', $this->form_gui->getInput(
'im_skype'));
742 $user->setInstantMessengerId(
'jabber', $this->form_gui->getInput(
'im_jabber'));
743 $user->setInstantMessengerId(
'voip', $this->form_gui->getInput(
'im_voip'));
748 $user->setDelicious($this->form_gui->getInput(
'delicious'));
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'))
761 $user->setActive($this->form_gui->getInput(
'active'), $ilUser->getId());
776 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
778 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
785 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
787 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
793 unset(
$_POST[
'approve_date']);
794 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
795 unset(
$_POST[
'last_login']);
798 $profileMaybeIncomplete =
false;
799 if($this->form_gui->getInput(
'ignore_rf',
false))
804 if ($this->form_gui->checkInput())
809 && trim(
$_POST[
'passwd']) !=
"")
818 if(
$_POST[
'active'] == 1 )
823 #$this->object->assignData($_POST);
827 foreach(
$_POST as $k => $v)
829 if (substr($k, 0, 4) ==
"udf_")
831 $udf[substr($k, 4)] = $v;
834 $this->
object->setUserDefinedData($udf);
838 $this->
object->updateLogin(
$_POST[
'login']);
843 $this->form_gui->setValuesByPost();
844 return $tpl->setContent($this->form_gui->getHtml());
847 $this->
object->setTitle($this->object->getFullname());
848 $this->
object->setDescription($this->object->getEmail());
852 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
855 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
870 $sknst = explode(
":",
$_POST[
"skin_style"]);
872 if ($this->object->getPref(
"style") != $sknst[1] ||
873 $this->
object->getPref(
"skin") != $sknst[0])
875 $this->
object->setPref(
"skin", $sknst[0]);
876 $this->
object->setPref(
"style", $sknst[1]);
881 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
885 $this->
object->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
889 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
894 $this->
object->setLastPasswordChangeTS( time() );
897 if((
int)$ilSetting->get(
'session_reminder_enabled'))
899 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
903 $this->
object->setProfileIncomplete(
false );
905 $this->update = $this->
object->update();
910 if ($ilUser->getId() == $this->
object->getId())
912 $ilUser->readPrefs();
914 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
915 $ilUser->writePrefs();
918 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
926 if( $profileMaybeIncomplete )
928 include_once
'Services/User/classes/class.ilUserProfile.php';
931 $this->
object->setProfileIncomplete(
true );
932 $this->
object->update();
939 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
941 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
945 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
950 $this->form_gui->setValuesByPost();
951 $tpl->setContent($this->form_gui->getHtml());
965 $data[
"auth_mode"] = $this->
object->getAuthMode();
966 $data[
"login"] = $this->
object->getLogin();
969 $data[
"ext_account"] = $this->
object->getExternalAccount();
972 require_once
'./Services/Utilities/classes/class.ilFormat.php';
975 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
978 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
981 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
984 $data[
"active"] = $this->
object->getActive();
985 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
987 $from =
new ilDateTime($this->object->getTimeLimitFrom() ? $this->
object->getTimeLimitFrom() : time(),
IL_CAL_UNIX);
988 $data[
"time_limit_from"][
"date"] = $from->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
989 $data[
"time_limit_from"][
"time"] = $from->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
991 $until =
new ilDateTime($this->object->getTimeLimitUntil() ? $this->
object->getTimeLimitUntil() : time(),
IL_CAL_UNIX);
992 $data[
'time_limit_until'][
'date'] = $until->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
993 $data[
'time_limit_until'][
'time'] = $until->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
997 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1026 $data[
"gender"] = $this->
object->getGender();
1027 $data[
"firstname"] = $this->
object->getFirstname();
1028 $data[
"lastname"] = $this->
object->getLastname();
1029 $data[
"title"] = $this->
object->getUTitle();
1030 $data[
'birthday'] = $this->
object->getBirthday();
1031 $data[
"institution"] = $this->
object->getInstitution();
1032 $data[
"department"] = $this->
object->getDepartment();
1033 $data[
"street"] = $this->
object->getStreet();
1034 $data[
"city"] = $this->
object->getCity();
1035 $data[
"zipcode"] = $this->
object->getZipcode();
1036 $data[
"country"] = $this->
object->getCountry();
1037 $data[
"sel_country"] = $this->
object->getSelectedCountry();
1038 $data[
"phone_office"] = $this->
object->getPhoneOffice();
1039 $data[
"phone_home"] = $this->
object->getPhoneHome();
1040 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
1041 $data[
"fax"] = $this->
object->getFax();
1042 $data[
"email"] = $this->
object->getEmail();
1043 $data[
"hobby"] = $this->
object->getHobby();
1044 $data[
"referral_comment"] = $this->
object->getComment();
1047 $data[
"interests_general"] = $this->
object->getGeneralInterests();
1048 $data[
"interests_help_offered"] = $this->
object->getOfferingHelp();
1049 $data[
"interests_help_looking"] = $this->
object->getLookingForHelp();
1052 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1053 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1054 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1055 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1056 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1057 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1058 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1061 $data[
"matriculation"] = $this->
object->getMatriculation();
1062 $data[
"delicious"] = $this->
object->getDelicious();
1063 $data[
"client_ip"] = $this->
object->getClientIP();
1066 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1068 $user_defined_data = $this->
object->getUserDefinedData();
1069 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1071 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1075 $data[
"language"] = $this->
object->getLanguage();
1076 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1077 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1078 $data[
"show_users_online"] = $this->
object->prefs[
"show_users_online"];
1079 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1080 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1082 $this->form_gui->setValuesByArray($data);
1092 $settings = $ilSetting->getAll();
1094 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1097 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1098 if ($a_mode ==
"create")
1100 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1104 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1109 $sec_l->setTitle($lng->txt(
"login_data"));
1110 $this->form_gui->addItem($sec_l);
1113 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1117 foreach ($active_auth_modes as $auth_name => $auth_key)
1119 if ($auth_name ==
'default')
1125 $name = $this->lng->txt(
'auth_'.$auth_name);
1127 $option[$auth_name] = $name;
1130 $this->form_gui->addItem($am);
1132 if($a_mode ==
"edit")
1135 $id->
setValue($this->object->getId());
1136 $this->form_gui->addItem($id);
1142 if ($a_mode ==
"edit")
1144 $lo->setCurrentUserId($this->object->getId());
1147 include_once
'Services/Calendar/classes/class.ilDate.php';
1152 $this->lng->txt(
'usr_loginname_history_info'),
1154 $last_history_entry[0]
1161 $this->form_gui->addItem($lo);
1169 $pw->setMaxLength(32);
1170 $pw->setValidateAuthPost(
"auth_mode");
1171 if ($a_mode ==
"create")
1173 $pw->setRequiredOnAuth(
true);
1176 $this->form_gui->addItem($pw);
1181 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1184 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1186 $ext->setMaxLength(250);
1187 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1188 $this->form_gui->addItem($ext);
1193 $sec_si->setTitle($this->lng->txt(
"system_information"));
1194 $this->form_gui->addItem($sec_si);
1197 if ($a_mode ==
"edit")
1199 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1203 $this->form_gui->addItem($siai);
1210 $this->form_gui->addItem($ac);
1213 $lng->loadLanguageModule(
'crs');
1218 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1219 $radg->addOption($op1);
1220 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1221 $radg->addOption($op2);
1231 $op2->addSubItem($acfrom);
1237 $op2->addSubItem($acto);
1240 $this->form_gui->addItem($radg);
1242 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1245 $lng->loadLanguageModule(
"file");
1248 $quota_head->setTitle($lng->txt(
"repository_disk_quota"));
1249 $this->form_gui->addItem($quota_head);
1252 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1254 $disk_quota->setMaxLength(11);
1255 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1256 $this->form_gui->addItem($disk_quota);
1258 if ($a_mode ==
"edit")
1261 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1263 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1265 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1268 $dq_info[
'role_title']);
1270 else if (is_infinite($dq_info[
'role_disk_quota']))
1272 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1276 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1278 $dq_info[
'role_title']);
1280 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1286 if ($du_info[
'last_update'] === null)
1288 $disk_usage->
setValue($lng->txt(
'unknown'));
1292 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1294 $info =
'<table class="il_user_quota_disk_usage_overview">';
1296 foreach ($du_info[
'details'] as $detail_data)
1299 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1300 '<td class="std">'.$lng->txt($detail_data[
'type']).
'</td>'.
1301 '<td class="std">'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1305 $info .=
'</table>';
1306 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
1308 $disk_usage->setInfo($info);
1311 $this->form_gui->addItem($disk_usage);
1314 if (
true || $dq_info[
'last_reminder'])
1320 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1321 $this->form_gui->addItem($reminder);
1328 $lng->loadLanguageModule(
"file");
1331 $quota_head->setTitle($lng->txt(
"personal_workspace_disk_quota"));
1332 $this->form_gui->addItem($quota_head);
1335 $wsp_disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"wsp_disk_quota");
1337 $wsp_disk_quota->setMaxLength(11);
1338 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1339 $this->form_gui->addItem($wsp_disk_quota);
1341 if ($a_mode ==
"edit")
1344 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1346 if ($dq_info[
'user_wsp_disk_quota'] > $dq_info[
'role_wsp_disk_quota'])
1348 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1351 $dq_info[
'role_title']);
1353 else if (is_infinite($dq_info[
'role_wsp_disk_quota']))
1355 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1359 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1361 $dq_info[
'role_title']);
1363 $wsp_disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1367 include_once
"Services/DiskQuota/classes/class.ilDiskQuotaHandler.php";
1370 if (!
sizeof($du_info))
1372 $disk_usage->
setValue($lng->txt(
'unknown'));
1376 require_once
'./Services/Utilities/classes/class.ilFormat.php';
1378 $info =
'<table class="il_user_quota_disk_usage_overview">';
1380 foreach ($du_info as $detail_data)
1383 '<td class="std">'.$detail_data[
'count'].
'</td>'.
1384 '<td class="std">'.$lng->txt(
"obj_".$detail_data[
"src_type"]).
'</td>'.
1385 '<td class="std">'.ilFormat::formatSize($detail_data[
'filesize'],
'short').
'</td>'.
1389 $info .=
'</table>';
1390 $disk_usage->setInfo($info);
1393 $this->form_gui->addItem($disk_usage);
1407 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1408 $this->form_gui->addItem($sec_pd);
1415 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1417 $gndr->addOption($female);
1419 $gndr->addOption($male);
1420 $this->form_gui->addItem($gndr);
1424 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1425 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1426 foreach($fields as $field => $req)
1432 $inp->setMaxLength(32);
1433 $inp->setRequired($req);
1434 $this->form_gui->addItem($inp);
1442 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1447 $this->form_gui->addItem($pi);
1453 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1454 $birthday->setShowEmpty(
true);
1455 $birthday->setStartYear(1900);
1456 $this->form_gui->addItem($birthday);
1463 array(
"institution", 40, 80),
1464 array(
"department", 40, 80),
1465 array(
"street", 40, 40),
1466 array(
"city", 40, 40),
1467 array(
"zipcode", 10, 10),
1468 array(
"country", 40, 40),
1469 array(
"sel_country"),
1470 array(
"phone_office", 30, 30),
1471 array(
"phone_home", 30, 30),
1472 array(
"phone_mobile", 30, 30),
1473 array(
"fax", 30, 30));
1476 foreach ($fields as $field)
1482 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1483 $this->form_gui->addItem($sec_cd);
1487 if ($field[0] !=
"sel_country")
1491 $inp->setMaxLength($field[2]);
1492 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1493 $settings[
"require_".$field[0]]);
1494 $this->form_gui->addItem($inp);
1499 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1501 $cs->
setRequired(isset($settings[
"require_".$field[0]]) &&
1502 $settings[
"require_".$field[0]]);
1503 $this->form_gui->addItem($cs);
1512 $em->
setRequired(isset($settings[
"require_email"]) &&
1513 $settings[
"require_email"]);
1514 $this->form_gui->addItem($em);
1523 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1524 $settings[
"require_hobby"]);
1525 $this->form_gui->addItem($hob);
1534 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1535 $settings[
"require_referral_comment"]);
1536 $this->form_gui->addItem($rc);
1543 $sh->setTitle($lng->txt(
"interests"));
1544 $this->form_gui->addItem($sh);
1546 $multi_fields = array(
"interests_general",
"interests_help_offered",
"interests_help_looking");
1547 foreach($multi_fields as $multi_field)
1554 $ti->setMaxLength(40);
1556 $ti->setRequired(isset($settings[
"require_".$multi_field]) &&
1557 $settings[
"require_".$multi_field]);
1558 $this->form_gui->addItem($ti);
1567 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1568 $this->form_gui->addItem($sec_im);
1572 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1573 foreach ($fields as $field)
1579 $im->setMaxLength(40);
1580 $this->form_gui->addItem($im);
1588 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1589 $this->form_gui->addItem($sec_oi);
1595 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1597 $mr->setMaxLength(40);
1598 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1599 $settings[
"require_matriculation"]);
1600 $this->form_gui->addItem($mr);
1608 $mr->setMaxLength(40);
1609 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1610 $settings[
"require_delicious"]);
1611 $this->form_gui->addItem($mr);
1617 $ip->setMaxLength(255);
1618 $ip->setInfo($this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
" <br />".
1619 '<span class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1620 $this->form_gui->addItem($ip);
1623 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1628 $all_defs = $user_defined_fields->getDefinitions();
1632 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1635 foreach($all_defs as $field_id => $definition)
1640 "udf_".$definition[
'field_id']);
1642 $udf->setMaxLength(255);
1647 "udf_".$definition[
'field_id']);
1648 $udf->setUseRte(
true);
1653 "udf_".$definition[
'field_id']);
1654 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1655 $definition[
'field_values']));
1657 $udf->setRequired($definition[
'required']);
1658 $this->form_gui->addItem($udf);
1663 $a_mode ==
'create' or
1671 $sec_st->setTitle($this->lng->txt(
"settings"));
1672 $this->form_gui->addItem($sec_st);
1676 if ($a_mode ==
"create")
1681 $role->setValue($this->default_role);
1682 $role->setOptions($this->selectable_roles);
1683 $this->form_gui->addItem($role);
1691 $languages = $lng->getInstalledLanguages();
1692 $lng->loadLanguageModule(
"meta");
1694 foreach($languages as $l)
1696 $options[$l] = $lng->txt(
"meta_l_".$l);
1699 $lang->setValue($ilSetting->get(
"language"));
1700 $this->form_gui->addItem(
$lang);
1708 $templates = $styleDefinition->getAllTemplates();
1710 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1713 if (count($templates) > 0 && is_array ($templates))
1715 foreach ($templates as $template)
1718 $styleDef->startParsing();
1719 $styles = $styleDef->getStyles();
1720 foreach ($styles as $style)
1726 $options[$template[
"id"].
":".$style[
"id"]] =
1727 $styleDef->getTemplateName().
" / ".$style[
"name"];
1732 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1733 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1735 $this->form_gui->addItem($sk);
1743 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1744 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1745 $hpp->setOptions($options);
1746 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1747 $this->form_gui->addItem($hpp);
1751 'show_users_online');
1753 "y" => $lng->txt(
"users_online_show_y"),
1754 "associated" => $lng->txt(
"users_online_show_associated"),
1755 "n" => $lng->txt(
"users_online_show_n"));
1757 $uo->setValue($ilSetting->get(
"show_users_online"));
1758 $this->form_gui->addItem($uo);
1764 $os =
new ilCheckboxInputGUI($lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1765 $this->form_gui->addItem($os);
1768 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1770 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1772 $this->form_gui->addItem($cb);
1779 $sec_op->setTitle($this->lng->txt(
"options"));
1780 $this->form_gui->addItem($sec_op);
1785 $se->
setInfo($lng->txt(
'inform_user_mail_info'));
1787 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1788 $this->form_gui->addItem($se);
1792 $irf->
setInfo($lng->txt(
'ignore_required_fields_info'));
1794 $this->form_gui->addItem($irf);
1799 if ($a_mode ==
"create" || $a_mode ==
"save")
1801 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1803 if ($a_mode ==
"edit" || $a_mode ==
"update")
1805 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1807 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1823 static $settings = null;
1832 if($settings == NULL)
1834 $settings = $ilSetting->getAll();
1836 return (
bool) $settings[
'usr_settings_changeable_lua_'.$a_field];
1852 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1854 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1861 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1863 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1867 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
1869 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
1871 if ($userfile_input->getDeletionFlag())
1873 $this->
object->removeUserPicture();
1877 if ($_FILES[
"userfile"][
"size"] == 0)
1884 $image_dir = $webspace_dir.
"/usr_images";
1885 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
1888 $this->
object->setPref(
"profile_image", $store_file);
1889 $this->
object->update();
1892 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
"pic";
1894 $uploaded_file,
false))
1897 $this->ctrl->redirect($this,
"showProfile");
1899 chmod($uploaded_file, 0770);
1903 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
1904 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
1905 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
1906 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
1915 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:".$show_file);
1916 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:".$thumb_file);
1917 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:".$xthumb_file);
1918 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:".$xxthumb_file);
1922 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
1923 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
1924 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
1925 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
1936 $image_dir = $webspace_dir.
"/usr_images";
1937 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
1938 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
1939 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
1940 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
1941 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
1944 $this->
object->setPref(
"profile_image",
"");
1945 $this->
object->update();
1948 if (@is_file(
$file))
1952 if (@is_file($thumb_file))
1954 unlink($thumb_file);
1956 if (@is_file($xthumb_file))
1958 unlink($xthumb_file);
1960 if (@is_file($xxthumb_file))
1962 unlink($xxthumb_file);
1964 if (@is_file($upload_file))
1966 unlink($upload_file);
2212 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2215 $settings = $ilias->getAllSettings();
2218 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2220 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2227 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2229 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2233 foreach (
$_POST[
"Fobject"] as $key => $val)
2239 foreach ($settings as $key => $val)
2241 $field = substr($key,8);
2248 $require_keys[] = $field;
2252 $require_keys[] = $field;
2258 foreach ($require_keys as $key => $val)
2261 $system_fields = array(
"default_role");
2262 if (!in_array($val, $system_fields))
2264 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2266 if (empty(
$_POST[
"Fobject"][$val]))
2268 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2269 $this->lng->txt($val),$this->ilias->error_obj->MESSAGE);
2277 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
2280 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2283 $this->ilias->raiseError($this->lng->txt(
"login_invalid"),$this->ilias->error_obj->MESSAGE);
2289 $this->ilias->raiseError($this->lng->txt(
"login_exists"),$this->ilias->error_obj->MESSAGE);
2294 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2295 !strlen($this->object->getPasswd()))
2297 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2298 $this->lng->txt(
'password'),$this->ilias->error_obj->MESSAGE);
2301 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2303 $this->ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->ilias->error_obj->MESSAGE);
2309 $this->ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->ilias->error_obj->MESSAGE);
2315 $_POST[
'Fobject'][
'passwd'] =
"********";
2319 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2321 $this->ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->ilias->error_obj->MESSAGE);
2324 if(
$_POST[
'Fobject'][
'ext_account'] &&
2327 if($elogin != $this->object->getLogin())
2329 $this->ilias->raiseError(
2330 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2331 $_POST[
"Fobject"][
"ext_account"],
2332 $_POST[
'Fobject'][
'auth_mode'],
2334 $this->ilias->error_obj->MESSAGE);
2340 include_once (
'./Services/User/classes/class.ilObjUser.php');
2346 $this->ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->ilias->error_obj->MESSAGE);
2353 if (!
$_POST[
"time_limit"][
"unlimited"] and
2356 $this->ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->ilias->error_obj->MESSAGE);
2359 if(!$this->ilias->account->getTimeLimitUnlimited())
2361 if($start < $this->ilias->account->getTimeLimitFrom() or
2362 $end > $this->ilias->account->getTimeLimitUntil() or
2363 $_POST[
'time_limit'][
'unlimited'])
2377 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
2379 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
2383 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
2384 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
2385 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
2387 $_POST[
'Fobject'][
'time_limit_message'] = 0;
2391 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
2394 $this->
object->assignData(
$_POST[
"Fobject"]);
2395 $this->
object->setUserDefinedData(
$_POST[
'udf']);
2399 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
2404 $this->form_gui->setValuesByPost();
2405 return $tpl->setContent($this->form_gui->getHtml());
2408 $this->
object->setTitle($this->object->getFullname());
2409 $this->
object->setDescription($this->object->getEmail());
2410 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
2413 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
2415 if ($this->object->getPref(
"style") != $sknst[1] ||
2416 $this->
object->getPref(
"skin") != $sknst[0])
2418 $this->
object->setPref(
"skin", $sknst[0]);
2419 $this->
object->setPref(
"style", $sknst[1]);
2423 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
2425 $this->
object->setPref(
"show_users_online",
$_POST[
"Fobject"][
"show_users_online"]);
2427 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
2428 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
2431 $this->
object->setPref(
"hide_own_online_status",
"n");
2434 $this->update = $this->
object->update();
2439 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
2440 $ilUser->writePrefs();
2444 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
2449 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2451 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
2455 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2468 global $rbacsystem, $rbacadmin, $rbacreview;
2470 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2472 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
2475 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
2476 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
2479 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
2481 array_push($selected_roles,SYSTEM_ROLE_ID);
2484 $global_roles_all = $rbacreview->getGlobalRoles();
2485 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
2486 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
2487 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
2488 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
2489 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
2491 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
2492 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
2496 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
2497 $this->ctrl->redirect($this,
'roleassignment');
2500 foreach (array_diff($assigned_roles,$selected_roles) as $role)
2502 $rbacadmin->deassignUser($role,$this->object->getId());
2505 foreach (array_diff($selected_roles,$assigned_roles) as $role)
2507 $rbacadmin->assignUser($role,$this->object->getId(),
false);
2510 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
2513 $this->
object->update();
2517 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2519 $this->ctrl->redirect($this,
'roleassignment');
2523 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2535 global $rbacreview,$rbacsystem,
$ilUser, $ilTabs;
2537 $ilTabs->activateTab(
"role_assignment");
2539 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2541 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
2551 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html',
'Services/User');
2555 $this->tpl->setCurrentBlock(
"filter");
2556 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
2558 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
2559 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
2560 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
2561 $this->tpl->parseCurrentBlock();
2565 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2569 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
2570 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
2574 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
2577 foreach ($role_list as $role)
2580 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2583 if ($rbacreview->isDeleted($rolf[0]))
2591 if ($this->tree->isInTree($rolf[0]))
2593 if ($rolf[0] == ROLE_FOLDER_ID)
2595 $path = $this->lng->txt(
"global");
2599 $tmpPath = $this->tree->getPathFull($rolf[0]);
2612 $path = $tmpPath[count($tmpPath)-1][
"title"];
2617 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
2623 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
2624 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
2630 if($role[
'obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
2632 include_once
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php';
2639 if (substr($role[
"title"],0,3) ==
"il_")
2643 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
2644 $rolf2 = $rolf_arr[0];
2651 $parent_node = $this->tree->getNodeData($rolf2);
2653 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
2656 $role_ids[$counter] = $role[
"obj_id"];
2658 $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"].
"\"/>";
2659 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
2660 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
2661 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
2663 $result_set[$counter][] = $role[
"description"];
2666 if ($role[
"role_type"] ==
"local") {
2674 foreach ($ref_ids as
$ref_id) {}
2676 require_once(
"./Services/Link/classes/class.ilLink.php");
2682 $result_set[$counter][] =
$path;
2686 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
2687 "context" => $context,
"checkbox" => $checkbox,
2688 "role" => $link,
"title" => $title);
2695 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
2705 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2707 $table_gui->writeFilterToSession();
2708 $table_gui->resetOffset();
2717 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
2719 $table_gui->resetOffset();
2720 $table_gui->resetFilter();
2729 for($i=0;$i<=60;$i++)
2731 $days[$i] = $i < 10 ?
"0".$i : $i;
2736 for($i=0;$i<24;$i++)
2738 $days[$i] = $i < 10 ?
"0".$i : $i;
2743 for($i=1;$i<32;$i++)
2745 $days[$i] = $i < 10 ?
"0".$i : $i;
2750 for($i=1;$i<13;$i++)
2752 $month[$i] = $i < 10 ?
"0".$i : $i;
2757 if($a_selected < date(
'Y',time()))
2759 $start = $a_selected;
2763 $start = date(
'Y',time());
2766 for($i = $start;$i < date(
"Y",time()) + 11;++$i)
2776 return mktime($a_time_arr[
"hour"],
2777 $a_time_arr[
"minute"],
2778 $a_time_arr[
"second"],
2779 $a_time_arr[
"month"],
2781 $a_time_arr[
"year"]);
2794 $action[0] = $this->lng->txt(
'assigned_roles');
2795 $action[1] = $this->lng->txt(
'all_roles');
2796 $action[2] = $this->lng->txt(
'all_global_roles');
2797 $action[3] = $this->lng->txt(
'all_local_roles');
2798 $action[4] = $this->lng->txt(
'internal_local_roles_only');
2799 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
2818 $ilLocator->clearItems();
2820 if (
$_GET[
"admin_mode"] ==
"settings")
2822 $this->ctrl->setParameterByClass(
"ilobjsystemfoldergui",
2823 "ref_id", SYSTEM_FOLDER_ID);
2824 $ilLocator->addItem($this->lng->txt(
"administration"),
2825 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
""),
2830 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2832 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
2834 elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID)
2836 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
2838 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
2841 if (
$_GET[
"obj_id"] > 0)
2843 $ilLocator->addItem($this->object->getTitle(),
2844 $this->ctrl->getLinkTarget($this,
"view"));
2861 if(
$_POST[
'send_mail'] !=
'y')
2865 if(!strlen($this->object->getEmail()))
2871 $usr_lang =
new ilLanguage($this->object->getLanguage());
2873 $usr_lang->loadLanguageModule(
'registration');
2875 include_once
"Services/Mail/classes/class.ilMimeMail.php";
2878 $mmail->autoCheck(
false);
2879 $mmail->From($ilUser->getEmail());
2880 $mmail->To($this->object->getEmail());
2883 $subject = $usr_lang->txt(
"profile_changed");
2887 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
2889 $date = $this->
object->getApproveDate();
2891 if((time() - strtotime($date)) < 10)
2893 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
2897 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
2901 if(
$_POST[
'passwd'] !=
'********')
2903 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
2904 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
2905 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
2906 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
2908 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
2909 $body .= $this->
object->getProfileAsString($usr_lang);
2911 $mmail->Subject($subject);
2912 $mmail->Body($body);
2916 return "<br/>".$this->lng->txt(
"mail_sent");
2927 if($a_target == md5(
"usrdelown"))
2929 if($ilUser->getId() != ANONYMOUS_USER_ID &&
2930 $ilUser->hasDeletionFlag())
2932 $ilCtrl->setTargetScript(
"ilias.php");
2933 $ilCtrl->initBaseClass(
"ilpersonaldesktopgui");
2934 $ilCtrl->redirectByClass(array(
"ilpersonaldesktopgui",
"ilpersonalsettingsgui"),
"deleteOwnAccount3");
2936 exit(
"This account is not flagged for deletion.");
2939 if (substr($a_target, 0, 1) ==
"n")
2944 $_GET[
"cmd"] =
"view";
2945 $_GET[
"user_id"] = (int) $a_target;
2946 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
2947 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
2948 include(
"ilias.php");
2962 $profileMaybeIncomplete =
false;
2964 require_once
'Services/User/classes/class.ilUserProfile.php';
2968 $elm = $this->form_gui->getItemByPostVar($fieldName);
2970 if( !$elm )
continue;
2972 if( $elm->getRequired() )
2974 $profileMaybeIncomplete =
true;
2977 $elm->setRequired(
false );
2981 include_once
'Services/User/classes/class.ilUserDefinedFields.php';
2983 foreach($user_defined_fields->getDefinitions() as $field_id => $definition)
2985 $elm = $this->form_gui->getItemByPostVar(
'udf_'.$definition[
'field_id']);
2987 if( !$elm )
continue;
2989 if( $elm->getRequired() && $definition[
'changeable'] && $definition[
'required'] && $definition[
'visible'] )
2991 $profileMaybeIncomplete =
true;
2994 $elm->setRequired(
false );
2998 return $profileMaybeIncomplete;
3004 protected function showAcceptedTermsOfService()
3009 $agree_date = $this->form_gui->getItemByPostVar(
'agree_date');
3010 if($agree_date && $agree_date->getValue())
3012 $this->lng->loadLanguageModule(
'tos');
3013 require_once
'Services/TermsOfService/classes/class.ilTermsOfServiceHelper.php';
3018 if($entity->getId())
3020 $show_agreement_text =
new ilCheckboxInputGUI($this->lng->txt(
'tos_show_signed_text'),
'tos_show_signed_text');
3023 $agreement_lang->
setValue($this->lng->txt(
'meta_l_' . $entity->getIso2LanguageCode()));
3024 $show_agreement_text->addSubItem($agreement_lang);
3026 require_once
'Services/TermsOfService/classes/form/class.ilTermsOfServiceSignedDocumentFormElementGUI.php';
3028 $show_agreement_text->addSubItem($agreement_document);
3029 $agree_date->addSubItem($show_agreement_text);
3032 else if($agree_date)
3034 $agree_date->setValue($this->lng->txt(
'tos_not_accepted_yet'));