25 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
32 $this->settings = $ilias->getAllSettings();
33 $lng->loadLanguageModule(
"jsmath");
34 $this->upload_error =
"";
35 $this->password_error =
"";
36 $lng->loadLanguageModule(
"user");
37 $ilCtrl->saveParameter($this,
"user_page");
47 $next_class = $this->ctrl->getNextClass();
53 $cmd = $this->ctrl->getCmd(
"showGeneralSettings");
57 if( $ilUser->isPasswordChangeDemanded() &&
$cmd !=
'savePassword' )
59 $cmd =
'showPassword';
62 $this->lng->txt(
'password_change_on_first_login_demand'), true
65 elseif( $ilUser->isPasswordExpired() &&
$cmd !=
'savePassword' )
67 $cmd =
'showPassword';
69 $msg = $this->lng->txt(
'password_expired');
70 $password_age = $ilUser->getPasswordAge();
91 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
92 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
93 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
94 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local"))
97 $this->password_error = $this->lng->txt(
"not_changeable_for_non_local_auth");
101 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1)
106 if ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || ! $ilSetting->get(
"shib_auth_allow_local"))
109 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
111 $this->password_error = $this->lng->txt(
"passwd_wrong");
117 $this->password_error = $this->lng->txt(
"passwd_not_selected");
120 if (empty($this->password_error))
123 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"new_passwd"],
$_POST[
"new_passwd"]);
129 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd())
131 $this->password_error = $this->lng->txt(
"passwd_wrong");
134 else if (
$_POST[
"desired_password"] !=
$_POST[
"retype_password"])
136 $this->password_error = $this->lng->txt(
"passwd_not_match");
141 if( $custom_error !=
'' )
142 $this->password_error = $custom_error;
143 else $this->password_error = $this->lng->txt(
"passwd_invalid");
145 else if (
$_POST[
"current_password"] !=
"" and empty($this->password_error))
147 if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
149 if(
$_POST[
"current_password"] !=
$_POST[
"desired_password"] )
151 if( $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]) )
154 $ilUser->setLastPasswordChangeToNow();
159 $this->password_error = $this->lng->txt(
"new_pass_equals_old_pass");
165 $ilUser->updatePassword(
$_POST[
"current_password"],
$_POST[
"desired_password"],
$_POST[
"retype_password"]);
166 $ilUser->setLastPasswordChangeToNow();
171 $this->saveProfile();
183 $lng->loadLanguageModule(
'mail');
186 $ilTabs->activateTab(
'mail_settings');
190 require_once
'Services/Mail/classes/class.ilMailOptions.php';
192 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1' &&
193 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') !=
'1')
195 $incoming_type = (int)
$_POST[
'incoming_type'];
199 $incoming_type = $mailOptions->getIncomingType();
203 if($this->form->checkInput())
205 $mailOptions->updateOptions(
209 (
int)$_POST[
'cronjob_notification']
215 if(!isset(
$_POST[
'incoming_type']))
217 $_POST[
'incoming_type'] = $mailOptions->getIncomingType();
220 $this->form->setValuesByPost();
222 $this->tpl->setContent($this->form->getHTML());
233 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
236 $this->form->setFormAction($ilCtrl->getFormAction($this,
'saveMailOptions'));
237 $this->form->setTitle($lng->txt(
'mail_settings'));
240 include_once
'Services/Mail/classes/class.ilMailOptions.php';
241 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
251 $ilSetting->get(
'usr_settings_disable_mail_incoming_mail') ==
'1')
253 $si->setDisabled(
true);
255 $this->form->addItem($si);
260 for($i = 50; $i <= 80; $i++)
266 $this->form->addItem($si);
272 $this->form->addItem($ta);
275 if($ilSetting->get(
'mail_notification'))
277 $cb =
new ilCheckboxInputGUI($lng->txt(
'cron_mail_notification'),
'cronjob_notification');
278 $cb->
setInfo($lng->txt(
'mail_cronjob_notification_info'));
280 $this->form->addItem($cb);
283 $this->form->addCommandButton(
'saveMailOptions', $lng->txt(
'save'));
293 require_once
'Services/Mail/classes/class.ilMailOptions.php';
297 'linebreak' => $mailOptions->getLinebreak(),
298 'signature' => $mailOptions->getSignature(),
299 'cronjob_notification' => $mailOptions->getCronjobNotification()
302 if($ilSetting->get(
'usr_settings_hide_mail_incoming_mail') !=
'1')
307 $this->form->setValuesByArray($data);
315 global $ilTabs,
$lng;
317 $lng->loadLanguageModule(
'mail');
320 $ilTabs->activateTab(
'mail_settings');
327 $this->tpl->setContent($this->form->getHTML());
338 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
340 $form->setFormAction($ilCtrl->getFormAction($this));
341 $form->setTitle($lng->txt(
"jsmath_settings"));
344 include_once
"./Services/Administration/classes/class.ilSetting.php";
345 $jsMathSetting =
new ilSetting(
"jsMath");
347 $checked = ($ilUser->getPref(
"js_math") === FALSE) ? $jsMathSetting->get(
"makedefault") : $ilUser->getPref(
"js_math");
349 $enable->setInfo($lng->txt(
"jsmath_enable_user_desc"));
350 $form->addItem($enable);
352 $form->addCommandButton(
"savejsMath", $lng->txt(
"save"));
353 $form->addCommandButton(
"showjsMath", $lng->txt(
"cancel"));
355 $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
363 include_once
"./Services/Administration/classes/class.ilSetting.php";
364 $jsMathSetting =
new ilSetting(
"jsMath");
365 if ($jsMathSetting->get(
"enable"))
369 $ilUser->writePref(
"js_math",
"1");
373 $ilUser->writePref(
"js_math",
"0");
376 $ilCtrl->redirect($this,
"showjsMath");
384 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
385 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
386 $showMailOptions = ($a_cmd ==
'showMailOptions') ?
true :
false;
387 $showjsMath = ($a_cmd ==
'showjsMath') ?
true :
false;
388 $showChatOptions = ($a_cmd ==
'showChatOptions') ?
true :
false;
393 $ilTabs->addTarget(
"general_settings", $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
394 "",
"",
"", $showGeneralSettings);
399 $ilTabs->addTarget(
"password", $this->ctrl->getLinkTarget($this,
"showPassword"),
400 "",
"",
"", $showPassword);
404 $ilTabs->addTarget(
"mail_settings", $this->ctrl->getLinkTarget($this,
"showMailOptions"),
405 "",
"",
"", $showMailOptions);
407 if(((
int)$ilSetting->get(
'chat_sound_status') &&
408 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
409 (int)$ilSetting->get(
'chat_new_message_sound_status'))) ||
410 (int)$ilSetting->get(
'chat_message_notify_status') == 1)
412 $ilTabs->addTarget(
"chat_settings", $this->ctrl->getLinkTarget($this,
"showChatOptions"),
413 "",
"",
"", $showChatOptions);
416 include_once
"./Services/Administration/classes/class.ilSetting.php";
417 $jsMathSetting =
new ilSetting(
"jsMath");
418 if ($jsMathSetting->get(
"enable"))
420 $ilTabs->addTarget(
"jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this,
"showjsMath"),
421 "",
"",
"", $showjsMath);
431 $lng->loadLanguageModule(
'chat');
433 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
436 $form->setFormAction($this->ctrl->getFormAction($this,
'saveChatOptions'));
437 $form->setTitle($lng->txt(
"chat_settings"));
439 if((
int)$ilSetting->get(
'chat_message_notify_status'))
445 $ro_parent =
new ilCheckboxInputGUI($this->lng->txt(
'chat_message_notify_activate'),
'chat_message_notify_activate');
447 #$ro_parent->setValue(0);
449 if((
int)$ilSetting->get(
'chat_sound_status') &&
450 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
451 (int)$ilSetting->get(
'chat_new_message_sound_status')))
454 #$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_sounds'), 'chat_sound_status');
456 #$ro = new ilCheckboxInputGUI($this->lng->txt('chat_sound_status_activate'), 1);
457 if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
460 $chb->setOptionTitle($this->lng->txt(
'chat_new_invitation_sound_status'));
461 $chb->setChecked(
false);
462 $ro_parent->addSubItem($chb);
465 if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
467 $chb =
new ilCheckBoxInputGUI(
'',
'chat_new_message_sound_status');
468 $chb->setOptionTitle($this->lng->txt(
'chat_new_message_sound_status'));
469 $chb->setChecked(
false);
470 $ro_parent->addSubItem($chb);
472 #$rg->addOption($ro);
477 #$ro_parent->addSubItem($rg);
482 #$ro_parent = new ilRadioOption($this->lng->txt('chat_message_notify_deactivate'), 0);
483 #$rg_parent->addOption($ro_parent);
484 $form->addItem($ro_parent);
487 $form->addCommandButton(
"saveChatOptions", $lng->txt(
"save"));
495 if((
int)$ilSetting->get(
'chat_message_notify_status'))
497 $ilUser->setPref(
'chat_message_notify_status', (
int)
$_POST[
'chat_message_notify_activate']);
500 if((
int)$ilSetting->get(
'chat_sound_status') &&
501 ((int)$ilSetting->get(
'chat_new_invitation_sound_status') ||
502 (int)$ilSetting->get(
'chat_new_message_sound_status')))
504 $ilUser->setPref(
'chat_sound_status', (
int)
$_POST[
'chat_sound_status']);
505 if((
int)$ilSetting->get(
'chat_new_invitation_sound_status'))
507 $ilUser->setPref(
'chat_new_invitation_sound_status', (
int)$_POST[
'chat_new_invitation_sound_status']);
509 if((
int)$ilSetting->get(
'chat_new_message_sound_status'))
511 $ilUser->setPref(
'chat_new_message_sound_status', (
int)$_POST[
'chat_new_message_sound_status']);
515 $ilUser->writePrefs();
528 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_settings'));
546 $form->setValuesByPost();
551 $values[
'chat_message_notify_status'] = $ilUser->getPref(
'chat_message_notify_status');
552 $values[
'chat_message_notify_activate'] = $ilUser->getPref(
'chat_message_notify_status');
554 $values[
'chat_sound_status'] = $ilUser->getPref(
'chat_sound_status');
555 $values[
'chat_new_invitation_sound_status'] = $ilUser->getPref(
'chat_new_invitation_sound_status');
556 $values[
'chat_new_message_sound_status'] = $ilUser->getPref(
'chat_new_message_sound_status');
559 $form->setValuesByArray($values);
562 $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
581 $ilTabs->activateTab(
"password");
589 $this->tpl->setContent($this->form->getHTML());
602 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
619 $cpass->setSkipSyntaxCheck(
true);
621 if($ilUser->getPasswd())
623 $cpass->setRequired(
true);
625 $this->form->addItem($cpass);
633 if ($ilSetting->get(
"passwd_auto_generate") == 1)
635 $ipass->setPreSelection(
true);
637 $this->form->addItem($ipass);
638 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
639 $this->form->addCommandButton(
"showPassword", $lng->txt(
"new_list_password"));
643 $this->form->addItem($ipass);
644 $this->form->addCommandButton(
"savePassword", $lng->txt(
"save"));
647 switch ($ilUser->getAuthMode(
true))
650 $this->form->setTitle($lng->txt(
"chg_password"));
655 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
658 $this->form->setTitle($lng->txt(
"chg_ilias_and_webfolder_password"));
662 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
666 $this->form->setTitle($lng->txt(
"chg_ilias_password"));
669 $this->form->setFormAction($this->ctrl->getFormAction($this));
686 if ($ilUser->getAuthMode(
true) !=
AUTH_LOCAL &&
687 ($ilUser->getAuthMode(
true) !=
AUTH_CAS || !$ilSetting->get(
"cas_allow_local")) &&
688 ($ilUser->getAuthMode(
true) !=
AUTH_SHIBBOLETH || !$ilSetting->get(
"shib_auth_allow_local")) &&
689 ($ilUser->getAuthMode(
true) !=
AUTH_SOAP || !$ilSetting->get(
"soap_auth_allow_local")) &&
696 $this->ilias->getSetting(
'usr_settings_disable_password'))
714 $ilCtrl->redirect($this,
"showPersonalData");
719 if ($this->form->checkInput())
721 $cp = $this->form->getItemByPostVar(
"current_password");
722 $np = $this->form->getItemByPostVar(
"new_password");
728 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
732 if (md5(
$_POST[
"current_password"]) != $ilUser->getPasswd() and
733 $ilUser->getPasswd())
736 $cp->setAlert($this->lng->txt(
"passwd_wrong"));
741 if ($this->ilias->getSetting(
"passwd_auto_generate") == 1 &&
745 $np->setAlert($this->lng->txt(
"passwd_not_selected"));
749 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
753 if ($custom_error !=
'')
755 $np->setAlert($custom_error);
759 $np->setAlert($this->lng->txt(
"passwd_invalid"));
762 if ($this->ilias->getSetting(
"passwd_auto_generate") != 1 &&
763 ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
767 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
773 $ilUser->resetPassword(
$_POST[
"new_password"],
$_POST[
"new_password"]);
774 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"])
776 $ilUser->setLastPasswordChangeToNow();
778 $ilCtrl->redirect($this,
"showPassword");
781 $this->form->setValuesByPost();
798 if ($this->settings[
"usr_settings_hide_".$setting] == 1)
802 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
816 if (isset($this->settings[
"usr_settings_hide_".$setting]) &&
817 $this->settings[
"usr_settings_hide_".$setting] == 1)
831 if ($this->settings[
"usr_settings_disable_".$setting] == 1)
846 $ilTabs->activateTab(
"general_settings");
854 $this->tpl->setContent($this->form->getHTML());
867 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
873 $languages = $this->lng->getInstalledLanguages();
875 foreach($languages as $lang_key)
882 $si->setValue($ilUser->getLanguage());
883 $si->setDisabled($ilSetting->get(
"usr_settings_disable_language"));
884 $this->form->addItem($si);
888 include_once(
"./Services/Style/classes/class.ilObjStyleSettings.php");
891 $templates = $styleDefinition->getAllTemplates();
892 if (is_array($templates))
897 foreach($templates as $template)
901 $styleDef->startParsing();
902 $styles = $styleDef->getStyles();
904 foreach($styles as $style)
911 $options[$template[
"id"].
":".$style[
"id"]] =
912 $styleDef->getTemplateName().
" / ".$style[
"name"];
916 $si->setValue($ilUser->skin.
":".$ilUser->prefs[
"style"]);
917 $si->setDisabled($ilSetting->get(
"usr_settings_disable_skin_style"));
918 $this->form->addItem($si);
925 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
926 $cb->
setChecked($ilUser->prefs[
"screen_reader_optimization"]);
927 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
928 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
929 $this->form->addItem($cb);
935 $si =
new ilSelectInputGUI($this->lng->txt(
"hits_per_page"),
"hits_per_page");
937 $hits_options = array(10,15,20,30,40,50,100,9999);
940 foreach($hits_options as $hits_option)
942 $hstr = ($hits_option == 9999)
943 ? $this->lng->txt(
"no_limit")
945 $options[$hits_option] = $hstr;
947 $si->setOptions($options);
948 $si->setValue($ilUser->prefs[
"hits_per_page"]);
949 $si->setDisabled($ilSetting->get(
"usr_settings_disable_hits_per_page"));
950 $this->form->addItem($si);
956 $si =
new ilSelectInputGUI($this->lng->txt(
"show_users_online"),
"show_users_online");
959 "y" => $this->lng->txt(
"users_online_show_y"),
960 "associated" => $this->lng->txt(
"users_online_show_associated"),
961 "n" => $this->lng->txt(
"users_online_show_n"));
963 $si->setValue($ilUser->prefs[
"show_users_online"]);
964 $si->setDisabled($ilSetting->get(
"usr_settings_disable_show_users_online"));
965 $this->form->addItem($si);
971 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"hide_own_online_status"),
"hide_own_online_status");
972 $cb->
setChecked($ilUser->prefs[
"hide_own_online_status"] ==
"y");
973 $cb->setDisabled($ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
974 $this->form->addItem($cb);
978 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
979 (int)$ilSetting->get(
'session_reminder_enabled'))
981 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
982 $cb->
setInfo($this->lng->txt(
'session_reminder_info'));
984 $cb->setChecked((
int)$ilUser->getPref(
'session_reminder_enabled'));
987 $lead_time_gui =
new ilTextInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
989 $lead_time_gui->setValue($ilUser->getPref(
'session_reminder_lead_time'));
990 $lead_time_gui->setMaxLength(10);
991 $lead_time_gui->setSize(10);
992 $cb->addSubItem($lead_time_gui);
994 $this->form->addItem($cb);
1001 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1002 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
1003 $lng->loadLanguageModule(
"dateplaner");
1008 $select->setInfo($lng->txt(
'cal_timezone_info'));
1009 $select->setValue($user_settings->getTimeZone());
1010 $this->form->addItem($select);
1013 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_date_format'),
'date_format');
1018 $select->setInfo($lng->txt(
'cal_date_format_info'));
1019 $select->setValue($user_settings->getDateFormat());
1020 $this->form->addItem($select);
1022 $select =
new ilSelectInputGUI($lng->txt(
'cal_user_time_format'),
'time_format');
1026 $select->setInfo($lng->txt(
'cal_time_format_info'));
1027 $select->setValue($user_settings->getTimeFormat());
1028 $this->form->addItem($select);
1031 $this->form->addCommandButton(
"saveGeneralSettings", $lng->txt(
"save"));
1032 $this->form->setTitle($lng->txt(
"general_settings"));
1033 $this->form->setFormAction($this->ctrl->getFormAction($this));
1045 if ($this->form->checkInput())
1050 if (
$_POST[
"skin_style"] !=
"")
1052 $sknst = explode(
":",
$_POST[
"skin_style"]);
1054 if ($ilUser->getPref(
"style") != $sknst[1] ||
1055 $ilUser->getPref(
"skin") != $sknst[0])
1057 $ilUser->setPref(
"skin", $sknst[0]);
1058 $ilUser->setPref(
"style", $sknst[1]);
1066 $ilUser->setLanguage(
$_POST[
"language"]);
1072 if (
$_POST[
"hits_per_page"] !=
"")
1074 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
1081 $ilUser->setPref(
"show_users_online",
$_POST[
"show_users_online"]);
1087 if (
$_POST[
"hide_own_online_status"] == 1)
1089 $ilUser->setPref(
"hide_own_online_status",
"y");
1093 $ilUser->setPref(
"hide_own_online_status",
"n");
1100 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
1105 if((
int)$ilSetting->get(
'session_handling_type') == 0 &&
1106 (int)$ilSetting->get(
'session_reminder_enabled'))
1108 $ilUser->setPref(
'session_reminder_enabled', (
int)
$_POST[
'session_reminder_enabled']);
1110 if(!preg_match(
'/^([0]|([1-9][0-9]*))([\.][0-9][0-9]*)?$/', $_POST[
'session_reminder_lead_time']))
1111 $_POST[
'session_reminder_lead_time'] = 0;
1112 $ilUser->setPref(
'session_reminder_lead_time', $_POST[
'session_reminder_lead_time']);
1118 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
1120 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
1121 $user_settings->setDateFormat((
int)$this->form->getInput(
"date_format"));
1122 $user_settings->setTimeFormat((
int)$this->form->getInput(
"time_format"));
1123 $user_settings->save();
1126 $ilCtrl->redirect($this,
"showGeneralSettings");
1129 $this->form->setValuesByPost();
1130 $tpl->showGeneralSettings(
true);