25 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
32 $this->
settings = $ilias->getAllSettings();
34 $lng->loadLanguageModule(
'chatroom');
35 $lng->loadLanguageModule(
'chatroom_adm');
36 $this->upload_error =
"";
37 $this->password_error =
"";
38 $lng->loadLanguageModule(
"user");
39 $ilCtrl->saveParameter($this,
"user_page");
49 $next_class = $this->ctrl->getNextClass();
51 switch ($next_class) {
52 case 'ilmailoptionsgui':
53 require_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
55 $this->
ilias->raiseError($DIC->language()->txt(
'permission_denied'), $this->ilias->error_obj->MESSAGE);
58 $this->__initSubTabs(
'showMailOptions');
59 $DIC->tabs()->activateTab(
'mail_settings');
62 require_once
'Services/Mail/classes/class.ilMailOptionsGUI.php';
66 case 'ilpersonalchatsettingsformgui':
67 $this->__initSubTabs($this->ctrl->getCmd());
70 require_once
'Modules/Chatroom/classes/class.ilPersonalChatSettingsFormGUI.php';
72 $this->ctrl->forwardCommand($chatSettingsGui);
76 $cmd = $this->ctrl->getCmd(
"showGeneralSettings");
84 public function __initSubTabs($a_cmd)
91 $ilHelp->setScreenIdComponent(
"user");
93 $showPassword = ($a_cmd ==
'showPassword') ?
true :
false;
94 $showGeneralSettings = ($a_cmd ==
'showGeneralSettings') ?
true :
false;
101 $this->ctrl->getLinkTarget($this,
"showGeneralSettings"),
112 $this->ctrl->getLinkTarget($this,
"showPassword"),
120 require_once
'Services/Mail/classes/class.ilMailGlobalServices.php';
124 $this->ctrl->getLinkTargetByClass(
'ilMailOptionsGUI'),
126 array(
'ilMailOptionsGUI')
130 require_once
'Modules/Chatroom/classes/class.ilPersonalChatSettingsFormGUI.php';
132 if ($chatSettingsGui->isAccessible()) {
136 $this->ctrl->getLinkTarget($chatSettingsGui,
'showChatOptions'),
138 'ilPersonalChatSettingsFormGUI',
140 method_exists($chatSettingsGui, $a_cmd)
144 include_once
"./Services/Administration/classes/class.ilSetting.php";
146 if ((
bool)
$ilSetting->get(
'user_delete_own_account') &&
147 $ilUser->getId() != SYSTEM_USER_ID) {
150 $this->lng->txt(
'user_delete_own_account'),
151 $this->ctrl->getLinkTarget($this,
"deleteOwnAccount1")
161 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'personal_settings'));
177 $this->__initSubTabs(
"showPersonalData");
178 $ilTabs->activateTab(
"password");
183 if ($ilUser->isPasswordChangeDemanded()) {
185 $this->lng->txt(
'password_change_on_first_login_demand')
187 } elseif (
$ilUser->isPasswordExpired()) {
188 $msg = $this->lng->txt(
'password_expired');
189 $password_age =
$ilUser->getPasswordAge();
193 if (!$a_no_init && !$hide_form) {
196 $this->tpl->setContent(!$hide_form ? $this->form->getHTML() :
'');
209 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
220 if ($ilUser->getAuthMode(
true) ==
AUTH_LOCAL) {
223 $cpass->setRetype(
false);
224 $cpass->setSkipSyntaxCheck(
true);
227 $cpass->setRequired(
true);
229 $this->form->addItem($cpass);
234 $ipass->setRequired(
true);
237 $this->form->addItem($ipass);
238 $this->form->addCommandButton(
"savePassword",
$lng->txt(
"save"));
240 switch (
$ilUser->getAuthMode(
true)) {
242 $this->form->setTitle(
$lng->txt(
"chg_password"));
247 require_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php');
249 $this->form->setTitle(
$lng->txt(
"chg_ilias_and_webfolder_password"));
251 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
255 $this->form->setTitle(
$lng->txt(
"chg_ilias_password"));
258 $this->form->setFormAction($this->ctrl->getFormAction($this));
278 return \ilAuthUtils::isPasswordModificationHidden() && (
$ilUser->isPasswordChangeDemanded() ||
$ilUser->isPasswordExpired());
291 $ilCtrl->redirect($this,
"showPersonalData");
296 if ($this->form->checkInput()) {
297 $cp = $this->form->getItemByPostVar(
"current_password");
298 $np = $this->form->getItemByPostVar(
"new_password");
304 #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
306 require_once
'Services/User/classes/class.ilUserPasswordManager.php';
309 $cp->setAlert($this->lng->txt(
'passwd_wrong'));
315 if ($custom_error !=
'') {
316 $np->setAlert($custom_error);
318 $np->setAlert($this->lng->txt(
"passwd_invalid"));
324 $np->setAlert($this->lng->txt($error_lng_var));
328 (
$ilUser->isPasswordExpired() ||
$ilUser->isPasswordChangeDemanded()) &&
331 $np->setAlert($this->lng->txt(
"new_pass_equals_old_pass"));
336 if (
$_POST[
"current_password"] !=
$_POST[
"new_password"]) {
337 $ilUser->setLastPasswordChangeToNow();
352 $this->form->setValuesByPost();
369 if ($this->
settings[
"usr_settings_hide_" . $setting] == 1) {
372 if ($this->
settings[
"usr_settings_disable_" . $setting] == 1) {
385 if (isset($this->
settings[
"usr_settings_hide_" . $setting]) &&
386 $this->
settings[
"usr_settings_hide_" . $setting] == 1) {
399 if ($this->
settings[
"usr_settings_disable_" . $setting] == 1) {
412 $this->__initSubTabs(
"showPersonalData");
413 $ilTabs->activateTab(
"general_settings");
420 $this->tpl->setContent($this->form->getHTML());
433 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
438 $languages = $this->lng->getInstalledLanguages();
440 foreach ($languages as $lang_key) {
447 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_language"));
448 $this->form->addItem(
$si);
453 $skins = $styleDefinition->getAllSkins();
454 if (is_array($skins)) {
458 foreach ($skins as $skin) {
459 foreach ($skin->getStyles() as
$style) {
460 include_once(
"./Services/Style/System/classes/class.ilSystemStyleSettings.php");
465 $options[$skin->getId() .
":" .
$style->getId()] = $skin->getName() .
" / " .
$style->getName();
470 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_skin_style"));
471 $this->form->addItem(
$si);
477 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"user_screen_reader_optimization"),
"screen_reader_optimization");
478 $cb->setChecked(
$ilUser->prefs[
"screen_reader_optimization"]);
479 $cb->setDisabled(
$ilSetting->get(
"usr_settings_disable_screen_reader_optimization"));
480 $cb->setInfo($this->lng->txt(
"user_screen_reader_optimization_info"));
481 $this->form->addItem($cb);
488 $hits_options = array(10,15,20,30,40,50,100,9999);
491 foreach ($hits_options as $hits_option) {
492 $hstr = ($hits_option == 9999)
493 ? $this->lng->txt(
"no_limit")
498 $si->setValue(
$ilUser->prefs[
"hits_per_page"]);
499 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_hits_per_page"));
500 $this->form->addItem(
$si);
520 $lv =
new ilSelectInputGUI($this->lng->txt(
"user_store_last_visited"),
"store_last_visited");
522 0 => $this->lng->txt(
"user_lv_keep_entries"),
523 1 => $this->lng->txt(
"user_lv_keep_only_for_session"),
524 2 => $this->lng->txt(
"user_lv_do_not_store"));
526 $lv->setValue((
int)
$ilUser->prefs[
"store_last_visited"]);
527 $this->form->addItem($lv);
531 if ($awrn_set->get(
"awrn_enabled",
false) && $this->userSettingVisible(
"hide_own_online_status")) {
532 $this->lng->loadLanguageModule(
"awrn");
534 $default = ($this->
settings[
'hide_own_online_status'] ==
"n")
535 ? $this->lng->txt(
"user_awrn_show")
536 : $this->lng->txt(
"user_awrn_hide");
539 "" => $this->lng->txt(
"user_awrn_default").
" (".$default.
")",
540 "n" => $this->lng->txt(
"user_awrn_show"),
541 "y" => $this->lng->txt(
"user_awrn_hide"));
544 $si->setDisabled(
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
545 $si->setValue(
$ilUser->prefs[
"hide_own_online_status"]);
546 $si->setInfo(
$lng->txt(
"awrn_hide_from_awareness_info"));
547 $this->form->addItem(
$si);
549 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"awrn_hide_from_awareness"),
"hide_own_online_status");
550 $cb->setInfo($this->lng->txt(
"awrn_hide_from_awareness_info"));
551 $cb->setChecked(
$ilUser->prefs[
"hide_own_online_status"] ==
"y");
552 $cb->setDisabled(
$ilSetting->get(
"usr_settings_disable_hide_own_online_status"));
556 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
558 $this->lng->loadLanguageModule(
'buddysystem');
559 $allow_to_contact_be =
new ilCheckboxInputGUI($this->lng->txt(
'buddy_allow_to_contact_me'),
'bs_allow_to_contact_me');
560 $allow_to_contact_be->setInfo($this->lng->txt(
'buddy_allow_to_contact_me_info'));
561 $allow_to_contact_be->setChecked(
$ilUser->prefs[
'bs_allow_to_contact_me'] ==
'y');
562 $allow_to_contact_be->setDisabled(
$ilSetting->get(
'usr_settings_disable_bs_allow_to_contact_me'));
563 $this->form->addItem($allow_to_contact_be);
566 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
567 if (ilSessionReminder::isGloballyActivated()) {
568 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'session_reminder'),
'session_reminder_enabled');
569 $cb->setInfo($this->lng->txt(
'session_reminder_info'));
571 $cb->setChecked((
int)
$ilUser->getPref(
'session_reminder_enabled'));
574 $lead_time_gui =
new ilNumberInputGUI($this->lng->txt(
'session_reminder_lead_time'),
'session_reminder_lead_time');
578 $max_value = max($min_value, ((
int) $expires / 60) - 1);
580 $current_user_value =
$ilUser->getPref(
'session_reminder_lead_time');
581 if ($current_user_value < $min_value ||
582 $current_user_value > $max_value) {
593 $lead_time_gui->setValue($value);
594 $lead_time_gui->setSize(3);
595 $lead_time_gui->setMinValue($min_value);
596 $lead_time_gui->setMaxValue($max_value);
597 $cb->addSubItem($lead_time_gui);
599 $this->form->addItem($cb);
605 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
606 include_once(
'Services/Calendar/classes/class.ilCalendarUtil.php');
607 $lng->loadLanguageModule(
"dateplaner");
612 $select->setInfo(
$lng->txt(
'cal_timezone_info'));
613 $select->setValue($user_settings->getTimeZone());
614 $this->form->addItem($select);
618 $select->setOptions(array(
622 $select->setInfo(
$lng->txt(
'cal_date_format_info'));
623 $select->setValue($user_settings->getDateFormat());
624 $this->form->addItem($select);
627 $select->setOptions(array(
630 $select->setInfo(
$lng->txt(
'cal_time_format_info'));
631 $select->setValue($user_settings->getTimeFormat());
632 $this->form->addItem($select);
636 include_once
"Services/User/classes/class.ilUserUtil.php";
638 $this->lng->loadLanguageModule(
"administration");
640 $si->setRequired(
true);
641 $si->setInfo($this->lng->txt(
"adm_user_starting_point_info"));
642 $def_opt =
new ilRadioOption($this->lng->txt(
"adm_user_starting_point_inherit"), 0);
643 $def_opt->setInfo($this->lng->txt(
"adm_user_starting_point_inherit_info"));
644 $si->addOption($def_opt);
651 $this->form->addItem(
$si);
655 $repobj_id =
new ilTextInputGUI(
$lng->txt(
"adm_user_starting_point_ref_id"),
"usr_start_ref_id");
656 $repobj_id->setInfo(
$lng->txt(
"adm_user_starting_point_ref_id_info"));
657 $repobj_id->setRequired(
true);
658 $repobj_id->setSize(5);
661 $repobj_id->setValue($start_ref_id);
670 $repobj->addSubItem($repobj_id);
671 $si->addOption($repobj);
676 if (
$ilSetting->get(
'char_selector_availability') > 0) {
677 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
679 $char_selector->getConfig()->setAvailability(
$ilUser->getPref(
'char_selector_availability'));
680 $char_selector->getConfig()->setDefinition(
$ilUser->getPref(
'char_selector_definition'));
681 $char_selector->addFormProperties($this->form);
682 $char_selector->setFormValues($this->form);
685 $this->form->addCommandButton(
"saveGeneralSettings",
$lng->txt(
"save"));
686 $this->form->setTitle(
$lng->txt(
"general_settings"));
687 $this->form->setFormAction($this->ctrl->getFormAction($this));
698 if ($this->form->checkInput()) {
701 if (
$_POST[
"skin_style"] !=
"") {
702 $sknst = explode(
":",
$_POST[
"skin_style"]);
704 if (
$ilUser->getPref(
"style") != $sknst[1] ||
705 $ilUser->getPref(
"skin") != $sknst[0]) {
706 $ilUser->setPref(
"skin", $sknst[0]);
707 $ilUser->setPref(
"style", $sknst[1]);
714 $ilUser->setLanguage(
$_POST[
"language"]);
719 if (
$_POST[
"hits_per_page"] !=
"") {
720 $ilUser->setPref(
"hits_per_page",
$_POST[
"hits_per_page"]);
732 global $ilNavigationHistory;
733 $ilUser->setPref(
"store_last_visited", (
int)
$_POST[
"store_last_visited"]);
734 if ((
int)
$_POST[
"store_last_visited"] > 0) {
735 $ilNavigationHistory->deleteDBEntries();
736 if ((
int)
$_POST[
"store_last_visited"] == 2) {
737 $ilNavigationHistory->deleteSessionEntries();
751 require_once
'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
753 if (isset(
$_POST[
'bs_allow_to_contact_me']) &&
$_POST[
'bs_allow_to_contact_me'] == 1) {
754 $ilUser->setPref(
'bs_allow_to_contact_me',
'y');
756 $ilUser->setPref(
'bs_allow_to_contact_me',
'n');
762 $ilUser->setPref(
"screen_reader_optimization",
$_POST[
"screen_reader_optimization"]);
766 include_once
'Services/Authentication/classes/class.ilSessionReminder.php';
767 if (ilSessionReminder::isGloballyActivated()) {
768 $ilUser->setPref(
'session_reminder_enabled', (
int) $this->form->getInput(
'session_reminder_enabled'));
769 $ilUser->setPref(
'session_reminder_lead_time', $this->form->getInput(
'session_reminder_lead_time'));
773 include_once
"Services/User/classes/class.ilUserUtil.php";
776 $this->form->getInput(
'usr_start'),
777 $this->form->getInput(
'usr_start_ref_id')
783 if (
$ilSetting->get(
'char_selector_availability') > 0) {
784 require_once
'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
786 $char_selector->getFormValues($this->form);
787 $ilUser->setPref(
'char_selector_availability', $char_selector->getConfig()->getAvailability());
788 $ilUser->setPref(
'char_selector_definition', $char_selector->getConfig()->getDefinition());
794 include_once(
'Services/Calendar/classes/class.ilCalendarUserSettings.php');
796 $user_settings->setTimeZone($this->form->getInput(
"timezone"));
797 $user_settings->setDateFormat((
int) $this->form->getInput(
"date_format"));
798 $user_settings->setTimeFormat((
int) $this->form->getInput(
"time_format"));
799 $user_settings->save();
802 $ilCtrl->redirect($this,
"showGeneralSettings");
805 $this->form->setValuesByPost();
816 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
817 $ilUser->getId() == SYSTEM_USER_ID) {
818 $this->ctrl->redirect($this,
"showGeneralSettings");
825 $this->__initSubTabs(
"deleteOwnAccount");
826 $ilTabs->activateTab(
"delacc");
829 $ilToolbar->addButton(
830 $this->lng->txt(
'btn_next'),
831 $this->ctrl->getLinkTarget($this,
'deleteOwnAccount2')
844 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
845 $ilUser->getId() == SYSTEM_USER_ID) {
846 $this->ctrl->redirect($this,
"showGeneralSettings");
850 $this->__initSubTabs(
"deleteOwnAccount");
851 $ilTabs->activateTab(
"delacc");
853 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
855 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_logout_confirmation'));
856 $cgui->setFormAction($this->ctrl->getFormAction($this));
857 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
858 $cgui->setConfirm($this->lng->txt(
"user_delete_own_account_logout_button"),
"deleteOwnAccountLogout");
859 $this->tpl->setContent($cgui->getHTML());
870 $ilCtrl->redirect($this,
"showGeneralSettings");
879 $ilUser->activateDeletionFlag();
883 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
895 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
896 $ilUser->getId() == SYSTEM_USER_ID ||
898 $this->ctrl->redirect($this,
"showGeneralSettings");
902 $this->__initSubTabs(
"deleteOwnAccount");
903 $ilTabs->activateTab(
"delacc");
905 include_once
"Services/Utilities/classes/class.ilConfirmationGUI.php";
907 $cgui->setHeaderText($this->lng->txt(
'user_delete_own_account_final_confirmation'));
908 $cgui->setFormAction($this->ctrl->getFormAction($this));
909 $cgui->setCancel($this->lng->txt(
"cancel"),
"abortDeleteOwnAccount");
910 $cgui->setConfirm($this->lng->txt(
"confirm"),
"deleteOwnAccount4");
911 $this->tpl->setContent($cgui->getHTML());
922 if (!(
bool)
$ilSetting->get(
'user_delete_own_account') ||
923 $ilUser->getId() == SYSTEM_USER_ID ||
925 $this->ctrl->redirect($this,
"showGeneralSettings");
930 include_once
"./Services/Notification/classes/class.ilSystemNotification.php";
932 $ntf->setLangModules(array(
"user"));
933 $ntf->addAdditionalInfo(
"profile",
$ilUser->getProfileAsString($this->lng),
true);
937 $ntf->setIntroductionDirect(
939 $this->lng->txt(
"user_delete_own_account_email_body"),
946 $message = $ntf->composeAndGetMessage(
$ilUser->getId(),
null,
null,
true);
947 $subject = $this->lng->txt(
"user_delete_own_account_email_subject");
952 include_once
"Services/Mail/classes/class.ilMail.php";
953 $mail =
new ilMail(ANONYMOUS_USER_ID);
955 $user_email =
$ilUser->getEmail();
956 $admin_mail =
$ilSetting->get(
"user_delete_own_account_email");
960 $mail->sendMimeMail($user_email,
null, $admin_mail, $subject,
$message,
null,
true);
963 elseif ($admin_mail) {
964 $mail->sendMimeMail($admin_mail,
null,
null, $subject,
$message,
null,
true);
972 $GLOBALS[
'DIC'][
'ilAuthSession']->logout();
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
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)
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.
This class handles base functions for mail handling.
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.
userSettingEnabled($setting)
Returns TRUE if user setting is enabled, FALSE otherwise.
deleteOwnAccount4()
Delete own account dialog - action incl.
deleteOwnAccount1()
Delete own account dialog - 1st confirmation.
deleteOwnAccount2()
Delete own account dialog - login redirect.
savePassword()
Save password form.
deleteOwnAccount3()
Delete own account dialog - final confirmation.
initPasswordForm()
Init password form.
allowPasswordChange()
Check, whether password change is allowed for user.
userSettingVisible($setting)
Returns TRUE if user setting is visible, FALSE otherwise.
saveGeneralSettings()
Save general settings.
showPassword($a_no_init=false, $hide_form=false)
executeCommand()
execute command
workWithUserSetting($setting)
Returns TRUE if working with the given user setting is allowed, FALSE otherwise.
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)
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
catch(Exception $e) $message
redirection script todo: (a better solution should control the processing via a xml file)