ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPersonalSettingsGUI Class Reference

GUI class for personal profile. More...

+ Collaboration diagram for ilPersonalSettingsGUI:

Public Member Functions

 __construct ()
 constructor More...
 
 executeCommand ()
 execute command More...
 
 setHeader ()
 Set header. More...
 
 showPassword ($a_no_init=false, $hide_form=false)
 
 initPasswordForm ()
 Init password form. More...
 
 savePassword ()
 Save password form. More...
 
 workWithUserSetting ($setting)
 Returns TRUE if working with the given user setting is allowed, FALSE otherwise. More...
 
 userSettingVisible ($setting)
 Returns TRUE if user setting is visible, FALSE otherwise. More...
 
 userSettingEnabled ($setting)
 Returns TRUE if user setting is enabled, FALSE otherwise. More...
 
 showGeneralSettings ($a_no_init=false)
 General settings form. More...
 
 initGeneralSettingsForm ()
 Init general settings form. More...
 
 saveGeneralSettings ()
 Save general settings. More...
 

Data Fields

 $tpl
 
 $lng
 
 $ilias
 
 $ctrl
 

Protected Member Functions

 allowPasswordChange ()
 Check, whether password change is allowed for user. More...
 
 deleteOwnAccount1 ()
 Delete own account dialog - 1st confirmation. More...
 
 deleteOwnAccount2 ()
 Delete own account dialog - login redirect. More...
 
 abortDeleteOwnAccount ()
 
 deleteOwnAccountLogout ()
 
 deleteOwnAccount3 ()
 Delete own account dialog - final confirmation. More...
 
 deleteOwnAccount4 ()
 Delete own account dialog - action incl. More...
 

Detailed Description

GUI class for personal profile.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ ilPersonalSettingsGUI: ilMailOptionsGUI

Definition at line 11 of file class.ilPersonalSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSettingsGUI::__construct ( )

constructor

Definition at line 21 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilCtrl, $ilias, $lng, $tpl, ilUserDefinedFields\_getInstance(), and settings().

22  {
23  global $DIC;
24 
25  $ilias = $DIC['ilias'];
26  $tpl = $DIC['tpl'];
27  $lng = $DIC['lng'];
28  $rbacsystem = $DIC['rbacsystem'];
29  $ilCtrl = $DIC['ilCtrl'];
30 
31  include_once './Services/User/classes/class.ilUserDefinedFields.php';
32  $this->user_defined_fields = &ilUserDefinedFields::_getInstance();
33 
34  $this->tpl = &$tpl;
35  $this->lng = &$lng;
36  $this->ilias = &$ilias;
37  $this->ctrl = &$ilCtrl;
38  $this->settings = $ilias->getAllSettings();
39  // $lng->loadLanguageModule("jsmath");
40  $lng->loadLanguageModule('chatroom');
41  $lng->loadLanguageModule('chatroom_adm');
42  $this->upload_error = "";
43  $this->password_error = "";
44  $lng->loadLanguageModule("user");
45  $ilCtrl->saveParameter($this, "user_page");
46  }
settings()
Definition: settings.php:2
static _getInstance()
Get instance.
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

Member Function Documentation

◆ abortDeleteOwnAccount()

ilPersonalSettingsGUI::abortDeleteOwnAccount ( )
protected

Definition at line 945 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilCtrl, $ilUser, and ilUtil\sendInfo().

946  {
947  global $DIC;
948 
949  $ilCtrl = $DIC['ilCtrl'];
950  $ilUser = $DIC['ilUser'];
951 
952  $ilUser->removeDeletionFlag();
953 
954  ilUtil::sendInfo($this->lng->txt("user_delete_own_account_aborted"), true);
955  $ilCtrl->redirect($this, "showGeneralSettings");
956  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ allowPasswordChange()

ilPersonalSettingsGUI::allowPasswordChange ( )
protected

Check, whether password change is allowed for user.

Definition at line 293 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilUser, ilSession\get(), and ilAuthUtils\isPasswordModificationEnabled().

Referenced by executeCommand(), initPasswordForm(), and savePassword().

294  {
295  global $DIC;
296 
297  $ilUser = $DIC['ilUser'];
298 
299  if (\ilSession::get('used_external_auth')) {
300  return false;
301  }
302 
303  $status = ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));
304  if ($status) {
305  return true;
306  }
307 
308  return \ilAuthUtils::isPasswordModificationHidden() && ($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired());
309  }
global $DIC
Definition: saml.php:7
static get($a_var)
Get a value.
$ilUser
Definition: imgupload.php:18
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteOwnAccount1()

ilPersonalSettingsGUI::deleteOwnAccount1 ( )
protected

Delete own account dialog - 1st confirmation.

Definition at line 885 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilSetting, $ilUser, ilUtil\sendInfo(), and setHeader().

886  {
887  global $DIC;
888 
889  $ilTabs = $DIC['ilTabs'];
890  $ilToolbar = $DIC['ilToolbar'];
891  $ilUser = $DIC['ilUser'];
892  $ilSetting = $DIC['ilSetting'];
893 
894  if (!(bool) $ilSetting->get('user_delete_own_account') ||
895  $ilUser->getId() == SYSTEM_USER_ID) {
896  $this->ctrl->redirect($this, "showGeneralSettings");
897  }
898 
899  // too make sure
900  $ilUser->removeDeletionFlag();
901 
902  $this->setHeader();
903  $this->__initSubTabs("deleteOwnAccount");
904  $ilTabs->activateTab("delacc");
905 
906  ilUtil::sendInfo($this->lng->txt('user_delete_own_account_info'));
907  $ilToolbar->addButton(
908  $this->lng->txt('btn_next'),
909  $this->ctrl->getLinkTarget($this, 'deleteOwnAccount2')
910  );
911 
912  $this->tpl->show();
913  }
global $DIC
Definition: saml.php:7
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ deleteOwnAccount2()

