39 $this->tpl =
$DIC->ui()->mainTemplate();
40 $this->lng =
$DIC->language();
42 $this->ctrl =
$DIC->ctrl();
45 $this->upload_error =
"";
46 $this->password_error =
"";
47 $this->lng->loadLanguageModule(
"user");
48 $this->ctrl->saveParameter($this,
"user_page");
60 $next_class = $this->ctrl->getNextClass();
62 switch ($next_class) {
63 case 'ilmailoptionsgui':
64 require_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
66 $this->
ilias->raiseError($DIC->language()->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
69 $this->__initSubTabs(
'showMailOptions');
70 $DIC->tabs()->activateTab(
'mail_settings');
73 require_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
77 case 'ilpersonalchatsettingsformgui':
78 $this->__initSubTabs($this->ctrl->getCmd());
81 $DIC->tabs()->activateTab(
'chat_settings');
84 $this->ctrl->forwardCommand($chatSettingsGui);
88 $cmd = $this->ctrl->getCmd(
"showGeneralSettings");
96 public function __initSubTabs($a_cmd)
104 $ilTabs =
$DIC[
'ilTabs'];
106 $ilHelp =
$DIC[
'ilHelp'];
107 $rbacsystem =
$DIC[
'rbacsystem'];
110 $ilHelp->setScreenIdComponent(
"user");
112 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
113 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
120 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
131 $this->ctrl->getLinkTarget($this,
"showPassword"),
139 require_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
141 $this->ctrl->setParameter($this,
'referrer',
'ilPersonalSettingsGUI');
145 $this->ctrl->getLinkTargetByClass(
'ilMailOptionsGUI'),
147 array(
'ilMailOptionsGUI')
152 if ($chatSettingsGui->isAccessible()) {
155 $this->ctrl->getLinkTarget($chatSettingsGui,
'showChatOptions'),
157 [
'ilPersonalChatSettingsFormGUI']
161 include_once
"./Services/Administration/classes/class.ilSetting.php";
163 if ((
bool)
$ilSetting->get(
'user_delete_own_account') &&
164 $ilUser->getId() != SYSTEM_USER_ID) {
167 $this->lng->txt(
'user_delete_own_account'),
168 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1")
178 $this->tpl->setTitle($this->lng->txt(
'personal_settings'));
195 $ilTabs =
$DIC[
'ilTabs'];
198 $this->__initSubTabs(
"showPersonalData");
199 $ilTabs->activateTab(
"password");
204 if (
$ilUser->isPasswordChangeDemanded()) {
206 $this->lng->txt(
'password_change_on_first_login_demand')
208 } elseif (
$ilUser->isPasswordExpired()) {
209 $msg = $this->lng->txt(
'password_expired');
210 $password_age =
$ilUser->getPasswordAge();
214 if (!$a_no_init && !$hide_form) {
217 $this->tpl->setContent(!$hide_form ? $this->form->getHTML() :
'');
218 $this->tpl->printToStdout();
234 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
245 $pw_info_set =
false;
250 $cpass->setRetype(
false);
251 $cpass->setSkipSyntaxCheck(
true);
255 $cpass->setRequired(
true);
257 $this->form->addItem($cpass);
262 if($pw_info_set ===
false) {
265 $ipass->setRequired(
true);
267 $this->form->addItem($ipass);
268 $this->form->addCommandButton(
"savePassword",
$lng->txt(
"save"));
270 switch (
$ilUser->getAuthMode(
true)) {
272 $this->form->setTitle(
$lng->txt(
"chg_password"));
277 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
279 $this->form->setTitle(
$lng->txt(
"chg_ilias_and_webfolder_password"));
281 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
285 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
288 $this->form->setFormAction($this->ctrl->getFormAction($this));
310 return \ilAuthUtils::isPasswordModificationHidden() && (
$ilUser->isPasswordChangeDemanded() ||
$ilUser->isPasswordExpired());
329 $ilCtrl->redirect($this,
"showPersonalData");
334 if ($this->form->checkInput()) {
335 $cp = $this->form->getItemByPostVar(
"current_password");
336 $np = $this->form->getItemByPostVar(
"new_password");
342 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
344 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
347 $cp->setAlert($this->lng->txt(
'passwd_wrong'));
353 if ($custom_error !=
'') {
354 $np->setAlert($custom_error);
356 $np->setAlert($this->lng->txt(
"passwd_invalid"));
362 $np->setAlert($this->lng->txt($error_lng_var));
366 (
$ilUser->isPasswordExpired() ||
$ilUser->isPasswordChangeDemanded()) &&
369 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
374 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"]) {
375 $ilUser->setLastPasswordChangeToNow();
376 $ilUser->setPasswordPolicyResetStatus(
false);
381 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
386 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'));
392 $this->form->setValuesByPost();
408 return $this->user_settings_config->isVisibleAndChangeable($setting);
417 return $this->user_settings_config->isVisible($setting);
426 return $this->user_settings_config->isChangeable($setting);
436 $ilTabs =
$DIC[
'ilTabs'];
438 $this->__initSubTabs(
"showPersonalData");
439 $ilTabs->activateTab(
"general_settings");
446 $this->tpl->setContent($this->form->getHTML());
447 $this->tpl->printToStdout();
460 $styleDefinition =
$DIC[
'styleDefinition'];
464 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
469 $languages = $this->lng->getInstalledLanguages();
471 foreach ($languages as $lang_key) {
476 $si->setOptions($options);
478 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_language"));
479 $this->form->addItem(
$si);
484 $skins = $styleDefinition->getAllSkins();
485 if (is_array($skins)) {
489 foreach ($skins as $skin) {
490 foreach ($skin->getStyles() as $style) {
491 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
496 $options[$skin->getId() .
":" . $style->getId()] = $skin->getName() .
" / " . $style->getName();
499 $si->setOptions($options);
501 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_skin_style"));
502 $this->form->addItem(
$si);
508 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
509 $cb->setChecked(
$ilUser->prefs[
"screen_reader_optimization"]);
510 $cb->setDisabled(
$ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
511 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
512 $this->form->addItem($cb);
516 $module_id = (int)
$ilSetting->get(
"help_module");
517 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" &&
519 $this->lng->loadLanguageModule(
"help");
520 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"help_toggle_tooltips"),
"help_tooltips");
521 $cb->setChecked(!
$ilUser->prefs[
"hide_help_tt"]);
522 $cb->setInfo($this->lng->txt(
"help_toggle_tooltips_info"));
523 $this->form->addItem($cb);
530 $hits_options = array(10,15,20,30,40,50,100,9999);
533 foreach ($hits_options as $hits_option) {
534 $hstr = ($hits_option == 9999)
535 ? $this->lng->txt(
"no_limit")
537 $options[$hits_option] = $hstr;
539 $si->setOptions($options);
540 $si->setValue(
$ilUser->prefs[
"hits_per_page"]);
541 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_hits_per_page"));
542 $this->form->addItem(
$si);
562 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
564 0 => $this->lng->txt(
"user_lv_keep_entries"),
565 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
566 2 => $this->lng->txt(
"user_lv_do_not_store"));
567 $lv->setOptions($options);
568 $lv->setValue((
int)
$ilUser->prefs[
"store_last_visited"]);
569 $this->form->addItem($lv);
572 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
573 if (ilSessionReminder::isGloballyActivated()) {
574 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
575 $cb->setInfo($this->lng->txt(
'session_reminder_info'));
577 $cb->setChecked((
int)
$ilUser->getPref(
'session_reminder_enabled'));
580 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
584 $max_value = max($min_value, ((
int) $expires / 60) - 1);
586 $current_user_value =
$ilUser->getPref(
'session_reminder_lead_time');
587 if ($current_user_value < $min_value ||
588 $current_user_value > $max_value) {
599 $lead_time_gui->setValue($value);
600 $lead_time_gui->setSize(3);
601 $lead_time_gui->setMinValue($min_value);
602 $lead_time_gui->setMaxValue($max_value);
603 $cb->addSubItem($lead_time_gui);
605 $this->form->addItem($cb);
611 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
612 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
613 $lng->loadLanguageModule(
"dateplaner");
618 $select->setInfo(
$lng->txt(
'cal_timezone_info'));
619 $select->setValue($user_settings->getTimeZone());
620 $this->form->addItem($select);
624 $select->setOptions(array(
628 $select->setInfo(
$lng->txt(
'cal_date_format_info'));
629 $select->setValue($user_settings->getDateFormat());
630 $this->form->addItem($select);
633 $select->setOptions(array(
636 $select->setInfo(
$lng->txt(
'cal_time_format_info'));
637 $select->setValue($user_settings->getTimeFormat());
638 $this->form->addItem($select);
642 include_once
"Services/User/classes/class.ilUserUtil.php";
644 $this->lng->loadLanguageModule(
"administration");
646 $si->setRequired(
true);
647 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
648 $def_opt =
new ilRadioOption($this->lng->txt(
"adm_user_starting_point_inherit"), 0);
649 $def_opt->setInfo($this->lng->txt(
"adm_user_starting_point_inherit_info"));
650 $si->addOption($def_opt);
657 $this->form->addItem(
$si);
661 $repobj_id =
new ilTextInputGUI(
$lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
662 $repobj_id->setInfo(
$lng->txt(
"adm_user_starting_point_ref_id_info"));
663 $repobj_id->setRequired(
true);
664 $repobj_id->setSize(5);
667 $repobj_id->setValue($start_ref_id);
676 $repobj->addSubItem($repobj_id);
677 $si->addOption($repobj);
684 if (
$ilSetting->get(
'char_selector_availability') > 0) {
685 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
687 $char_selector->getConfig()->setAvailability(
$ilUser->getPref(
'char_selector_availability'));
688 $char_selector->getConfig()->setDefinition(
$ilUser->getPref(
'char_selector_definition'));
689 $char_selector->addFormProperties($this->form);
690 $char_selector->setFormValues($this->form);
693 $this->form->addCommandButton(
"saveGeneralSettings",
$lng->txt(
"save"));
694 $this->form->setTitle(
$lng->txt(
"general_settings"));
695 $this->form->setFormAction($this->ctrl->getFormAction($this));
712 if ($this->form->checkInput()) {
715 if (
$_POST[
"skin_style"] !=
"") {
716 $sknst = explode(
":",
$_POST[
"skin_style"]);
718 if (
$ilUser->getPref(
"style") != $sknst[1] ||
719 $ilUser->getPref(
"skin") != $sknst[0]) {
720 $ilUser->setPref(
"skin", $sknst[0]);
721 $ilUser->setPref(
"style", $sknst[1]);
733 if (
$_POST[
"hits_per_page"] !=
"") {
739 $module_id = (int)
$ilSetting->get(
"help_module");
740 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" &&
742 $ilUser->setPref(
"hide_help_tt", (
int) !
$_POST[
"help_tooltips"]);
755 $ilNavigationHistory =
$DIC[
'ilNavigationHistory'];
756 $ilUser->setPref(
"store_last_visited", (
int)
$_POST[
"store_last_visited"]);
757 if ((
int)
$_POST[
"store_last_visited"] > 0) {
758 $ilNavigationHistory->deleteDBEntries();
759 if ((
int)
$_POST[
"store_last_visited"] == 2) {
760 $ilNavigationHistory->deleteSessionEntries();
766 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
770 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
771 if (ilSessionReminder::isGloballyActivated()) {
772 $ilUser->setPref(
'session_reminder_enabled', (
int) $this->form->getInput(
'session_reminder_enabled'));
773 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
777 include_once
"Services/User/classes/class.ilUserUtil.php";
780 $this->form->getInput(
'usr_start'),
781 $this->form->getInput(
'usr_start_ref_id')
789 if (
$ilSetting->get(
'char_selector_availability') > 0) {
790 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
792 $char_selector->getFormValues($this->form);
793 $ilUser->setPref(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
794 $ilUser->setPref(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
800 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
802 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
803 $user_settings->setDateFormat((
int) $this->form->getInput(
"date_format"));
804 $user_settings->setTimeFormat((
int) $this->form->getInput(
"time_format"));
805 $user_settings->save();
807 ilUtil::sendSuccess(
$lng->txtlng(
"common",
"msg_obj_modified",
$ilUser->getLanguage()),
true);
809 $ilCtrl->redirect($this,
"showGeneralSettings");
812 $this->form->setValuesByPost();
823 $ilTabs =
$DIC[
'ilTabs'];
824 $ilToolbar =
$DIC[
'ilToolbar'];
828 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
829 $ilUser->getId() == SYSTEM_USER_ID) {
830 $this->ctrl->redirect($this,
"showGeneralSettings");
837 $this->__initSubTabs(
"deleteOwnAccount");
838 $ilTabs->activateTab(
"delacc");
841 $ilToolbar->addButton(
842 $this->lng->txt(
'btn_next'),
843 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2')
846 $this->tpl->printToStdout();
856 $ilTabs =
$DIC[
'ilTabs'];
860 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
861 $ilUser->getId() == SYSTEM_USER_ID) {
862 $this->ctrl->redirect($this,
"showGeneralSettings");
866 $this->__initSubTabs(
"deleteOwnAccount");
867 $ilTabs->activateTab(
"delacc");
869 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
871 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
872 $cgui->setFormAction($this->ctrl->getFormAction($this));
873 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
874 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
875 $this->tpl->setContent($cgui->getHTML());
876 $this->tpl->printToStdout();
889 $ilCtrl->redirect($this,
"showGeneralSettings");
900 $ilUser->activateDeletionFlag();
904 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
906 ilUtil::redirect(
"login.php?cmd=force_login&target=usr_" . md5(
"usrdelown"));
916 $ilTabs =
$DIC[
'ilTabs'];
920 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
921 $ilUser->getId() == SYSTEM_USER_ID ||
923 $this->ctrl->redirect($this,
"showGeneralSettings");
927 $this->__initSubTabs(
"deleteOwnAccount");
928 $ilTabs->activateTab(
"delacc");
930 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
932 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
933 $cgui->setFormAction($this->ctrl->getFormAction($this));
934 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
935 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
936 $this->tpl->setContent($cgui->getHTML());
937 $this->tpl->printToStdout();
943 protected function deleteOwnAccount4()
951 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
952 $ilUser->getId() == SYSTEM_USER_ID ||
954 $this->ctrl->redirect($this,
"showGeneralSettings");
959 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
961 $ntf->setLangModules(array(
"user"));
962 $ntf->addAdditionalInfo(
"profile",
$ilUser->getProfileAsString($this->lng),
true);
966 $ntf->setIntroductionDirect(
968 $this->lng->txt(
"user_delete_own_account_email_body"),
975 $message = $ntf->composeAndGetMessage(
$ilUser->getId(),
null,
null,
true);
976 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
980 $user_email =
$ilUser->getEmail();
981 $admin_mail =
$ilSetting->get(
"user_delete_own_account_email");
983 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
986 $mmail->From($senderFactory->system());
989 $mmail->To($user_email);
990 $mmail->Bcc($admin_mail);
991 $mmail->Subject($subject,
true);
996 elseif ($admin_mail) {
997 $mmail->To($admin_mail);
998 $mmail->Subject($subject,
true);
1008 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
static _getInstanceByUserId($a_user_id)
get singleton instance
static _getShortTimeZoneList()
get short timezone list
This shows a character selector.
Confirmation screen class.
static _isActive()
Static getter.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
@classDescription Date and time handling
static _lookupEntry($a_lang_key, $a_mod, $a_id)
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
GUI class for personal profile.
initGeneralSettingsForm()
Init general settings form.
deleteOwnAccount1()
Delete own account dialog - 1st confirmation.
deleteOwnAccount2()
Delete own account dialog - login redirect.
userSettingVisible(string $setting)
savePassword()
Save password form.
deleteOwnAccount3()
Delete own account dialog - final confirmation.
initPasswordForm()
Init password form.
allowPasswordChange()
Check, whether password change is allowed for user.
workWithUserSetting(string $setting)
userSettingEnabled(string $setting)
saveGeneralSettings()
Save general settings.
showPassword($a_no_init=false, $hide_form=false)
executeCommand()
execute command
showGeneralSettings($a_no_init=false)
General settings form.
This class represents an option in a radio group.
const SUGGESTED_LEAD_TIME
static set($a_var, $a_val)
Set a value.
static setClosingContext($a_context)
set closing context (for statistics)
static get($a_var)
Get a value.
static getSessionExpireValue()
Returns the session expiration value.
Wrapper classes for system notifications.
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
This class represents a text property in a property form.
static _getInstance()
Get instance.
static getInstance()
Single method to reduce footprint (included files, created instances)
User settings configuration (what preferences can be visible/changed/...)
static getPersonalStartingObject()
Get ref id of personal starting object.
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
static hasPersonalStartPointPref()
Did user set any personal starting point (yet)?
static hasPersonalStartingPoint()
Can starting point be personalized?
static getPersonalStartingPoint()
Get current personal starting point.
static setPersonalStartingPoint($a_value, $a_ref_id=null)
Set personal starting point setting.
const START_REPOSITORY_OBJ
static redirect($a_script)
static isPassword($a_passwd, &$customError=null)
validates a password @access public
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static isPasswordValidForUserContext($clear_text_password, $user, &$error_language_variable=null)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file)