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");
43 $ilCtrl->saveParameter($this,
"user_page");
53 $next_class = $this->ctrl->getNextClass();
57 case "ilpublicuserprofilegui":
58 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
60 $ilCtrl->forwardCommand($pub_profile_gui);
64 case 'ilextpublicprofilepagegui':
66 $ilTabs->clearTargets();
67 $ilTabs->setBackTarget($lng->txt(
"back"),
68 $ilCtrl->getLinkTarget($this,
"showExtendedProfile"));
69 include_once(
"./Services/User/classes/class.ilExtPublicProfilePageGUI.php");
71 $tpl->setCurrentBlock(
"ContentStyle");
72 $tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
74 $tpl->parseCurrentBlock();
75 $ret = $this->ctrl->forwardCommand($page_gui);
78 $tpl->setContent(
$ret);
87 $cmd = $this->ctrl->getCmd(
"showPersonalData");
91 if( $ilUser->isPasswordChangeDemanded() &&
$cmd !=
'savePassword' )
93 $cmd =
'showPassword';
96 $this->lng->txt(
'password_change_on_first_login_demand'), true
99 elseif( $ilUser->isPasswordExpired() &&
$cmd !=
'savePassword' )
101 $cmd =
'showPassword';
103 $msg = $this->lng->txt(
'password_expired');
104 $password_age = $ilUser->getPasswordAge();
123 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
127 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
141 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
142 $this->settings[
"usr_settings_hide_".$setting] == 1)
156 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
172 $userfile_input = $this->form->getItemByPostVar(
"userfile");
174 if ($_FILES[
"userfile"][
"tmp_name"] ==
"")
176 if ($userfile_input->getDeletionFlag())
178 $ilUser->removeUserPicture();
183 if ($_FILES[
"userfile"][
"size"] != 0)
186 $image_dir = $webspace_dir.
"/usr_images";
187 $store_file =
"usr_".$ilUser->getID().
".".
"jpg";
190 $ilUser->setPref(
"profile_image", $store_file);
194 $uploaded_file = $image_dir.
"/upload_".$ilUser->getId().
"pic";
197 $uploaded_file,
false))
200 $this->ctrl->redirect($this,
"showProfile");
202 chmod($uploaded_file, 0770);
206 $show_file =
"$image_dir/usr_".$ilUser->getId().
".jpg";
207 $thumb_file =
"$image_dir/usr_".$ilUser->getId().
"_small.jpg";
208 $xthumb_file =
"$image_dir/usr_".$ilUser->getId().
"_xsmall.jpg";
209 $xxthumb_file =
"$image_dir/usr_".$ilUser->getId().
"_xxsmall.jpg";
215 ilUtil::execConvert($uploaded_file .
"[0] -geometry 200x200 -quality 100 JPEG:".$show_file);
216 ilUtil::execConvert($uploaded_file .
"[0] -geometry 100x100 -quality 100 JPEG:".$thumb_file);
217 ilUtil::execConvert($uploaded_file .
"[0] -geometry 75x75 -quality 100 JPEG:".$xthumb_file);
218 ilUtil::execConvert($uploaded_file .
"[0] -geometry 30x30 -quality 100 JPEG:".$xxthumb_file);
232 $ilUser->removeUserPicture();
263 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
264 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
265 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
266 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
269 $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
273 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
278 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
281 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
283 $this->password_error = $this->lng->txt(
"passwd_wrong");
289 $this->password_error = $this->lng->txt(
"passwd_not_selected");
292 if (empty($this->password_error))
295 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"new_passwd"],
$_POST[
"new_passwd"]);
301 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
303 $this->password_error = $this->lng->txt(
"passwd_wrong");
306 else if (
$_POST[
"desired_password"] !=
$_POST[
"retype_password"])
308 $this->password_error = $this->lng->txt(
"passwd_not_match");
313 if( $custom_error !=
'' )
314 $this->password_error = $custom_error;
315 else $this->password_error = $this->lng->txt(
"passwd_invalid");
317 else if (
$_POST[
"current_password"] !=
"" and empty($this->password_error))
319 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
321 if(
$_POST[
"current_password"] !=
$_POST[
"desired_password"] )
323 if( $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]) )
326 $ilUser->setLastPasswordChangeToNow();
331 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
337 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]);
338 $ilUser->setLastPasswordChangeToNow();
362 if ((
$_POST[
"chk_pub"])==
"on")
364 $ilUser->setPref(
"public_profile",
"y");
368 $ilUser->setPref(
"public_profile",
"n");
372 $val_array = array(
"institution",
"department",
"upload",
"street",
373 "zip",
"city",
"country",
"phone_office",
"phone_home",
"phone_mobile",
374 "fax",
"email",
"hobby",
"matriculation");
377 foreach($val_array as $key => $value)
379 if ((
$_POST[
"chk_".$value]) ==
"on")
381 $ilUser->setPref(
"public_".$value,
"y");
385 $ilUser->setPref(
"public_".$value,
"n");
390 if ($d_set->get(
"user_profile"))
392 if ((
$_POST[
"chk_delicious"]) ==
"on")
394 $ilUser->setPref(
"public_delicious",
"y");
398 $ilUser->setPref(
"public_delicious",
"n");
404 foreach($this->settings as $key => $val)
406 if (substr($key,0,8) ==
"require_")
408 $require_keys[] = substr($key,8);
412 foreach($require_keys as $key => $val)
415 $system_fields = array(
"login",
"default_role",
"passwd",
"passwd2");
416 if (!in_array($val, $system_fields))
420 if (isset($this->settings[
"require_" . $val]) && $this->settings[
"require_" . $val])
422 if (empty(
$_POST[
"usr_" . $val]))
424 ilUtil::sendFailure($this->lng->txt(
"fill_out_all_required_fields") .
": " . $this->lng->txt($val));
460 $ilUser->setGender(
$_POST[
"usr_gender"]);
466 $ilUser->setFullname();
526 if ($d_set->get(
"user_profile"))
544 $ilUser->setUserDefinedData(
$_POST[
'udf']);
555 if (
$_POST[
"usr_skin_style"] !=
"")
557 $sknst = explode(
":",
$_POST[
"usr_skin_style"]);
559 if ($ilUser->getPref(
"style") != $sknst[1] ||
560 $ilUser->getPref(
"skin") != $sknst[0])
562 $ilUser->setPref(
"skin", $sknst[0]);
563 $ilUser->setPref(
"style", $sknst[1]);
574 if (
$_POST[
"usr_language"] != $ilUser->getLanguage())
580 $ilUser->setLanguage(
$_POST[
"usr_language"]);
586 if (
$_POST[
"hits_per_page"] !=
"")
588 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
595 $ilUser->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
601 if (
$_POST[
"chk_hide_own_online_status"] !=
"")
603 $ilUser->setPref(
"hide_own_online_status",
"y");
607 $ilUser->setPref(
"hide_own_online_status",
"n");
624 $ilUser->setProfileIncomplete(
false);
627 $ilUser->setTitle($ilUser->getFullname());
628 $ilUser->setDescription($ilUser->getEmail());
634 if (!empty($this->password_error))
638 elseif (!empty($this->upload_error))
646 $this->ctrl->redirect($this,
"");
679 $lng->loadLanguageModule(
'mail');
682 $ilTabs->setSubTabActive(
'mail_settings');
688 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
690 require_once
'Services/Mail/classes/class.ilMailOptions.php';
692 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
693 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
695 $incoming_type = (int)
$_POST[
'incoming_type'];
699 $incoming_type = $mailOptions->getIncomingType();
703 if($this->form->checkInput())
705 $mailOptions->updateOptions(
709 (
int)$_POST[
'cronjob_notification']
715 if(!isset(
$_POST[
'incoming_type']))
717 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
720 $this->form->setValuesByPost();
722 $this->tpl->setContent($this->form->getHTML());
736 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
739 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
740 $this->form->setTitle($lng->txt(
'mail_settings'));
743 include_once
'Services/Mail/classes/class.ilMailOptions.php';
744 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
754 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
756 $si->setDisabled(
true);
758 $this->form->addItem($si);
763 for($i = 50; $i <= 80; $i++)
769 $this->form->addItem($si);
775 $this->form->addItem($ta);
778 if($ilSetting->get(
'mail_notification'))
780 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
781 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
783 $this->form->addItem($cb);
786 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
799 require_once
'Services/Mail/classes/class.ilMailOptions.php';
803 'linebreak' => $mailOptions->getLinebreak(),
804 'signature' => $mailOptions->getSignature(),
805 'cronjob_notification' => $mailOptions->getCronjobNotification()
808 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
813 $this->form->setValuesByArray($data);
824 global $ilTabs,
$lng;
826 $lng->loadLanguageModule(
'mail');
829 $ilTabs->setSubTabActive(
'mail_settings');
835 $this->tpl->setTitle($lng->txt(
'personal_desktop'));
840 $this->tpl->setContent($this->form->getHTML());
851 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
853 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
855 $form->setFormAction($ilCtrl->getFormAction($this));
856 $form->setTitle($lng->txt(
"jsmath_settings"));
859 include_once
"./Services/Administration/classes/class.ilSetting.php";
860 $jsMathSetting =
new ilSetting(
"jsMath");
862 $checked = ($ilUser->getPref(
"js_math") === FALSE) ? $jsMathSetting->get(
"makedefault") : $ilUser->getPref(
"js_math");
864 $enable->setInfo($lng->txt(
"jsmath_enable_user_desc"));
865 $form->addItem($enable);
867 $form->addCommandButton(
"savejsMath", $lng->txt(
"save"));
868 $form->addCommandButton(
"showjsMath", $lng->txt(
"cancel"));
870 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
878 include_once
"./Services/Administration/classes/class.ilSetting.php";
879 $jsMathSetting =
new ilSetting(
"jsMath");
880 if ($jsMathSetting->get(
"enable"))
884 $ilUser->writePref(
"js_math",
"1");
888 $ilUser->writePref(
"js_math",
"0");
891 $ilCtrl->redirect($this,
"showjsMath");
898 $lng->loadLanguageModule(
"gmaps");
901 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
909 $latitude = $ilUser->getLatitude();
910 $longitude = $ilUser->getLongitude();
911 $zoom = $ilUser->getLocationZoom();
914 if ($latitude == 0 && $longitude == 0 && $zoom == 0)
917 $latitude = $def[
"latitude"];
918 $longitude = $def[
"longitude"];
919 $zoom = $def[
"zoom"];
924 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"personal_desktop"));
926 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
928 $form->setFormAction($ilCtrl->getFormAction($this));
930 $form->setTitle($this->lng->txt(
"location").
" ".
931 strtolower($this->lng->txt(
"of")).
" ".$ilUser->getFullname());
937 $public->setInfo($this->lng->txt(
"gmaps_public_profile_info"));
938 $public->setChecked($ilUser->getPref(
"public_location"));
939 $form->addItem($public);
945 $loc_prop->setLongitude($longitude);
946 $loc_prop->setZoom($zoom);
948 $street = $ilUser->getStreet();
951 $street = $this->lng->txt(
"street");
954 $city = $ilUser->getCity();
957 $city = $this->lng->txt(
"city");
960 $country = $ilUser->getCountry();
963 $country = $this->lng->txt(
"country");
966 $loc_prop->setAddress($street.
",".$city.
",".$country);
968 $form->addItem($loc_prop);
970 $form->addCommandButton(
"saveLocation", $this->lng->txt(
"save"));
972 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
980 $ilUser->writePref(
"public_location",
$_POST[
"public_location"]);
988 $ilCtrl->redirect($this,
"showLocation");
996 $showProfile = ($a_cmd ==
'showProfile') ?
true :
false;
997 $showPersonalData = ($a_cmd ==
'showPersonalData') ?
true :
false;
998 $showPublicProfile = ($a_cmd ==
'showPublicProfile') ?
true :
false;
999 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
1000 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
1001 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
1002 $showLocation = ($a_cmd ==
'showLocation') ?
true :
false;
1003 $showjsMath = ($a_cmd ==
'showjsMath') ?
true :
false;
1004 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
1013 $ilTabs->addSubTabTarget(
"personal_data", $this->ctrl->getLinkTarget($this,
"showPersonalData"));
1016 $ilTabs->addSubTabTarget(
"public_profile", $this->ctrl->getLinkTarget($this,
"showPublicProfile"));
1018 if ($ilSetting->get(
'user_ext_profiles'))
1020 $ilTabs->addSubTabTarget(
"user_ext_profile",
1021 $this->ctrl->getLinkTarget($this,
"showExtendedProfile"));
1027 $ilTabs->addSubTabTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
1028 "",
"",
"", $showPassword);
1032 $ilTabs->addSubTabTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
1033 "",
"",
"", $showGeneralSettings);
1037 include_once(
"./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php");
1040 $ilTabs->addSubTabTarget(
"location", $this->ctrl->getLinkTarget($this,
"showLocation"),
1041 "",
"",
"", $showLocation);
1044 $ilTabs->addSubTabTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
1045 "",
"",
"", $showMailOptions);
1047 include_once
"./Services/Administration/classes/class.ilSetting.php";
1048 $jsMathSetting =
new ilSetting(
"jsMath");
1049 if ($jsMathSetting->get(
"enable"))
1051 $ilTabs->addSubTabTarget(
"jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this,
"showjsMath"),
1052 "",
"",
"", $showjsMath);
1060 if($this->
userSettingVisible(
"matriculation") or count($this->user_defined_fields->getVisibleDefinitions())
1061 or $d_set->get(
"user_profile") ==
"1")
1072 $user_defined_data = $ilUser->getUserDefinedData();
1073 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1077 $this->tpl->setCurrentBlock(
"field_text");
1079 if(!$definition[
'changeable'])
1081 $this->tpl->setVariable(
"DISABLED_FIELD",
'disabled=\"disabled\"');
1082 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
1086 $this->tpl->setVariable(
"FIELD_NAME",
'udf['.$definition[
'field_id'].
']');
1088 $this->tpl->parseCurrentBlock();
1092 if($definition[
'changeable'])
1094 $name =
'udf['.$definition[
'field_id'].
']';
1102 $this->tpl->setCurrentBlock(
"field_select");
1103 $this->tpl->setVariable(
"SELECT_BOX",
ilUtil::formSelect($user_defined_data[$field_id],
1105 $this->user_defined_fields->fieldValuesToSelectArray(
1106 $definition[
'field_values']),
1108 true,0,
'',
'',$disabled));
1109 $this->tpl->parseCurrentBlock();
1111 $this->tpl->setCurrentBlock(
"user_defined");
1113 if($definition[
'required'])
1115 $name = $definition[
'field_name'].
"<span class=\"asterisk\">*</span>";
1119 $name = $definition[
'field_name'];
1121 $this->tpl->setVariable(
"TXT_FIELD_NAME",
$name);
1122 $this->tpl->parseCurrentBlock();
1129 foreach($this->user_defined_fields->getVisibleDefinitions() as $definition)
1131 $field_id = $definition[
'field_id'];
1132 if($definition[
'required'] and !strlen(
$_POST[
'udf'][$field_id]))
1154 $ilTabs->setSubTabActive(
"personal_data");
1156 $settings = $ilias->getAllSettings();
1165 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
1171 if ($ilUser->getProfileIncomplete())
1176 $this->tpl->setContent($this->form->getHTML());
1188 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1190 $this->form->setFormAction($this->ctrl->getFormAction($this));
1193 $user_defined_data = $ilUser->getUserDefinedData();
1195 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1199 $this->input[
"udf_".$definition[
'field_id']] =
1200 new ilTextInputGUI($definition[
'field_name'],
"udf_".$definition[
'field_id']);
1201 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1202 $this->input[
"udf_".$definition[
'field_id']]->setMaxLength(255);
1203 $this->input[
"udf_".$definition[
'field_id']]->setSize(40);
1207 $this->input[
"udf_".$definition[
'field_id']] =
1209 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1210 $this->input[
"udf_".$definition[
'field_id']]->setUseRte(
true);
1214 $this->input[
"udf_".$definition[
'field_id']] =
1215 new ilSelectInputGUI($definition[
'field_name'],
"udf_".$definition[
'field_id']);
1216 $this->input[
"udf_".$definition[
'field_id']]->setValue($user_defined_data[
"f_".$field_id]);
1217 $this->input[
"udf_".$definition[
'field_id']]->setOptions(
1218 $this->user_defined_fields->fieldValuesToSelectArray($definition[
'field_values']));
1220 if(!$definition[
'changeable'])
1222 $this->input[
"udf_".$definition[
'field_id']]->setDisabled(
true);
1224 if($definition[
'required'])
1226 $this->input[
"udf_".$definition[
'field_id']]->setRequired(
true);
1231 include_once(
"./Services/User/classes/class.ilUserProfile.php");
1233 $up->skipField(
"password");
1234 $up->skipGroup(
"settings");
1235 $up->skipGroup(
"preferences");
1238 $up->addStandardFieldsToForm($this->form, $ilUser, $this->input);
1240 $this->form->addCommandButton(
"savePersonalData", $lng->txt(
"save"));
1253 if ($this->form->checkInput())
1259 "firstname" =>
"FirstName",
1260 "lastname" =>
"LastName",
1261 "title" =>
"UTitle",
1262 "sel_country" =>
"SelectedCountry",
1263 "phone_office" =>
"PhoneOffice",
1264 "phone_home" =>
"PhoneHome",
1265 "phone_mobile" =>
"PhoneMobile",
1266 "referral_comment" =>
"Comment"
1268 include_once(
"./Services/User/classes/class.ilUserProfile.php");
1270 foreach(
$up->getStandardFields() as
$f => $p)
1272 $ilUser->setFirstName(
$_POST[
"usr_firstname"]);
1276 $ilUser->setLastName(
$_POST[
"usr_lastname"]);
1280 $ilUser->setGender(
$_POST[
"usr_gender"]);
1284 $ilUser->setUTitle(
$_POST[
"usr_title"]);
1288 if (is_array(
$_POST[
'usr_birthday']))
1290 if (is_array(
$_POST[
'usr_birthday'][
'date']))
1292 if ((
$_POST[
'usr_birthday'][
'd'] > 0) && (
$_POST[
'usr_birthday'][
'm'] > 0) && (
$_POST[
'usr_birthday'][
'y'] > 0))
1294 $ilUser->setBirthday(sprintf(
"%04d-%02d-%02d",
$_POST[
'user_birthday'][
'y'],
$_POST[
'user_birthday'][
'm'],
$_POST[
'user_birthday'][
'd']));
1298 $ilUser->setBirthday(
"");
1303 $ilUser->setBirthday(
$_POST[
'usr_birthday'][
'date']);
1307 $ilUser->setFullname();
1310 $ilUser->setInstitution(
$_POST[
"usr_institution"]);
1314 $ilUser->setDepartment(
$_POST[
"usr_department"]);
1318 $ilUser->setStreet(
$_POST[
"usr_street"]);
1322 $ilUser->setZipcode(
$_POST[
"usr_zipcode"]);
1326 $ilUser->setCity(
$_POST[
"usr_city"]);
1330 $ilUser->setCountry(
$_POST[
"usr_country"]);
1334 $ilUser->setSelectedCountry(
$_POST[
"usr_sel_country"]);
1338 $ilUser->setPhoneOffice(
$_POST[
"usr_phone_office"]);
1342 $ilUser->setPhoneHome(
$_POST[
"usr_phone_home"]);
1346 $ilUser->setPhoneMobile(
$_POST[
"usr_phone_mobile"]);
1350 $ilUser->setFax(
$_POST[
"usr_fax"]);
1354 $ilUser->setEmail(
$_POST[
"usr_email"]);
1358 $ilUser->setHobby(
$_POST[
"usr_hobby"]);
1362 $ilUser->setComment(
$_POST[
"usr_referral_comment"]);
1366 $ilUser->setMatriculation(
$_POST[
"usr_matriculation"]);
1370 $ilUser->setDelicious(
$_POST[
"usr_delicious"]);
1375 if ($d_set->get(
"user_profile"))
1377 $ilUser->setDelicious(
$_POST[
"usr_delicious"]);
1383 $ilUser->setInstantMessengerId(
'icq',
$_POST[
"usr_im_icq"]);
1384 $ilUser->setInstantMessengerId(
'yahoo',
$_POST[
"usr_im_yahoo"]);
1385 $ilUser->setInstantMessengerId(
'msn',
$_POST[
"usr_im_msn"]);
1386 $ilUser->setInstantMessengerId(
'aim',
$_POST[
"usr_im_aim"]);
1387 $ilUser->setInstantMessengerId(
'skype',
$_POST[
"usr_im_skype"]);
1388 $ilUser->setInstantMessengerId(
'jabber',
$_POST[
"usr_im_jabber"]);
1389 $ilUser->setInstantMessengerId(
'voip',
$_POST[
"usr_im_voip"]);
1393 $defs = $this->user_defined_fields->getVisibleDefinitions();
1395 foreach ($defs as $definition)
1397 $f =
"udf_".$definition[
'field_id'];
1398 $item = $this->form->getItemByPostVar($f);
1399 if ($item && !$item->getDisabled())
1401 $udf[$definition[
'field_id']] = $this->form->getInput($f);
1404 $ilUser->setUserDefinedData($udf);
1407 $un = $this->form->getInput(
'username');
1408 if((
int)$ilSetting->get(
'allow_change_loginname') &&
1409 $un != $ilUser->getLogin())
1414 $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'login_invalid'));
1415 $form_valid =
false;
1420 $this->form->getItemByPostVar(
'username')->setAlert($this->lng->txt(
'loginname_already_exists'));
1421 $form_valid =
false;
1425 $ilUser->setLogin($un);
1429 $ilUser->updateLogin($ilUser->getLogin());
1430 $ilAuth->setAuth($ilUser->getLogin());
1436 $this->form->getItemByPostVar(
'username')->setAlert($e->getMessage());
1437 $form_valid =
false;
1448 $ilUser->setProfileIncomplete(
false);
1451 $ilUser->setTitle($ilUser->getFullname());
1452 $ilUser->setDescription($ilUser->getEmail());
1458 unset(
$_SESSION[
'profile_complete_redirect']);
1462 $ilCtrl->redirect($this,
"showPersonalData");
1466 $this->form->setValuesByPost();
1484 $ilTabs->setSubTabActive(
"public_profile");
1490 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
1497 $ptpl =
new ilTemplate(
"tpl.edit_personal_profile.html",
true,
true,
"Services/User");
1498 $ptpl->setVariable(
"FORM", $this->form->getHTML());
1499 include_once(
"./Services/User/classes/class.ilPublicUserProfileGUI.php");
1501 $ptpl->setVariable(
"PREVIEW", $pub_profile->getHTML(
true));
1502 $this->tpl->setContent($ptpl->get());
1515 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1520 $radg->
setInfo($this->lng->txt(
"user_activate_public_profile_info"));
1521 $pub_prof = in_array($ilUser->prefs[
"public_profile"], array(
"y",
"n",
"g"))
1522 ? $ilUser->prefs[
"public_profile"]
1524 if (!$ilSetting->get(
'enable_global_profiles') && $pub_prof ==
"g")
1528 $radg->setValue($pub_prof);
1529 $op1 =
new ilRadioOption($lng->txt(
"usr_public_profile_disabled"),
"n",$lng->txt(
"usr_public_profile_disabled_info"));
1530 $radg->addOption($op1);
1531 $op2 =
new ilRadioOption($lng->txt(
"usr_public_profile_logged_in"),
"y",$lng->txt(
"usr_public_profile_logged_in_info"));
1532 $radg->addOption($op2);
1533 if ($ilSetting->get(
'enable_global_profiles'))
1535 $op3 =
new ilRadioOption($lng->txt(
"usr_public_profile_global"),
"g",$lng->txt(
"usr_public_profile_global_info"));
1536 $radg->addOption($op3);
1538 $this->form->addItem($radg);
1547 $birthday = $ilUser->getBirthday();
1552 $gender = $ilUser->getGender();
1555 $gender = $lng->txt(
"gender_".$gender);
1558 if ($ilUser->getSelectedCountry() !=
"")
1560 $lng->loadLanguageModule(
"meta");
1561 $txt_sel_country = $lng->txt(
"meta_c_".$ilUser->getSelectedCountry());
1566 "title" => $ilUser->getUTitle(),
1567 "birthday" => $birthday,
1568 "gender" => $gender,
1569 "institution" => $ilUser->getInstitution(),
1570 "department" => $ilUser->getDepartment(),
1572 "street" => $ilUser->getStreet(),
1573 "zipcode" => $ilUser->getZipcode(),
1574 "city" => $ilUser->getCity(),
1575 "country" => $ilUser->getCountry(),
1576 "sel_country" => $txt_sel_country,
1577 "phone_office" => $ilUser->getPhoneOffice(),
1578 "phone_home" => $ilUser->getPhoneHome(),
1579 "phone_mobile" => $ilUser->getPhoneMobile(),
1580 "fax" => $ilUser->getFax(),
1581 "email" => $ilUser->getEmail(),
1582 "hobby" => $ilUser->getHobby(),
1583 "matriculation" => $ilUser->getMatriculation(),
1584 "delicious" => $ilUser->getDelicious()
1586 foreach($val_array as $key => $value)
1591 if ($key ==
"upload")
1599 if ($ilUser->prefs[
"public_".$key] ==
"y")
1604 $cb->setOptionTitle($value);
1605 $this->form->addItem($cb);
1609 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1612 foreach ($im_arr as $im)
1618 if ($ilUser->prefs[
"public_im_".$im] !=
"n")
1620 $cb->setChecked(
true);
1622 $this->form->addItem($cb);
1627 $user_defined_data = $ilUser->getUserDefinedData();
1628 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1631 $cb =
new ilCheckboxInputGUI($definition[
"field_name"],
"chk_udf_".$definition[
"field_id"]);
1632 $cb->setOptionTitle($user_defined_data[
"f_".$definition[
"field_id"]]);
1633 if ($ilUser->prefs[
"public_udf_".$definition[
"field_id"]] ==
"y")
1635 $cb->setChecked(
true);
1637 $this->form->addItem($cb);
1642 $this->form->addCommandButton(
"savePublicProfile", $lng->txt(
"save"));
1644 $this->form->setTitle($lng->txt(
"public_profile"));
1645 $this->form->setDescription($lng->txt(
"user_public_profile_info"));
1646 $this->form->setFormAction($this->ctrl->getFormAction($this));
1658 if ($this->form->checkInput())
1668 $ilUser->setPref(
"public_profile",
$_POST[
"public_profile"]);
1671 $val_array = array(
"title",
"birthday",
"gender",
"institution",
"department",
"upload",
"street",
1672 "zipcode",
"city",
"country",
"sel_country",
"phone_office",
"phone_home",
"phone_mobile",
1673 "fax",
"email",
"hobby",
"matriculation");
1676 foreach($val_array as $key => $value)
1678 if ((
$_POST[
"chk_".$value]))
1680 $ilUser->setPref(
"public_".$value,
"y");
1684 $ilUser->setPref(
"public_".$value,
"n");
1688 $im_arr = array(
"icq",
"yahoo",
"msn",
"aim",
"skype",
"jabber",
"voip");
1691 foreach ($im_arr as $im)
1693 if ((
$_POST[
"chk_im_".$im]))
1695 $ilUser->setPref(
"public_im_".$im,
"y");
1699 $ilUser->setPref(
"public_im_".$im,
"n");
1707 if ((
$_POST[
"chk_delicious"]))
1709 $ilUser->setPref(
"public_delicious",
"y");
1713 $ilUser->setPref(
"public_delicious",
"n");
1718 foreach($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition)
1720 if ((
$_POST[
"chk_udf_".$definition[
"field_id"]]))
1722 $ilUser->setPref(
"public_udf_".$definition[
"field_id"],
"y");
1726 $ilUser->setPref(
"public_udf_".$definition[
"field_id"],
"n");
1732 $ilCtrl->redirect($this,
"showPublicProfile");
1734 $this->form->setValuesByPost();
1735 $tpl->showPublicProfile(
true);
1753 $ilTabs->setSubTabActive(
"password");
1759 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
1765 $this->tpl->setContent($this->form->getHTML());
1778 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1795 $cpass->setSkipSyntaxCheck(
true);
1797 if($ilUser->getPasswd())
1799 $cpass->setRequired(
true);
1801 $this->form->addItem($cpass);
1809 if ($ilSetting->get(
"passwd_auto_generate") == 1)
1811 $ipass->setPreSelection(
true);
1813 $this->form->addItem($ipass);
1814 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
1815 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
1819 $this->form->addItem($ipass);
1820 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
1823 switch ($ilUser->getAuthMode(
true))
1826 $this->form->setTitle($lng->txt(
"chg_password"));
1831 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
1834 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
1838 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
1842 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
1845 $this->form->setFormAction($this->ctrl->getFormAction($this));
1862 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
1863 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
1864 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
1865 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
1872 $this->ilias->getSetting(
'usr_settings_disable_password'))
1890 $ilCtrl->redirect($this,
"showPersonalData");
1895 if ($this->form->checkInput())
1897 $cp = $this->form->getItemByPostVar(
"current_password");
1898 $np = $this->form->getItemByPostVar(
"new_password");
1904 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
1908 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd() and
1909 $ilUser->getPasswd())
1912 $cp->setAlert($this->lng->txt(
"passwd_wrong"));
1917 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
1921 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
1925 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
1929 if ($custom_error !=
'')
1931 $np->setAlert($custom_error);
1935 $np->setAlert($this->lng->txt(
"passwd_invalid"));
1938 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
1939 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
1940 (
$_POST[
"current_password"] ==
$_POST[
"new_password"]))
1943 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
1949 $ilUser->resetPassword(
$_POST[
"new_password"],
$_POST[
"new_password"]);
1950 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"])
1952 $ilUser->setLastPasswordChangeToNow();
1954 $ilCtrl->redirect($this,
"showPassword");
1957 $this->form->setValuesByPost();
1975 $ilTabs->setSubTabActive(
"general_settings");
1981 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
1987 $this->tpl->setContent($this->form->getHTML());
2000 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2006 $languages = $this->lng->getInstalledLanguages();
2008 foreach($languages as $lang_key)
2015 $si->setValue($ilUser->getLanguage());
2016 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
2017 $this->form->addItem($si);
2021 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
2024 $templates = $styleDefinition->getAllTemplates();
2025 if (is_array($templates))
2030 foreach($templates as $template)
2034 $styleDef->startParsing();
2035 $styles = $styleDef->getStyles();
2037 foreach($styles as $style)
2044 $options[$template[
"id"].
":".$style[
"id"]] =
2045 $styleDef->getTemplateName().
" / ".$style[
"name"];
2049 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
2050 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
2051 $this->form->addItem($si);
2058 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
2059 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
2060 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
2061 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
2062 $this->form->addItem($cb);
2068 $si =
new ilSelectInputGUI($this->lng->txt(
"hits_per_page"),
"hits_per_page");
2070 $hits_options = array(10,15,20,30,40,50,100,9999);
2073 foreach($hits_options as $hits_option)
2075 $hstr = ($hits_option == 9999)
2076 ? $this->lng->txt(
"no_limit")
2078 $options[$hits_option] = $hstr;
2080 $si->setOptions($options);
2081 $si->setValue($ilUser->prefs[
"hits_per_page"]);
2082 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
2083 $this->form->addItem($si);
2089 $si =
new ilSelectInputGUI($this->lng->txt(
"show_users_online"),
"show_users_online");
2092 "y" => $this->lng->txt(
"users_online_show_y"),
2093 "associated" => $this->lng->txt(
"users_online_show_associated"),
2094 "n" => $this->lng->txt(
"users_online_show_n"));
2096 $si->setValue($ilUser->prefs[
"show_users_online"]);
2097 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
2098 $this->form->addItem($si);
2104 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
2105 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
2106 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
2107 $this->form->addItem($cb);
2111 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
2112 (int)$ilSetting->get(
'session_reminder_enabled'))
2114 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
2115 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
2117 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
2119 global $ilClientIniFile;
2121 $lead_time_gui =
new ilTextInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
2122 $lead_time_gui->
setInfo(sprintf($this->lng->txt(
'session_reminder_lead_time_info'),
ilFormat::_secondsToString($ilClientIniFile->readVariable(
'session',
'expire'))));
2123 $lead_time_gui->setValue($ilUser->getPref(
'session_reminder_lead_time'));
2124 $lead_time_gui->setMaxLength(10);
2125 $lead_time_gui->setSize(10);
2126 $cb->addSubItem($lead_time_gui);
2128 $this->form->addItem($cb);
2135 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
2136 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
2137 $lng->loadLanguageModule(
"dateplaner");
2142 $select->setInfo($lng->txt(
'cal_timezone_info'));
2143 $select->setValue($user_settings->getTimeZone());
2144 $this->form->addItem($select);
2147 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
2152 $select->setInfo($lng->txt(
'cal_date_format_info'));
2153 $select->setValue($user_settings->getDateFormat());
2154 $this->form->addItem($select);
2156 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
2160 $select->setInfo($lng->txt(
'cal_time_format_info'));
2161 $select->setValue($user_settings->getTimeFormat());
2162 $this->form->addItem($select);
2165 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
2166 $this->form->setTitle($lng->txt(
"general_settings"));
2167 $this->form->setFormAction($this->ctrl->getFormAction($this));
2180 if ($this->form->checkInput())
2185 if (
$_POST[
"skin_style"] !=
"")
2187 $sknst = explode(
":",
$_POST[
"skin_style"]);
2189 if ($ilUser->getPref(
"style") != $sknst[1] ||
2190 $ilUser->getPref(
"skin") != $sknst[0])
2192 $ilUser->setPref(
"skin", $sknst[0]);
2193 $ilUser->setPref(
"style", $sknst[1]);
2201 $ilUser->setLanguage(
$_POST[
"language"]);
2207 if (
$_POST[
"hits_per_page"] !=
"")
2209 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
2216 $ilUser->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
2222 if (
$_POST[
"hide_own_online_status"] == 1)
2224 $ilUser->setPref(
"hide_own_online_status",
"y");
2228 $ilUser->setPref(
"hide_own_online_status",
"n");
2235 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
2240 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
2241 (int)$ilSetting->get(
'session_reminder_enabled'))
2243 $ilUser->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
2245 if(!preg_match(
'/^([0]|([1-9][0-9]*))([\.][0-9][0-9]*)?$/', $_POST[
'session_reminder_lead_time']))
2246 $_POST[
'session_reminder_lead_time'] = 0;
2247 $ilUser->setPref(
'session_reminder_lead_time', $_POST[
'session_reminder_lead_time']);
2253 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
2255 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
2256 $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
2257 $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
2258 $user_settings->save();
2261 $ilCtrl->redirect($this,
"showGeneralSettings");
2264 $this->form->setValuesByPost();
2265 $tpl->showGeneralSettings(
true);
2285 $ilToolbar->addButton($lng->txt(
"user_add_page"),
2286 $ilCtrl->getLinkTarget($this,
"addProfilePage"));
2288 include_once(
"./Services/User/classes/class.ilExtendedProfileTableGUI.php");
2290 $tpl->setContent(
$tab->getHTML());
2303 global
$tpl, $ilTabs;
2307 $tpl->setContent($this->form->getHTML());
2322 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2327 if ($a_mode ==
"create")
2332 $ti->setRequired(
true);
2333 $this->form->addItem($ti);
2335 $this->form->addCommandButton(
"saveProfilePage", $lng->txt(
"save"));
2336 $this->form->addCommandButton(
"showExtendedProfile", $lng->txt(
"cancel"));
2337 $this->form->setTitle($lng->txt(
"user_new_profile_page"));
2341 $this->form->addCommandButton(
"updateProfilePage", $lng->txt(
"save"));
2342 $this->form->addCommandButton(
"showExtendedProfile", $lng->txt(
"cancel"));
2343 $this->form->setTitle($lng->txt(
"user_add_profile_page"));
2346 $this->form->setFormAction($ilCtrl->getFormAction($this));
2357 if ($this->form->checkInput())
2359 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
2361 $page->setUserId($ilUser->getId());
2362 $page->setTitle(
$_POST[
"title"]);
2365 $ilCtrl->redirect($this,
"showExtendedProfile");
2369 $this->form->setValuesByPost();
2370 $tpl->setContent($this->form->getHtml());
2381 $values[
"title"] =
"";
2383 $this->form->setValuesByArray($values);
2394 $ilTabs->setSubTabActive(
"user_ext_profile");
2397 $this->tpl->setTitle($this->lng->txt(
"personal_desktop"));
2407 if (!is_array(
$_POST[
"user_page"]) || count(
$_POST[
"user_page"]) == 0)
2410 $ilCtrl->redirect($this,
"showExtendedProfile");
2414 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2416 $cgui->setFormAction($ilCtrl->getFormAction($this));
2417 $cgui->setHeaderText($lng->txt(
"user_sure_delete_pages"));
2418 $cgui->setCancel($lng->txt(
"cancel"),
"showExtendedProfile");
2419 $cgui->setConfirm($lng->txt(
"delete"),
"deleteProfilePages");
2421 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
2422 foreach (
$_POST[
"user_page"] as $i => $v)
2428 $tpl->setContent($cgui->getHTML());
2444 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
2445 if (is_array(
$_POST[
"user_page"]))
2447 foreach (
$_POST[
"user_page"] as $i => $v)
2450 if ($page->getUserId() == $ilUser->getId())
2458 $ilCtrl->redirect($this,
"showExtendedProfile");
2471 include_once(
"./Services/User/classes/class.ilExtPublicProfilePage.php");
2473 if (is_array(
$_POST[
"title"]))
2475 foreach (
$_POST[
"title"] as $k => $v)
2478 if ($page->getUserId() == $ilUser->getId())
2488 $ilCtrl->redirect($this,
"showExtendedProfile");