ilPersonalSettingsGUI::deleteOwnAccount2 ( )
protected

Delete own account dialog - login redirect.

Definition at line 918 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilSetting, $ilUser, and setHeader().

919  {
920  global $DIC;
921 
922  $ilTabs = $DIC['ilTabs'];
923  $ilUser = $DIC['ilUser'];
924  $ilSetting = $DIC['ilSetting'];
925 
926  if (!(bool) $ilSetting->get('user_delete_own_account') ||
927  $ilUser->getId() == SYSTEM_USER_ID) {
928  $this->ctrl->redirect($this, "showGeneralSettings");
929  }
930 
931  $this->setHeader();
932  $this->__initSubTabs("deleteOwnAccount");
933  $ilTabs->activateTab("delacc");
934 
935  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
936  $cgui = new ilConfirmationGUI();
937  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_logout_confirmation'));
938  $cgui->setFormAction($this->ctrl->getFormAction($this));
939  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
940  $cgui->setConfirm($this->lng->txt("user_delete_own_account_logout_button"), "deleteOwnAccountLogout");
941  $this->tpl->setContent($cgui->getHTML());
942  $this->tpl->show();
943  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteOwnAccount3()

ilPersonalSettingsGUI::deleteOwnAccount3 ( )
protected

Delete own account dialog - final confirmation.

Definition at line 978 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilSetting, $ilUser, and setHeader().

979  {
980  global $DIC;
981 
982  $ilTabs = $DIC['ilTabs'];
983  $ilUser = $DIC['ilUser'];
984  $ilSetting = $DIC['ilSetting'];
985 
986  if (!(bool) $ilSetting->get('user_delete_own_account') ||
987  $ilUser->getId() == SYSTEM_USER_ID ||
988  !$ilUser->hasDeletionFlag()) {
989  $this->ctrl->redirect($this, "showGeneralSettings");
990  }
991 
992  $this->setHeader();
993  $this->__initSubTabs("deleteOwnAccount");
994  $ilTabs->activateTab("delacc");
995 
996  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
997  $cgui = new ilConfirmationGUI();
998  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_final_confirmation'));
999  $cgui->setFormAction($this->ctrl->getFormAction($this));
1000  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
1001  $cgui->setConfirm($this->lng->txt("confirm"), "deleteOwnAccount4");
1002  $this->tpl->setContent($cgui->getHTML());
1003  $this->tpl->show();
1004  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteOwnAccount4()

ilPersonalSettingsGUI::deleteOwnAccount4 ( )
protected

Delete own account dialog - action incl.

notification email

Definition at line 1009 of file class.ilPersonalSettingsGUI.php.

References $DIC, $GLOBALS, $ilLog, $ilSetting, $ilUser, $message, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\redirect(), and ilDatePresentation\setUseRelativeDates().

1010  {
1011  global $DIC;
1012 
1013  $ilUser = $DIC['ilUser'];
1014  $ilSetting = $DIC['ilSetting'];
1015  $ilLog = $DIC['ilLog'];
1016 
1017  if (!(bool) $ilSetting->get('user_delete_own_account') ||
1018  $ilUser->getId() == SYSTEM_USER_ID ||
1019  !$ilUser->hasDeletionFlag()) {
1020  $this->ctrl->redirect($this, "showGeneralSettings");
1021  }
1022 
1023  // build notification
1024 
1025  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1026  $ntf = new ilSystemNotification();
1027  $ntf->setLangModules(array("user"));
1028  $ntf->addAdditionalInfo("profile", $ilUser->getProfileAsString($this->lng), true);
1029 
1030  // mail message
1032  $ntf->setIntroductionDirect(
1033  sprintf(
1034  $this->lng->txt("user_delete_own_account_email_body"),
1035  $ilUser->getLogin(),
1036  ILIAS_HTTP_PATH,
1038  )
1039  );
1040 
1041  $message = $ntf->composeAndGetMessage($ilUser->getId(), null, null, true);
1042  $subject = $this->lng->txt("user_delete_own_account_email_subject");
1043 
1044 
1045  // send notification
1046 
1047  include_once "Services/Mail/classes/class.ilMail.php";
1048  $mail = new ilMail(ANONYMOUS_USER_ID);
1049 
1050  $user_email = $ilUser->getEmail();
1051  $admin_mail = $ilSetting->get("user_delete_own_account_email");
1052 
1053  // to user, admin as bcc
1054  if ($user_email) {
1055  $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
1056  }
1057  // admin only
1058  elseif ($admin_mail) {
1059  $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
1060  }
1061 
1062  $ilLog->write("Account deleted: " . $ilUser->getLogin() . " (" . $ilUser->getId() . ")");
1063 
1064  $ilUser->delete();
1065 
1066  // terminate session
1067  $GLOBALS['DIC']['ilAuthSession']->logout();
1068  ilUtil::redirect("login.php?accdel=1");
1069  }
global $DIC
Definition: saml.php:7
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
catch(Exception $e) $message
Date and time handling
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
static redirect($a_script)
Wrapper classes for system notifications.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ deleteOwnAccountLogout()

ilPersonalSettingsGUI::deleteOwnAccountLogout ( )
protected

Definition at line 958 of file class.ilPersonalSettingsGUI.php.

References $DIC, $GLOBALS, $ilUser, ilUtil\redirect(), ilSession\SESSION_CLOSE_USER, and ilSession\setClosingContext().

959  {
960  global $DIC;
961 
962  $ilUser = $DIC['ilUser'];
963 
964  // we are setting the flag and ending the session in the same step
965 
966  $ilUser->activateDeletionFlag();
967 
968  // see ilStartupGUI::showLogout()
970  $GLOBALS['DIC']['ilAuthSession']->logout();
971 
972  ilUtil::redirect("login.php?target=usr_" . md5("usrdelown"));
973  }
global $DIC
Definition: saml.php:7
const SESSION_CLOSE_USER
$ilUser
Definition: imgupload.php:18
static setClosingContext($a_context)
set closing context (for statistics)
static redirect($a_script)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ executeCommand()

ilPersonalSettingsGUI::executeCommand ( )

execute command

Definition at line 51 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilSetting, $ilUser, allowPasswordChange(), ilMailGlobalServices\getMailObjectRefId(), and setHeader().

52  {
53  global $DIC;
54 
55  $next_class = $this->ctrl->getNextClass();
56 
57  switch ($next_class) {
58  case 'ilmailoptionsgui':
59  require_once 'Services/Mail/classes/class.ilMailGlobalServices.php';
60  if (!$DIC->rbac()->system()->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
61  $this->ilias->raiseError($DIC->language()->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
62  }
63 
64  $this->__initSubTabs('showMailOptions');
65  $DIC->tabs()->activateTab('mail_settings');
66  $this->setHeader();
67 
68  require_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
69  $this->ctrl->forwardCommand(new ilMailOptionsGUI());
70  break;
71 
72  case 'ilpersonalchatsettingsformgui':
73  $this->__initSubTabs($this->ctrl->getCmd());
74  $this->setHeader();
75 
76  require_once 'Modules/Chatroom/classes/class.ilPersonalChatSettingsFormGUI.php';
77  $chatSettingsGui = new ilPersonalChatSettingsFormGUI();
78  $this->ctrl->forwardCommand($chatSettingsGui);
79  break;
80 
81  default:
82  $cmd = $this->ctrl->getCmd("showGeneralSettings");
83  $this->$cmd();
84  break;
85  }
86  return true;
87  }
global $DIC
Definition: saml.php:7
redirection script todo: (a better solution should control the processing via a xml file) ...
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
Class ilPersonalChatSettingsFormGUI ilPersonalChatSettingsFormGUI: ilPersonalSettingsGUI.
+ Here is the call graph for this function:

◆ initGeneralSettingsForm()

ilPersonalSettingsGUI::initGeneralSettingsForm ( )

Init general settings form.

Definition at line 466 of file class.ilPersonalSettingsGUI.php.

References $default, $DIC, $ilSetting, $ilUser, $languages, $lng, PHPMailer\PHPMailer\$options, $si, $style, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilSystemStyleSettings\_lookupActivatedStyle(), ilLanguage\_lookupEntry(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilCharSelectorConfig\CONTEXT_USER, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilBuddySystem\getInstance(), ilUserUtil\getPersonalStartingObject(), ilUserUtil\getPersonalStartingPoint(), ilUserUtil\getPossibleStartingPoints(), ilSession\getSessionExpireValue(), ilUserUtil\hasPersonalStartingPoint(), ilUserUtil\hasPersonalStartPointPref(), ilSessionReminder\MIN_LEAD_TIME, ilDatePresentation\secondsToString(), ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), settings(), ilRadioOption\setValue(), ilUserUtil\START_REPOSITORY_OBJ, ilSessionReminder\SUGGESTED_LEAD_TIME, ilCalendarSettings\TIME_FORMAT_12, ilCalendarSettings\TIME_FORMAT_24, and userSettingVisible().

Referenced by saveGeneralSettings(), and showGeneralSettings().

467  {
468  global $DIC;
469 
470  $lng = $DIC['lng'];
471  $ilUser = $DIC['ilUser'];
472  $styleDefinition = $DIC['styleDefinition'];
473  $ilSetting = $DIC['ilSetting'];
474 
475 
476  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
477  $this->form = new ilPropertyFormGUI();
478 
479  // language
480  if ($this->userSettingVisible("language")) {
481  $languages = $this->lng->getInstalledLanguages();
482  $options = array();
483  foreach ($languages as $lang_key) {
484  $options[$lang_key] = ilLanguage::_lookupEntry($lang_key, "meta", "meta_l_" . $lang_key);
485  }
486 
487  $si = new ilSelectInputGUI($this->lng->txt("language"), "language");
488  $si->setOptions($options);
489  $si->setValue($ilUser->getLanguage());
490  $si->setDisabled($ilSetting->get("usr_settings_disable_language"));
491  $this->form->addItem($si);
492  }
493 
494  // skin/style
495  if ($this->userSettingVisible("skin_style")) {
496  $skins = $styleDefinition->getAllSkins();
497  if (is_array($skins)) {
498  $si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
499 
500  $options = array();
501  foreach ($skins as $skin) {
502  foreach ($skin->getStyles() as $style) {
503  include_once("./Services/Style/System/classes/class.ilSystemStyleSettings.php");
504  if (!ilSystemStyleSettings::_lookupActivatedStyle($skin->getId(), $style->getId()) || $style->isSubstyle()) {
505  continue;
506  }
507 
508  $options[$skin->getId() . ":" . $style->getId()] = $skin->getName() . " / " . $style->getName();
509  }
510  }
511  $si->setOptions($options);
512  $si->setValue($ilUser->skin . ":" . $ilUser->prefs["style"]);
513  $si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
514  $this->form->addItem($si);
515  }
516  }
517 
518  // screen reader optimization
519  if ($this->userSettingVisible("screen_reader_optimization")) {
520  $cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
521  $cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
522  $cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
523  $cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
524  $this->form->addItem($cb);
525  }
526 
527  // help tooltips
528  $module_id = (int) $ilSetting->get("help_module");
529  if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
530  $ilSetting->get("help_mode") != "1") {
531  $this->lng->loadLanguageModule("help");
532  $cb = new ilCheckboxInputGUI($this->lng->txt("help_toggle_tooltips"), "help_tooltips");
533  $cb->setChecked(!$ilUser->prefs["hide_help_tt"]);
534  $cb->setInfo($this->lng->txt("help_toggle_tooltips_info"));
535  $this->form->addItem($cb);
536  }
537 
538  // hits per page
539  if ($this->userSettingVisible("hits_per_page")) {
540  $si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
541 
542  $hits_options = array(10,15,20,30,40,50,100,9999);
543  $options = array();
544 
545  foreach ($hits_options as $hits_option) {
546  $hstr = ($hits_option == 9999)
547  ? $this->lng->txt("no_limit")
548  : $hits_option;
549  $options[$hits_option] = $hstr;
550  }
551  $si->setOptions($options);
552  $si->setValue($ilUser->prefs["hits_per_page"]);
553  $si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
554  $this->form->addItem($si);
555  }
556 
557  // Users Online
558  /*
559  if ($this->userSettingVisible("show_users_online"))
560  {
561  $si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
562 
563  $options = array(
564  "y" => $this->lng->txt("users_online_show_y"),
565  "associated" => $this->lng->txt("users_online_show_associated"),
566  "n" => $this->lng->txt("users_online_show_n"));
567  $si->setOptions($options);
568  $si->setValue($ilUser->prefs["show_users_online"]);
569  $si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
570  $this->form->addItem($si);
571  }*/
572 
573  // Store last visited
574  $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
575  $options = array(
576  0 => $this->lng->txt("user_lv_keep_entries"),
577  1 => $this->lng->txt("user_lv_keep_only_for_session"),
578  2 => $this->lng->txt("user_lv_do_not_store"));
579  $lv->setOptions($options);
580  $lv->setValue((int) $ilUser->prefs["store_last_visited"]);
581  $this->form->addItem($lv);
582 
583  // hide_own_online_status
584  $awrn_set = new ilSetting("awrn");
585  if ($awrn_set->get("awrn_enabled", false) && $this->userSettingVisible("hide_own_online_status")) {
586  $this->lng->loadLanguageModule("awrn");
587 
588  $default = ($this->settings['hide_own_online_status'] == "n")
589  ? $this->lng->txt("user_awrn_show")
590  : $this->lng->txt("user_awrn_hide");
591 
592  $options = array(
593  "" => $this->lng->txt("user_awrn_default")." (".$default.")",
594  "n" => $this->lng->txt("user_awrn_show"),
595  "y" => $this->lng->txt("user_awrn_hide"));
596  $si = new ilSelectInputGUI($lng->txt("awrn_user_show"), "hide_own_online_status");
597  $si->setOptions($options);
598  $si->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
599  $si->setValue($ilUser->prefs["hide_own_online_status"]);
600  $si->setInfo($lng->txt("awrn_hide_from_awareness_info"));
601  $this->form->addItem($si);
602 
603  $cb = new ilCheckboxInputGUI($this->lng->txt("awrn_hide_from_awareness"), "hide_own_online_status");
604  $cb->setInfo($this->lng->txt("awrn_hide_from_awareness_info"));
605  $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
606  $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
607  //$this->form->addItem($cb);
608  }
609 
610  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
611  if (ilBuddySystem::getInstance()->isEnabled() && $this->userSettingVisible('bs_allow_to_contact_me')) {
612  $this->lng->loadLanguageModule('buddysystem');
613  $allow_to_contact_be = new ilCheckboxInputGUI($this->lng->txt('buddy_allow_to_contact_me'), 'bs_allow_to_contact_me');
614  $allow_to_contact_be->setInfo($this->lng->txt('buddy_allow_to_contact_me_info'));
615  $allow_to_contact_be->setChecked($ilUser->prefs['bs_allow_to_contact_me'] == 'y');
616  $allow_to_contact_be->setDisabled($ilSetting->get('usr_settings_disable_bs_allow_to_contact_me'));
617  $this->form->addItem($allow_to_contact_be);
618  }
619 
620  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
621  if (ilSessionReminder::isGloballyActivated()) {
622  $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
623  $cb->setInfo($this->lng->txt('session_reminder_info'));
624  $cb->setValue(1);
625  $cb->setChecked((int) $ilUser->getPref('session_reminder_enabled'));
626 
628  $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
629  $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilDatePresentation::secondsToString($expires, true)));
630 
632  $max_value = max($min_value, ((int) $expires / 60) - 1);
633 
634  $current_user_value = $ilUser->getPref('session_reminder_lead_time');
635  if ($current_user_value < $min_value ||
636  $current_user_value > $max_value) {
637  $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
638  }
639  $value = min(
640  max(
641  $min_value,
642  $current_user_value
643  ),
644  $max_value
645  );
646 
647  $lead_time_gui->setValue($value);
648  $lead_time_gui->setSize(3);
649  $lead_time_gui->setMinValue($min_value);
650  $lead_time_gui->setMaxValue($max_value);
651  $cb->addSubItem($lead_time_gui);
652 
653  $this->form->addItem($cb);
654  }
655 
656  // calendar settings (copied here to be reachable when calendar is inactive)
657  // they cannot be hidden/deactivated
658 
659  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
660  include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
661  $lng->loadLanguageModule("dateplaner");
662  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
663 
664  $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'), 'timezone');
666  $select->setInfo($lng->txt('cal_timezone_info'));
667  $select->setValue($user_settings->getTimeZone());
668  $this->form->addItem($select);
669 
670  $year = date("Y");
671  $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'), 'date_format');
672  $select->setOptions(array(
673  ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year,
674  ilCalendarSettings::DATE_FORMAT_YMD => $year . "-10-31",
675  ilCalendarSettings::DATE_FORMAT_MDY => "10/31/" . $year));
676  $select->setInfo($lng->txt('cal_date_format_info'));
677  $select->setValue($user_settings->getDateFormat());
678  $this->form->addItem($select);
679 
680  $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'), 'time_format');
681  $select->setOptions(array(
684  $select->setInfo($lng->txt('cal_time_format_info'));
685  $select->setValue($user_settings->getTimeFormat());
686  $this->form->addItem($select);
687 
688 
689  // starting point
690  include_once "Services/User/classes/class.ilUserUtil.php";
692  $this->lng->loadLanguageModule("administration");
693  $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
694  $si->setRequired(true);
695  $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
696  $def_opt = new ilRadioOption($this->lng->txt("adm_user_starting_point_inherit"), 0);
697  $def_opt->setInfo($this->lng->txt("adm_user_starting_point_inherit_info"));
698  $si->addOption($def_opt);
699  foreach (ilUserUtil::getPossibleStartingPoints() as $value => $caption) {
700  $si->addOption(new ilRadioOption($caption, $value));
701  }
704  : 0);
705  $this->form->addItem($si);
706 
707  // starting point: repository object
708  $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
709  $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
710  $repobj_id->setInfo($lng->txt("adm_user_starting_point_ref_id_info"));
711  $repobj_id->setRequired(true);
712  $repobj_id->setSize(5);
713  if ($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ) {
714  $start_ref_id = ilUserUtil::getPersonalStartingObject();
715  $repobj_id->setValue($start_ref_id);
716  if ($start_ref_id) {
717  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
718  if ($start_obj_id) {
719  $repobj_id->setInfo($lng->txt("obj_" . ilObject::_lookupType($start_obj_id)) .
720  ": " . ilObject::_lookupTitle($start_obj_id));
721  }
722  }
723  }
724  $repobj->addSubItem($repobj_id);
725  $si->addOption($repobj);
726  }
727 
728  // selector for unicode characters
729  global $DIC;
730 
731  $ilSetting = $DIC['ilSetting'];
732  if ($ilSetting->get('char_selector_availability') > 0) {
733  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
735  $char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));
736  $char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));
737  $char_selector->addFormProperties($this->form);
738  $char_selector->setFormValues($this->form);
739  }
740 
741  $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
742  $this->form->setTitle($lng->txt("general_settings"));
743  $this->form->setFormAction($this->ctrl->getFormAction($this));
744  }
This class represents an option in a radio group.
$style
Definition: example_012.php:70
settings()
Definition: settings.php:2
static hasPersonalStartPointPref()
Did user set any personal starting point (yet)?
This class represents a selection list property in a property form.
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
This shows a character selector.
static _getInstanceByUserId($a_user_id)
get singleton instance
static getPersonalStartingPoint()
Get current personal starting point.
This class represents a checkbox property in a property form.
static _lookupTitle($a_id)
lookup object title
static _lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
static _lookupEntry($a_lang_key, $a_mod, $a_id)
static _getShortTimeZoneList()
get short timezone list
setInfo($a_info)
Set Info.
static hasPersonalStartingPoint()
Can starting point be personalized?
userSettingVisible($setting)
Returns TRUE if user setting is visible, FALSE otherwise.
static getPossibleStartingPoints($a_force_all=false)
Get all valid starting points.
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
setValue($a_value)
Set Value.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
This class represents a number property in a property form.
static _lookupObjId($a_id)
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
static _lookupType($a_id, $a_reference=false)
lookup object type
$default
Definition: build.php:20
global $ilSetting
Definition: privfeed.php:17
const START_REPOSITORY_OBJ
$languages
Definition: cssgen2.php:34
static getPersonalStartingObject()
Get ref id of personal starting object.
static getSessionExpireValue()
Returns the session expiration value.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPasswordForm()

