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';
78 $cmd = $this->ctrl->getCmd(
"showGeneralSettings");
86 public function __initSubTabs($a_cmd)
94 $ilTabs =
$DIC[
'ilTabs'];
96 $ilHelp =
$DIC[
'ilHelp'];
97 $rbacsystem =
$DIC[
'rbacsystem'];
100 $ilHelp->setScreenIdComponent(
"user");
102 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
103 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
110 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
121 $this->ctrl->getLinkTarget($this,
"showPassword"),
129 require_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
131 $this->ctrl->setParameter($this,
'referrer',
'ilPersonalSettingsGUI');
135 $this->ctrl->getLinkTargetByClass(
'ilMailOptionsGUI'),
137 array(
'ilMailOptionsGUI')
141 include_once
"./Services/Administration/classes/class.ilSetting.php";
143 if ((
bool)
$ilSetting->get(
'user_delete_own_account') &&
147 $this->lng->txt(
'user_delete_own_account'),
148 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1")
158 $this->tpl->setTitle($this->lng->txt(
'personal_settings'));
175 $ilTabs =
$DIC[
'ilTabs'];
178 $this->__initSubTabs(
"showPersonalData");
179 $ilTabs->activateTab(
"password");
184 if (
$ilUser->isPasswordChangeDemanded()) {
186 $this->lng->txt(
'password_change_on_first_login_demand')
188 } elseif (
$ilUser->isPasswordExpired()) {
189 $msg = $this->lng->txt(
'password_expired');
190 $password_age =
$ilUser->getPasswordAge();
194 if (!$a_no_init && !$hide_form) {
197 $this->tpl->setContent(!$hide_form ? $this->form->getHTML() :
'');
198 $this->tpl->printToStdout();
214 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
225 $pw_info_set =
false;
230 $cpass->setRetype(
false);
231 $cpass->setSkipSyntaxCheck(
true);
235 $cpass->setRequired(
true);
237 $this->form->addItem($cpass);
242 if ($pw_info_set ===
false) {
245 $ipass->setRequired(
true);
246 $ipass->setUseStripSlashes(
false);
248 $this->form->addItem($ipass);
249 $this->form->addCommandButton(
"savePassword",
$lng->txt(
"save"));
251 switch (
$ilUser->getAuthMode(
true)) {
253 $this->form->setTitle(
$lng->txt(
"chg_password"));
258 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
260 $this->form->setTitle(
$lng->txt(
"chg_ilias_and_webfolder_password"));
262 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
266 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
269 $this->form->setFormAction($this->ctrl->getFormAction($this));
291 return \ilAuthUtils::isPasswordModificationHidden() && (
$ilUser->isPasswordChangeDemanded() ||
$ilUser->isPasswordExpired());
304 $ilCtrl =
$DIC[
'ilCtrl'];
310 $ilCtrl->redirect($this,
"showPersonalData");
315 if ($this->form->checkInput()) {
316 $cp = $this->form->getItemByPostVar(
"current_password");
317 $np = $this->form->getItemByPostVar(
"new_password");
324 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
327 $cp->setAlert($this->lng->txt(
'passwd_wrong'));
333 if ($custom_error !=
'') {
334 $np->setAlert($custom_error);
336 $np->setAlert($this->lng->txt(
"passwd_invalid"));
342 $np->setAlert($this->lng->txt($error_lng_var));
346 (
$ilUser->isPasswordExpired() ||
$ilUser->isPasswordChangeDemanded()) &&
349 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
354 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"]) {
355 $ilUser->setLastPasswordChangeToNow();
356 $ilUser->setPasswordPolicyResetStatus(
false);
361 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'),
true);
366 ilUtil::sendSuccess($this->lng->txt(
'saved_successfully'));
372 $this->form->setValuesByPost();
388 return $this->user_settings_config->isVisibleAndChangeable($setting);
397 return $this->user_settings_config->isVisible($setting);
406 return $this->user_settings_config->isChangeable($setting);
416 $ilTabs =
$DIC[
'ilTabs'];
418 $this->__initSubTabs(
"showPersonalData");
419 $ilTabs->activateTab(
"general_settings");
426 $this->tpl->setContent($this->form->getHTML());
427 $this->tpl->printToStdout();
440 $styleDefinition =
$DIC[
'styleDefinition'];
444 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
449 $languages = $this->lng->getInstalledLanguages();
451 foreach ($languages as $lang_key) {
456 $si->setOptions($options);
458 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_language"));
459 $this->form->addItem(
$si);
464 $skins = $styleDefinition->getAllSkins();
465 if (is_array($skins)) {
469 foreach ($skins as $skin) {
470 foreach ($skin->getStyles() as $style) {
471 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
476 $options[$skin->getId() .
":" . $style->getId()] = $skin->getName() .
" / " . $style->getName();
479 $si->setOptions($options);
481 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_skin_style"));
482 $this->form->addItem(
$si);
488 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
489 $cb->setChecked(
$ilUser->prefs[
"screen_reader_optimization"]);
490 $cb->setDisabled(
$ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
491 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
492 $this->form->addItem($cb);
496 $module_id = (int)
$ilSetting->get(
"help_module");
497 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" &&
499 $this->lng->loadLanguageModule(
"help");
500 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"help_toggle_tooltips"),
"help_tooltips");
501 $cb->setChecked(!
$ilUser->prefs[
"hide_help_tt"]);
502 $cb->setInfo($this->lng->txt(
"help_toggle_tooltips_info"));
503 $this->form->addItem($cb);
510 $hits_options = array(10,15,20,30,40,50,100,9999);
513 foreach ($hits_options as $hits_option) {
514 $hstr = ($hits_option == 9999)
515 ? $this->lng->txt(
"no_limit")
517 $options[$hits_option] = $hstr;
519 $si->setOptions($options);
520 $si->setValue(
$ilUser->prefs[
"hits_per_page"]);
521 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_hits_per_page"));
522 $this->form->addItem(
$si);
542 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
544 0 => $this->lng->txt(
"user_lv_keep_entries"),
545 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
546 2 => $this->lng->txt(
"user_lv_do_not_store"));
547 $lv->setOptions($options);
548 $lv->setValue((
int)
$ilUser->prefs[
"store_last_visited"]);
549 $this->form->addItem($lv);
552 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
553 if (ilSessionReminder::isGloballyActivated()) {
554 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
555 $cb->setInfo($this->lng->txt(
'session_reminder_info'));
557 $cb->setChecked((
int)
$ilUser->getPref(
'session_reminder_enabled'));
560 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
564 $max_value = max($min_value, ((
int) $expires / 60) - 1);
566 $current_user_value =
$ilUser->getPref(
'session_reminder_lead_time');
567 if ($current_user_value < $min_value ||
568 $current_user_value > $max_value) {
579 $lead_time_gui->setValue($value);
580 $lead_time_gui->setSize(3);
581 $lead_time_gui->setMinValue($min_value);
582 $lead_time_gui->setMaxValue($max_value);
583 $cb->addSubItem($lead_time_gui);
585 $this->form->addItem($cb);
591 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
592 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
593 $lng->loadLanguageModule(
"dateplaner");
598 $select->setInfo(
$lng->txt(
'cal_timezone_info'));
599 $select->setValue($user_settings->getTimeZone());
600 $this->form->addItem($select);
604 $select->setOptions(array(
608 $select->setInfo(
$lng->txt(
'cal_date_format_info'));
609 $select->setValue($user_settings->getDateFormat());
610 $this->form->addItem($select);
613 $select->setOptions(array(
616 $select->setInfo(
$lng->txt(
'cal_time_format_info'));
617 $select->setValue($user_settings->getTimeFormat());
618 $this->form->addItem($select);
622 include_once
"Services/User/classes/class.ilUserUtil.php";
624 $this->lng->loadLanguageModule(
"administration");
626 $si->setRequired(
true);
627 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
628 $def_opt =
new ilRadioOption($this->lng->txt(
"adm_user_starting_point_inherit"), 0);
629 $def_opt->setInfo($this->lng->txt(
"adm_user_starting_point_inherit_info"));
630 $si->addOption($def_opt);
637 $this->form->addItem(
$si);
641 $repobj_id =
new ilTextInputGUI(
$lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
642 $repobj_id->setInfo(
$lng->txt(
"adm_user_starting_point_ref_id_info"));
643 $repobj_id->setRequired(
true);
644 $repobj_id->setSize(5);
647 $repobj_id->setValue($start_ref_id);
656 $repobj->addSubItem($repobj_id);
657 $si->addOption($repobj);
664 if (
$ilSetting->get(
'char_selector_availability') > 0) {
665 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
667 $char_selector->getConfig()->setAvailability(
$ilUser->getPref(
'char_selector_availability'));
668 $char_selector->getConfig()->setDefinition(
$ilUser->getPref(
'char_selector_definition'));
669 $char_selector->addFormProperties($this->form);
670 $char_selector->setFormValues($this->form);
673 $this->form->addCommandButton(
"saveGeneralSettings",
$lng->txt(
"save"));
674 $this->form->setTitle(
$lng->txt(
"general_settings"));
675 $this->form->setFormAction($this->ctrl->getFormAction($this));
687 $ilCtrl =
$DIC[
'ilCtrl'];
692 if ($this->form->checkInput()
693 && $this->checkPersonalStartingPoint()) {
696 if (
$_POST[
"skin_style"] !=
"") {
697 $sknst = explode(
":",
$_POST[
"skin_style"]);
699 if (
$ilUser->getPref(
"style") != $sknst[1] ||
700 $ilUser->getPref(
"skin") != $sknst[0]) {
701 $ilUser->setPref(
"skin", $sknst[0]);
702 $ilUser->setPref(
"style", $sknst[1]);
714 if (
$_POST[
"hits_per_page"] !=
"") {
720 $module_id = (int)
$ilSetting->get(
"help_module");
721 if ((OH_REF_ID > 0 || $module_id > 0) &&
$ilUser->getLanguage() ==
"de" &&
723 $ilUser->setPref(
"hide_help_tt", (
int) !
$_POST[
"help_tooltips"]);
736 $ilNavigationHistory =
$DIC[
'ilNavigationHistory'];
737 $ilUser->setPref(
"store_last_visited", (
int)
$_POST[
"store_last_visited"]);
738 if ((
int)
$_POST[
"store_last_visited"] > 0) {
739 $ilNavigationHistory->deleteDBEntries();
740 if ((
int)
$_POST[
"store_last_visited"] == 2) {
741 $ilNavigationHistory->deleteSessionEntries();
747 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
751 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
752 if (ilSessionReminder::isGloballyActivated()) {
753 $ilUser->setPref(
'session_reminder_enabled', (
int) $this->form->getInput(
'session_reminder_enabled'));
754 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
758 include_once
"Services/User/classes/class.ilUserUtil.php";
761 $this->form->getInput(
'usr_start'),
762 $this->form->getInput(
'usr_start_ref_id')
770 if (
$ilSetting->get(
'char_selector_availability') > 0) {
771 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
773 $char_selector->getFormValues($this->form);
774 $ilUser->setPref(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
775 $ilUser->setPref(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
781 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
783 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
784 $user_settings->setDateFormat((
int) $this->form->getInput(
"date_format"));
785 $user_settings->setTimeFormat((
int) $this->form->getInput(
"time_format"));
786 $user_settings->save();
788 ilUtil::sendSuccess(
$lng->txtlng(
"common",
"msg_obj_modified",
$ilUser->getLanguage()),
true);
790 $ilCtrl->redirect($this,
"showGeneralSettings");
793 $this->form->setValuesByPost();
804 $ref_id = $this->form->getInput(
'usr_start_ref_id');
806 $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'obj_ref_id_not_exist'),
true);
820 $ilTabs =
$DIC[
'ilTabs'];
821 $ilToolbar =
$DIC[
'ilToolbar'];
825 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
827 $this->ctrl->redirect($this,
"showGeneralSettings");
834 $this->__initSubTabs(
"deleteOwnAccount");
835 $ilTabs->activateTab(
"delacc");
838 $ilToolbar->addButton(
839 $this->lng->txt(
'btn_next'),
840 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2')
843 $this->tpl->printToStdout();
853 $ilTabs =
$DIC[
'ilTabs'];
857 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
859 $this->ctrl->redirect($this,
"showGeneralSettings");
863 $this->__initSubTabs(
"deleteOwnAccount");
864 $ilTabs->activateTab(
"delacc");
866 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
868 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
869 $cgui->setFormAction($this->ctrl->getFormAction($this));
870 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
871 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
872 $this->tpl->setContent($cgui->getHTML());
873 $this->tpl->printToStdout();
880 $ilCtrl =
$DIC[
'ilCtrl'];
886 $ilCtrl->redirect($this,
"showGeneralSettings");
897 $ilUser->activateDeletionFlag();
901 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
903 ilUtil::redirect(
"login.php?cmd=force_login&target=usr_" . md5(
"usrdelown"));
913 $ilTabs =
$DIC[
'ilTabs'];
917 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
920 $this->ctrl->redirect($this,
"showGeneralSettings");
924 $this->__initSubTabs(
"deleteOwnAccount");
925 $ilTabs->activateTab(
"delacc");
927 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
929 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
930 $cgui->setFormAction($this->ctrl->getFormAction($this));
931 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
932 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
933 $this->tpl->setContent($cgui->getHTML());
934 $this->tpl->printToStdout();
940 protected function deleteOwnAccount4()
946 $ilLog =
$DIC[
'ilLog'];
948 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
951 $this->ctrl->redirect($this,
"showGeneralSettings");
956 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
958 $ntf->setLangModules(array(
"user"));
959 $ntf->addAdditionalInfo(
"profile",
$ilUser->getProfileAsString($this->lng),
true);
963 $ntf->setIntroductionDirect(
965 $this->lng->txt(
"user_delete_own_account_email_body"),
972 $message = $ntf->composeAndGetMessage(
$ilUser->getId(),
null,
null,
true);
973 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
977 $user_email =
$ilUser->getEmail();
978 $admin_mail =
$ilSetting->get(
"user_delete_own_account_email");
980 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
983 $mmail->From($senderFactory->system());
986 $mmail->To($user_email);
987 $mmail->Bcc($admin_mail);
988 $mmail->Subject($subject,
true);
993 elseif ($admin_mail) {
994 $mmail->To($admin_mail);
995 $mmail->Subject($subject,
true);
1000 $ilLog->write(
"Account deleted: " .
$ilUser->getLogin() .
" (" .
$ilUser->getId() .
")");
1005 $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 _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
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)
checkPersonalStartingPoint()
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.
const SYSTEM_USER_ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirection script todo: (a better solution should control the processing via a xml file)