31 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
38 $this->settings = $ilias->getAllSettings();
39 $lng->loadLanguageModule(
"jsmath");
40 $this->upload_error =
"";
41 $this->password_error =
"";
42 $lng->loadLanguageModule(
"user");
52 $next_class = $this->ctrl->getNextClass();
56 case "ilpublicuserprofilegui":
57 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
59 $ilCtrl->forwardCommand($pub_profile_gui);
65 $cmd = $this->ctrl->getCmd(
"showPersonalData");
69 if( $ilUser->isPasswordChangeDemanded() &&
$cmd !=
'savePassword' )
71 $cmd =
'showPassword';
74 $this->lng->txt(
'password_change_on_first_login_demand'), true
77 elseif( $ilUser->isPasswordExpired() &&
$cmd !=
'savePassword' )
79 $cmd =
'showPassword';
81 $msg = $this->lng->txt(
'password_expired');
82 $password_age = $ilUser->getPasswordAge();
101 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
105 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
119 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
133 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
149 $userfile_input = $this->form->getItemByPostVar(
"userfile");
151 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
153 if ($userfile_input->getDeletionFlag())
155 $ilUser->removeUserPicture();
160 if ($_FILES[
"userfile"][
"size"] != 0)
163 $image_dir = $webspace_dir.
"/usr_images";
164 $store_file =
"usr_".$ilUser->getID().
".".
"jpg";
167 $ilUser->setPref(
"profile_image", $store_file);
171 $uploaded_file = $image_dir.
"/upload_".$ilUser->getId().
"pic";
174 $uploaded_file,
false))
177 $this->ctrl->redirect($this,
"showProfile");
179 chmod($uploaded_file, 0770);
183 $show_file =
"$image_dir/usr_".$ilUser->getId().
".jpg";
184 $thumb_file =
"$image_dir/usr_".$ilUser->getId().
"_small.jpg";
185 $xthumb_file =
"$image_dir/usr_".$ilUser->getId().
"_xsmall.jpg";
186 $xxthumb_file =
"$image_dir/usr_".$ilUser->getId().
"_xxsmall.jpg";
193 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 200x200 -quality 100 JPEG:$show_file");
194 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 100x100 -quality 100 JPEG:$thumb_file");
195 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 75x75 -quality 100 JPEG:$xthumb_file");
196 system(
ilUtil::getConvertCmd().
" $uploaded_file" .
"[0] -geometry 30x30 -quality 100 JPEG:$xxthumb_file");
210 $ilUser->removeUserPicture();
241 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
242 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
243 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
244 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
247 $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
251 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
256 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
259 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
261 $this->password_error = $this->lng->txt(
"passwd_wrong");
267 $this->password_error = $this->lng->txt(
"passwd_not_selected");
270 if (empty($this->password_error))
273 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"new_passwd"],
$_POST[
"new_passwd"]);
279 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
281 $this->password_error = $this->lng->txt(
"passwd_wrong");
284 else if (
$_POST[
"desired_password"] !=
$_POST[
"retype_password"])
286 $this->password_error = $this->lng->txt(
"passwd_not_match");
291 if( $custom_error !=
'' )
292 $this->password_error = $custom_error;
293 else $this->password_error = $this->lng->txt(
"passwd_invalid");
295 else if (
$_POST[
"current_password"] !=
"" and empty($this->password_error))
297 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
299 if(
$_POST[
"current_password"] !=
$_POST[
"desired_password"] )
301 if( $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]) )
304 $ilUser->setLastPasswordChangeToNow();
309 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
315 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]);
316 $ilUser->setLastPasswordChangeToNow();
340 if ((
$_POST[
"chk_pub"])==
"on")
342 $ilUser->setPref(
"public_profile",
"y");
346 $ilUser->setPref(
"public_profile",
"n");
350 $val_array = array(
"institution",
"department",
"upload",
"street",
351 "zip",
"city",
"country",
"phone_office",
"phone_home",
"phone_mobile",
352 "fax",
"email",
"hobby",
"matriculation");
355 foreach($val_array as
$key => $value)
357 if ((
$_POST[
"chk_".$value]) ==
"on")
359 $ilUser->setPref(
"public_".$value,
"y");
363 $ilUser->setPref(
"public_".$value,
"n");
368 if ($d_set->get(
"user_profile"))
370 if ((
$_POST[
"chk_delicious"]) ==
"on")
372 $ilUser->setPref(
"public_delicious",
"y");
376 $ilUser->setPref(
"public_delicious",
"n");
382 foreach($this->settings as
$key => $val)
384 if (substr(
$key,0,8) ==
"require_")
386 $require_keys[] = substr(
$key,8);
390 foreach($require_keys as
$key => $val)
393 $system_fields = array(
"login",
"default_role",
"passwd",
"passwd2");
394 if (!in_array($val, $system_fields))
398 if (isset($this->settings[
"require_" . $val]) && $this->settings[
"require_" . $val])
400 if (empty(
$_POST[
"usr_" . $val]))
402 ilUtil::sendFailure($this->lng->txt(
"fill_out_all_required_fields") .
": " . $this->lng->txt($val));
438 $ilUser->setGender(
$_POST[
"usr_gender"]);
444 $ilUser->setFullname();
504 if ($d_set->get(
"user_profile"))
522 $ilUser->setUserDefinedData(
$_POST[
'udf']);
533 if (
$_POST[
"usr_skin_style"] !=
"")
535 $sknst = explode(
":",
$_POST[
"usr_skin_style"]);
537 if ($ilUser->getPref(
"style") != $sknst[1] ||
538 $ilUser->getPref(
"skin") != $sknst[0])
540 $ilUser->setPref(
"skin", $sknst[0]);
541 $ilUser->setPref(
"style", $sknst[1]);
552 if (
$_POST[
"usr_language"] != $ilUser->getLanguage())
558 $ilUser->setLanguage(
$_POST[
"usr_language"]);
564 if (
$_POST[
"hits_per_page"] !=
"")
566 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
573 $ilUser->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
579 if (
$_POST[
"chk_hide_own_online_status"] !=
"")
581 $ilUser->setPref(
"hide_own_online_status",
"y");
585 $ilUser->setPref(
"hide_own_online_status",
"n");
602 $ilUser->setProfileIncomplete(
false);
605 $ilUser->setTitle($ilUser->getFullname());
606 $ilUser->setDescription($ilUser->getEmail());
612 if (!empty($this->password_error))
616 elseif (!empty($this->upload_error))
624 $this->ctrl->redirect($this,
"");
649 $settings = $ilias->getAllSettings();
651 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.usr_profile.html",
655 if ($ilUser->getProfileIncomplete())
666 $languages = $this->lng->getInstalledLanguages();
669 $selected_lang = (isset(
$_POST[
"usr_language"]))
671 : $ilUser->getLanguage();
674 foreach($languages as $lang_key)
676 $this->tpl->setCurrentBlock(
"sel_lang");
679 $this->tpl->setVariable(
"LANGSHORT", $lang_key);
681 if ($selected_lang == $lang_key)
683 $this->tpl->setVariable(
"SELECTED_LANG",
"selected=\"selected\"");
686 $this->tpl->parseCurrentBlock();
691 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
692 $templates = $styleDefinition->getAllTemplates();
696 if (is_array($templates))
699 foreach($templates as $template)
703 $styleDef->startParsing();
704 $styles = $styleDef->getStyles();
706 foreach($styles as $style)
713 $this->tpl->setCurrentBlock(
"selectskin");
715 if ($ilUser->skin == $template[
"id"] &&
716 $ilUser->prefs[
"style"] == $style[
"id"])
718 $this->tpl->setVariable(
"SKINSELECTED",
"selected=\"selected\"");
721 $this->tpl->setVariable(
"SKINVALUE", $template[
"id"].
":".$style[
"id"]);
722 $this->tpl->setVariable(
"SKINOPTION", $styleDef->getTemplateName().
" / ".$style[
"name"]);
723 $this->tpl->parseCurrentBlock();
733 $hits_options = array(2,10,15,20,30,40,50,100,9999);
735 foreach($hits_options as $hits_option)
737 $this->tpl->setCurrentBlock(
"selecthits");
739 if ($ilUser->prefs[
"hits_per_page"] == $hits_option)
741 $this->tpl->setVariable(
"HITSSELECTED",
"selected=\"selected\"");
744 $this->tpl->setVariable(
"HITSVALUE", $hits_option);
746 if ($hits_option == 9999)
748 $hits_option = $this->lng->txt(
"no_limit");
751 $this->tpl->setVariable(
"HITSOPTION", $hits_option);
752 $this->tpl->parseCurrentBlock();
759 $users_online_options = array(
"y",
"associated",
"n");
760 $selected_option = $ilUser->prefs[
"show_users_online"];
761 foreach($users_online_options as $an_option)
763 $this->tpl->setCurrentBlock(
"select_users_online");
765 if ($selected_option == $an_option)
767 $this->tpl->setVariable(
"USERS_ONLINE_SELECTED",
"selected=\"selected\"");
770 $this->tpl->setVariable(
"USERS_ONLINE_VALUE", $an_option);
772 $this->tpl->setVariable(
"USERS_ONLINE_OPTION", $this->lng->txt(
"users_online_show_".$an_option));
773 $this->tpl->parseCurrentBlock();
779 if ($ilUser->prefs[
"hide_own_online_status"] ==
"y")
781 $this->tpl->setVariable(
"CHK_HIDE_OWN_ONLINE_STATUS",
"checked");
797 if (($ilUser->getAuthMode(
true) ==
AUTH_LOCAL ||
798 ($ilUser->getAuthMode(
true) ==
AUTH_CAS && $ilSetting->get(
"cas_allow_local")) ||
799 ($ilUser->getAuthMode(
true) ==
AUTH_SHIBBOLETH && $ilSetting->get(
"shib_auth_allow_local")) ||
800 ($ilUser->getAuthMode(
true) ==
AUTH_SOAP && $ilSetting->get(
"soap_auth_allow_local"))
805 if($this->ilias->getSetting(
'usr_settings_disable_password'))
807 $this->tpl->setCurrentBlock(
"disabled_password");
808 $this->tpl->setVariable(
"TXT_DISABLED_PASSWORD", $this->lng->txt(
"chg_password"));
809 $this->tpl->setVariable(
"TXT_DISABLED_CURRENT_PASSWORD", $this->lng->txt(
"current_password"));
810 $this->tpl->parseCurrentBlock();
812 elseif ($settings[
"passwd_auto_generate"] == 1)
816 foreach ($passwd_list as $passwd)
821 $this->tpl->setCurrentBlock(
"select_password");
822 switch ($ilUser->getAuthMode(
true))
825 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_password"));
828 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_ilias_and_webfolder_password"));
831 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_ilias_password"));
834 $this->tpl->setVariable(
"TXT_CURRENT_PASSWORD", $this->lng->txt(
"current_password"));
835 $this->tpl->setVariable(
"TXT_SELECT_PASSWORD", $this->lng->txt(
"select_password"));
836 $this->tpl->setVariable(
"PASSWORD_CHOICE", $passwd_choice);
837 $this->tpl->setVariable(
"TXT_NEW_LIST_PASSWORD", $this->lng->txt(
"new_list_password"));
838 $this->tpl->parseCurrentBlock();
842 $this->tpl->setCurrentBlock(
"change_password");
843 switch ($ilUser->getAuthMode(
true))
846 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_password"));
849 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
852 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_ilias_and_webfolder_password"));
856 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_ilias_password"));
860 $this->tpl->setVariable(
"TXT_CHANGE_PASSWORD", $this->lng->txt(
"chg_ilias_password"));
863 $this->tpl->setVariable(
"TXT_CURRENT_PW", $this->lng->txt(
"current_password"));
864 $this->tpl->setVariable(
"TXT_DESIRED_PW", $this->lng->txt(
"desired_password"));
865 $this->tpl->setVariable(
"TXT_RETYPE_PW", $this->lng->txt(
"retype_password"));
866 $this->tpl->setVariable(
"CHANGE_PASSWORD", $this->lng->txt(
"chg_password"));
867 $this->tpl->parseCurrentBlock();
876 $this->tpl->setCurrentBlock(
"content");
877 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
879 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
880 $this->tpl->setVariable(
"TXT_OF",strtolower($this->lng->txt(
"of")));
881 $this->tpl->setVariable(
"USR_FULLNAME",$ilUser->getFullname());
883 $this->tpl->setVariable(
"TXT_USR_DATA", $this->lng->txt(
"userdata"));
884 switch ($ilUser->getAuthMode(
true))
887 $this->tpl->setVariable(
"TXT_NICKNAME", $this->lng->txt(
"username"));
891 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
894 $this->tpl->setVariable(
"TXT_NICKNAME", $this->lng->txt(
"ilias_and_webfolder_username"));
898 $this->tpl->setVariable(
"TXT_NICKNAME", $this->lng->txt(
"ilias_username"));
902 $this->tpl->setVariable(
"TXT_NICKNAME", $this->lng->txt(
"ilias_username"));
907 $this->tpl->setVariable(
"TXT_PUBLIC_PROFILE", $this->lng->txt(
"public_profile"));
910 $data[
"fields"] = array();
911 $data[
"fields"][
"gender"] =
"";
912 $data[
"fields"][
"firstname"] =
"";
913 $data[
"fields"][
"lastname"] =
"";
914 $data[
"fields"][
"title"] =
"";
915 $data[
"fields"][
"birthday"] =
"";
916 $data[
"fields"][
"institution"] =
"";
917 $data[
"fields"][
"department"] =
"";
918 $data[
"fields"][
"street"] =
"";
919 $data[
"fields"][
"city"] =
"";
920 $data[
"fields"][
"zipcode"] =
"";
921 $data[
"fields"][
"country"] =
"";
922 $data[
"fields"][
"phone_office"] =
"";
923 $data[
"fields"][
"phone_home"] =
"";
924 $data[
"fields"][
"phone_mobile"] =
"";
925 $data[
"fields"][
"fax"] =
"";
926 $data[
"fields"][
"email"] =
"";
927 $data[
"fields"][
"hobby"] =
"";
928 $data[
"fields"][
"referral_comment"] =
"";
929 $data[
"fields"][
"matriculation"] =
"";
930 $data[
"fields"][
"create_date"] =
"";
931 $data[
"fields"][
"approve_date"] =
"";
932 $data[
"fields"][
"active"] =
"";
934 $data[
"fields"][
"default_role"] = $role;
941 $str = $this->lng->txt(
$key);
945 $str = $this->lng->txt(
"person_title");
949 if (isset($this->settings[
"require_" .
$key]) && $this->settings[
"require_" . $key])
951 $str = $str .
'<span class="asterisk">*</span>';
956 $this->tpl->setVariable(
"TXT_".strtoupper($key), $str);
962 $this->tpl->setVariable(
"TXT_GENDER_F",$this->lng->txt(
"gender_f"));
963 $this->tpl->setVariable(
"TXT_GENDER_M",$this->lng->txt(
"gender_m"));
967 if ($d_set->get(
"user_profile"))
969 $this->tpl->setVariable(
"TXT_DELICIOUS", $lng->txt(
"delicious"));
974 $this->tpl->setVariable(
"TXT_UPLOAD",$this->lng->txt(
"personal_picture"));
976 $full_img = $ilUser->getPref(
"profile_image");
977 $last_dot = strrpos($full_img,
".");
978 $small_img = substr($full_img, 0, $last_dot).
979 "_small".substr($full_img, $last_dot, strlen($full_img) - $last_dot);
980 $image_file = $webspace_dir.
"/usr_images/".$small_img;
982 if (@is_file($image_file))
984 $this->tpl->setCurrentBlock(
"pers_image");
985 $this->tpl->setVariable(
"IMG_PERSONAL", $image_file.
"?dummy=".rand(1,99999));
986 $this->tpl->setVariable(
"ALT_IMG_PERSONAL",$this->lng->txt(
"personal_picture"));
987 $this->tpl->parseCurrentBlock();
990 $this->tpl->setCurrentBlock(
"remove_pic");
991 $this->tpl->setVariable(
"TXT_REMOVE_PIC", $this->lng->txt(
"remove_personal_picture"));
993 $this->tpl->parseCurrentBlock();
994 $this->tpl->setCurrentBlock(
"content");
999 $this->tpl->setCurrentBlock(
"upload_pic");
1000 $this->tpl->setVariable(
"UPLOAD", $this->lng->txt(
"upload"));
1002 $this->tpl->setVariable(
"TXT_FILE", $this->lng->txt(
"userfile"));
1003 $this->tpl->setVariable(
"USER_FILE", $this->lng->txt(
"user_file"));
1005 $this->tpl->setCurrentBlock(
"adm_content");
1008 if ($this->
userSettingVisible(
"upload") and $this->ilias->getSetting(
"ilinc_active"))
1010 include_once (
'./Modules/ILinc/classes/class.ilObjiLincUser.php');
1013 if ($ilinc_user->id)
1015 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
1018 $ilincAPI->uploadPicture($ilinc_user);
1019 $response = $ilincAPI->sendRequest(
"uploadPicture");
1022 $url = trim($response->data[
'url'][
'cdata']);
1023 $this->tpl->setCurrentBlock(
"ilinc_upload_pic");
1024 $this->tpl->setVariable(
"TXT_ILINC_UPLOAD", $this->lng->txt(
"ilinc_upload_pic_text"));
1025 $this->tpl->setVariable(
"ILINC_UPLOAD_LINK", $url);
1026 $this->tpl->setVariable(
"ILINC_UPLOAD_LINKTXT", $this->lng->txt(
"ilinc_upload_pic_linktext"));
1027 $this->tpl->parseCurrentBlock();
1034 $this->tpl->setVariable(
"TXT_LANGUAGE", $this->lng->txt(
"language"));
1038 $this->tpl->setVariable(
"TXT_SHOW_USERS_ONLINE", $this->lng->txt(
"show_users_online"));
1042 $this->tpl->setVariable(
"TXT_HIDE_OWN_ONLINE_STATUS", $this->lng->txt(
"hide_own_online_status"));
1046 $this->tpl->setVariable(
"TXT_USR_SKIN_STYLE", $this->lng->txt(
"usr_skin_style"));
1050 $this->tpl->setVariable(
"TXT_HITS_PER_PAGE", $this->lng->txt(
"usr_hits_per_page"));
1054 $this->tpl->setVariable(
"TXT_SHOW_USERS_ONLINE", $this->lng->txt(
"show_users_online"));
1056 $this->tpl->setVariable(
"TXT_PERSONAL_DATA", $this->lng->txt(
"personal_data"));
1057 $this->tpl->setVariable(
"TXT_SYSTEM_INFO", $this->lng->txt(
"system_information"));
1058 $this->tpl->setVariable(
"TXT_CONTACT_DATA", $this->lng->txt(
"contact_data"));
1062 $this->tpl->setVariable(
"TXT_OTHER", $this->lng->txt(
"user_profile_other"));
1065 $this->tpl->setVariable(
"TXT_SETTINGS", $this->lng->txt(
"settings"));
1068 if((
int)$ilSetting->get(
'allow_change_loginname'))
1070 $this->tpl->setCurrentBlock(
'nickname_req');
1071 $this->tpl->touchBlock(
'nickname_req');
1072 $this->tpl->parseCurrentBlock();
1093 $gender = strtoupper($ilUser->getGender());
1095 if (!empty($gender))
1097 $this->tpl->setVariable(
"BTN_GENDER_".$gender,
"checked=\"checked\"");
1101 $this->tpl->setVariable(
"CREATE_DATE", $ilUser->getCreateDate());
1102 $this->tpl->setVariable(
"APPROVE_DATE", $ilUser->getApproveDate());
1104 if ($ilUser->getActive())
1106 $this->tpl->setVariable(
"ACTIVE",
"checked=\"checked\"");
1173 $this->tpl->setVariable(
"TXT_INSTANT_MESSENGERS", $this->lng->txt(
"user_profile_instant_messengers"));
1175 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1176 $im_disabled = !$this->
userSettingEnabled(
"instant_messengers") ?
"disabled=\"disabled\"":
"";
1178 foreach ($im_arr as $im_name)
1180 $im_id = $ilUser->getInstantMessengerId($im_name);
1181 $this->tpl->setCurrentBlock(
"im_row");
1182 $this->tpl->setVariable(
"TXT_IM_NAME",$this->lng->txt(
"im_".$im_name));
1183 $this->tpl->setVariable(
"USR_IM_NAME",
"usr_im_".$im_name);
1184 $this->tpl->setVariable(
"IM_ID",$im_id);
1185 $this->tpl->setVariable(
"DISABLED_IM_NAME",$im_disabled);
1187 $this->tpl->setVariable(
"TXT_IM_ICON", $this->lng->txt(
"im_".$im_name.
"_icon"));
1188 $this->tpl->setVariable(
"CHK_IM",
"checked=\"checked\" disabled=\"disabled\"");
1189 $this->tpl->parseCurrentBlock();
1194 if ($d_set->get(
"user_profile") ==
"1")
1203 $global_roles = $rbacreview->getGlobalRoles();
1205 foreach($global_roles as $role_id)
1207 if (in_array($role_id,$rbacreview->assignedRoles($ilUser->getId())))
1209 $roleObj = $this->ilias->obj_factory->getInstanceByObjId($role_id);
1210 $role_names .= $roleObj->getTitle().
", ";
1215 $this->tpl->setVariable(
"TXT_DEFAULT_ROLES", $this->lng->txt(
"default_roles"));
1216 $this->tpl->setVariable(
"DEFAULT_ROLES", substr($role_names,0,-2));
1218 $this->tpl->setVariable(
"TXT_REQUIRED_FIELDS", $this->lng->txt(
"required_field"));
1221 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
1226 $this->tpl->setVariable(
"UPLOAD", $this->lng->txt(
"upload"));
1230 if ($ilUser->prefs[
"public_profile"] ==
"y")
1232 $this->tpl->setVariable(
"CHK_PUB",
"checked");
1234 $val_array = array(
"institution",
"department",
"upload",
"street",
1235 "zip",
"city",
"country",
"phone_office",
"phone_home",
"phone_mobile",
1236 "fax",
"email",
"hobby",
"matriculation",
"show_users_online");
1237 foreach($val_array as
$key => $value)
1241 if ($ilUser->prefs[
"public_".$value] ==
"y")
1243 $this->tpl->setVariable(
"CHK_".strtoupper($value),
"checked");
1249 if ($d_set->get(
"user_profile") ==
"1")
1251 if ($ilUser->prefs[
"public_delicious"] ==
"y")
1253 $this->tpl->setVariable(
"CHK_DELICIOUS",
"checked");
1262 $profile_fields = array(
1285 "show_users_online",
1286 "hide_own_online_status"
1288 foreach ($profile_fields as $field)
1290 if (!$this->ilias->getSetting(
"usr_settings_hide_" . $field))
1292 if ($this->ilias->getSetting(
"usr_settings_disable_" . $field))
1294 $this->tpl->setVariable(
"DISABLED_" . strtoupper($field),
" disabled=\"disabled\"");
1299 $this->tpl->parseCurrentBlock();
1314 $lng->loadLanguageModule(
'mail');
1317 $ilTabs->setSubTabActive(
'mail_settings');
1323 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
1325 require_once
'Services/Mail/classes/class.ilMailOptions.php';
1327 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
1328 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
1330 $incoming_type = (int)
$_POST[
'incoming_type'];
1334 $incoming_type = $mailOptions->getIncomingType();
1338 if($this->form->checkInput())
1340 $mailOptions->updateOptions(
1342 (
int)
$_POST[
'linebreak'],
1344 (
int)$_POST[
'cronjob_notification']
1350 if(!isset(
$_POST[
'incoming_type']))
1352 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
1355 $this->form->setValuesByPost();
1357 $this->tpl->setContent($this->form->getHTML());
1371 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1374 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
1375 $this->form->setTitle($lng->txt(
'mail_settings'));
1378 include_once
'Services/Mail/classes/class.ilMailOptions.php';
1379 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
1389 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
1391 $si->setDisabled(
true);
1393 $this->form->addItem($si);
1398 for($i = 50; $i <= 80; $i++)
1404 $this->form->addItem($si);
1410 $this->form->addItem($ta);
1413 if($ilSetting->get(
'mail_notification'))
1415 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
1416 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
1418 $this->form->addItem($cb);
1421 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
1434 require_once
'Services/Mail/classes/class.ilMailOptions.php';
1438 'linebreak' => $mailOptions->getLinebreak(),
1439 'signature' => $mailOptions->getSignature(),
1440 'cronjob_notification' => $mailOptions->getCronjobNotification()
1443 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
1448 $this->form->setValuesByArray($data);
1459 global $ilTabs,
$lng;
1461 $lng->loadLanguageModule(
'mail');
1464 $ilTabs->setSubTabActive(
'mail_settings');
1470 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
1475 $this->tpl->setContent($this->form->getHTML());
1486 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
1488 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1490 $form->setFormAction($ilCtrl->getFormAction($this));
1491 $form->setTitle($lng->txt(
"jsmath_settings"));
1494 include_once
"./Services/Administration/classes/class.ilSetting.php";
1495 $jsMathSetting =
new ilSetting(
"jsMath");
1497 $checked = ($ilUser->getPref(
"js_math") === FALSE) ? $jsMathSetting->get(
"makedefault") : $ilUser->getPref(
"js_math");
1499 $enable->setInfo($lng->txt(
"jsmath_enable_user_desc"));
1500 $form->addItem($enable);
1502 $form->addCommandButton(
"savejsMath", $lng->txt(
"save"));
1503 $form->addCommandButton(
"showjsMath", $lng->txt(
"cancel"));
1505 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1513 include_once
"./Services/Administration/classes/class.ilSetting.php";
1514 $jsMathSetting =
new ilSetting(
"jsMath");
1515 if ($jsMathSetting->get(
"enable"))
1519 $ilUser->writePref(
"js_math",
"1");
1523 $ilUser->writePref(
"js_math",
"0");
1526 $ilCtrl->redirect($this,
"showjsMath");
1533 $lng->loadLanguageModule(
"gmaps");
1536 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1544 $latitude = $ilUser->getLatitude();
1545 $longitude = $ilUser->getLongitude();
1546 $zoom = $ilUser->getLocationZoom();
1549 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
1552 $latitude = $def[
"latitude"];
1553 $longitude = $def[
"longitude"];
1554 $zoom = $def[
"zoom"];
1559 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
1561 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1563 $form->setFormAction($ilCtrl->getFormAction($this));
1565 $form->setTitle($this->lng->txt(
"location").
" ".
1566 strtolower($this->lng->txt(
"of")).
" ".$ilUser->getFullname());
1572 $public->setInfo($this->lng->txt(
"gmaps_public_profile_info"));
1573 $public->setChecked($ilUser->getPref(
"public_location"));
1574 $form->addItem($public);
1580 $loc_prop->setLongitude($longitude);
1581 $loc_prop->setZoom($zoom);
1583 $street = $ilUser->getStreet();
1586 $street = $this->lng->txt(
"street");
1589 $city = $ilUser->getCity();
1592 $city = $this->lng->txt(
"city");
1595 $country = $ilUser->getCountry();
1598 $country = $this->lng->txt(
"country");
1601 $loc_prop->setAddress($street.
",".$city.
",".$country);
1603 $form->addItem($loc_prop);
1605 $form->addCommandButton(
"saveLocation", $this->lng->txt(
"save"));
1607 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
1615 $ilUser->writePref(
"public_location",
$_POST[
"public_location"]);
1623 $ilCtrl->redirect($this,
"showLocation");
1631 $showProfile = ($a_cmd ==
'showProfile') ?
true :
false;
1632 $showPersonalData = ($a_cmd ==
'showPersonalData') ?
true :
false;
1633 $showPublicProfile = ($a_cmd ==
'showPublicProfile') ?
true :
false;
1634 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
1635 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
1636 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
1637 $showLocation = ($a_cmd ==
'showLocation') ?
true :
false;
1638 $showjsMath = ($a_cmd ==
'showjsMath') ?
true :
false;
1639 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
1648 $ilTabs->addSubTabTarget(
"personal_data", $this->ctrl->getLinkTarget($this,
"showPersonalData"));
1651 $ilTabs->addSubTabTarget(
"public_profile", $this->ctrl->getLinkTarget($this,
"showPublicProfile"));
1656 $ilTabs->addSubTabTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
1657 "",
"",
"", $showPassword);
1661 $ilTabs->addSubTabTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
1662 "",
"",
"", $showGeneralSettings);
1666 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1669 $ilTabs->addSubTabTarget(
"location", $this->ctrl->getLinkTarget($this,
"showLocation"),
1670 "",
"",
"", $showLocation);
1673 $ilTabs->addSubTabTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
1674 "",
"",
"", $showMailOptions);
1676 if(((
int)$ilSetting->get(
'chat_sound_status') &&
1677 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
1678 (int)$ilSetting->get(
'chat_new_message_sound_status'))) ||
1679 (int)$ilSetting->get(
'chat_message_notify_status') == 1)
1681 $ilTabs->addSubTabTarget(
"chat_settings", $this->ctrl->getLinkTarget($this,
"showChatOptions"),
1682 "",
"",
"", $showChatOptions);
1685 include_once
"./Services/Administration/classes/class.ilSetting.php";
1686 $jsMathSetting =
new ilSetting(
"jsMath");
1687 if ($jsMathSetting->get(
"enable"))
1689 $ilTabs->addSubTabTarget(
"jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this,
"showjsMath"),
1690 "",
"",
"", $showjsMath);
1698 if($this->
userSettingVisible(
"matriculation") or count($this->user_defined_fields->getVisibleDefinitions())
1699 or $d_set->get(
"user_profile") ==
"1")
1710 $user_defined_data = $ilUser->getUserDefinedData();
1711 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1715 $this->tpl->setCurrentBlock(
"field_text");
1717 if(!$definition[
'changeable'])
1719 $this->tpl->setVariable(
"DISABLED_FIELD",
'disabled=\"disabled\"');
1720 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
1724 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
1726 $this->tpl->parseCurrentBlock();
1730 if($definition[
'changeable'])
1732 $name =
'udf['.$definition[
'field_id'].
']';
1740 $this->tpl->setCurrentBlock(
"field_select");
1741 $this->tpl->setVariable(
"SELECT_BOX",
ilUtil::formSelect($user_defined_data[$field_id],
1743 $this->user_defined_fields->fieldValuesToSelectArray(
1744 $definition[
'field_values']),
1746 true,0,
'',
'',$disabled));
1747 $this->tpl->parseCurrentBlock();
1749 $this->tpl->setCurrentBlock(
"user_defined");
1751 if($definition[
'required'])
1753 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
1757 $name = $definition[
'field_name'];
1759 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
1760 $this->tpl->parseCurrentBlock();
1767 foreach($this->user_defined_fields->getVisibleDefinitions() as $definition)
1769 $field_id = $definition[
'field_id'];
1770 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
1783 $lng->loadLanguageModule(
'chat');
1785 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1788 $form->setFormAction($this->ctrl->getFormAction($this,
'saveChatOptions'));
1789 $form->setTitle($lng->txt(
"chat_settings"));
1791 if((
int)$ilSetting->get(
'chat_message_notify_status'))
1797 $ro_parent =
new ilCheckboxInputGUI($this->lng->txt(
'chat_message_notify_activate'),
'chat_message_notify_activate');
1798 $ro_parent->
setOptionTitle($this->lng->txt(
'chat_activate_status_notification'));
1800 #$ro_parent->setValue(0);
1802 if((
int)$ilSetting->get(
'chat_sound_status') &&
1803 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
1804 (int)$ilSetting->get(
'chat_new_message_sound_status')))
1807 #$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_sounds'), 'chat_sound_status');
1809 #$ro = new ilCheckboxInputGUI($this->lng->txt('chat_sound_status_activate'), 1);
1810 if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
1813 $chb->setOptionTitle($this->lng->txt(
'chat_new_invitation_sound_status'));
1814 $chb->setChecked(
false);
1815 $ro_parent->addSubItem($chb);
1818 if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
1820 $chb =
new ilCheckBoxInputGUI(
'',
'chat_new_message_sound_status');
1821 $chb->setOptionTitle($this->lng->txt(
'chat_new_message_sound_status'));
1822 $chb->setChecked(
false);
1823 $ro_parent->addSubItem($chb);
1825 #$rg->addOption($ro);
1830 #$ro_parent->addSubItem($rg);
1835 #$ro_parent = new ilRadioOption($this->lng->txt('chat_message_notify_deactivate'), 0);
1836 #$rg_parent->addOption($ro_parent);
1837 $form->addItem($ro_parent);
1840 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
1848 if((
int)$ilSetting->get(
'chat_message_notify_status'))
1850 $ilUser->setPref(
'chat_message_notify_status', (
int)
$_POST[
'chat_message_notify_activate']);
1853 if((
int)$ilSetting->get(
'chat_sound_status') &&
1854 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
1855 (int)$ilSetting->get(
'chat_new_message_sound_status')))
1857 $ilUser->setPref(
'chat_sound_status', (
int)
$_POST[
'chat_sound_status']);
1858 if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
1860 $ilUser->setPref(
'chat_new_invitation_sound_status', (
int)$_POST[
'chat_new_invitation_sound_status']);
1862 if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
1864 $ilUser->setPref(
'chat_new_message_sound_status', (
int)$_POST[
'chat_new_message_sound_status']);
1868 $ilUser->writePrefs();
1886 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_desktop'));
1892 $form->setValuesByPost();
1897 $values[
'chat_message_notify_status'] = $ilUser->getPref(
'chat_message_notify_status');
1898 $values[
'chat_message_notify_activate'] = $ilUser->getPref(
'chat_message_notify_status');
1900 $values[
'chat_sound_status'] = $ilUser->getPref(
'chat_sound_status');
1901 $values[
'chat_new_invitation_sound_status'] = $ilUser->getPref(
'chat_new_invitation_sound_status');
1902 $values[
'chat_new_message_sound_status'] = $ilUser->getPref(
'chat_new_message_sound_status');
1905 $form->setValuesByArray($values);
1908 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
1925 $ilTabs->setSubTabActive(
"personal_data");
1927 $settings = $ilias->getAllSettings();
1936 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
1942 if ($ilUser->getProfileIncomplete())
1947 $this->tpl->setContent($this->form->getHTML());
1959 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1961 $this->form->setFormAction($this->ctrl->getFormAction($this));
1964 include_once(
"./Services/User/classes/class.ilUserProfile.php");
1966 $up->skipField(
"password");
1967 $up->skipGroup(
"settings");
1968 $up->skipGroup(
"preferences");
1971 $up->addStandardFieldsToForm($this->form, $ilUser);
1974 $user_defined_data = $ilUser->getUserDefinedData();
1976 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1980 $this->input[
"udf_".$definition[
'field_id']] =
1981 new ilTextInputGUI($definition[
'field_name'],
"udf_".$definition[
'field_id']);
1982 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1983 $this->input[
"udf_".$definition[
'field_id']]->setMaxLength(255);
1984 $this->input[
"udf_".$definition[
'field_id']]->setSize(40);
1988 $this->input[
"udf_".$definition[
'field_id']] =
1990 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1991 $this->input[
"udf_".$definition[
'field_id']]->setUseRte(
true);
1995 $this->input[
"udf_".$definition[
'field_id']] =
1996 new ilSelectInputGUI($definition[
'field_name'],
"udf_".$definition[
'field_id']);
1997 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1998 $this->input[
"udf_".$definition[
'field_id']]->setOptions(
1999 $this->user_defined_fields->fieldValuesToSelectArray($definition[
'field_values']));
2001 if(!$definition[
'changeable'])
2003 $this->input[
"udf_".$definition[
'field_id']]->setDisabled(
true);
2005 if($definition[
'required'])
2007 $this->input[
"udf_".$definition[
'field_id']]->setRequired(
true);
2009 $this->form->addItem($this->input[
"udf_".$definition[
'field_id']]);
2012 $this->form->addCommandButton(
"savePersonalData", $lng->txt(
"save"));
2025 if ($this->form->checkInput())
2031 $ilUser->setFirstName(
$_POST[
"usr_firstname"]);
2035 $ilUser->setLastName(
$_POST[
"usr_lastname"]);
2039 $ilUser->setGender(
$_POST[
"usr_gender"]);
2043 $ilUser->setUTitle(
$_POST[
"usr_title"]);
2047 if (is_array(
$_POST[
'usr_birthday']))
2049 if (is_array(
$_POST[
'usr_birthday'][
'date']))
2051 if ((
$_POST[
'usr_birthday'][
'd'] > 0) && (
$_POST[
'usr_birthday'][
'm'] > 0) && (
$_POST[
'usr_birthday'][
'y'] > 0))
2053 $ilUser->setBirthday(sprintf(
"%04d-%02d-%02d",
$_POST[
'user_birthday'][
'y'],
$_POST[
'user_birthday'][
'm'],
$_POST[
'user_birthday'][
'd']));
2057 $ilUser->setBirthday(
"");
2062 $ilUser->setBirthday(
$_POST[
'usr_birthday'][
'date']);
2066 $ilUser->setFullname();
2069 $ilUser->setInstitution(
$_POST[
"usr_institution"]);
2073 $ilUser->setDepartment(
$_POST[
"usr_department"]);
2077 $ilUser->setStreet(
$_POST[
"usr_street"]);
2081 $ilUser->setZipcode(
$_POST[
"usr_zipcode"]);
2085 $ilUser->setCity(
$_POST[
"usr_city"]);
2089 $ilUser->setCountry(
$_POST[
"usr_country"]);
2093 $ilUser->setPhoneOffice(
$_POST[
"usr_phone_office"]);
2097 $ilUser->setPhoneHome(
$_POST[
"usr_phone_home"]);
2101 $ilUser->setPhoneMobile(
$_POST[
"usr_phone_mobile"]);
2105 $ilUser->setFax(
$_POST[
"usr_fax"]);
2109 $ilUser->setEmail(
$_POST[
"usr_email"]);
2113 $ilUser->setHobby(
$_POST[
"usr_hobby"]);
2117 $ilUser->setComment(
$_POST[
"usr_referral_comment"]);
2121 $ilUser->setMatriculation(
$_POST[
"usr_matriculation"]);
2125 $ilUser->setDelicious(
$_POST[
"usr_delicious"]);
2130 if ($d_set->get(
"user_profile"))
2132 $ilUser->setDelicious(
$_POST[
"usr_delicious"]);
2138 $ilUser->setInstantMessengerId(
'icq',
$_POST[
"usr_im_icq"]);
2139 $ilUser->setInstantMessengerId(
'yahoo',
$_POST[
"usr_im_yahoo"]);
2140 $ilUser->setInstantMessengerId(
'msn',
$_POST[
"usr_im_msn"]);
2141 $ilUser->setInstantMessengerId(
'aim',
$_POST[
"usr_im_aim"]);
2142 $ilUser->setInstantMessengerId(
'skype',
$_POST[
"usr_im_skype"]);
2143 $ilUser->setInstantMessengerId(
'jabber',
$_POST[
"usr_im_jabber"]);
2144 $ilUser->setInstantMessengerId(
'voip',
$_POST[
"usr_im_voip"]);
2148 $defs = $this->user_defined_fields->getVisibleDefinitions();
2150 foreach (
$_POST as $k => $v)
2152 if (substr($k, 0, 4) ==
"udf_")
2155 if ($defs[
$f][
"changeable"] && $defs[
$f][
"visible"])
2162 $ilUser->setUserDefinedData($udf);
2165 $un = $this->form->getInput(
'username');
2166 if((
int)$ilSetting->get(
'allow_change_loginname') &&
2167 $un != $ilUser->getLogin())
2172 $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'login_invalid'));
2173 $form_valid =
false;
2178 $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'loginname_already_exists'));
2179 $form_valid =
false;
2183 $ilUser->setLogin($un);
2187 $ilUser->updateLogin($ilUser->getLogin());
2188 $ilAuth->setAuth($ilUser->getLogin());
2194 $this->form->getItemByPostVar(
'username')->setAlert($e->getMessage());
2195 $form_valid =
false;
2206 $ilUser->setProfileIncomplete(
false);
2209 $ilUser->setTitle($ilUser->getFullname());
2210 $ilUser->setDescription($ilUser->getEmail());
2214 $ilCtrl->redirect($this,
"showPersonalData");
2218 $this->form->setValuesByPost();
2236 $ilTabs->setSubTabActive(
"public_profile");
2242 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
2249 $ptpl =
new ilTemplate(
"tpl.edit_personal_profile.html",
true,
true,
"Services/User");
2250 $ptpl->setVariable(
"FORM", $this->form->getHTML());
2251 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
2253 $ptpl->setVariable(
"PREVIEW", $pub_profile->getHTML());
2254 $this->tpl->setContent($ptpl->get());
2267 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2272 $radg->
setInfo($this->lng->txt(
"user_activate_public_profile_info"));
2273 $pub_prof = in_array($ilUser->prefs[
"public_profile"], array(
"y",
"n",
"g"))
2274 ? $ilUser->prefs[
"public_profile"]
2276 if (!$ilSetting->get(
'enable_global_profiles') && $pub_prof ==
"g")
2280 $radg->setValue($pub_prof);
2281 $op1 =
new ilRadioOption($lng->txt(
"usr_public_profile_disabled"),
"n",$lng->txt(
"usr_public_profile_disabled_info"));
2282 $radg->addOption($op1);
2283 $op2 =
new ilRadioOption($lng->txt(
"usr_public_profile_logged_in"),
"y",$lng->txt(
"usr_public_profile_logged_in_info"));
2284 $radg->addOption($op2);
2285 if ($ilSetting->get(
'enable_global_profiles'))
2287 $op3 =
new ilRadioOption($lng->txt(
"usr_public_profile_global"),
"g",$lng->txt(
"usr_public_profile_global_info"));
2288 $radg->addOption($op3);
2290 $this->form->addItem($radg);
2301 "institution" => $ilUser->getInstitution(),
2302 "department" => $ilUser->getDepartment(),
2304 "street" => $ilUser->getStreet(),
2305 "zipcode" => $ilUser->getZipcode(),
2306 "city" => $ilUser->getCity(),
2307 "country" => $ilUser->getCountry(),
2308 "phone_office" => $ilUser->getPhoneOffice(),
2309 "phone_home" => $ilUser->getPhoneHome(),
2310 "phone_mobile" => $ilUser->getPhoneMobile(),
2311 "fax" => $ilUser->getFax(),
2312 "email" => $ilUser->getEmail(),
2313 "hobby" => $ilUser->getHobby(),
2314 "matriculation" => $ilUser->getMatriculation(),
2315 "delicious" => $ilUser->getDelicious()
2317 foreach($val_array as
$key => $value)
2322 if (
$key ==
"upload")
2330 if ($ilUser->prefs[
"public_".$key] ==
"y")
2335 $cb->setOptionTitle($value);
2336 $this->form->addItem($cb);
2340 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
2343 foreach ($im_arr as $im)
2349 if ($ilUser->prefs[
"public_im_".$im] !=
"n")
2351 $cb->setChecked(
true);
2353 $this->form->addItem($cb);
2358 $user_defined_data = $ilUser->getUserDefinedData();
2359 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
2362 $cb =
new ilCheckboxInputGUI($definition[
"field_name"],
"chk_udf_".$definition[
"field_id"]);
2363 $cb->setOptionTitle($user_defined_data[
"f_".$definition[
"field_id"]]);
2364 if ($ilUser->prefs[
"public_udf_".$definition[
"field_id"]] ==
"y")
2366 $cb->setChecked(
true);
2368 $this->form->addItem($cb);
2373 $this->form->addCommandButton(
"savePublicProfile", $lng->txt(
"save"));
2375 $this->form->setTitle($lng->txt(
"public_profile"));
2376 $this->form->setDescription($lng->txt(
"user_public_profile_info"));
2377 $this->form->setFormAction($this->ctrl->getFormAction($this));
2389 if ($this->form->checkInput())
2399 $ilUser->setPref(
"public_profile",
$_POST[
"public_profile"]);
2402 $val_array = array(
"institution",
"department",
"upload",
"street",
2403 "zipcode",
"city",
"country",
"phone_office",
"phone_home",
"phone_mobile",
2404 "fax",
"email",
"hobby",
"matriculation");
2407 foreach($val_array as
$key => $value)
2409 if ((
$_POST[
"chk_".$value]))
2411 $ilUser->setPref(
"public_".$value,
"y");
2415 $ilUser->setPref(
"public_".$value,
"n");
2419 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
2422 foreach ($im_arr as $im)
2424 if ((
$_POST[
"chk_im_".$im]))
2426 $ilUser->setPref(
"public_im_".$im,
"y");
2430 $ilUser->setPref(
"public_im_".$im,
"n");
2438 if ((
$_POST[
"chk_delicious"]))
2440 $ilUser->setPref(
"public_delicious",
"y");
2444 $ilUser->setPref(
"public_delicious",
"n");
2449 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
2451 if ((
$_POST[
"chk_udf_".$definition[
"field_id"]]))
2453 $ilUser->setPref(
"public_udf_".$definition[
"field_id"],
"y");
2457 $ilUser->setPref(
"public_udf_".$definition[
"field_id"],
"n");
2463 $ilCtrl->redirect($this,
"showPublicProfile");
2465 $this->form->setValuesByPost();
2466 $tpl->showPublicProfile(
true);
2484 $ilTabs->setSubTabActive(
"password");
2490 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
2496 $this->tpl->setContent($this->form->getHTML());
2509 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2518 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
2523 $cpass->setSkipSyntaxCheck(
true);
2525 if($ilUser->getPasswd())
2527 $cpass->setRequired(
true);
2529 $this->form->addItem($cpass);
2537 if ($ilSetting->get(
"passwd_auto_generate") == 1)
2539 $ipass->setPreSelection(
true);
2541 $this->form->addItem($ipass);
2542 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
2543 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
2547 $this->form->addItem($ipass);
2548 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
2551 switch ($ilUser->getAuthMode(
true))
2554 $this->form->setTitle($lng->txt(
"chg_password"));
2559 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
2562 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
2566 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
2570 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
2573 $this->form->setFormAction($this->ctrl->getFormAction($this));
2585 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
2586 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
2587 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
2588 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
2594 $this->ilias->getSetting(
'usr_settings_disable_password'))
2612 $ilCtrl->redirect($this,
"showPersonalData");
2617 if ($this->form->checkInput())
2619 $cp = $this->form->getItemByPostVar(
"current_password");
2620 $np = $this->form->getItemByPostVar(
"new_password");
2626 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
2629 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd() and
2630 $ilUser->getPasswd())
2633 $cp->setAlert($this->lng->txt(
"passwd_wrong"));
2638 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
2642 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
2646 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
2650 if ($custom_error !=
'')
2652 $np->setAlert($custom_error);
2656 $np->setAlert($this->lng->txt(
"passwd_invalid"));
2659 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
2660 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
2661 (
$_POST[
"current_password"] ==
$_POST[
"new_password"]))
2664 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
2670 $ilUser->resetPassword(
$_POST[
"new_password"],
$_POST[
"new_password"]);
2671 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"])
2673 $ilUser->setLastPasswordChangeToNow();
2675 $ilCtrl->redirect($this,
"showPassword");
2678 $this->form->setValuesByPost();
2696 $ilTabs->setSubTabActive(
"general_settings");
2702 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
2708 $this->tpl->setContent($this->form->getHTML());
2721 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2727 $languages = $this->lng->getInstalledLanguages();
2729 foreach($languages as $lang_key)
2736 $si->setValue($ilUser->getLanguage());
2737 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
2738 $this->form->addItem($si);
2742 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
2745 $templates = $styleDefinition->getAllTemplates();
2746 if (is_array($templates))
2751 foreach($templates as $template)
2755 $styleDef->startParsing();
2756 $styles = $styleDef->getStyles();
2758 foreach($styles as $style)
2765 $options[$template[
"id"].
":".$style[
"id"]] =
2766 $styleDef->getTemplateName().
" / ".$style[
"name"];
2770 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
2771 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
2772 $this->form->addItem($si);
2779 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
2780 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
2781 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
2782 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
2783 $this->form->addItem($cb);
2789 $si =
new ilSelectInputGUI($this->lng->txt(
"hits_per_page"),
"hits_per_page");
2791 $hits_options = array(10,15,20,30,40,50,100,9999);
2794 foreach($hits_options as $hits_option)
2796 $hstr = ($hits_option == 9999)
2797 ? $this->lng->txt(
"no_limit")
2799 $options[$hits_option] = $hstr;
2801 $si->setOptions($options);
2802 $si->setValue($ilUser->prefs[
"hits_per_page"]);
2803 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
2804 $this->form->addItem($si);
2810 $si =
new ilSelectInputGUI($this->lng->txt(
"show_users_online"),
"show_users_online");
2813 "y" => $this->lng->txt(
"users_online_show_y"),
2814 "associated" => $this->lng->txt(
"users_online_show_associated"),
2815 "n" => $this->lng->txt(
"users_online_show_n"));
2817 $si->setValue($ilUser->prefs[
"show_users_online"]);
2818 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
2819 $this->form->addItem($si);
2825 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
2826 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
2827 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
2828 $this->form->addItem($cb);
2832 if((
int)$ilSetting->get(
'session_reminder_enabled'))
2834 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
2835 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
2837 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
2839 global $ilClientIniFile;
2841 $lead_time_gui =
new ilTextInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
2842 $lead_time_gui->
setInfo(sprintf($this->lng->txt(
'session_reminder_lead_time_info'),
ilFormat::_secondsToString($ilClientIniFile->readVariable(
'session',
'expire'))));
2843 $lead_time_gui->setValue($ilUser->getPref(
'session_reminder_lead_time'));
2844 $lead_time_gui->setMaxLength(10);
2845 $lead_time_gui->setSize(10);
2846 $cb->addSubItem($lead_time_gui);
2848 $this->form->addItem($cb);
2851 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
2852 $this->form->setTitle($lng->txt(
"general_settings"));
2853 $this->form->setFormAction($this->ctrl->getFormAction($this));
2866 if ($this->form->checkInput())
2871 if (
$_POST[
"skin_style"] !=
"")
2873 $sknst = explode(
":",
$_POST[
"skin_style"]);
2875 if ($ilUser->getPref(
"style") != $sknst[1] ||
2876 $ilUser->getPref(
"skin") != $sknst[0])
2878 $ilUser->setPref(
"skin", $sknst[0]);
2879 $ilUser->setPref(
"style", $sknst[1]);
2887 $ilUser->setLanguage(
$_POST[
"language"]);
2893 if (
$_POST[
"hits_per_page"] !=
"")
2895 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
2902 $ilUser->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
2908 if (
$_POST[
"hide_own_online_status"] == 1)
2910 $ilUser->setPref(
"hide_own_online_status",
"y");
2914 $ilUser->setPref(
"hide_own_online_status",
"n");
2921 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
2926 if((
int)$ilSetting->get(
'session_reminder_enabled'))
2928 $ilUser->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
2930 if(!preg_match(
'/^([0]|([1-9][0-9]*))([\.,][0-9][0-9]*)?$/', (
int)$_POST[
'session_reminder_lead_time']))
2931 $_POST[
'session_reminder_lead_time'] = 0;
2932 $ilUser->setPref(
'session_reminder_lead_time', (
int)$_POST[
'session_reminder_lead_time']);
2937 $ilCtrl->redirect($this,
"showGeneralSettings");
2940 $this->form->setValuesByPost();
2941 $tpl->showGeneralSettings(
true);