ilPersonalSettingsGUI::initPasswordForm ( )

Init password form.

Parameters
int$a_modeEdit Mode

Definition at line 222 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilSetting, $ilUser, $lng, ilDAVActivationChecker\_isActive(), allowPasswordChange(), AUTH_CAS, AUTH_LOCAL, AUTH_SHIBBOLETH, ilUtil\getPasswordRequirementsInfo(), and ilFormPropertyGUI\setInfo().

Referenced by savePassword(), and showPassword().

223  {
224  global $DIC;
225 
226  $lng = $DIC['lng'];
227  $ilUser = $DIC['ilUser'];
228  $ilSetting = $DIC['ilSetting'];
229 
230  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
231  $this->form = new ilPropertyFormGUI();
232 
233  // Check whether password change is allowed
234  if ($this->allowPasswordChange()) {
235  // The current password needs to be checked for verification
236  // unless the user uses Shibboleth authentication with additional
237  // local authentication for WebDAV.
238  //if (
239  // ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local"))
240  //)
241  $pw_info_set = false;
242  if ($ilUser->getAuthMode(true) == AUTH_LOCAL) {
243  // current password
244  $cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password");
246  $cpass->setRetype(false);
247  $cpass->setSkipSyntaxCheck(true);
248 
249  $pw_info_set = true;
250 
251  // only if a password exists.
252  if ($ilUser->getPasswd()) {
253  $cpass->setRequired(true);
254  }
255  $this->form->addItem($cpass);
256  }
257 
258  // new password
259  $ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password");
260  if($pw_info_set === false) {
262  }
263  $ipass->setRequired(true);
264 
265  $this->form->addItem($ipass);
266  $this->form->addCommandButton("savePassword", $lng->txt("save"));
267 
268  switch ($ilUser->getAuthMode(true)) {
269  case AUTH_LOCAL:
270  $this->form->setTitle($lng->txt("chg_password"));
271  break;
272 
273  case AUTH_SHIBBOLETH:
274  case AUTH_CAS:
275  require_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
277  $this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password"));
278  } else {
279  $this->form->setTitle($lng->txt("chg_ilias_password"));
280  }
281  break;
282  default:
283  $this->form->setTitle($lng->txt("chg_ilias_password"));
284  break;
285  }
286  $this->form->setFormAction($this->ctrl->getFormAction($this));
287  }
288  }
This class represents a property form user interface.
global $DIC
Definition: saml.php:7
const AUTH_CAS
const AUTH_SHIBBOLETH
static _isActive()
Static getter.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
setInfo($a_info)
Set Information Text.
This class represents a password property in a property form.
$ilUser
Definition: imgupload.php:18
const AUTH_LOCAL
allowPasswordChange()
Check, whether password change is allowed for user.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGeneralSettings()

