4 require_once
"./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 "ilobjilincusergui":
89 include_once
'./Modules/ILinc/classes/class.ilObjiLincUserGUI.php';
91 $this->ctrl->forwardCommand($new_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().
"_b.gif"), $this->lng->txt(
"obj_" . $this->object->getType()));
127 session_unregister(
"saved_post");
129 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
131 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
137 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
156 $tabs_gui->clearTargets();
160 $tabs_gui->setBackTarget(
161 $this->lng->txt(
"search_results"),
$_SESSION[
"usr_search_link"]);
163 $tabs_gui->addTarget(
"properties",
164 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this),
"",
true);
168 $tabs_gui->addTarget(
"properties",
169 $this->ctrl->getLinkTarget($this,
"edit"), array(
"edit",
"",
"view"), get_class($this));
172 $tabs_gui->addTarget(
"role_assignment",
173 $this->ctrl->getLinkTarget($this,
"roleassignment"), array(
"roleassignment"), get_class($this));
176 include_once(
"Services/Tracking/classes/class.ilObjUserTracking.php");
180 $tabs_gui->addTarget(
'learning_progress',
181 $this->ctrl->getLinkTargetByClass(
'illearningprogressgui',
''),
183 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
186 if ($this->ilias->getSetting(
"ilinc_active"))
188 $tabs_gui->addTarget(
"extt_ilinc",
189 $this->ctrl->getLinkTargetByClass(
'ilobjilincusergui',
''),
191 array(
'ilobjilincusergui'));
200 $this->back_target = array(
"text" => $a_text,
210 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
213 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
215 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
226 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
229 if($this->object->getType() ==
'usr')
231 $user_defined_data = $this->
object->getUserDefinedData();
233 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
235 $old = isset(
$_SESSION[
"error_post_vars"][
"udf"][$field_id]) ?
236 $_SESSION[
"error_post_vars"][
"udf"][$field_id] : $user_defined_data[$field_id];
240 $this->tpl->setCurrentBlock(
"field_text");
241 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
243 $this->tpl->parseCurrentBlock();
247 $this->tpl->setCurrentBlock(
"field_select");
249 'udf['.$definition[
'field_id'].
']',
250 $this->user_defined_fields->fieldValuesToSelectArray(
251 $definition[
'field_values']),
254 $this->tpl->parseCurrentBlock();
256 $this->tpl->setCurrentBlock(
"user_defined");
258 if($definition[
'required'])
260 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
264 $name = $definition[
'field_name'];
266 $this->tpl->setVariable(
"TXT_FIELD_NAME",$name);
267 $this->tpl->parseCurrentBlock();
274 global
$tpl, $rbacsystem, $rbacreview, $ilUser;
278 $this->tabs_gui->clearTargets();
282 $obj_list = $rbacreview->getRoleListByObject(ROLE_FOLDER_ID);
284 foreach ($obj_list as $obj_data)
287 if($this->object->getRefId() !=
USER_FOLDER_ID and !in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
289 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
297 if ($obj_data[
"obj_id"] != ANONYMOUS_ROLE_ID)
300 if ($obj_data[
"obj_id"] != SYSTEM_ROLE_ID or in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())))
302 $rol[$obj_data[
"obj_id"]] = $obj_data[
"title"];
310 $this->ilias->raiseError($this->lng->txt(
"msg_no_roles_users_can_be_assigned_to"),$this->ilias->error_obj->MESSAGE);
313 $keys = array_keys($rol);
316 if (in_array(4,$keys))
318 $this->default_role = 4;
322 if (count($keys) > 1 and in_array(2,$keys))
325 foreach ($keys as $key => $val)
335 $this->default_role = array_shift($keys);
337 $this->selectable_roles = $rol;
345 global
$tpl, $rbacsystem, $rbacreview, $ilUser;
347 if (!$rbacsystem->checkAccess(
'create_usr', $this->usrf_ref_id) and
348 !$rbacsystem->checkAccess(
'cat_administrate_users',$this->usrf_ref_id))
350 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
355 return $tpl->setContent($this->form_gui->getHtml());
366 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
369 if (!$ilAccess->checkAccess(
'create_usr',
"", $this->usrf_ref_id) &&
370 !$ilAccess->checkAccess(
'cat_administrate_users',
"", $this->usrf_ref_id))
372 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
378 if ($this->form_gui->checkInput())
385 $userObj->setPasswd($this->form_gui->getInput(
'passwd'),
IL_PASSWD_PLAIN);
386 $userObj->setTitle($userObj->getFullname());
387 $userObj->setDescription($userObj->getEmail());
390 foreach(
$_POST as $k => $v)
392 if (substr($k, 0, 4) ==
"udf_")
394 $udf[substr($k, 4)] = $v;
397 $userObj->setUserDefinedData($udf);
401 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
404 $userObj->setExternalAccount(
$_POST[
"ext_account"]);
410 $userObj->setLastPasswordChangeTS( time() );
413 $userObj->saveAsNew();
418 $userObj->setLanguage(
$_POST[
"language"]);
422 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
432 $sknst = explode(
":",
$_POST[
"skin_style"]);
434 if ($userObj->getPref(
"style") != $sknst[1] ||
435 $userObj->getPref(
"skin") != $sknst[0])
437 $userObj->setPref(
"skin", $sknst[0]);
438 $userObj->setPref(
"style", $sknst[1]);
443 $userObj->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
447 $userObj->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
451 $userObj->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
453 if((
int)$ilSetting->get(
'session_reminder_enabled'))
455 $userObj->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
457 $userObj->writePrefs();
460 $rbacadmin->assignUser(
$_POST[
"default_role"],$userObj->getId(),
true);
462 $msg = $this->lng->txt(
"user_added");
464 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
465 $ilUser->writePrefs();
467 $this->
object = $userObj;
475 if(
$_POST[
'send_mail'] ==
'y')
477 include_once(
'Services/Mail/classes/class.ilAccountMail.php');
479 $acc_mail->useLangVariablesAsFallback(
true);
480 $acc_mail->setUserPassword(
$_POST[
'passwd']);
481 $acc_mail->setUser($userObj);
483 if ($acc_mail->send())
485 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_sent');
490 $msg = $msg.
'<br />'.$this->lng->txt(
'mail_not_sent');
500 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
502 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
506 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
511 $this->form_gui->setValuesByPost();
512 $tpl->setContent($this->form_gui->getHtml());
523 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition, $ilUser
526 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
529 $settings = $ilias->getAllSettings();
532 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
534 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
541 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
543 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
549 $this->tabs_gui->clearTargets();
555 $this->tpl->setContent($this->form_gui->getHTML());
581 $user->setTimeLimitUntil($until->get(
IL_CAL_UNIX));
583 $user->setTimeLimitUnlimited($this->form_gui->getInput(
'time_limit_unlimited'));
585 if($a_mode ==
'create')
587 $user->setTimeLimitOwner($this->usrf_ref_id);
593 $bd = $this->form_gui->getInput(
'birthday');
596 $user->setBirthday($bd[
'date']);
600 $user->setBirthday(null);
605 $user->setLogin($this->form_gui->getInput(
'login'));
611 $user->setGender($this->form_gui->getInput(
'gender'));
617 $user->setUTitle($this->form_gui->getInput(
'title'));
623 $user->setFirstname($this->form_gui->getInput(
'firstname'));
628 $user->setLastname($this->form_gui->getInput(
'lastname'));
630 $user->setFullname();
635 $user->setInstitution($this->form_gui->getInput(
'institution'));
641 $user->setDepartment($this->form_gui->getInput(
'department'));
646 $user->setStreet($this->form_gui->getInput(
'street'));
651 $user->setCity($this->form_gui->getInput(
'city'));
656 $user->setZipcode($this->form_gui->getInput(
'zipcode'));
661 $user->setCountry($this->form_gui->getInput(
'country'));
666 $user->setSelectedCountry($this->form_gui->getInput(
'sel_country'));
671 $user->setPhoneOffice($this->form_gui->getInput(
'phone_office'));
676 $user->setPhoneHome($this->form_gui->getInput(
'phone_home'));
681 $user->setPhoneMobile($this->form_gui->getInput(
'phone_mobile'));
686 $user->setFax($this->form_gui->getInput(
'fax'));
691 $user->setMatriculation($this->form_gui->getInput(
'matriculation'));
696 $user->setEmail($this->form_gui->getInput(
'email'));
701 $user->setHobby($this->form_gui->getInput(
'hobby'));
706 $user->setComment($this->form_gui->getInput(
'referral_comment'));
709 $user->setClientIP($this->form_gui->getInput(
'client_ip'));
713 $user->setInstantMessengerId(
'icq', $this->form_gui->getInput(
'im_icq'));
714 $user->setInstantMessengerId(
'yahoo', $this->form_gui->getInput(
'im_yahoo'));
715 $user->setInstantMessengerId(
'msn', $this->form_gui->getInput(
'im_msn'));
716 $user->setInstantMessengerId(
'aim', $this->form_gui->getInput(
'im_aim'));
717 $user->setInstantMessengerId(
'skype', $this->form_gui->getInput(
'im_skype'));
718 $user->setInstantMessengerId(
'jabber', $this->form_gui->getInput(
'im_jabber'));
719 $user->setInstantMessengerId(
'voip', $this->form_gui->getInput(
'im_voip'));
724 $user->setDelicious($this->form_gui->getInput(
'delicious'));
727 $user->setLatitude($this->form_gui->getInput(
'latitude'));
728 $user->setLongitude($this->form_gui->getInput(
'longitude'));
729 $user->setLocationZoom($this->form_gui->getInput(
'loc_zoom'));
732 $user->setAuthMode($this->form_gui->getInput(
'auth_mode'));
733 $user->setExternalAccount($this->form_gui->getInput(
'ext_account'));
735 if((
int) $user->getActive() != (int) $this->form_gui->getInput(
'active'))
737 $user->setActive($this->form_gui->getInput(
'active'), $ilUser->getId());
752 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
754 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
761 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
763 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
769 unset(
$_POST[
'approve_date']);
770 $_POST[
'agree_date'] = $this->
object->getAgreeDate();
771 unset(
$_POST[
'last_login']);
773 if ($this->form_gui->checkInput())
778 && trim(
$_POST[
'passwd']) !=
"")
784 require_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
786 if( $security_settings->getAccountSecurityMode() ==
793 if(
$_POST[
'active'] == 1 )
798 #$this->object->assignData($_POST);
802 foreach(
$_POST as $k => $v)
804 if (substr($k, 0, 4) ==
"udf_")
806 $udf[substr($k, 4)] = $v;
809 $this->
object->setUserDefinedData($udf);
813 $this->
object->updateLogin(
$_POST[
'login']);
818 $this->form_gui->setValuesByPost();
819 return $tpl->setContent($this->form_gui->getHtml());
822 $this->
object->setTitle($this->object->getFullname());
823 $this->
object->setDescription($this->object->getEmail());
827 $this->
object->setLanguage($this->form_gui->getInput(
'language'));
830 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
840 $sknst = explode(
":",
$_POST[
"skin_style"]);
842 if ($this->object->getPref(
"style") != $sknst[1] ||
843 $this->
object->getPref(
"skin") != $sknst[0])
845 $this->
object->setPref(
"skin", $sknst[0]);
846 $this->
object->setPref(
"style", $sknst[1]);
851 $this->
object->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
855 $this->
object->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
859 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"hide_own_online_status"] ?
'y' :
'n');
865 $this->
object->setLastPasswordChangeTS( time() );
868 if((
int)$ilSetting->get(
'session_reminder_enabled'))
870 $this->
object->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
874 $this->update = $this->
object->update();
879 if ($ilUser->getId() == $this->
object->getId())
881 $ilUser->readPrefs();
883 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
884 $ilUser->writePrefs();
887 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
898 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
900 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
904 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
909 $this->form_gui->setValuesByPost();
910 $tpl->setContent($this->form_gui->getHtml());
924 $data[
"auth_mode"] = $this->
object->getAuthMode();
925 $data[
"login"] = $this->
object->getLogin();
928 $data[
"ext_account"] = $this->
object->getExternalAccount();
931 require_once
'classes/class.ilFormat.php';
934 $data[
"approve_date"] = ($this->
object->getApproveDate() !=
"")
937 $data[
"agree_date"] = ($this->
object->getAgreeDate() !=
"")
940 $data[
"last_login"] = ($this->
object->getLastLogin() !=
"")
943 $data[
"active"] = $this->
object->getActive();
944 $data[
"time_limit_unlimited"] = $this->
object->getTimeLimitUnlimited();
946 $from =
new ilDateTime($this->object->getTimeLimitFrom() ? $this->
object->getTimeLimitFrom() : time(),
IL_CAL_UNIX);
947 $data[
"time_limit_from"][
"date"] = $from->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
948 $data[
"time_limit_from"][
"time"] = $from->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
950 $until =
new ilDateTime($this->object->getTimeLimitUntil() ? $this->
object->getTimeLimitUntil() : time(),
IL_CAL_UNIX);
951 $data[
'time_limit_until'][
'date'] = $until->
get(
IL_CAL_FKT_DATE,
'Y-m-d',$ilUser->getTimeZone());
952 $data[
'time_limit_until'][
'time'] = $until->
get(
IL_CAL_FKT_DATE,
'H:i:s',$ilUser->getTimeZone());
956 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
981 $data[
"gender"] = $this->
object->getGender();
982 $data[
"firstname"] = $this->
object->getFirstname();
983 $data[
"lastname"] = $this->
object->getLastname();
984 $data[
"title"] = $this->
object->getUTitle();
985 $data[
'birthday'] = $this->
object->getBirthday();
986 $data[
"institution"] = $this->
object->getInstitution();
987 $data[
"department"] = $this->
object->getDepartment();
988 $data[
"street"] = $this->
object->getStreet();
989 $data[
"city"] = $this->
object->getCity();
990 $data[
"zipcode"] = $this->
object->getZipcode();
991 $data[
"country"] = $this->
object->getCountry();
992 $data[
"sel_country"] = $this->
object->getSelectedCountry();
993 $data[
"phone_office"] = $this->
object->getPhoneOffice();
994 $data[
"phone_home"] = $this->
object->getPhoneHome();
995 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
996 $data[
"fax"] = $this->
object->getFax();
997 $data[
"email"] = $this->
object->getEmail();
998 $data[
"hobby"] = $this->
object->getHobby();
999 $data[
"referral_comment"] = $this->
object->getComment();
1002 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1003 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1004 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1005 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1006 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1007 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1008 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1011 $data[
"matriculation"] = $this->
object->getMatriculation();
1012 $data[
"delicious"] = $this->
object->getDelicious();
1013 $data[
"client_ip"] = $this->
object->getClientIP();
1016 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1018 $user_defined_data = $this->
object->getUserDefinedData();
1019 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1021 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1025 $data[
"language"] = $this->
object->getLanguage();
1026 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1027 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1028 $data[
"show_users_online"] = $this->
object->prefs[
"show_users_online"];
1029 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1030 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1032 $this->form_gui->setValuesByArray($data);
1042 $settings = $ilSetting->getAll();
1044 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1047 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1048 if ($a_mode ==
"create")
1050 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1054 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1059 $sec_l->setTitle($lng->txt(
"login_data"));
1060 $this->form_gui->addItem($sec_l);
1063 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1067 foreach ($active_auth_modes as $auth_name => $auth_key)
1069 if ($auth_name ==
'default')
1075 $name = $this->lng->txt(
'auth_'.$auth_name);
1077 $option[$auth_name] = $name;
1080 $this->form_gui->addItem($am);
1085 if ($a_mode ==
"edit")
1087 $lo->setCurrentUserId($this->object->getId());
1090 include_once
'Services/Calendar/classes/class.ilDate.php';
1095 $this->lng->txt(
'usr_loginname_history_info'),
1097 $last_history_entry[0]
1104 $this->form_gui->addItem($lo);
1112 $pw->setMaxLength(32);
1113 $pw->setValidateAuthPost(
"auth_mode");
1114 if ($a_mode ==
"create")
1116 $pw->setRequiredOnAuth(
true);
1119 $this->form_gui->addItem($pw);
1124 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1127 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1129 $ext->setMaxLength(50);
1130 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1131 $this->form_gui->addItem($ext);
1136 $sec_si->setTitle($this->lng->txt(
"system_information"));
1137 $this->form_gui->addItem($sec_si);
1140 if ($a_mode ==
"edit")
1142 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1146 $this->form_gui->addItem($siai);
1153 $this->form_gui->addItem($ac);
1156 $lng->loadLanguageModule(
'crs');
1161 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1162 $radg->addOption($op1);
1163 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1164 $radg->addOption($op2);
1174 $op2->addSubItem($acfrom);
1180 $op2->addSubItem($acto);
1183 $this->form_gui->addItem($radg);
1185 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1189 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1191 $disk_quota->setMaxLength(11);
1192 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1193 $this->form_gui->addItem($disk_quota);
1195 if ($a_mode ==
"edit")
1198 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1200 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1202 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1205 $dq_info[
'role_title']);
1207 else if (is_infinite($dq_info[
'role_disk_quota']))
1209 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1213 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1215 $dq_info[
'role_title']);
1217 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1223 if ($du_info[
'last_update'] === null)
1225 $disk_usage->
setValue($lng->txt(
'unknown'));
1229 require_once
'classes/class.ilFormat.php';
1233 foreach ($du_info[
'details'] as $detail_data)
1236 '<td>'.$detail_data[
'count'].
'</td>'.
1237 '<td>'.$lng->txt($detail_data[
'type']).
'</td>'.
1238 '<td>'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1242 $info .=
'</table>';
1243 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
1245 $disk_usage->setInfo($info);
1248 $this->form_gui->addItem($disk_usage);
1251 if (
true || $dq_info[
'last_reminder'])
1257 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1258 $this->form_gui->addItem($reminder);
1275 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1276 $this->form_gui->addItem($sec_pd);
1283 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1285 $gndr->addOption($female);
1287 $gndr->addOption($male);
1288 $this->form_gui->addItem($gndr);
1292 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1293 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1294 foreach($fields as $field => $req)
1300 $inp->setMaxLength(32);
1301 $inp->setRequired($req);
1302 $this->form_gui->addItem($inp);
1310 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1315 $this->form_gui->addItem($pi);
1321 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1322 $birthday->setShowEmpty(
true);
1323 $birthday->setStartYear(1900);
1324 $this->form_gui->addItem($birthday);
1331 array(
"institution", 40, 80),
1332 array(
"department", 40, 80),
1333 array(
"street", 40, 40),
1334 array(
"city", 40, 40),
1335 array(
"zipcode", 10, 10),
1336 array(
"country", 40, 40),
1337 array(
"sel_country"),
1338 array(
"phone_office", 30, 30),
1339 array(
"phone_home", 30, 30),
1340 array(
"phone_mobile", 30, 30),
1341 array(
"fax", 30, 30));
1344 foreach ($fields as $field)
1350 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1351 $this->form_gui->addItem($sec_cd);
1355 if ($field[0] !=
"sel_country")
1359 $inp->setMaxLength($field[2]);
1360 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1361 $settings[
"require_".$field[0]]);
1362 $this->form_gui->addItem($inp);
1367 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1369 $cs->
setRequired(isset($settings[
"require_".$field[0]]) &&
1370 $settings[
"require_".$field[0]]);
1371 $this->form_gui->addItem($cs);
1380 $em->
setRequired(isset($settings[
"require_email"]) &&
1381 $settings[
"require_email"]);
1382 $this->form_gui->addItem($em);
1391 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1392 $settings[
"require_hobby"]);
1393 $this->form_gui->addItem($hob);
1402 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1403 $settings[
"require_referral_comment"]);
1404 $this->form_gui->addItem($rc);
1411 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1412 $this->form_gui->addItem($sec_im);
1416 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1417 foreach ($fields as $field)
1423 $im->setMaxLength(40);
1424 $this->form_gui->addItem($im);
1432 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1433 $this->form_gui->addItem($sec_oi);
1439 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1441 $mr->setMaxLength(40);
1442 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1443 $settings[
"require_matriculation"]);
1444 $this->form_gui->addItem($mr);
1452 $mr->setMaxLength(40);
1453 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1454 $settings[
"require_delicious"]);
1455 $this->form_gui->addItem($mr);
1461 $ip->setMaxLength(255);
1462 $ip->setInfo($this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
" <br />".
1463 '<small class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1464 $this->form_gui->addItem($ip);
1467 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1472 $all_defs = $user_defined_fields->getDefinitions();
1476 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1479 foreach($all_defs as $field_id => $definition)
1484 "udf_".$definition[
'field_id']);
1486 $udf->setMaxLength(255);
1491 "udf_".$definition[
'field_id']);
1492 $udf->setUseRte(
true);
1497 "udf_".$definition[
'field_id']);
1498 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1499 $definition[
'field_values']));
1501 $udf->setRequired($definition[
'required']);
1502 $this->form_gui->addItem($udf);
1507 $a_mode ==
'create' or
1515 $sec_st->setTitle($this->lng->txt(
"settings"));
1516 $this->form_gui->addItem($sec_st);
1520 if ($a_mode ==
"create")
1525 $role->setValue($this->default_role);
1526 $role->setOptions($this->selectable_roles);
1527 $this->form_gui->addItem($role);
1535 $languages = $this->lng->getInstalledLanguages();
1537 foreach($languages as $l)
1539 $options[$l] = $lng->txt(
"lang_".$l);
1541 $lang->setOptions($options);
1542 $lang->setValue($ilSetting->get(
"language"));
1543 $this->form_gui->addItem(
$lang);
1551 $templates = $styleDefinition->getAllTemplates();
1553 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1556 if (count($templates) > 0 && is_array ($templates))
1558 foreach ($templates as $template)
1561 $styleDef->startParsing();
1562 $styles = $styleDef->getStyles();
1563 foreach ($styles as $style)
1569 $options[$template[
"id"].
":".$style[
"id"]] =
1570 $styleDef->getTemplateName().
" / ".$style[
"name"];
1574 $sk->setOptions($options);
1575 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1576 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1578 $this->form_gui->addItem($sk);
1586 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1587 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1589 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1590 $this->form_gui->addItem($hpp);
1594 'show_users_online');
1596 "y" => $lng->txt(
"users_online_show_y"),
1597 "associated" => $lng->txt(
"users_online_show_associated"),
1598 "n" => $lng->txt(
"users_online_show_n"));
1600 $uo->setValue($ilSetting->get(
"show_users_online"));
1601 $this->form_gui->addItem($uo);
1607 $os =
new ilCheckboxInputGUI($lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1608 $this->form_gui->addItem($os);
1615 $sec_op->setTitle($this->lng->txt(
"options"));
1616 $this->form_gui->addItem($sec_op);
1622 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1623 $this->form_gui->addItem($se);
1625 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1627 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1629 $this->form_gui->addItem($cb);
1635 if ($a_mode ==
"create" || $a_mode ==
"save")
1637 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1639 if ($a_mode ==
"edit" || $a_mode ==
"update")
1641 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1643 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1659 static $settings = null;
1668 if($settings == NULL)
1670 $settings = $ilSetting->getAll();
1672 return (
bool) $settings[
'usr_settings_changeable_lua_'.$a_field];
1682 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition, $ilUser
1685 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1689 $settings = $ilias->getAllSettings();
1692 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1694 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1701 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1703 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1709 $this->tabs_gui->clearTargets();
1713 $data[
"fields"] = array();
1714 $data[
"fields"][
"login"] = $this->
object->getLogin();
1715 $data[
"fields"][
"passwd"] =
"********";
1716 #$data["fields"]["passwd2"] = "********"; // will not be saved
1717 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1718 $data[
"fields"][
"title"] = $this->
object->getUTitle();
1719 $data[
"fields"][
"gender"] = $this->
object->getGender();
1720 $data[
"fields"][
"firstname"] = $this->
object->getFirstname();
1721 $data[
"fields"][
"lastname"] = $this->
object->getLastname();
1722 $data[
"fields"][
"institution"] = $this->
object->getInstitution();
1723 $data[
"fields"][
"department"] = $this->
object->getDepartment();
1724 $data[
"fields"][
"street"] = $this->
object->getStreet();
1725 $data[
"fields"][
"city"] = $this->
object->getCity();
1726 $data[
"fields"][
"zipcode"] = $this->
object->getZipcode();
1727 $data[
"fields"][
"country"] = $this->
object->getCountry();
1728 $data[
"fields"][
"sel_country"] = $this->
object->getSelectedCountry();
1729 $data[
"fields"][
"phone_office"] = $this->
object->getPhoneOffice();
1730 $data[
"fields"][
"phone_home"] = $this->
object->getPhoneHome();
1731 $data[
"fields"][
"phone_mobile"] = $this->
object->getPhoneMobile();
1732 $data[
"fields"][
"fax"] = $this->
object->getFax();
1733 $data[
"fields"][
"email"] = $this->
object->getEmail();
1734 $data[
"fields"][
"hobby"] = $this->
object->getHobby();
1735 $data[
"fields"][
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1736 $data[
"fields"][
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1737 $data[
"fields"][
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1738 $data[
"fields"][
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1739 $data[
"fields"][
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1740 $data[
"fields"][
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1741 $data[
"fields"][
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1742 $data[
"fields"][
"matriculation"] = $this->
object->getMatriculation();
1743 $data[
"fields"][
"client_ip"] = $this->
object->getClientIP();
1744 $data[
"fields"][
"referral_comment"] = $this->
object->getComment();
1746 $data[
"fields"][
"create_date"] = $this->
object->getCreateDate();
1747 $data[
"fields"][
"approve_date"] = $this->
object->getApproveDate();
1748 $data[
"fields"][
"agree_date"] = $this->
object->getAgreeDate();
1749 $data[
"fields"][
"last_login"] = $this->
object->getLastLogin();
1750 $data[
"fields"][
"active"] = $this->
object->getActive();
1751 $data[
"fields"][
"auth_mode"] = $this->
object->getAuthMode();
1752 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1755 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"personal_picture"));
1757 $full_img = $this->
object->getPref(
"profile_image");
1758 $last_dot = strrpos($full_img,
".");
1759 $small_img = substr($full_img, 0, $last_dot).
1760 "_small".substr($full_img, $last_dot, strlen($full_img) - $last_dot);
1761 $image_file = $webspace_dir.
"/usr_images/".$small_img;
1762 if (@is_file($image_file))
1764 $this->tpl->setVariable(
"IMG_PERSONAL", $image_file.
"?dummy=".rand(1,99999));
1765 $this->tpl->setVariable(
"ALT_IMG_PERSONAL",$this->lng->txt(
"personal_picture"));
1766 $this->tpl->setVariable(
"TXT_REMOVE_PIC", $this->lng->txt(
"remove_personal_picture"));
1769 $this->tpl->setVariable(
"UPLOAD", $this->lng->txt(
"upload"));
1770 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"userfile"));
1771 $this->tpl->setVariable(
"USER_FILE", $this->lng->txt(
"user_file"));
1796 $user_is_online =
false;
1800 $user_is_online =
true;
1803 preg_match(
"/RoleId.*?;\}/",$user_online[$this->object->getId()][
"data"],$matches);
1805 $active_roles = unserialize(substr($matches[0],7));
1808 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
1810 foreach ($assigned_roles as $key => $role)
1812 $roleObj = $this->ilias->obj_factory->getInstanceByObjId($role);
1815 $rolf = $rbacreview->getFoldersAssignedToRole($role,
true);
1818 if (count($rolf) > 0)
1820 if (!$rbacreview->isDeleted($rolf[0]))
1824 if ($this->tree->isInTree($rolf[0]))
1826 $tmpPath = $this->tree->getPathFull($rolf[0]);
1829 for ($i = 0; $i < (count($tmpPath)-1); $i++)
1836 $path .= $tmpPath[$i][
"title"];
1841 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role.
")</b>";
1843 $active_roles = $active_roles ? $active_roles : array();
1844 if (in_array($role,$active_roles))
1846 $data[
"active_role"][$role][
"active"] =
true;
1849 $data[
"active_role"][$role][
"title"] = $roleObj->getTitle();
1850 $data[
"active_role"][$role][
"context"] =
$path;
1857 $path =
"<b>No role folder found for role ".$role.
"!</b>";
1865 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"]))
1867 if (!isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"]))
1869 $_SESSION[
"error_post_vars"][
"Fobject"][
"active"] = 0;
1872 foreach (
$_SESSION[
"error_post_vars"][
"Fobject"] as $key => $val)
1874 $str = $this->lng->txt($key);
1875 if ($key ==
"title")
1877 $str = $this->lng->txt(
"person_title");
1879 if($key ==
'passwd2')
1883 if($key ==
'passwd')
1888 $this->tpl->setCurrentBlock(
'passwords_visible');
1889 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1890 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1891 $this->tpl->setVariable(
'VISIBLE_PASSWD',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd']);
1892 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd2']);
1893 $this->tpl->parseCurrentBlock();
1897 $this->tpl->setCurrentBlock(
'passwords_invisible');
1898 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1899 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1900 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
1903 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
1906 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
1907 $this->tpl->parseCurrentBlock();
1914 if (isset($settings[
"require_" . $key]) && $settings[
"require_" . $key])
1916 $str = $str .
'<span class="asterisk">*</span>';
1919 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
1921 if ($key !=
"default_role" and $key !=
"language"
1922 and $key !=
"skin_style" and $key !=
"hits_per_page"
1923 and $key !=
"show_users_online")
1935 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
1938 $active =
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"];
1941 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
1946 if (!isset($data[
"fields"][
"active"]))
1948 $data[
"fields"][
"active"] = 0;
1951 foreach ($data[
"fields"] as $key => $val)
1953 $str = $this->lng->txt($key);
1954 if ($key ==
"title")
1956 $str = $this->lng->txt(
"person_title");
1958 if ($key ==
"ext_account")
1962 if($key ==
'passwd')
1964 $auth_mode = $this->
object->getAuthMode(
true);
1967 $this->tpl->setCurrentBlock(
'passwords_visible');
1968 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1969 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1970 $this->tpl->setVariable(
'VISIBLE_PASSWD',
"********");
1971 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
"********");
1972 $this->tpl->parseCurrentBlock();
1976 $this->tpl->setCurrentBlock(
'passwords_invisible');
1977 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1978 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1979 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
1982 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
1985 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
1986 $this->tpl->parseCurrentBlock();
1992 if (isset($settings[
"require_" . $key]) && $settings[
"require_" . $key])
1994 $str = $str .
'<span class="asterisk">*</span>';
1997 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
2000 #$this->tpl->parseCurrentBlock();
2004 $gender = strtoupper($data[
"fields"][
"gender"]);
2008 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
2011 $active = $data[
"fields"][
"active"];
2014 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
2019 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2022 $this->tpl->setCurrentBlock(
"ext_account");
2023 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT",$this->lng->txt(
"user_ext_account"));
2024 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT_DESC",$this->lng->txt(
"user_ext_account_desc"));
2025 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]))
2027 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2028 $_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]);
2032 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2033 $data[
"fields"][
"ext_account"]);
2044 $this->tpl->parseCurrentBlock();
2046 $auth_mode =
$_SESSION[
'error_post_vars'][
'Fobject'][
'auth_mode'] ?
2048 $this->
object->getAuthMode(
true);
2051 $this->tpl->setVariable(
"OPTION_DISABLED",
"\"disabled=disabled\"");
2053 $obj_str = ($this->call_by_reference) ?
"" :
"&obj_id=".$this->obj_id;
2055 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2056 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
2057 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2058 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2059 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
2060 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
2061 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2063 $this->tpl->setVariable(
"TXT_LOGIN_DATA", $this->lng->txt(
"login_data"));
2064 $this->tpl->setVariable(
"TXT_SYSTEM_INFO", $this->lng->txt(
"system_information"));
2065 $this->tpl->setVariable(
"TXT_PERSONAL_DATA", $this->lng->txt(
"personal_data"));
2066 $this->tpl->setVariable(
"TXT_CONTACT_DATA", $this->lng->txt(
"contact_data"));
2067 $this->tpl->setVariable(
"TXT_SETTINGS", $this->lng->txt(
"settings"));
2068 $this->tpl->setVariable(
"TXT_LANGUAGE",$this->lng->txt(
"language"));
2069 $this->tpl->setVariable(
"TXT_SKIN_STYLE",$this->lng->txt(
"usr_skin_style"));
2070 $this->tpl->setVariable(
"TXT_HITS_PER_PAGE",$this->lng->txt(
"hits_per_page"));
2071 $this->tpl->setVariable(
"TXT_SHOW_USERS_ONLINE",$this->lng->txt(
"show_users_online"));
2072 $this->tpl->setVariable(
"TXT_GENDER_F",$this->lng->txt(
"gender_f"));
2073 $this->tpl->setVariable(
"TXT_GENDER_M",$this->lng->txt(
"gender_m"));
2074 $this->tpl->setVariable(
"TXT_INSTANT_MESSENGERS",$this->lng->txt(
"user_profile_instant_messengers"));
2075 $this->tpl->setVariable(
"TXT_OTHER",$this->lng->txt(
"user_profile_other"));
2076 if ($this->object->getId() == $ilUser->getId())
2078 $this->tpl->setVariable(
"TXT_CURRENT_IP",
"(".$this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
")");
2080 $this->tpl->setVariable(
"TXT_CURRENT_IP_ALERT",$this->lng->txt(
"current_ip_alert"));
2083 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2087 $selected_auth_mode = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"] : $this->object->getAuthMode();
2089 foreach ($active_auth_modes as $auth_name => $auth_key)
2091 $this->tpl->setCurrentBlock(
"auth_mode_selection");
2093 if ($auth_name ==
'default')
2099 $name = $this->lng->txt(
'auth_'.$auth_name);
2102 $this->tpl->setVariable(
"AUTH_MODE_NAME", $name);
2104 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
2106 if ($selected_auth_mode == $auth_name)
2108 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
2111 $this->tpl->parseCurrentBlock();
2116 $languages = $this->lng->getInstalledLanguages();
2119 $selected_lang = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"] : $this->object->getLanguage();
2121 foreach ($languages as $lang_key)
2123 $this->tpl->setCurrentBlock(
"language_selection");
2124 $this->tpl->setVariable(
"LANG", $this->lng->txt(
"lang_".$lang_key));
2125 $this->tpl->setVariable(
"LANGSHORT", $lang_key);
2127 if ($selected_lang == $lang_key)
2129 $this->tpl->setVariable(
"SELECTED_LANG",
"selected=\"selected\"");
2132 $this->tpl->parseCurrentBlock();
2137 $templates = $styleDefinition->getAllTemplates();
2140 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]))
2142 $sknst = explode(
":",
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]);
2144 $selected_style = $sknst[1];
2145 $selected_skin = $sknst[0];
2149 $selected_style = $this->
object->prefs[
"style"];
2150 $selected_skin = $this->
object->skin;
2153 include(
"./Services/Style/classes/class.ilObjStyleSettings.php");
2154 if (count($templates) > 0 && is_array ($templates))
2156 foreach ($templates as $template)
2161 $styleDef->startParsing();
2162 $styles = $styleDef->getStyles();
2163 foreach ($styles as $style)
2170 $this->tpl->setCurrentBlock(
"selectskin");
2172 if ($selected_skin == $template[
"id"] &&
2173 $selected_style == $style[
"id"])
2175 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
2178 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
2179 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
2180 $this->tpl->parseCurrentBlock();
2185 $hits_options = array(2,10,15,20,30,40,50,100,9999);
2187 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"]))
2189 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"];
2193 $selected_option = $this->
object->prefs[
"hits_per_page"];
2195 foreach($hits_options as $hits_option)
2197 $this->tpl->setCurrentBlock(
"selecthits");
2199 if ($selected_option == $hits_option)
2201 $this->tpl->setVariable(
"HITSSELECTED",
"selected=\"selected\"");
2204 $this->tpl->setVariable(
"HITSVALUE", $hits_option);
2206 if ($hits_option == 9999)
2208 $hits_option = $this->lng->txt(
"no_limit");
2211 $this->tpl->setVariable(
"HITSOPTION", $hits_option);
2212 $this->tpl->parseCurrentBlock();
2217 $users_online_options = array(
"y",
"associated",
"n");
2219 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"]))
2221 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"];
2225 $selected_option = $this->
object->prefs[
"show_users_online"];
2227 foreach($users_online_options as $an_option)
2229 $this->tpl->setCurrentBlock(
"show_users_online");
2231 if ($selected_option == $an_option)
2233 $this->tpl->setVariable(
"USERS_ONLINE_SELECTED",
"selected=\"selected\"");
2236 $this->tpl->setVariable(
"USERS_ONLINE_VALUE", $an_option);
2238 $this->tpl->setVariable(
"USERS_ONLINE_OPTION", $this->lng->txt(
"users_online_show_".$an_option));
2239 $this->tpl->parseCurrentBlock();
2244 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"]))
2246 $hide_own_online_status =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"];
2250 $hide_own_online_status = ($this->
object->prefs[
"hide_own_online_status"] !=
'') ? $this->object->prefs[
"hide_own_online_status"] :
"n";
2252 $this->tpl->setCurrentBlock(
"hide_own_online_status");
2253 $this->tpl->setVariable(
"TXT_HIDE_OWN_ONLINE_STATUS", $this->lng->txt(
"hide_own_online_status"));
2254 if ($hide_own_online_status ==
"y") {
2255 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"checked=\"checked\"");
2258 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"");
2260 $this->tpl->parseCurrentBlock();
2264 $this->tpl->setCurrentBlock(
"inform_user");
2267 $sendInfoMail = $ilUser->getPref(
'send_info_mails') ==
'y';
2271 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
2274 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL", $this->lng->txt(
"inform_user_mail"));
2275 $this->tpl->parseCurrentBlock();
2277 $this->lng->loadLanguageModule(
'crs');
2279 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] ?
2280 $_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] :
2281 $this->
object->getTimeLimitUnlimited();
2282 $time_limit_from =
$_SESSION[
"error_post_vars"][
"time_limit"][
"from"] ?
2284 $this->
object->getTimeLimitFrom();
2286 $time_limit_until =
$_SESSION[
"error_post_vars"][
"time_limit"][
"until"] ?
2288 $this->
object->getTimeLimitUntil();
2290 $this->tpl->setCurrentBlock(
"time_limit");
2291 $this->tpl->setVariable(
"TXT_TIME_LIMIT", $this->lng->txt(
"time_limit"));
2292 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED", $this->lng->txt(
"crs_unlimited"));
2293 $this->tpl->setVariable(
"TXT_TIME_LIMIT_FROM", $this->lng->txt(
"crs_from"));
2294 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNTIL", $this->lng->txt(
"crs_to"));
2296 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"time_limit[unlimited]",1));
2297 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[from][minute]",
2298 date(
"i",$time_limit_from)));
2299 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[from][hour]",
2300 date(
"G",$time_limit_from)));
2301 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_DAY",$this->
__getDateSelect(
"day",
"time_limit[from][day]",
2302 date(
"d",$time_limit_from)));
2303 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MONTH",$this->
__getDateSelect(
"month",
"time_limit[from][month]",
2304 date(
"m",$time_limit_from)));
2305 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_YEAR",$this->
__getDateSelect(
"year",
"time_limit[from][year]",
2306 date(
"Y",$time_limit_from)));
2307 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[until][minute]",
2308 date(
"i",$time_limit_until)));
2309 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[until][hour]",
2310 date(
"G",$time_limit_until)));
2311 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_DAY",$this->
__getDateSelect(
"day",
"time_limit[until][day]",
2312 date(
"d",$time_limit_until)));
2313 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MONTH",$this->
__getDateSelect(
"month",
"time_limit[until][month]",
2314 date(
"m",$time_limit_until)));
2315 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_YEAR",$this->
__getDateSelect(
"year",
"time_limit[until][year]",
2316 date(
"Y",$time_limit_until)));
2317 $this->tpl->parseCurrentBlock();
2330 global $ilUser, $rbacsystem;
2334 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
2336 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2343 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2345 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2349 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
2351 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
2353 if ($userfile_input->getDeletionFlag())
2355 $this->
object->removeUserPicture();
2359 if ($_FILES[
"userfile"][
"size"] == 0)
2366 $image_dir = $webspace_dir.
"/usr_images";
2367 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
2370 $this->
object->setPref(
"profile_image", $store_file);
2371 $this->
object->update();
2374 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
"pic";
2376 $uploaded_file,
false))
2379 $this->ctrl->redirect($this,
"showProfile");
2381 chmod($uploaded_file, 0770);
2385 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
2386 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
2387 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
2388 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
2397 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200^ -gravity center -extent 200x200 -quality 100 JPEG:".$show_file);
2398 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100^ -gravity center -extent 100x100 -quality 100 JPEG:".$thumb_file);
2399 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75^ -gravity center -extent 75x75 -quality 100 JPEG:".$xthumb_file);
2400 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30^ -gravity center -extent 30x30 -quality 100 JPEG:".$xxthumb_file);
2404 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
2405 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
2406 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
2407 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
2418 $image_dir = $webspace_dir.
"/usr_images";
2419 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
2420 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
2421 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
2422 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
2423 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
2426 $this->
object->setPref(
"profile_image",
"");
2427 $this->
object->update();
2430 if (@is_file(
$file))
2434 if (@is_file($thumb_file))
2436 unlink($thumb_file);
2438 if (@is_file($xthumb_file))
2440 unlink($xthumb_file);
2442 if (@is_file($xxthumb_file))
2444 unlink($xxthumb_file);
2446 if (@is_file($upload_file))
2448 unlink($upload_file);
2692 global
$ilias, $rbacsystem, $rbacadmin,$ilUser;
2694 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2697 $settings = $ilias->getAllSettings();
2700 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2702 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2709 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2711 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2715 foreach (
$_POST[
"Fobject"] as $key => $val)
2721 foreach ($settings as $key => $val)
2723 $field = substr($key,8);
2730 $require_keys[] = $field;
2734 $require_keys[] = $field;
2740 foreach ($require_keys as $key => $val)
2743 $system_fields = array(
"default_role");
2744 if (!in_array($val, $system_fields))
2746 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2748 if (empty(
$_POST[
"Fobject"][$val]))
2750 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2751 $this->lng->txt($val),$this->ilias->error_obj->MESSAGE);
2759 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
2762 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2765 $this->ilias->raiseError($this->lng->txt(
"login_invalid"),$this->ilias->error_obj->MESSAGE);
2771 $this->ilias->raiseError($this->lng->txt(
"login_exists"),$this->ilias->error_obj->MESSAGE);
2776 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2777 !strlen($this->object->getPasswd()))
2779 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2780 $this->lng->txt(
'password'),$this->ilias->error_obj->MESSAGE);
2783 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2785 $this->ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->ilias->error_obj->MESSAGE);
2791 $this->ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->ilias->error_obj->MESSAGE);
2797 $_POST[
'Fobject'][
'passwd'] =
"********";
2801 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2803 $this->ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->ilias->error_obj->MESSAGE);
2806 if(
$_POST[
'Fobject'][
'ext_account'] &&
2809 if($elogin != $this->object->getLogin())
2811 $this->ilias->raiseError(
2812 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2813 $_POST[
"Fobject"][
"ext_account"],
2814 $_POST[
'Fobject'][
'auth_mode'],
2816 $this->ilias->error_obj->MESSAGE);
2822 include_once (
'./Services/User/classes/class.ilObjUser.php');
2828 $this->ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->ilias->error_obj->MESSAGE);
2835 if (!
$_POST[
"time_limit"][
"unlimited"] and
2838 $this->ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->ilias->error_obj->MESSAGE);
2841 if(!$this->ilias->account->getTimeLimitUnlimited())
2843 if($start < $this->ilias->account->getTimeLimitFrom() or
2844 $end > $this->ilias->account->getTimeLimitUntil() or
2845 $_POST[
'time_limit'][
'unlimited'])
2859 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
2861 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
2865 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
2866 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
2867 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
2869 $_POST[
'Fobject'][
'time_limit_message'] = 0;
2873 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
2876 $this->
object->assignData(
$_POST[
"Fobject"]);
2877 $this->
object->setUserDefinedData(
$_POST[
'udf']);
2881 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
2886 $this->form_gui->setValuesByPost();
2887 return $tpl->setContent($this->form_gui->getHtml());
2890 $this->
object->setTitle($this->object->getFullname());
2891 $this->
object->setDescription($this->object->getEmail());
2892 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
2895 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
2897 if ($this->object->getPref(
"style") != $sknst[1] ||
2898 $this->
object->getPref(
"skin") != $sknst[0])
2900 $this->
object->setPref(
"skin", $sknst[0]);
2901 $this->
object->setPref(
"style", $sknst[1]);
2905 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
2907 $this->
object->setPref(
"show_users_online",
$_POST[
"Fobject"][
"show_users_online"]);
2909 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
2910 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
2913 $this->
object->setPref(
"hide_own_online_status",
"n");
2916 $this->update = $this->
object->update();
2921 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
2922 $ilUser->writePrefs();
2926 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
2931 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2933 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
2937 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2950 global $rbacsystem, $rbacadmin, $rbacreview;
2952 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2954 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
2957 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
2958 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
2961 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
2963 array_push($selected_roles,SYSTEM_ROLE_ID);
2966 $global_roles_all = $rbacreview->getGlobalRoles();
2967 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
2968 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
2969 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
2970 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
2971 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
2973 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
2974 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
2978 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
2979 $this->ctrl->redirect($this,
'roleassignment');
2982 foreach (array_diff($assigned_roles,$selected_roles) as $role)
2984 $rbacadmin->deassignUser($role,$this->object->getId());
2987 foreach (array_diff($selected_roles,$assigned_roles) as $role)
2989 $rbacadmin->assignUser($role,$this->object->getId(),
false);
2992 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
2995 $this->
object->update();
2999 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
3001 $this->ctrl->redirect($this,
'roleassignment');
3005 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
3017 global $rbacreview,$rbacsystem,$ilUser, $ilTabs;
3019 $ilTabs->activateTab(
"role_assignment");
3021 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
3023 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
3033 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html');
3037 $this->tpl->setCurrentBlock(
"filter");
3038 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
3040 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
3041 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
3042 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
3043 $this->tpl->parseCurrentBlock();
3047 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3051 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
3052 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
3056 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
3059 foreach ($role_list as $role)
3062 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3065 if ($rbacreview->isDeleted($rolf[0]))
3073 if ($this->tree->isInTree($rolf[0]))
3075 if ($rolf[0] == ROLE_FOLDER_ID)
3077 $path = $this->lng->txt(
"global");
3081 $tmpPath = $this->tree->getPathFull($rolf[0]);
3094 $path = $tmpPath[count($tmpPath)-2][
"title"];
3099 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
3105 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
3106 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
3111 if (substr($role[
"title"],0,3) ==
"il_")
3115 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3116 $rolf2 = $rolf_arr[0];
3123 $parent_node = $this->tree->getParentNodeData($rolf2);
3125 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
3128 $role_ids[$counter] = $role[
"obj_id"];
3130 $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"].
"\"/>";
3131 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
3132 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
3133 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
3135 $result_set[$counter][] = $role[
"description"];
3138 if ($role[
"role_type"] ==
"local") {
3146 foreach ($ref_ids as
$ref_id) {}
3148 require_once(
"./classes/class.ilLink.php");
3154 $result_set[$counter][] =
$path;
3158 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
3159 "context" => $context,
"checkbox" => $checkbox,
3160 "role" => $link,
"title" =>
$title);
3166 $tab->setData($records);
3167 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
3179 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3181 $table_gui->writeFilterToSession();
3182 $table_gui->resetOffset();
3191 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3193 $table_gui->resetOffset();
3194 $table_gui->resetFilter();
3203 for($i=0;$i<=60;$i++)
3205 $days[$i] = $i < 10 ?
"0".$i : $i;
3210 for($i=0;$i<24;$i++)
3212 $days[$i] = $i < 10 ?
"0".$i : $i;
3217 for($i=1;$i<32;$i++)
3219 $days[$i] = $i < 10 ?
"0".$i : $i;
3224 for($i=1;$i<13;$i++)
3226 $month[$i] = $i < 10 ?
"0".$i : $i;
3231 if($a_selected < date(
'Y',time()))
3233 $start = $a_selected;
3237 $start = date(
'Y',time());
3240 for($i = $start;$i < date(
"Y",time()) + 11;++$i)
3250 return mktime($a_time_arr[
"hour"],
3251 $a_time_arr[
"minute"],
3252 $a_time_arr[
"second"],
3253 $a_time_arr[
"month"],
3255 $a_time_arr[
"year"]);
3262 $actions = array(
"assignSave" => $this->lng->txt(
"change_assignment"));
3265 $tpl =& $tbl->getTemplateObject();
3267 $tpl->setCurrentBlock(
"tbl_form_header");
3268 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3269 $tpl->parseCurrentBlock();
3271 $tpl->setCurrentBlock(
"tbl_action_row");
3273 $tpl->setVariable(
"COLUMN_COUNTS",4);
3276 foreach (
$actions as $name => $value)
3278 $tpl->setCurrentBlock(
"tbl_action_btn");
3279 $tpl->setVariable(
"BTN_NAME",$name);
3280 $tpl->setVariable(
"BTN_VALUE",$value);
3281 $tpl->parseCurrentBlock();
3284 if (!empty($a_role_ids))
3287 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
3288 $tpl->setVariable(
"JS_VARNAME",
"role_id");
3290 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3291 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3292 $tpl->parseCurrentBlock();
3295 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3298 $this->ctrl->setParameter($this,
"cmd",
"roleassignment");
3301 $tbl->setTitle($this->lng->txt(
"edit_roleassignment"),
"icon_role.gif",$this->lng->txt(
"roles"));
3304 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"role"),$this->lng->txt(
"description"),$this->lng->txt(
"context")));
3305 $tbl->setHeaderVars(array(
"",
"title",
"description",
"context"),$this->ctrl->getParameterArray($this,
"",
false));
3306 $tbl->setColumnWidth(array(
"",
"30%",
"40%",
"30%"));
3310 $this->tpl->setVariable(
"ROLES_TABLE",$tbl->tpl->get());
3317 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3327 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3332 $tbl->setOrderColumn($order);
3333 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3334 $tbl->setOffset(
$_GET[
"offset"]);
3335 $tbl->setLimit(
$_GET[
"limit"]);
3336 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3337 $tbl->setData($result_set);
3347 $action[0] = $this->lng->txt(
'assigned_roles');
3348 $action[1] = $this->lng->txt(
'all_roles');
3349 $action[2] = $this->lng->txt(
'all_global_roles');
3350 $action[3] = $this->lng->txt(
'all_local_roles');
3351 $action[4] = $this->lng->txt(
'internal_local_roles_only');
3352 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
3371 $ilLocator->clearItems();
3373 if (
$_GET[
"admin_mode"] ==
"settings")
3375 $ilLocator->addItem($this->lng->txt(
"administration"),
3376 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
3381 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3383 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3385 elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID)
3387 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3389 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
3392 if (
$_GET[
"obj_id"] > 0)
3394 $ilLocator->addItem($this->object->getTitle(),
3395 $this->ctrl->getLinkTarget($this,
"view"));
3408 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
3411 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3415 if ($this->object->getRefId() != ROOT_FOLDER_ID &&
3416 $this->
object->getRefId() != SYSTEM_FOLDER_ID)
3418 $par_id = $tree->getParentId($this->usrf_ref_id);
3419 $tpl->setUpperIcon(
"repository.php?ref_id=".$par_id);
3428 if(
$_POST[
'send_mail'] !=
'y')
3432 if(!strlen($this->object->getEmail()))
3438 $usr_lang =
new ilLanguage($this->object->getLanguage());
3440 $usr_lang->loadLanguageModule(
'registration');
3442 include_once
"Services/Mail/classes/class.ilMimeMail.php";
3445 $mmail->autoCheck(
false);
3446 $mmail->From($ilUser->getEmail());
3447 $mmail->To($this->object->getEmail());
3450 $subject = $usr_lang->txt(
"profile_changed");
3454 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
3456 $date = $this->
object->getApproveDate();
3458 if((time() - strtotime($date)) < 10)
3460 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
3464 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
3468 if(
$_POST[
'passwd'] !=
'********')
3470 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
3471 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
3472 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
3473 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
3475 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
3476 $body .= $this->
object->getProfileAsString($usr_lang);
3478 $mmail->Subject($subject);
3479 $mmail->Body($body);
3483 return "<br/>".$this->lng->txt(
"mail_sent");
3491 global $ilAccess,
$ilErr,
$lng, $ilNavigationHistory;
3493 if (substr($a_target, 0, 1) ==
"n")
3498 $_GET[
"cmd"] =
"view";
3499 $_GET[
"user_id"] = (int) $a_target;
3500 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
3501 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
3502 include(
"ilias.php");