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);
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';
979 $data[
"gender"] = $this->
object->getGender();
980 $data[
"firstname"] = $this->
object->getFirstname();
981 $data[
"lastname"] = $this->
object->getLastname();
982 $data[
"title"] = $this->
object->getUTitle();
983 $data[
'birthday'] = $this->
object->getBirthday();
984 $data[
"institution"] = $this->
object->getInstitution();
985 $data[
"department"] = $this->
object->getDepartment();
986 $data[
"street"] = $this->
object->getStreet();
987 $data[
"city"] = $this->
object->getCity();
988 $data[
"zipcode"] = $this->
object->getZipcode();
989 $data[
"country"] = $this->
object->getCountry();
990 $data[
"sel_country"] = $this->
object->getSelectedCountry();
991 $data[
"phone_office"] = $this->
object->getPhoneOffice();
992 $data[
"phone_home"] = $this->
object->getPhoneHome();
993 $data[
"phone_mobile"] = $this->
object->getPhoneMobile();
994 $data[
"fax"] = $this->
object->getFax();
995 $data[
"email"] = $this->
object->getEmail();
996 $data[
"hobby"] = $this->
object->getHobby();
997 $data[
"referral_comment"] = $this->
object->getComment();
1000 $data[
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1001 $data[
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1002 $data[
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1003 $data[
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1004 $data[
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1005 $data[
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1006 $data[
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1009 $data[
"matriculation"] = $this->
object->getMatriculation();
1010 $data[
"delicious"] = $this->
object->getDelicious();
1011 $data[
"client_ip"] = $this->
object->getClientIP();
1014 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1016 $user_defined_data = $this->
object->getUserDefinedData();
1017 foreach($this->user_defined_fields->getDefinitions() as $field_id => $definition)
1019 $data[
"udf_".$field_id] = $user_defined_data[
"f_".$field_id];
1023 $data[
"language"] = $this->
object->getLanguage();
1024 $data[
"skin_style"] = $this->
object->skin.
":".$this->
object->prefs[
"style"];
1025 $data[
"hits_per_page"] = $this->
object->prefs[
"hits_per_page"];
1026 $data[
"show_users_online"] = $this->
object->prefs[
"show_users_online"];
1027 $data[
"hide_own_online_status"] = $this->
object->prefs[
"hide_own_online_status"] ==
'y';
1028 $data[
"session_reminder_enabled"] = (int)$this->object->prefs[
"session_reminder_enabled"];
1030 $this->form_gui->setValuesByArray($data);
1040 $settings = $ilSetting->getAll();
1042 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1045 $this->form_gui->setFormAction($ilCtrl->getFormAction($this));
1046 if ($a_mode ==
"create")
1048 $this->form_gui->setTitle($lng->txt(
"usr_new"));
1052 $this->form_gui->setTitle($lng->txt(
"usr_edit"));
1057 $sec_l->setTitle($lng->txt(
"login_data"));
1058 $this->form_gui->addItem($sec_l);
1061 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1065 foreach ($active_auth_modes as $auth_name => $auth_key)
1067 if ($auth_name ==
'default')
1073 $name = $this->lng->txt(
'auth_'.$auth_name);
1075 $option[$auth_name] =
$name;
1077 $am->setOptions($option);
1078 $this->form_gui->addItem($am);
1083 if ($a_mode ==
"edit")
1085 $lo->setCurrentUserId($this->object->getId());
1088 include_once
'Services/Calendar/classes/class.ilDate.php';
1093 $this->lng->txt(
'usr_loginname_history_info'),
1095 $last_history_entry[0]
1102 $this->form_gui->addItem($lo);
1110 $pw->setMaxLength(32);
1111 $pw->setValidateAuthPost(
"auth_mode");
1112 if ($a_mode ==
"create")
1114 $pw->setRequiredOnAuth(
true);
1117 $this->form_gui->addItem($pw);
1122 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1125 $ext =
new ilTextInputGUI($lng->txt(
"user_ext_account"),
"ext_account");
1127 $ext->setMaxLength(50);
1128 $ext->setInfo($lng->txt(
"user_ext_account_desc"));
1129 $this->form_gui->addItem($ext);
1134 $sec_si->setTitle($this->lng->txt(
"system_information"));
1135 $this->form_gui->addItem($sec_si);
1138 if ($a_mode ==
"edit")
1140 $sia = array(
"create_date",
"approve_date",
"agree_date",
"last_login",
"owner");
1144 $this->form_gui->addItem($siai);
1151 $this->form_gui->addItem($ac);
1154 $lng->loadLanguageModule(
'crs');
1159 $op1 =
new ilRadioOption($lng->txt(
"user_access_unlimited"), 1);
1160 $radg->addOption($op1);
1161 $op2 =
new ilRadioOption($lng->txt(
"user_access_limited"), 0);
1162 $radg->addOption($op2);
1172 $op2->addSubItem($acfrom);
1178 $op2->addSubItem($acto);
1181 $this->form_gui->addItem($radg);
1183 require_once
'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
1187 $disk_quota =
new ilTextInputGUI($lng->txt(
"disk_quota"),
"disk_quota");
1189 $disk_quota->setMaxLength(11);
1190 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc"));
1191 $this->form_gui->addItem($disk_quota);
1193 if ($a_mode ==
"edit")
1196 require_once
'Services/WebDAV/classes/class.ilDiskQuotaChecker.php';
1198 if ($dq_info[
'user_disk_quota'] > $dq_info[
'role_disk_quota'])
1200 $info_text = sprintf($lng->txt(
'disk_quota_is_1_instead_of_2_by_3'),
1203 $dq_info[
'role_title']);
1205 else if (is_infinite($dq_info[
'role_disk_quota']))
1207 $info_text = sprintf($lng->txt(
'disk_quota_is_unlimited_by_1'), $dq_info[
'role_title']);
1211 $info_text = sprintf($lng->txt(
'disk_quota_is_1_by_2'),
1213 $dq_info[
'role_title']);
1215 $disk_quota->setInfo($this->lng->txt(
"enter_in_mb_desc").
'<br>'.$info_text);
1221 if ($du_info[
'last_update'] === null)
1223 $disk_usage->
setValue($lng->txt(
'unknown'));
1227 require_once
'classes/class.ilFormat.php';
1231 foreach ($du_info[
'details'] as $detail_data)
1234 '<td>'.$detail_data[
'count'].
'</td>'.
1235 '<td>'.$lng->txt($detail_data[
'type']).
'</td>'.
1236 '<td>'.ilFormat::formatSize($detail_data[
'size'],
'short').
'</td>'.
1240 $info .=
'</table>';
1241 $info .=
'<br>'.$this->lng->txt(
'last_update').
': '.
1243 $disk_usage->setInfo($info);
1246 $this->form_gui->addItem($disk_usage);
1249 if (
true || $dq_info[
'last_reminder'])
1255 $reminder->setInfo($this->lng->txt(
"disk_quota_last_reminder_sent_desc"));
1256 $this->form_gui->addItem($reminder);
1273 $sec_pd->setTitle($this->lng->txt(
"personal_data"));
1274 $this->form_gui->addItem($sec_pd);
1281 $gndr->
setRequired(isset($settings[
"require_gender"]) && $settings[
"require_gender"]);
1283 $gndr->addOption($female);
1285 $gndr->addOption($male);
1286 $this->form_gui->addItem($gndr);
1290 $fields = array(
"firstname" =>
true,
"lastname" =>
true,
1291 "title" => isset($settings[
"require_title"]) && $settings[
"require_title"]);
1292 foreach($fields as $field => $req)
1298 $inp->setMaxLength(32);
1299 $inp->setRequired($req);
1300 $this->form_gui->addItem($inp);
1308 if ($a_mode ==
"edit" || $a_mode ==
"upload")
1313 $this->form_gui->addItem($pi);
1319 $birthday->
setRequired(isset($settings[
"require_birthday"]) && $settings[
"require_birthday"]);
1320 $birthday->setShowEmpty(
true);
1321 $birthday->setStartYear(1900);
1322 $this->form_gui->addItem($birthday);
1329 array(
"institution", 40, 80),
1330 array(
"department", 40, 80),
1331 array(
"street", 40, 40),
1332 array(
"city", 40, 40),
1333 array(
"zipcode", 10, 10),
1334 array(
"country", 40, 40),
1335 array(
"sel_country"),
1336 array(
"phone_office", 30, 30),
1337 array(
"phone_home", 30, 30),
1338 array(
"phone_mobile", 30, 30),
1339 array(
"fax", 30, 30));
1342 foreach ($fields as $field)
1348 $sec_cd->setTitle($this->lng->txt(
"contact_data"));
1349 $this->form_gui->addItem($sec_cd);
1353 if ($field[0] !=
"sel_country")
1357 $inp->setMaxLength($field[2]);
1358 $inp->setRequired(isset($settings[
"require_".$field[0]]) &&
1359 $settings[
"require_".$field[0]]);
1360 $this->form_gui->addItem($inp);
1365 include_once(
"./Services/Form/classes/class.ilCountrySelectInputGUI.php");
1367 $cs->
setRequired(isset($settings[
"require_".$field[0]]) &&
1368 $settings[
"require_".$field[0]]);
1369 $this->form_gui->addItem($cs);
1378 $em->
setRequired(isset($settings[
"require_email"]) &&
1379 $settings[
"require_email"]);
1380 $this->form_gui->addItem($em);
1389 $hob->setRequired(isset($settings[
"require_hobby"]) &&
1390 $settings[
"require_hobby"]);
1391 $this->form_gui->addItem($hob);
1400 $rc->setRequired(isset($settings[
"require_referral_comment"]) &&
1401 $settings[
"require_referral_comment"]);
1402 $this->form_gui->addItem($rc);
1409 $sec_im->setTitle($this->lng->txt(
"instant_messengers"));
1410 $this->form_gui->addItem($sec_im);
1414 $fields = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1415 foreach ($fields as $field)
1421 $im->setMaxLength(40);
1422 $this->form_gui->addItem($im);
1430 $sec_oi->setTitle($this->lng->txt(
"user_profile_other"));
1431 $this->form_gui->addItem($sec_oi);
1437 $mr =
new ilTextInputGUI($lng->txt(
"matriculation"),
"matriculation");
1439 $mr->setMaxLength(40);
1440 $mr->setRequired(isset($settings[
"require_matriculation"]) &&
1441 $settings[
"require_matriculation"]);
1442 $this->form_gui->addItem($mr);
1450 $mr->setMaxLength(40);
1451 $mr->setRequired(isset($settings[
"require_delicious"]) &&
1452 $settings[
"require_delicious"]);
1453 $this->form_gui->addItem($mr);
1459 $ip->setMaxLength(255);
1460 $ip->setInfo($this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
" <br />".
1461 '<small class="warning">'.$this->lng->txt(
"current_ip_alert").
"</span>");
1462 $this->form_gui->addItem($ip);
1465 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1470 $all_defs = $user_defined_fields->getDefinitions();
1474 $all_defs = $user_defined_fields->getChangeableLocalUserAdministrationDefinitions();
1477 foreach($all_defs as $field_id => $definition)
1482 "udf_".$definition[
'field_id']);
1484 $udf->setMaxLength(255);
1489 "udf_".$definition[
'field_id']);
1490 $udf->setUseRte(
true);
1495 "udf_".$definition[
'field_id']);
1496 $udf->setOptions($user_defined_fields->fieldValuesToSelectArray(
1497 $definition[
'field_values']));
1499 $udf->setRequired($definition[
'required']);
1500 $this->form_gui->addItem($udf);
1505 $a_mode ==
'create' or
1513 $sec_st->setTitle($this->lng->txt(
"settings"));
1514 $this->form_gui->addItem($sec_st);
1518 if ($a_mode ==
"create")
1523 $role->setValue($this->default_role);
1524 $role->setOptions($this->selectable_roles);
1525 $this->form_gui->addItem($role);
1533 $languages = $this->lng->getInstalledLanguages();
1535 foreach($languages as
$l)
1537 $options[
$l] = $lng->txt(
"lang_".$l);
1539 $lang->setOptions($options);
1540 $lang->setValue($ilSetting->get(
"language"));
1541 $this->form_gui->addItem(
$lang);
1549 $templates = $styleDefinition->getAllTemplates();
1550 include(
"./Services/Style/classes/class.ilObjStyleSettings.php");
1552 if (count($templates) > 0 && is_array ($templates))
1554 foreach ($templates as $template)
1557 $styleDef->startParsing();
1558 $styles = $styleDef->getStyles();
1559 foreach ($styles as $style)
1565 $options[$template[
"id"].
":".$style[
"id"]] =
1566 $styleDef->getTemplateName().
" / ".$style[
"name"];
1570 $sk->setOptions($options);
1571 $sk->setValue($ilClientIniFile->readVariable(
"layout",
"skin").
1572 ":".$ilClientIniFile->readVariable(
"layout",
"style"));
1574 $this->form_gui->addItem($sk);
1582 $options = array(10 => 10, 15 => 15, 20 => 20, 30 => 30, 40 => 40,
1583 50 => 50, 100 => 100, 9999 => $this->lng->txt(
"no_limit"));
1585 $hpp->setValue($ilSetting->get(
"hits_per_page"));
1586 $this->form_gui->addItem($hpp);
1590 'show_users_online');
1592 "y" => $lng->txt(
"users_online_show_y"),
1593 "associated" => $lng->txt(
"users_online_show_associated"),
1594 "n" => $lng->txt(
"users_online_show_n"));
1596 $uo->setValue($ilSetting->get(
"show_users_online"));
1597 $this->form_gui->addItem($uo);
1603 $os =
new ilCheckboxInputGUI($lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
1604 $this->form_gui->addItem($os);
1611 $sec_op->setTitle($this->lng->txt(
"options"));
1612 $this->form_gui->addItem($sec_op);
1618 $se->setChecked(($ilUser->getPref(
'send_info_mails') ==
'y'));
1619 $this->form_gui->addItem($se);
1621 if((
int)$ilSetting->get(
'session_reminder_enabled'))
1623 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
1625 $this->form_gui->addItem($cb);
1631 if ($a_mode ==
"create" || $a_mode ==
"save")
1633 $this->form_gui->addCommandButton(
"save", $lng->txt(
"save"));
1635 if ($a_mode ==
"edit" || $a_mode ==
"update")
1637 $this->form_gui->addCommandButton(
"update", $lng->txt(
"save"));
1639 $this->form_gui->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1655 static $settings = null;
1664 if($settings == NULL)
1666 $settings = $ilSetting->getAll();
1668 return (
bool) $settings[
'usr_settings_changeable_lua_'.$a_field];
1678 global
$ilias, $rbacsystem, $rbacreview, $rbacadmin, $styleDefinition, $ilUser
1681 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
1685 $settings = $ilias->getAllSettings();
1688 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
1690 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1697 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
1699 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
1705 $this->tabs_gui->clearTargets();
1709 $data[
"fields"] = array();
1710 $data[
"fields"][
"login"] = $this->
object->getLogin();
1711 $data[
"fields"][
"passwd"] =
"********";
1712 #$data["fields"]["passwd2"] = "********"; // will not be saved
1713 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1714 $data[
"fields"][
"title"] = $this->
object->getUTitle();
1715 $data[
"fields"][
"gender"] = $this->
object->getGender();
1716 $data[
"fields"][
"firstname"] = $this->
object->getFirstname();
1717 $data[
"fields"][
"lastname"] = $this->
object->getLastname();
1718 $data[
"fields"][
"institution"] = $this->
object->getInstitution();
1719 $data[
"fields"][
"department"] = $this->
object->getDepartment();
1720 $data[
"fields"][
"street"] = $this->
object->getStreet();
1721 $data[
"fields"][
"city"] = $this->
object->getCity();
1722 $data[
"fields"][
"zipcode"] = $this->
object->getZipcode();
1723 $data[
"fields"][
"country"] = $this->
object->getCountry();
1724 $data[
"fields"][
"sel_country"] = $this->
object->getSelectedCountry();
1725 $data[
"fields"][
"phone_office"] = $this->
object->getPhoneOffice();
1726 $data[
"fields"][
"phone_home"] = $this->
object->getPhoneHome();
1727 $data[
"fields"][
"phone_mobile"] = $this->
object->getPhoneMobile();
1728 $data[
"fields"][
"fax"] = $this->
object->getFax();
1729 $data[
"fields"][
"email"] = $this->
object->getEmail();
1730 $data[
"fields"][
"hobby"] = $this->
object->getHobby();
1731 $data[
"fields"][
"im_icq"] = $this->
object->getInstantMessengerId(
'icq');
1732 $data[
"fields"][
"im_yahoo"] = $this->
object->getInstantMessengerId(
'yahoo');
1733 $data[
"fields"][
"im_msn"] = $this->
object->getInstantMessengerId(
'msn');
1734 $data[
"fields"][
"im_aim"] = $this->
object->getInstantMessengerId(
'aim');
1735 $data[
"fields"][
"im_skype"] = $this->
object->getInstantMessengerId(
'skype');
1736 $data[
"fields"][
"im_jabber"] = $this->
object->getInstantMessengerId(
'jabber');
1737 $data[
"fields"][
"im_voip"] = $this->
object->getInstantMessengerId(
'voip');
1738 $data[
"fields"][
"matriculation"] = $this->
object->getMatriculation();
1739 $data[
"fields"][
"client_ip"] = $this->
object->getClientIP();
1740 $data[
"fields"][
"referral_comment"] = $this->
object->getComment();
1742 $data[
"fields"][
"create_date"] = $this->
object->getCreateDate();
1743 $data[
"fields"][
"approve_date"] = $this->
object->getApproveDate();
1744 $data[
"fields"][
"agree_date"] = $this->
object->getAgreeDate();
1745 $data[
"fields"][
"last_login"] = $this->
object->getLastLogin();
1746 $data[
"fields"][
"active"] = $this->
object->getActive();
1747 $data[
"fields"][
"auth_mode"] = $this->
object->getAuthMode();
1748 $data[
"fields"][
"ext_account"] = $this->
object->getExternalAccount();
1751 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"personal_picture"));
1753 $full_img = $this->
object->getPref(
"profile_image");
1754 $last_dot = strrpos($full_img,
".");
1755 $small_img = substr($full_img, 0, $last_dot).
1756 "_small".substr($full_img, $last_dot, strlen($full_img) - $last_dot);
1757 $image_file = $webspace_dir.
"/usr_images/".$small_img;
1758 if (@is_file($image_file))
1760 $this->tpl->setVariable(
"IMG_PERSONAL", $image_file.
"?dummy=".rand(1,99999));
1761 $this->tpl->setVariable(
"ALT_IMG_PERSONAL",$this->lng->txt(
"personal_picture"));
1762 $this->tpl->setVariable(
"TXT_REMOVE_PIC", $this->lng->txt(
"remove_personal_picture"));
1765 $this->tpl->setVariable(
"UPLOAD", $this->lng->txt(
"upload"));
1766 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"userfile"));
1767 $this->tpl->setVariable(
"USER_FILE", $this->lng->txt(
"user_file"));
1790 $user_is_online =
false;
1794 $user_is_online =
true;
1797 preg_match(
"/RoleId.*?;\}/",$user_online[$this->object->getId()][
"data"],$matches);
1799 $active_roles = unserialize(substr($matches[0],7));
1802 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
1804 foreach ($assigned_roles as $key => $role)
1806 $roleObj = $this->ilias->obj_factory->getInstanceByObjId($role);
1809 $rolf = $rbacreview->getFoldersAssignedToRole($role,
true);
1812 if (count($rolf) > 0)
1814 if (!$rbacreview->isDeleted($rolf[0]))
1818 if ($this->tree->isInTree($rolf[0]))
1820 $tmpPath = $this->tree->getPathFull($rolf[0]);
1823 for ($i = 0; $i < (count($tmpPath)-1); $i++)
1830 $path .= $tmpPath[$i][
"title"];
1835 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role.
")</b>";
1837 $active_roles = $active_roles ? $active_roles : array();
1838 if (in_array($role,$active_roles))
1840 $data[
"active_role"][$role][
"active"] =
true;
1843 $data[
"active_role"][$role][
"title"] = $roleObj->getTitle();
1844 $data[
"active_role"][$role][
"context"] =
$path;
1851 $path =
"<b>No role folder found for role ".$role.
"!</b>";
1859 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"]))
1861 if (!isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"]))
1863 $_SESSION[
"error_post_vars"][
"Fobject"][
"active"] = 0;
1866 foreach (
$_SESSION[
"error_post_vars"][
"Fobject"] as $key => $val)
1868 $str = $this->lng->txt($key);
1869 if ($key ==
"title")
1871 $str = $this->lng->txt(
"person_title");
1873 if($key ==
'passwd2')
1877 if($key ==
'passwd')
1882 $this->tpl->setCurrentBlock(
'passwords_visible');
1883 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1884 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1885 $this->tpl->setVariable(
'VISIBLE_PASSWD',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd']);
1886 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
$_SESSION[
'error_post_vars'][
'Fobject'][
'passwd2']);
1887 $this->tpl->parseCurrentBlock();
1891 $this->tpl->setCurrentBlock(
'passwords_invisible');
1892 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1893 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1894 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
1897 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
1900 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
1901 $this->tpl->parseCurrentBlock();
1908 if (isset($settings[
"require_" . $key]) && $settings[
"require_" . $key])
1910 $str = $str .
'<span class="asterisk">*</span>';
1913 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
1915 if ($key !=
"default_role" and $key !=
"language"
1916 and $key !=
"skin_style" and $key !=
"hits_per_page"
1917 and $key !=
"show_users_online")
1929 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
1932 $active =
$_SESSION[
"error_post_vars"][
"Fobject"][
"active"];
1935 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
1940 if (!isset($data[
"fields"][
"active"]))
1942 $data[
"fields"][
"active"] = 0;
1945 foreach ($data[
"fields"] as $key => $val)
1947 $str = $this->lng->txt($key);
1948 if ($key ==
"title")
1950 $str = $this->lng->txt(
"person_title");
1952 if ($key ==
"ext_account")
1956 if($key ==
'passwd')
1958 $auth_mode = $this->
object->getAuthMode(
true);
1961 $this->tpl->setCurrentBlock(
'passwords_visible');
1962 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1963 $this->tpl->setVariable(
'VISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1964 $this->tpl->setVariable(
'VISIBLE_PASSWD',
"********");
1965 $this->tpl->setVariable(
'VISIBLE_PASSWD2',
"********");
1966 $this->tpl->parseCurrentBlock();
1970 $this->tpl->setCurrentBlock(
'passwords_invisible');
1971 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD',$this->lng->txt(
'passwd'));
1972 $this->tpl->setVariable(
'INVISIBLE_TXT_PASSWD2',$this->lng->txt(
'retype_password'));
1973 $this->tpl->setVariable(
'INVISIBLE_PASSWD',strlen($this->object->getPasswd()) ?
1976 $this->tpl->setVariable(
'INVISIBLE_PASSWD2',strlen($this->object->getPasswd()) ?
1979 $this->tpl->setVariable(
'INVISIBLE_PASSWD_HIDDEN',
"********");
1980 $this->tpl->parseCurrentBlock();
1986 if (isset($settings[
"require_" . $key]) && $settings[
"require_" . $key])
1988 $str = $str .
'<span class="asterisk">*</span>';
1991 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
1994 #$this->tpl->parseCurrentBlock();
1998 $gender = strtoupper($data[
"fields"][
"gender"]);
2002 $this->tpl->setVariable(
"BTN_GENDER_".
$gender,
"checked=\"checked\"");
2005 $active = $data[
"fields"][
"active"];
2008 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
2013 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2016 $this->tpl->setCurrentBlock(
"ext_account");
2017 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT",$this->lng->txt(
"user_ext_account"));
2018 $this->tpl->setVariable(
"TXT_EXT_ACCOUNT_DESC",$this->lng->txt(
"user_ext_account_desc"));
2019 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]))
2021 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2022 $_SESSION[
"error_post_vars"][
"Fobject"][
"ext_account"]);
2026 $this->tpl->setVariable(
"EXT_ACCOUNT_VAL",
2027 $data[
"fields"][
"ext_account"]);
2038 $this->tpl->parseCurrentBlock();
2040 $auth_mode =
$_SESSION[
'error_post_vars'][
'Fobject'][
'auth_mode'] ?
2042 $this->
object->getAuthMode(
true);
2045 $this->tpl->setVariable(
"OPTION_DISABLED",
"\"disabled=disabled\"");
2047 $obj_str = ($this->call_by_reference) ?
"" :
"&obj_id=".$this->obj_id;
2049 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
2050 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($this->object->getType().
"_edit"));
2051 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2052 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"save"));
2053 $this->tpl->setVariable(
"CMD_SUBMIT",
"update");
2054 $this->tpl->setVariable(
"TARGET", $this->
getTargetFrame(
"update"));
2055 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
2057 $this->tpl->setVariable(
"TXT_LOGIN_DATA", $this->lng->txt(
"login_data"));
2058 $this->tpl->setVariable(
"TXT_SYSTEM_INFO", $this->lng->txt(
"system_information"));
2059 $this->tpl->setVariable(
"TXT_PERSONAL_DATA", $this->lng->txt(
"personal_data"));
2060 $this->tpl->setVariable(
"TXT_CONTACT_DATA", $this->lng->txt(
"contact_data"));
2061 $this->tpl->setVariable(
"TXT_SETTINGS", $this->lng->txt(
"settings"));
2062 $this->tpl->setVariable(
"TXT_LANGUAGE",$this->lng->txt(
"language"));
2063 $this->tpl->setVariable(
"TXT_SKIN_STYLE",$this->lng->txt(
"usr_skin_style"));
2064 $this->tpl->setVariable(
"TXT_HITS_PER_PAGE",$this->lng->txt(
"hits_per_page"));
2065 $this->tpl->setVariable(
"TXT_SHOW_USERS_ONLINE",$this->lng->txt(
"show_users_online"));
2066 $this->tpl->setVariable(
"TXT_GENDER_F",$this->lng->txt(
"gender_f"));
2067 $this->tpl->setVariable(
"TXT_GENDER_M",$this->lng->txt(
"gender_m"));
2068 $this->tpl->setVariable(
"TXT_INSTANT_MESSENGERS",$this->lng->txt(
"user_profile_instant_messengers"));
2069 $this->tpl->setVariable(
"TXT_OTHER",$this->lng->txt(
"user_profile_other"));
2070 if ($this->object->getId() == $ilUser->getId())
2072 $this->tpl->setVariable(
"TXT_CURRENT_IP",
"(".$this->lng->txt(
"current_ip").
" ".$_SERVER[
"REMOTE_ADDR"].
")");
2074 $this->tpl->setVariable(
"TXT_CURRENT_IP_ALERT",$this->lng->txt(
"current_ip_alert"));
2077 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2081 $selected_auth_mode = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"auth_mode"] : $this->object->getAuthMode();
2083 foreach ($active_auth_modes as $auth_name => $auth_key)
2085 $this->tpl->setCurrentBlock(
"auth_mode_selection");
2087 if ($auth_name ==
'default')
2093 $name = $this->lng->txt(
'auth_'.$auth_name);
2096 $this->tpl->setVariable(
"AUTH_MODE_NAME",
$name);
2098 $this->tpl->setVariable(
"AUTH_MODE", $auth_name);
2100 if ($selected_auth_mode == $auth_name)
2102 $this->tpl->setVariable(
"SELECTED_AUTH_MODE",
"selected=\"selected\"");
2105 $this->tpl->parseCurrentBlock();
2110 $languages = $this->lng->getInstalledLanguages();
2113 $selected_lang = (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"])) ?
$_SESSION[
"error_post_vars"][
"Fobject"][
"language"] : $this->object->getLanguage();
2115 foreach ($languages as $lang_key)
2117 $this->tpl->setCurrentBlock(
"language_selection");
2118 $this->tpl->setVariable(
"LANG", $this->lng->txt(
"lang_".$lang_key));
2119 $this->tpl->setVariable(
"LANGSHORT", $lang_key);
2121 if ($selected_lang == $lang_key)
2123 $this->tpl->setVariable(
"SELECTED_LANG",
"selected=\"selected\"");
2126 $this->tpl->parseCurrentBlock();
2131 $templates = $styleDefinition->getAllTemplates();
2134 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]))
2136 $sknst = explode(
":",
$_SESSION[
"error_post_vars"][
"Fobject"][
"skin_style"]);
2138 $selected_style = $sknst[1];
2139 $selected_skin = $sknst[0];
2143 $selected_style = $this->
object->prefs[
"style"];
2144 $selected_skin = $this->
object->skin;
2147 include(
"./Services/Style/classes/class.ilObjStyleSettings.php");
2148 if (count($templates) > 0 && is_array ($templates))
2150 foreach ($templates as $template)
2155 $styleDef->startParsing();
2156 $styles = $styleDef->getStyles();
2157 foreach ($styles as $style)
2164 $this->tpl->setCurrentBlock(
"selectskin");
2166 if ($selected_skin == $template[
"id"] &&
2167 $selected_style == $style[
"id"])
2169 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
2172 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
2173 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
2174 $this->tpl->parseCurrentBlock();
2179 $hits_options = array(2,10,15,20,30,40,50,100,9999);
2181 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"]))
2183 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hits_per_page"];
2187 $selected_option = $this->
object->prefs[
"hits_per_page"];
2189 foreach($hits_options as $hits_option)
2191 $this->tpl->setCurrentBlock(
"selecthits");
2193 if ($selected_option == $hits_option)
2195 $this->tpl->setVariable(
"HITSSELECTED",
"selected=\"selected\"");
2198 $this->tpl->setVariable(
"HITSVALUE", $hits_option);
2200 if ($hits_option == 9999)
2202 $hits_option = $this->lng->txt(
"no_limit");
2205 $this->tpl->setVariable(
"HITSOPTION", $hits_option);
2206 $this->tpl->parseCurrentBlock();
2211 $users_online_options = array(
"y",
"associated",
"n");
2213 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"]))
2215 $selected_option =
$_SESSION[
"error_post_vars"][
"Fobject"][
"show_users_online"];
2219 $selected_option = $this->
object->prefs[
"show_users_online"];
2221 foreach($users_online_options as $an_option)
2223 $this->tpl->setCurrentBlock(
"show_users_online");
2225 if ($selected_option == $an_option)
2227 $this->tpl->setVariable(
"USERS_ONLINE_SELECTED",
"selected=\"selected\"");
2230 $this->tpl->setVariable(
"USERS_ONLINE_VALUE", $an_option);
2232 $this->tpl->setVariable(
"USERS_ONLINE_OPTION", $this->lng->txt(
"users_online_show_".$an_option));
2233 $this->tpl->parseCurrentBlock();
2238 if (isset(
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"]))
2240 $hide_own_online_status =
$_SESSION[
"error_post_vars"][
"Fobject"][
"hide_own_online_status"];
2244 $hide_own_online_status = ($this->
object->prefs[
"hide_own_online_status"] !=
'') ? $this->object->prefs[
"hide_own_online_status"] :
"n";
2246 $this->tpl->setCurrentBlock(
"hide_own_online_status");
2247 $this->tpl->setVariable(
"TXT_HIDE_OWN_ONLINE_STATUS", $this->lng->txt(
"hide_own_online_status"));
2248 if ($hide_own_online_status ==
"y") {
2249 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"checked=\"checked\"");
2252 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"");
2254 $this->tpl->parseCurrentBlock();
2258 $this->tpl->setCurrentBlock(
"inform_user");
2261 $sendInfoMail = $ilUser->getPref(
'send_info_mails') ==
'y';
2265 $this->tpl->setVariable(
"SEND_MAIL",
" checked=\"checked\"");
2268 $this->tpl->setVariable(
"TXT_INFORM_USER_MAIL", $this->lng->txt(
"inform_user_mail"));
2269 $this->tpl->parseCurrentBlock();
2271 $this->lng->loadLanguageModule(
'crs');
2273 $time_limit_unlimited =
$_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] ?
2274 $_SESSION[
"error_post_vars"][
"time_limit"][
"unlimited"] :
2275 $this->
object->getTimeLimitUnlimited();
2276 $time_limit_from =
$_SESSION[
"error_post_vars"][
"time_limit"][
"from"] ?
2278 $this->
object->getTimeLimitFrom();
2280 $time_limit_until =
$_SESSION[
"error_post_vars"][
"time_limit"][
"until"] ?
2282 $this->
object->getTimeLimitUntil();
2284 $this->tpl->setCurrentBlock(
"time_limit");
2285 $this->tpl->setVariable(
"TXT_TIME_LIMIT", $this->lng->txt(
"time_limit"));
2286 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNLIMITED", $this->lng->txt(
"crs_unlimited"));
2287 $this->tpl->setVariable(
"TXT_TIME_LIMIT_FROM", $this->lng->txt(
"crs_from"));
2288 $this->tpl->setVariable(
"TXT_TIME_LIMIT_UNTIL", $this->lng->txt(
"crs_to"));
2290 $this->tpl->setVariable(
"TIME_LIMIT_UNLIMITED",
ilUtil::formCheckbox($time_limit_unlimited,
"time_limit[unlimited]",1));
2291 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[from][minute]",
2292 date(
"i",$time_limit_from)));
2293 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[from][hour]",
2294 date(
"G",$time_limit_from)));
2295 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_DAY",$this->
__getDateSelect(
"day",
"time_limit[from][day]",
2296 date(
"d",$time_limit_from)));
2297 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_MONTH",$this->
__getDateSelect(
"month",
"time_limit[from][month]",
2298 date(
"m",$time_limit_from)));
2299 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_FROM_YEAR",$this->
__getDateSelect(
"year",
"time_limit[from][year]",
2300 date(
"Y",$time_limit_from)));
2301 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MINUTE",$this->
__getDateSelect(
"minute",
"time_limit[until][minute]",
2302 date(
"i",$time_limit_until)));
2303 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_HOUR",$this->
__getDateSelect(
"hour",
"time_limit[until][hour]",
2304 date(
"G",$time_limit_until)));
2305 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_DAY",$this->
__getDateSelect(
"day",
"time_limit[until][day]",
2306 date(
"d",$time_limit_until)));
2307 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_MONTH",$this->
__getDateSelect(
"month",
"time_limit[until][month]",
2308 date(
"m",$time_limit_until)));
2309 $this->tpl->setVariable(
"SELECT_TIME_LIMIT_UNTIL_YEAR",$this->
__getDateSelect(
"year",
"time_limit[until][year]",
2310 date(
"Y",$time_limit_until)));
2311 $this->tpl->parseCurrentBlock();
2324 global $ilUser, $rbacsystem;
2328 !$rbacsystem->checkAccess(
'visible,read',$this->usrf_ref_id))
2330 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2337 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2339 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2343 $userfile_input = $this->form_gui->getItemByPostVar(
"userfile");
2345 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
2347 if ($userfile_input->getDeletionFlag())
2349 $this->
object->removeUserPicture();
2353 if ($_FILES[
"userfile"][
"size"] == 0)
2360 $image_dir = $webspace_dir.
"/usr_images";
2361 $store_file =
"usr_".$this->object->getId().
".".
"jpg";
2364 $this->
object->setPref(
"profile_image", $store_file);
2365 $this->
object->update();
2368 $uploaded_file = $image_dir.
"/upload_".$this->
object->getId().
"pic";
2370 $uploaded_file,
false))
2373 $this->ctrl->redirect($this,
"showProfile");
2375 chmod($uploaded_file, 0770);
2379 $show_file =
"$image_dir/usr_".$this->object->getId().
".jpg";
2380 $thumb_file =
"$image_dir/usr_".$this->object->getId().
"_small.jpg";
2381 $xthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xsmall.jpg";
2382 $xxthumb_file =
"$image_dir/usr_".$this->object->getId().
"_xxsmall.jpg";
2388 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
2389 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
2390 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
2391 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
2401 $image_dir = $webspace_dir.
"/usr_images";
2402 $file = $image_dir.
"/usr_".$this->
object->getID().
".".
"jpg";
2403 $thumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_small.jpg";
2404 $xthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xsmall.jpg";
2405 $xxthumb_file = $image_dir.
"/usr_".$this->
object->getID().
"_xxsmall.jpg";
2406 $upload_file = $image_dir.
"/upload_".$this->
object->getID();
2409 $this->
object->setPref(
"profile_image",
"");
2410 $this->
object->update();
2413 if (@is_file(
$file))
2417 if (@is_file($thumb_file))
2419 unlink($thumb_file);
2421 if (@is_file($xthumb_file))
2423 unlink($xthumb_file);
2425 if (@is_file($xxthumb_file))
2427 unlink($xxthumb_file);
2429 if (@is_file($upload_file))
2431 unlink($upload_file);
2675 global
$ilias, $rbacsystem, $rbacadmin,$ilUser;
2677 include_once(
'./Services/Authentication/classes/class.ilAuthUtils.php');
2680 $settings = $ilias->getAllSettings();
2683 if($this->usrf_ref_id ==
USER_FOLDER_ID and !$rbacsystem->checkAccess(
'visible,read,write',$this->usrf_ref_id))
2685 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2692 if(!$rbacsystem->checkAccess(
'cat_administrate_users',$this->object->getTimeLimitOwner()))
2694 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_modify_user"),$this->ilias->error_obj->MESSAGE);
2698 foreach (
$_POST[
"Fobject"] as $key => $val)
2704 foreach ($settings as $key => $val)
2706 $field = substr($key,8);
2713 $require_keys[] = $field;
2717 $require_keys[] = $field;
2723 foreach ($require_keys as $key => $val)
2726 $system_fields = array(
"default_role");
2727 if (!in_array($val, $system_fields))
2729 if (isset($settings[
"require_" . $val]) && $settings[
"require_" . $val])
2731 if (empty(
$_POST[
"Fobject"][$val]))
2733 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2734 $this->lng->txt($val),$this->ilias->error_obj->MESSAGE);
2742 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields"),$this->ilias->error_obj->MESSAGE);
2745 if ($this->object->getLogin() !=
$_POST[
"Fobject"][
"login"] &&
2748 $this->ilias->raiseError($this->lng->txt(
"login_invalid"),$this->ilias->error_obj->MESSAGE);
2754 $this->ilias->raiseError($this->lng->txt(
"login_exists"),$this->ilias->error_obj->MESSAGE);
2759 if(
$_POST[
'Fobject'][
'passwd'] ==
"********" and
2760 !strlen($this->object->getPasswd()))
2762 $this->ilias->raiseError($this->lng->txt(
"fill_out_all_required_fields") .
": " .
2763 $this->lng->txt(
'password'),$this->ilias->error_obj->MESSAGE);
2766 if (
$_POST[
"Fobject"][
"passwd"] !=
$_POST[
"Fobject"][
"passwd2"])
2768 $this->ilias->raiseError($this->lng->txt(
"passwd_not_match"),$this->ilias->error_obj->MESSAGE);
2774 $this->ilias->raiseError($this->lng->txt(
"passwd_invalid"),$this->ilias->error_obj->MESSAGE);
2780 $_POST[
'Fobject'][
'passwd'] =
"********";
2784 if(!strlen(
$_POST[
'Fobject'][
'ext_account']))
2786 $this->ilias->raiseError($this->lng->txt(
'ext_acccount_required'),$this->ilias->error_obj->MESSAGE);
2789 if(
$_POST[
'Fobject'][
'ext_account'] &&
2792 if($elogin != $this->object->getLogin())
2794 $this->ilias->raiseError(
2795 sprintf($this->lng->txt(
"err_auth_ext_user_exists"),
2796 $_POST[
"Fobject"][
"ext_account"],
2797 $_POST[
'Fobject'][
'auth_mode'],
2799 $this->ilias->error_obj->MESSAGE);
2805 include_once (
'./Services/User/classes/class.ilObjUser.php');
2811 $this->ilias->raiseError($this->lng->txt(
"email_not_valid"),$this->ilias->error_obj->MESSAGE);
2818 if (!
$_POST[
"time_limit"][
"unlimited"] and
2821 $this->ilias->raiseError($this->lng->txt(
"time_limit_not_valid"),$this->ilias->error_obj->MESSAGE);
2824 if(!$this->ilias->account->getTimeLimitUnlimited())
2826 if($start < $this->ilias->account->getTimeLimitFrom() or
2827 $end > $this->ilias->account->getTimeLimitUntil() or
2828 $_POST[
'time_limit'][
'unlimited'])
2842 $_POST[
'Fobject'][
'time_limit_owner'] = $this->
object->getTimeLimitOwner();
2844 $_POST[
'Fobject'][
'time_limit_unlimited'] = (int)
$_POST[
'time_limit'][
'unlimited'];
2848 if(
$_POST[
'Fobject'][
'time_limit_unlimited'] != $this->object->getTimeLimitUnlimited() or
2849 $_POST[
'Fobject'][
'time_limit_from'] != $this->
object->getTimeLimitFrom() or
2850 $_POST[
'Fobject'][
'time_limit_until'] != $this->
object->getTimeLimitUntil())
2852 $_POST[
'Fobject'][
'time_limit_message'] = 0;
2856 $_POST[
'Fobject'][
'time_limit_message'] = $this->
object->getTimeLimitMessage();
2859 $this->
object->assignData(
$_POST[
"Fobject"]);
2860 $this->
object->setUserDefinedData(
$_POST[
'udf']);
2864 $this->
object->updateLogin(
$_POST[
'Fobject'][
'login']);
2869 $this->form_gui->setValuesByPost();
2870 return $tpl->setContent($this->form_gui->getHtml());
2873 $this->
object->setTitle($this->object->getFullname());
2874 $this->
object->setDescription($this->object->getEmail());
2875 $this->
object->setLanguage(
$_POST[
"Fobject"][
"language"]);
2878 $sknst = explode(
":",
$_POST[
"Fobject"][
"skin_style"]);
2880 if ($this->object->getPref(
"style") != $sknst[1] ||
2881 $this->
object->getPref(
"skin") != $sknst[0])
2883 $this->
object->setPref(
"skin", $sknst[0]);
2884 $this->
object->setPref(
"style", $sknst[1]);
2888 $this->
object->setPref(
"hits_per_page",
$_POST[
"Fobject"][
"hits_per_page"]);
2890 $this->
object->setPref(
"show_users_online",
$_POST[
"Fobject"][
"show_users_online"]);
2892 if (
$_POST[
"Fobject"][
"hide_own_online_status"]) {
2893 $this->
object->setPref(
"hide_own_online_status",
$_POST[
"Fobject"][
"hide_own_online_status"]);
2896 $this->
object->setPref(
"hide_own_online_status",
"n");
2899 $this->update = $this->
object->update();
2904 $ilUser->setPref(
'send_info_mails', (
$_POST[
'send_mail'] ==
'y') ?
'y' :
'n');
2905 $ilUser->writePrefs();
2909 $msg = $this->lng->txt(
'saved_successfully').$mail_message;
2914 if (strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2916 $this->ctrl->redirectByClass(
"ilobjuserfoldergui",
"view");
2920 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
2933 global $rbacsystem, $rbacadmin, $rbacreview;
2935 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
2937 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
2940 $selected_roles =
$_POST[
"role_id"] ?
$_POST[
"role_id"] : array();
2941 $posted_roles =
$_POST[
"role_id_ctrl"] ?
$_POST[
"role_id_ctrl"] : array();
2944 if ($this->object->getId() == SYSTEM_USER_ID and in_array(SYSTEM_ROLE_ID, $posted_roles))
2946 array_push($selected_roles,SYSTEM_ROLE_ID);
2949 $global_roles_all = $rbacreview->getGlobalRoles();
2950 $assigned_roles_all = $rbacreview->assignedRoles($this->object->getId());
2951 $assigned_roles = array_intersect($assigned_roles_all,$posted_roles);
2952 $assigned_global_roles_all = array_intersect($assigned_roles_all,$global_roles_all);
2953 $assigned_global_roles = array_intersect($assigned_global_roles_all,$posted_roles);
2954 $posted_global_roles = array_intersect($selected_roles,$global_roles_all);
2956 if ((empty($selected_roles) and count($assigned_roles_all) == count($assigned_roles))
2957 or (empty($posted_global_roles) and count($assigned_global_roles_all) == count($assigned_global_roles)))
2961 ilUtil::sendFailure($this->lng->txt(
"msg_min_one_role").
"<br/>".$this->lng->txt(
"action_aborted"),
true);
2962 $this->ctrl->redirect($this,
'roleassignment');
2965 foreach (array_diff($assigned_roles,$selected_roles) as $role)
2967 $rbacadmin->deassignUser($role,$this->object->getId());
2970 foreach (array_diff($selected_roles,$assigned_roles) as $role)
2972 $rbacadmin->assignUser($role,$this->object->getId(),
false);
2975 include_once
"./Services/AccessControl/classes/class.ilObjRole.php";
2978 $this->
object->update();
2982 if(strtolower(
$_GET[
"baseClass"]) ==
'iladministrationgui')
2984 $this->ctrl->redirect($this,
'roleassignment');
2988 $this->ctrl->redirectByClass(
'ilobjcategorygui',
'listUsers');
3000 global $rbacreview,$rbacsystem,$ilUser, $ilTabs;
3002 $ilTabs->activateTab(
"role_assignment");
3004 if (!$rbacsystem->checkAccess(
"edit_roleassignment", $this->usrf_ref_id))
3006 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_assign_role_to_user"),$this->ilias->error_obj->MESSAGE);
3016 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.usr_role_assignment.html');
3020 $this->tpl->setCurrentBlock(
"filter");
3021 $this->tpl->setVariable(
"FILTER_TXT_FILTER",$this->lng->txt(
'filter'));
3023 $this->tpl->setVariable(
"FILTER_ACTION",$this->ctrl->getFormAction($this));
3024 $this->tpl->setVariable(
"FILTER_NAME",
'roleassignment');
3025 $this->tpl->setVariable(
"FILTER_VALUE",$this->lng->txt(
'apply_filter'));
3026 $this->tpl->parseCurrentBlock();
3030 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3034 $role_list = $rbacreview->getRolesByFilter(
$tab->filter[
"role_filter"],$this->object->getId());
3035 $assigned_roles = $rbacreview->assignedRoles($this->object->getId());
3039 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
3042 foreach ($role_list as $role)
3045 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3048 if ($rbacreview->isDeleted($rolf[0]))
3056 if ($this->tree->isInTree($rolf[0]))
3058 if ($rolf[0] == ROLE_FOLDER_ID)
3060 $path = $this->lng->txt(
"global");
3064 $tmpPath = $this->tree->getPathFull($rolf[0]);
3077 $path = $tmpPath[count($tmpPath)-2][
"title"];
3082 $path =
"<b>Rolefolder ".$rolf[0].
" not found in tree! (Role ".$role[
"obj_id"].
")</b>";
3088 if (($this->object->getId() == SYSTEM_USER_ID and $role[
"obj_id"] == SYSTEM_ROLE_ID)
3089 or (!in_array(SYSTEM_ROLE_ID,$rbacreview->assignedRoles($ilUser->getId())) and $role[
"obj_id"] == SYSTEM_ROLE_ID))
3094 if (substr($role[
"title"],0,3) ==
"il_")
3098 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
3099 $rolf2 = $rolf_arr[0];
3106 $parent_node = $this->tree->getParentNodeData($rolf2);
3108 $role[
"description"] = $this->lng->txt(
"obj_".$parent_node[
"type"]).
" (#".$parent_node[
"obj_id"].
")";
3111 $role_ids[$counter] = $role[
"obj_id"];
3113 $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"].
"\"/>";
3114 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $rolf[0]);
3115 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $role[
"obj_id"]);
3116 $result_set[$counter][] = $link =
"<a href=\"".$this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm").
"\">".
ilObjRole::_getTranslation($role[
"title"]).
"</a>";
3118 $result_set[$counter][] = $role[
"description"];
3121 if ($role[
"role_type"] ==
"local") {
3129 foreach ($ref_ids as
$ref_id) {}
3131 require_once(
"./classes/class.ilLink.php");
3137 $result_set[$counter][] =
$path;
3141 $records[] = array(
"path" =>
$path,
"description" => $role[
"description"],
3142 "context" => $context,
"checkbox" => $checkbox,
3143 "role" => $link,
"title" =>
$title);
3149 $tab->setData($records);
3150 $this->tpl->setVariable(
"ROLES_TABLE",
$tab->getHTML());
3162 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3164 $table_gui->writeFilterToSession();
3165 $table_gui->resetOffset();
3174 include_once(
"./Services/User/classes/class.ilRoleAssignmentTableGUI.php");
3176 $table_gui->resetOffset();
3177 $table_gui->resetFilter();
3186 for($i=0;$i<=60;$i++)
3188 $days[$i] = $i < 10 ?
"0".$i : $i;
3193 for($i=0;$i<24;$i++)
3195 $days[$i] = $i < 10 ?
"0".$i : $i;
3200 for($i=1;$i<32;$i++)
3202 $days[$i] = $i < 10 ?
"0".$i : $i;
3207 for($i=1;$i<13;$i++)
3209 $month[$i] = $i < 10 ?
"0".$i : $i;
3214 if($a_selected < date(
'Y',time()))
3216 $start = $a_selected;
3220 $start = date(
'Y',time());
3223 for($i = $start;$i < date(
"Y",time()) + 11;++$i)
3233 return mktime($a_time_arr[
"hour"],
3234 $a_time_arr[
"minute"],
3235 $a_time_arr[
"second"],
3236 $a_time_arr[
"month"],
3238 $a_time_arr[
"year"]);
3245 $actions = array(
"assignSave" => $this->lng->txt(
"change_assignment"));
3248 $tpl =& $tbl->getTemplateObject();
3250 $tpl->setCurrentBlock(
"tbl_form_header");
3251 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
3252 $tpl->parseCurrentBlock();
3254 $tpl->setCurrentBlock(
"tbl_action_row");
3256 $tpl->setVariable(
"COLUMN_COUNTS",4);
3261 $tpl->setCurrentBlock(
"tbl_action_btn");
3263 $tpl->setVariable(
"BTN_VALUE",$value);
3264 $tpl->parseCurrentBlock();
3267 if (!empty($a_role_ids))
3270 $tpl->setCurrentBlock(
"tbl_action_toggle_checkboxes");
3271 $tpl->setVariable(
"JS_VARNAME",
"role_id");
3273 $tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3274 $tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3275 $tpl->parseCurrentBlock();
3278 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
3281 $this->ctrl->setParameter($this,
"cmd",
"roleassignment");
3284 $tbl->setTitle($this->lng->txt(
"edit_roleassignment"),
"icon_role.gif",$this->lng->txt(
"roles"));
3287 $tbl->setHeaderNames(array(
"",$this->lng->txt(
"role"),$this->lng->txt(
"description"),$this->lng->txt(
"context")));
3288 $tbl->setHeaderVars(array(
"",
"title",
"description",
"context"),$this->ctrl->getParameterArray($this,
"",
false));
3289 $tbl->setColumnWidth(array(
"",
"30%",
"40%",
"30%"));
3293 $this->tpl->setVariable(
"ROLES_TABLE",$tbl->tpl->get());
3300 include_once
"./Services/Table/classes/class.ilTableGUI.php";
3310 $order =
$_GET[
"sort_by"] ?
$_GET[
"sort_by"] :
"title";
3315 $tbl->setOrderColumn($order);
3316 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
3317 $tbl->setOffset(
$_GET[
"offset"]);
3318 $tbl->setLimit(
$_GET[
"limit"]);
3319 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
3320 $tbl->setData($result_set);
3330 $action[0] = $this->lng->txt(
'assigned_roles');
3331 $action[1] = $this->lng->txt(
'all_roles');
3332 $action[2] = $this->lng->txt(
'all_global_roles');
3333 $action[3] = $this->lng->txt(
'all_local_roles');
3334 $action[4] = $this->lng->txt(
'internal_local_roles_only');
3335 $action[5] = $this->lng->txt(
'non_internal_local_roles_only');
3354 $ilLocator->clearItems();
3356 if (
$_GET[
"admin_mode"] ==
"settings")
3358 $ilLocator->addItem($this->lng->txt(
"administration"),
3359 $this->ctrl->getLinkTargetByClass(
"iladministrationgui",
"frameset"),
3364 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3366 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3368 elseif (
$_GET[
'ref_id'] == ROLE_FOLDER_ID)
3370 $ilLocator->addItem($this->lng->txt(
"obj_".ilObject::_lookupType(
3372 $this->ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
"view"));
3375 if (
$_GET[
"obj_id"] > 0)
3377 $ilLocator->addItem($this->object->getTitle(),
3378 $this->ctrl->getLinkTarget($this,
"view"));
3391 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
3394 $this->ctrl->getLinkTargetByClass(
"ilobjuserfoldergui",
"view"));
3398 if ($this->object->getRefId() != ROOT_FOLDER_ID &&
3399 $this->
object->getRefId() != SYSTEM_FOLDER_ID)
3401 $par_id = $tree->getParentId($this->usrf_ref_id);
3402 $tpl->setUpperIcon(
"repository.php?ref_id=".$par_id);
3411 if(
$_POST[
'send_mail'] !=
'y')
3415 if(!strlen($this->object->getEmail()))
3421 $usr_lang =
new ilLanguage($this->object->getLanguage());
3423 $usr_lang->loadLanguageModule(
'registration');
3425 include_once
"Services/Mail/classes/class.ilMimeMail.php";
3428 $mmail->autoCheck(
false);
3429 $mmail->From($ilUser->getEmail());
3430 $mmail->To($this->object->getEmail());
3433 $subject = $usr_lang->txt(
"profile_changed");
3437 $body = ($usr_lang->txt(
"reg_mail_body_salutation").
" ".$this->
object->getFullname().
",\n\n");
3439 $date = $this->
object->getApproveDate();
3441 if((time() - strtotime($date)) < 10)
3443 $body .= ($usr_lang->txt(
'reg_mail_body_approve').
"\n\n");
3447 $body .= ($usr_lang->txt(
'reg_mail_body_profile_changed').
"\n\n");
3451 if(
$_POST[
'passwd'] !=
'********')
3453 $body .= $usr_lang->txt(
"reg_mail_body_text2").
"\n".
3454 ILIAS_HTTP_PATH.
"/login.php?client_id=".$ilias->client_id.
"\n".
3455 $usr_lang->txt(
"login").
": ".$this->
object->getLogin().
"\n".
3456 $usr_lang->txt(
"passwd").
": ".
$_POST[
'passwd'].
"\n\n";
3458 $body .= ($usr_lang->txt(
"reg_mail_body_text3").
"\n");
3459 $body .= $this->
object->getProfileAsString($usr_lang);
3461 $mmail->Subject($subject);
3462 $mmail->Body($body);
3466 return "<br/>".$this->lng->txt(
"mail_sent");
3474 global $ilAccess,
$ilErr,
$lng, $ilNavigationHistory;
3476 if (substr($a_target, 0, 1) ==
"n")
3481 $_GET[
"cmd"] =
"view";
3482 $_GET[
"user_id"] = (int) $a_target;
3483 $_GET[
"baseClass"] =
"ilPublicUserProfileGUI";
3484 $_GET[
"cmdClass"] =
"ilpublicuserprofilegui";
3485 include(
"ilias.php");