ilPersonalSettingsGUI::saveGeneralSettings ( )

Save general settings.

Definition at line 749 of file class.ilPersonalSettingsGUI.php.

References $_POST, $DIC, $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), ilCharSelectorConfig\CONTEXT_USER, ilBuddySystem\getInstance(), ilUserUtil\hasPersonalStartingPoint(), initGeneralSettingsForm(), ilUserUtil\setPersonalStartingPoint(), showGeneralSettings(), ilUtil\stripSlashes(), and workWithUserSetting().

750  {
751  global $DIC;
752 
753  $tpl = $DIC['tpl'];
754  $lng = $DIC['lng'];
755  $ilCtrl = $DIC['ilCtrl'];
756  $ilUser = $DIC['ilUser'];
757  $ilSetting = $DIC->settings();
758 
759  $this->initGeneralSettingsForm();
760  if ($this->form->checkInput()) {
761  if ($this->workWithUserSetting("skin_style")) {
762  //set user skin and style
763  if ($_POST["skin_style"] != "") {
764  $sknst = explode(":", $_POST["skin_style"]);
765 
766  if ($ilUser->getPref("style") != $sknst[1] ||
767  $ilUser->getPref("skin") != $sknst[0]) {
768  $ilUser->setPref("skin", $sknst[0]);
769  $ilUser->setPref("style", $sknst[1]);
770  }
771  }
772  }
773 
774  // language
775  if ($this->workWithUserSetting("language")) {
776  $ilUser->setLanguage($_POST["language"]);
777  }
778 
779  // hits per page
780  if ($this->workWithUserSetting("hits_per_page")) {
781  if ($_POST["hits_per_page"] != "") {
782  $ilUser->setPref("hits_per_page", $_POST["hits_per_page"]);
783  }
784  }
785 
786  // help tooltips
787  $module_id = (int) $ilSetting->get("help_module");
788  if ((OH_REF_ID > 0 || $module_id > 0) && $ilUser->getLanguage() == "de" &&
789  $ilSetting->get("help_mode") != "1") {
790  $ilUser->setPref("hide_help_tt", (int) !$_POST["help_tooltips"]);
791  }
792 
793  // set show users online
794  /*
795  if ($this->workWithUserSetting("show_users_online"))
796  {
797  $ilUser->setPref("show_users_online", $_POST["show_users_online"]);
798  }*/
799 
800  // store last visited?
801  global $DIC;
802 
803  $ilNavigationHistory = $DIC['ilNavigationHistory'];
804  $ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
805  if ((int) $_POST["store_last_visited"] > 0) {
806  $ilNavigationHistory->deleteDBEntries();
807  if ((int) $_POST["store_last_visited"] == 2) {
808  $ilNavigationHistory->deleteSessionEntries();
809  }
810  }
811 
812  // set hide own online_status
813  if ($this->workWithUserSetting("hide_own_online_status")) {
814  /*if ($_POST["hide_own_online_status"] == 1) {
815  $ilUser->setPref("hide_own_online_status", "y");
816  } else {
817  $ilUser->setPref("hide_own_online_status", "n");
818  }*/
819  $ilUser->setPref("hide_own_online_status", ilUtil::stripSlashes($_POST["hide_own_online_status"]));
820  }
821 
822  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
823  if (ilBuddySystem::getInstance()->isEnabled() && $this->workWithUserSetting('bs_allow_to_contact_me')) {
824  if (isset($_POST['bs_allow_to_contact_me']) && $_POST['bs_allow_to_contact_me'] == 1) {
825  $ilUser->setPref('bs_allow_to_contact_me', 'y');
826  } else {
827  $ilUser->setPref('bs_allow_to_contact_me', 'n');
828  }
829  }
830 
831  // set show users online
832  if ($this->workWithUserSetting("screen_reader_optimization")) {
833  $ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
834  }
835 
836  // session reminder
837  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
838  if (ilSessionReminder::isGloballyActivated()) {
839  $ilUser->setPref('session_reminder_enabled', (int) $this->form->getInput('session_reminder_enabled'));
840  $ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
841  }
842 
843  // starting point
844  include_once "Services/User/classes/class.ilUserUtil.php";
847  $this->form->getInput('usr_start'),
848  $this->form->getInput('usr_start_ref_id')
849  );
850  }
851 
852  // selector for unicode characters
853  global $DIC;
854 
855  $ilSetting = $DIC['ilSetting'];
856  if ($ilSetting->get('char_selector_availability') > 0) {
857  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
859  $char_selector->getFormValues($this->form);
860  $ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
861  $ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
862  }
863 
864  $ilUser->update();
865 
866  // calendar settings
867  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
868  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
869  $user_settings->setTimeZone($this->form->getInput("timezone"));
870  $user_settings->setDateFormat((int) $this->form->getInput("date_format"));
871  $user_settings->setTimeFormat((int) $this->form->getInput("time_format"));
872  $user_settings->save();
873 
874  ilUtil::sendSuccess($lng->txtlng("common", "msg_obj_modified", $ilUser->getLanguage()), true);
875  $ilCtrl->redirect($this, "showGeneralSettings");
876  }
877 
878  $this->form->setValuesByPost();
879  $this->showGeneralSettings(true);
880  }
global $DIC
Definition: saml.php:7
This shows a character selector.
static _getInstanceByUserId($a_user_id)
get singleton instance
initGeneralSettingsForm()
Init general settings form.
static hasPersonalStartingPoint()
Can starting point be personalized?
global $ilCtrl
Definition: ilias.php:18
workWithUserSetting($setting)
Returns TRUE if working with the given user setting is allowed, FALSE otherwise.
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
showGeneralSettings($a_no_init=false)
General settings form.
global $ilSetting
Definition: privfeed.php:17
$_POST["username"]
static setPersonalStartingPoint($a_value, $a_ref_id=null)
Set personal starting point setting.
+ Here is the call graph for this function:

◆ savePassword()

ilPersonalSettingsGUI::savePassword ( )

Save password form.

Definition at line 315 of file class.ilPersonalSettingsGUI.php.

References $_POST, $DIC, $ilCtrl, $ilSetting, $ilUser, $lng, $target, $tpl, allowPasswordChange(), AUTH_LOCAL, ilSession\get(), ilUserPasswordManager\getInstance(), initPasswordForm(), ilUtil\isPassword(), ilUtil\isPasswordValidForUserContext(), ilUtil\redirect(), ilUtil\sendFailure(), ilSession\set(), showPassword(), and ilUtil\stripSlashes().

316  {
317  global $DIC;
318 
319  $tpl = $DIC['tpl'];
320  $lng = $DIC['lng'];
321  $ilCtrl = $DIC['ilCtrl'];
322  $ilUser = $DIC['ilUser'];
323  $ilSetting = $DIC['ilSetting'];
324 
325  // normally we should not end up here
326  if (!$this->allowPasswordChange()) {
327  $ilCtrl->redirect($this, "showPersonalData");
328  return;
329  }
330 
331  $this->initPasswordForm();
332  if ($this->form->checkInput()) {
333  $cp = $this->form->getItemByPostVar("current_password");
334  $np = $this->form->getItemByPostVar("new_password");
335  $error = false;
336 
337  // The old password needs to be checked for verification
338  // unless the user uses Shibboleth authentication with additional
339  // local authentication for WebDAV.
340  #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
341  if ($ilUser->getAuthMode(true) == AUTH_LOCAL) {
342  require_once 'Services/User/classes/class.ilUserPasswordManager.php';
343  if (!ilUserPasswordManager::getInstance()->verifyPassword($ilUser, ilUtil::stripSlashes($_POST['current_password']))) {
344  $error = true;
345  $cp->setAlert($this->lng->txt('passwd_wrong'));
346  }
347  }
348 
349  if (!ilUtil::isPassword($_POST["new_password"], $custom_error)) {
350  $error = true;
351  if ($custom_error != '') {
352  $np->setAlert($custom_error);
353  } else {
354  $np->setAlert($this->lng->txt("passwd_invalid"));
355  }
356  }
357  $error_lng_var = '';
358  if (!ilUtil::isPasswordValidForUserContext($_POST["new_password"], $ilUser, $error_lng_var)) {
359  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
360  $np->setAlert($this->lng->txt($error_lng_var));
361  $error = true;
362  }
363  if (
364  ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
365  $_POST["current_password"] == $_POST["new_password"]) {
366  $error = true;
367  $np->setAlert($this->lng->txt("new_pass_equals_old_pass"));
368  }
369 
370  if (!$error) {
371  $ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]);
372  if ($_POST["current_password"] != $_POST["new_password"]) {
373  $ilUser->setLastPasswordChangeToNow();
374  }
375 
376  if (ilSession::get('orig_request_target')) {
377  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
378  $target = ilSession::get('orig_request_target');
379  ilSession::set('orig_request_target', '');
380  ilUtil::redirect($target);
381  } else {
382  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
383  $this->showPassword(true, true);
384  return;
385  }
386  }
387  }
388  $this->form->setValuesByPost();
389  $this->showPassword(true);
390  }
global $DIC
Definition: saml.php:7
static isPasswordValidForUserContext($clear_text_password, $user, &$error_language_variable=null)
static get($a_var)
Get a value.
static set($a_var, $a_val)
Set a value.
showPassword($a_no_init=false, $hide_form=false)
static isPassword($a_passwd, &$customError=null)
validates a password public
global $ilCtrl
Definition: ilias.php:18
initPasswordForm()
Init password form.
$ilUser
Definition: imgupload.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const AUTH_LOCAL
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
allowPasswordChange()
Check, whether password change is allowed for user.
global $ilSetting
Definition: privfeed.php:17
static redirect($a_script)
$target
Definition: test.php:19
$_POST["username"]
static getInstance()
Single method to reduce footprint (included files, created instances)
+ Here is the call graph for this function:

◆ setHeader()

ilPersonalSettingsGUI::setHeader ( )

Set header.

Definition at line 173 of file class.ilPersonalSettingsGUI.php.

Referenced by deleteOwnAccount1(), deleteOwnAccount2(), deleteOwnAccount3(), executeCommand(), showGeneralSettings(), and showPassword().

174  {
175  $this->tpl->setVariable('HEADER', $this->lng->txt('personal_settings'));
176  }
+ Here is the caller graph for this function:

◆ showGeneralSettings()

ilPersonalSettingsGUI::showGeneralSettings (   $a_no_init = false)

General settings form.

Definition at line 444 of file class.ilPersonalSettingsGUI.php.

References $DIC, initGeneralSettingsForm(), and setHeader().

Referenced by saveGeneralSettings().

445  {
446  global $DIC;
447 
448  $ilTabs = $DIC['ilTabs'];
449 
450  $this->__initSubTabs("showPersonalData");
451  $ilTabs->activateTab("general_settings");
452 
453  $this->setHeader();
454 
455  if (!$a_no_init) {
456  $this->initGeneralSettingsForm();
457  }
458  $this->tpl->setContent($this->form->getHTML());
459  $this->tpl->show();
460  }
global $DIC
Definition: saml.php:7
initGeneralSettingsForm()
Init general settings form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPassword()

ilPersonalSettingsGUI::showPassword (   $a_no_init = false,
  $hide_form = false 
)
Parameters
bool$a_no_init
bool$hide_form

Definition at line 187 of file class.ilPersonalSettingsGUI.php.

References $DIC, $ilUser, initPasswordForm(), ilUtil\sendInfo(), and setHeader().

Referenced by savePassword().

188  {
189  global $DIC;
190 
191  $ilTabs = $DIC['ilTabs'];
192  $ilUser = $DIC['ilUser'];
193 
194  $this->__initSubTabs("showPersonalData");
195  $ilTabs->activateTab("password");
196 
197  $this->setHeader();
198  // check whether password of user have to be changed
199  // due to first login or password of user is expired
200  if ($ilUser->isPasswordChangeDemanded()) {
202  $this->lng->txt('password_change_on_first_login_demand')
203  );
204  } elseif ($ilUser->isPasswordExpired()) {
205  $msg = $this->lng->txt('password_expired');
206  $password_age = $ilUser->getPasswordAge();
207  ilUtil::sendInfo(sprintf($msg, $password_age));
208  }
209 
210  if (!$a_no_init && !$hide_form) {
211  $this->initPasswordForm();
212  }
213  $this->tpl->setContent(!$hide_form ? $this->form->getHTML() : '');
214  $this->tpl->show();
215  }
global $DIC
Definition: saml.php:7
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initPasswordForm()
Init password form.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userSettingEnabled()

ilPersonalSettingsGUI::userSettingEnabled (   $setting)

Returns TRUE if user setting is enabled, FALSE otherwise.

Definition at line 432 of file class.ilPersonalSettingsGUI.php.

References $result, and settings().

433  {
434  $result = true;
435  if ($this->settings["usr_settings_disable_" . $setting] == 1) {
436  $result = false;
437  }
438  return $result;
439  }
settings()
Definition: settings.php:2
$result
+ Here is the call graph for this function:

◆ userSettingVisible()

ilPersonalSettingsGUI::userSettingVisible (   $setting)

Returns TRUE if user setting is visible, FALSE otherwise.

Definition at line 418 of file class.ilPersonalSettingsGUI.php.

References $result, and settings().

Referenced by initGeneralSettingsForm().

419  {
420  $result = true;
421  if (isset($this->settings["usr_settings_hide_" . $setting]) &&
422  $this->settings["usr_settings_hide_" . $setting] == 1) {
423  $result = false;
424  }
425  return $result;
426  }
settings()
Definition: settings.php:2
$result
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ workWithUserSetting()

ilPersonalSettingsGUI::workWithUserSetting (   $setting)

Returns TRUE if working with the given user setting is allowed, FALSE otherwise.

Definition at line 402 of file class.ilPersonalSettingsGUI.php.

References $result, and settings().

Referenced by saveGeneralSettings().

403  {
404  $result = true;
405  if ($this->settings["usr_settings_hide_" . $setting] == 1) {
406  $result = false;
407  }
408  if ($this->settings["usr_settings_disable_" . $setting] == 1) {
409  $result = false;
410  }
411  return $result;
412  }
settings()
Definition: settings.php:2
$result
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilPersonalSettingsGUI::$ctrl

Definition at line 16 of file class.ilPersonalSettingsGUI.php.

◆ $ilias

ilPersonalSettingsGUI::$ilias

Definition at line 15 of file class.ilPersonalSettingsGUI.php.

Referenced by __construct().

◆ $lng

ilPersonalSettingsGUI::$lng

◆ $tpl

ilPersonalSettingsGUI::$tpl

Definition at line 13 of file class.ilPersonalSettingsGUI.php.

Referenced by __construct(), saveGeneralSettings(), and savePassword().


The documentation for this class was generated from the following file: