ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 

Private Member Functions

 initMailOptionsForm ()
 Initialises the mail options form. More...
 
 setMailOptionsValuesByDB ()
 Fetches data from model and loads this data into form. 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:

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 $ilCtrl, $ilias, $lng, $tpl, ilUserDefinedFields\_getInstance(), and settings().

22  {
23  global $ilias, $tpl, $lng, $rbacsystem, $ilCtrl;
24 
25  include_once './Services/User/classes/class.ilUserDefinedFields.php';
26  $this->user_defined_fields =& ilUserDefinedFields::_getInstance();
27 
28  $this->tpl =& $tpl;
29  $this->lng =& $lng;
30  $this->ilias =& $ilias;
31  $this->ctrl =& $ilCtrl;
32  $this->settings = $ilias->getAllSettings();
33 // $lng->loadLanguageModule("jsmath");
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");
40  }
static _getInstance()
Get instance.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ abortDeleteOwnAccount()

ilPersonalSettingsGUI::abortDeleteOwnAccount ( )
protected

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

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

1068  {
1069  global $ilCtrl, $ilUser;
1070 
1071  $ilUser->removeDeletionFlag();
1072 
1073  ilUtil::sendInfo($this->lng->txt("user_delete_own_account_aborted"), true);
1074  $ilCtrl->redirect($this, "showGeneralSettings");
1075  }
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 423 of file class.ilPersonalSettingsGUI.php.

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

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

424  {
425  global $ilUser;
426 
427  if (\ilSession::get('used_external_auth')) {
428  return false;
429  }
430 
431  $status = ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));
432  if ($status) {
433  return true;
434  }
435 
436  return \ilAuthUtils::isPasswordModificationHidden() && ($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired());
437  }
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 1016 of file class.ilPersonalSettingsGUI.php.

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

1017  {
1018  global $ilTabs, $ilToolbar, $ilUser, $ilSetting;
1019 
1020  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1021  $ilUser->getId() == SYSTEM_USER_ID)
1022  {
1023  $this->ctrl->redirect($this, "showGeneralSettings");
1024  }
1025 
1026  // too make sure
1027  $ilUser->removeDeletionFlag();
1028 
1029  $this->setHeader();
1030  $this->__initSubTabs("deleteOwnAccount");
1031  $ilTabs->activateTab("delacc");
1032 
1033  ilUtil::sendInfo($this->lng->txt('user_delete_own_account_info'));
1034  $ilToolbar->addButton($this->lng->txt('btn_next'),
1035  $this->ctrl->getLinkTarget($this, 'deleteOwnAccount2'));
1036 
1037  $this->tpl->show();
1038  }
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 1043 of file class.ilPersonalSettingsGUI.php.

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

1044  {
1045  global $ilTabs, $ilUser, $ilSetting;
1046 
1047  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1048  $ilUser->getId() == SYSTEM_USER_ID)
1049  {
1050  $this->ctrl->redirect($this, "showGeneralSettings");
1051  }
1052 
1053  $this->setHeader();
1054  $this->__initSubTabs("deleteOwnAccount");
1055  $ilTabs->activateTab("delacc");
1056 
1057  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1058  $cgui = new ilConfirmationGUI();
1059  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_logout_confirmation'));
1060  $cgui->setFormAction($this->ctrl->getFormAction($this));
1061  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
1062  $cgui->setConfirm($this->lng->txt("user_delete_own_account_logout_button"), "deleteOwnAccountLogout");
1063  $this->tpl->setContent($cgui->getHTML());
1064  $this->tpl->show();
1065  }
$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 1095 of file class.ilPersonalSettingsGUI.php.

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

1096  {
1097  global $ilTabs, $ilUser, $ilSetting;
1098 
1099  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1100  $ilUser->getId() == SYSTEM_USER_ID ||
1101  !$ilUser->hasDeletionFlag())
1102  {
1103  $this->ctrl->redirect($this, "showGeneralSettings");
1104  }
1105 
1106  $this->setHeader();
1107  $this->__initSubTabs("deleteOwnAccount");
1108  $ilTabs->activateTab("delacc");
1109 
1110  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1111  $cgui = new ilConfirmationGUI();
1112  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_final_confirmation'));
1113  $cgui->setFormAction($this->ctrl->getFormAction($this));
1114  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
1115  $cgui->setConfirm($this->lng->txt("confirm"), "deleteOwnAccount4");
1116  $this->tpl->setContent($cgui->getHTML());
1117  $this->tpl->show();
1118  }
$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 1123 of file class.ilPersonalSettingsGUI.php.

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

1124  {
1125  global $ilUser, $ilAuth, $ilSetting, $ilLog;
1126 
1127  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1128  $ilUser->getId() == SYSTEM_USER_ID ||
1129  !$ilUser->hasDeletionFlag())
1130  {
1131  $this->ctrl->redirect($this, "showGeneralSettings");
1132  }
1133 
1134  // build notification
1135 
1136  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1137  $ntf = new ilSystemNotification();
1138  $ntf->setLangModules(array("user"));
1139  $ntf->addAdditionalInfo("profile", $ilUser->getProfileAsString($this->lng), true);
1140 
1141  // mail message
1143  $ntf->setIntroductionDirect(
1144  sprintf($this->lng->txt("user_delete_own_account_email_body"),
1145  $ilUser->getLogin(),
1146  ILIAS_HTTP_PATH,
1148 
1149  $message = $ntf->composeAndGetMessage($ilUser->getId(), null, null, true);
1150  $subject = $this->lng->txt("user_delete_own_account_email_subject");
1151 
1152 
1153  // send notification
1154 
1155  include_once "Services/Mail/classes/class.ilMail.php";
1156  $mail = new ilMail(ANONYMOUS_USER_ID);
1157 
1158  $user_email = $ilUser->getEmail();
1159  $admin_mail = $ilSetting->get("user_delete_own_account_email");
1160 
1161  // to user, admin as bcc
1162  if($user_email)
1163  {
1164  $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
1165  }
1166  // admin only
1167  else if($admin_mail)
1168  {
1169  $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
1170  }
1171 
1172  $ilLog->write("Account deleted: ".$ilUser->getLogin()." (".$ilUser->getId().")");
1173 
1174  $ilUser->delete();
1175 
1176  // terminate session
1177  $GLOBALS['DIC']['ilAuthSession']->logout();
1178  ilUtil::redirect("login.php?accdel=1");
1179  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
This class handles base functions for mail handling.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static redirect($a_script)
http redirect to other script
Wrapper classes for system notifications.
+ Here is the call graph for this function:

◆ deleteOwnAccountLogout()

ilPersonalSettingsGUI::deleteOwnAccountLogout ( )
protected

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

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

1078  {
1079  global $ilAuth, $ilUser;
1080 
1081  // we are setting the flag and ending the session in the same step
1082 
1083  $ilUser->activateDeletionFlag();
1084 
1085  // see ilStartupGUI::showLogout()
1087  $GLOBALS['DIC']['ilAuthSession']->logout();
1088 
1089  ilUtil::redirect("login.php?target=usr_".md5("usrdelown"));
1090  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const SESSION_CLOSE_USER
$ilUser
Definition: imgupload.php:18
static setClosingContext($a_context)
set closing context (for statistics)
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ executeCommand()

ilPersonalSettingsGUI::executeCommand ( )

execute command

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

References $_POST, $cmd, $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilMailGlobalServices\getMailObjectRefId(), initMailOptionsForm(), ilUtil\sendSuccess(), setHeader(), and ilUtil\stripSlashes().

46  {
47  global $ilUser, $ilCtrl, $tpl, $ilTabs, $lng;
48 
49  $next_class = $this->ctrl->getNextClass();
50 
51  switch($next_class)
52  {
53  case 'ilpersonalchatsettingsformgui':
54  $this->__initSubTabs($this->ctrl->getCmd());
55  $this->setHeader();
56 
57  require_once 'Modules/Chatroom/classes/class.ilPersonalChatSettingsFormGUI.php';
58  $chatSettingsGui = new ilPersonalChatSettingsFormGUI();
59  $this->ctrl->forwardCommand($chatSettingsGui);
60  break;
61 
62  default:
63  $cmd = $this->ctrl->getCmd("showGeneralSettings");
64  $this->$cmd();
65  break;
66  }
67  return true;
68  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Class ilPersonalChatSettingsFormGUI ilPersonalChatSettingsFormGUI: ilPersonalSettingsGUI.
+ Here is the call graph for this function:

◆ initGeneralSettingsForm()

ilPersonalSettingsGUI::initGeneralSettingsForm ( )

Init general settings form.

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

References $ilSetting, $ilUser, $languages, $lng, $options, $si, $style, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilSystemStyleSettings\_lookupActivatedStyle(), ilLanguage\_lookupEntry(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), array, ilCharSelectorConfig\CONTEXT_USER, date, 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(), 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().

611  {
612  global $lng, $ilUser, $styleDefinition, $ilSetting;
613 
614 
615  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
616  $this->form = new ilPropertyFormGUI();
617 
618  // language
619  if ($this->userSettingVisible("language"))
620  {
621  $languages = $this->lng->getInstalledLanguages();
622  $options = array();
623  foreach($languages as $lang_key)
624  {
625  $options[$lang_key] = ilLanguage::_lookupEntry($lang_key,"meta", "meta_l_".$lang_key);
626  }
627 
628  $si = new ilSelectInputGUI($this->lng->txt("language"), "language");
629  $si->setOptions($options);
630  $si->setValue($ilUser->getLanguage());
631  $si->setDisabled($ilSetting->get("usr_settings_disable_language"));
632  $this->form->addItem($si);
633  }
634 
635  // skin/style
636  if ($this->userSettingVisible("skin_style"))
637  {
638  $skins = $styleDefinition->getAllSkins();
639  if (is_array($skins))
640  {
641  $si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
642 
643  $options = array();
644  foreach($skins as $skin)
645  {
646  foreach($skin->getStyles() as $style)
647  {
648  include_once("./Services/Style/System/classes/class.ilSystemStyleSettings.php");
649  if (!ilSystemStyleSettings::_lookupActivatedStyle($skin->getId(),$style->getId()) || $style->isSubstyle())
650  {
651  continue;
652  }
653 
654  $options[$skin->getId().":".$style->getId()] = $skin->getName()." / ".$style->getName();
655  }
656  }
657  $si->setOptions($options);
658  $si->setValue($ilUser->skin.":".$ilUser->prefs["style"]);
659  $si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
660  $this->form->addItem($si);
661  }
662  }
663 
664  // screen reader optimization
665  if ($this->userSettingVisible("screen_reader_optimization"))
666  {
667  $cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
668  $cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
669  $cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
670  $cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
671  $this->form->addItem($cb);
672  }
673 
674  // hits per page
675  if ($this->userSettingVisible("hits_per_page"))
676  {
677  $si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
678 
679  $hits_options = array(10,15,20,30,40,50,100,9999);
680  $options = array();
681 
682  foreach($hits_options as $hits_option)
683  {
684  $hstr = ($hits_option == 9999)
685  ? $this->lng->txt("no_limit")
686  : $hits_option;
687  $options[$hits_option] = $hstr;
688  }
689  $si->setOptions($options);
690  $si->setValue($ilUser->prefs["hits_per_page"]);
691  $si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
692  $this->form->addItem($si);
693  }
694 
695  // Users Online
696  /*
697  if ($this->userSettingVisible("show_users_online"))
698  {
699  $si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
700 
701  $options = array(
702  "y" => $this->lng->txt("users_online_show_y"),
703  "associated" => $this->lng->txt("users_online_show_associated"),
704  "n" => $this->lng->txt("users_online_show_n"));
705  $si->setOptions($options);
706  $si->setValue($ilUser->prefs["show_users_online"]);
707  $si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
708  $this->form->addItem($si);
709  }*/
710 
711  // Store last visited
712  $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
713  $options = array(
714  0 => $this->lng->txt("user_lv_keep_entries"),
715  1 => $this->lng->txt("user_lv_keep_only_for_session"),
716  2 => $this->lng->txt("user_lv_do_not_store"));
717  $lv->setOptions($options);
718  $lv->setValue((int) $ilUser->prefs["store_last_visited"]);
719  $this->form->addItem($lv);
720 
721  // hide_own_online_status
722  $awrn_set = new ilSetting("awrn");
723  if ($awrn_set->get("awrn_enabled", false) && $this->userSettingVisible("hide_own_online_status"))
724  {
725  $this->lng->loadLanguageModule("awrn");
726  $cb = new ilCheckboxInputGUI($this->lng->txt("awrn_hide_from_awareness"), "hide_own_online_status");
727  $cb->setInfo($this->lng->txt("awrn_hide_from_awareness_info"));
728  $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
729  $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
730  $this->form->addItem($cb);
731  }
732 
733  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
734  if(ilBuddySystem::getInstance()->isEnabled() && $this->userSettingVisible('bs_allow_to_contact_me'))
735  {
736  $this->lng->loadLanguageModule('buddysystem');
737  $allow_to_contact_be = new ilCheckboxInputGUI($this->lng->txt('buddy_allow_to_contact_me'), 'bs_allow_to_contact_me');
738  $allow_to_contact_be->setInfo($this->lng->txt('buddy_allow_to_contact_me_info'));
739  $allow_to_contact_be->setChecked($ilUser->prefs['bs_allow_to_contact_me'] == 'y');
740  $allow_to_contact_be->setDisabled($ilSetting->get('usr_settings_disable_bs_allow_to_contact_me'));
741  $this->form->addItem($allow_to_contact_be);
742  }
743 
744  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
745  if(ilSessionReminder::isGloballyActivated())
746  {
747  $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
748  $cb->setInfo($this->lng->txt('session_reminder_info'));
749  $cb->setValue(1);
750  $cb->setChecked((int)$ilUser->getPref('session_reminder_enabled'));
751 
753  $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
754  $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilDatePresentation::secondsToString($expires, true)));
755 
757  $max_value = max($min_value, ((int)$expires / 60) - 1);
758 
759  $current_user_value = $ilUser->getPref('session_reminder_lead_time');
760  if($current_user_value < $min_value ||
761  $current_user_value > $max_value)
762  {
763  $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
764  }
765  $value = min(
766  max(
767  $min_value, $current_user_value
768  ),
769  $max_value
770  );
771 
772  $lead_time_gui->setValue($value);
773  $lead_time_gui->setSize(3);
774  $lead_time_gui->setMinValue($min_value);
775  $lead_time_gui->setMaxValue($max_value);
776  $cb->addSubItem($lead_time_gui);
777 
778  $this->form->addItem($cb);
779  }
780 
781  // calendar settings (copied here to be reachable when calendar is inactive)
782  // they cannot be hidden/deactivated
783 
784  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
785  include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
786  $lng->loadLanguageModule("dateplaner");
787  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
788 
789  $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'),'timezone');
791  $select->setInfo($lng->txt('cal_timezone_info'));
792  $select->setValue($user_settings->getTimeZone());
793  $this->form->addItem($select);
794 
795  $year = date("Y");
796  $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'),'date_format');
797  $select->setOptions(array(
798  ilCalendarSettings::DATE_FORMAT_DMY => '31.10.'.$year,
799  ilCalendarSettings::DATE_FORMAT_YMD => $year."-10-31",
800  ilCalendarSettings::DATE_FORMAT_MDY => "10/31/".$year));
801  $select->setInfo($lng->txt('cal_date_format_info'));
802  $select->setValue($user_settings->getDateFormat());
803  $this->form->addItem($select);
804 
805  $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'),'time_format');
806  $select->setOptions(array(
809  $select->setInfo($lng->txt('cal_time_format_info'));
810  $select->setValue($user_settings->getTimeFormat());
811  $this->form->addItem($select);
812 
813 
814  // starting point
815  include_once "Services/User/classes/class.ilUserUtil.php";
817  {
818  $this->lng->loadLanguageModule("administration");
819  $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
820  $si->setRequired(true);
821  $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
822  $def_opt = new ilRadioOption($this->lng->txt("adm_user_starting_point_inherit"), 0);
823  $def_opt->setInfo($this->lng->txt("adm_user_starting_point_inherit_info"));
824  $si->addOption($def_opt);
825  foreach(ilUserUtil::getPossibleStartingPoints() as $value => $caption)
826  {
827  $si->addOption(new ilRadioOption($caption, $value));
828  }
831  : 0);
832  $this->form->addItem($si);
833 
834  // starting point: repository object
835  $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
836  $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
837  $repobj_id->setInfo($lng->txt("adm_user_starting_point_ref_id_info"));
838  $repobj_id->setRequired(true);
839  $repobj_id->setSize(5);
840  if($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ)
841  {
842  $start_ref_id = ilUserUtil::getPersonalStartingObject();
843  $repobj_id->setValue($start_ref_id);
844  if($start_ref_id)
845  {
846  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
847  if($start_obj_id)
848  {
849  $repobj_id->setInfo($lng->txt("obj_".ilObject::_lookupType($start_obj_id)).
850  ": ".ilObject::_lookupTitle($start_obj_id));
851  }
852  }
853  }
854  $repobj->addSubItem($repobj_id);
855  $si->addOption($repobj);
856  }
857 
858  // selector for unicode characters
859  global $ilSetting;
860  if ($ilSetting->get('char_selector_availability') > 0)
861  {
862  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
864  $char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));
865  $char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));
866  $char_selector->addFormProperties($this->form);
867  $char_selector->setFormValues($this->form);
868  }
869 
870  $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
871  $this->form->setTitle($lng->txt("general_settings"));
872  $this->form->setFormAction($this->ctrl->getFormAction($this));
873 
874  }
This class represents an option in a radio group.
ILIAS Setting Class.
$style
Definition: example_012.php:70
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.
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) ...
if(!is_array($argv)) $options
This class represents a number property in a property form.
static _lookupObjId($a_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMailOptionsForm()

ilPersonalSettingsGUI::initMailOptionsForm ( )
private

Initialises the mail options form.

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $options, $si, ilObjUser\_lookupEmail(), array, IL_MAIL_BOTH, IL_MAIL_EMAIL, IL_MAIL_LOCAL, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilTextAreaInputGUI\setRows().

Referenced by executeCommand(), and setMailOptionsValuesByDB().

138  {
139  global $ilCtrl, $ilSetting, $lng, $ilUser;
140 
141  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
142  $this->form = new ilPropertyFormGUI();
143 
144  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));
145  $this->form->setTitle($lng->txt('mail_settings'));
146 
147  // BEGIN INCOMING
148  include_once 'Services/Mail/classes/class.ilMailOptions.php';
149  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
150  {
151  $options = array(
152  IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'),
153  IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),
154  IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')
155  );
156  $si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
157  $si->setOptions($options);
158  if(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||
159  $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')
160  {
161  $si->setDisabled(true);
162  }
163  $this->form->addItem($si);
164  }
165 
166  // BEGIN LINEBREAK_OPTIONS
167  $options = array();
168  for($i = 50; $i <= 80; $i++)
169  {
170  $options[$i] = $i;
171  }
172  $si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
173  $si->setOptions($options);
174  $this->form->addItem($si);
175 
176  // BEGIN SIGNATURE
177  $ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
178  $ta->setRows(10);
179  $ta->setCols(60);
180  $this->form->addItem($ta);
181 
182  // BEGIN CRONJOB NOTIFICATION
183  if($ilSetting->get('mail_notification'))
184  {
185  $cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
186  $cb->setInfo($lng->txt('mail_cronjob_notification_info'));
187  $cb->setValue(1);
188  $this->form->addItem($cb);
189  }
190 
191  $this->form->addCommandButton('saveMailOptions', $lng->txt('save'));
192  }
const IL_MAIL_BOTH
const IL_MAIL_EMAIL
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a checkbox property in a property form.
const IL_MAIL_LOCAL
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
if(!is_array($argv)) $options
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
static _lookupEmail($a_user_id)
Lookup email.
This class represents a text area property in a property form.
+ 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 356 of file class.ilPersonalSettingsGUI.php.

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

Referenced by savePassword(), and showPassword().

357  {
358  global $lng, $ilUser, $ilSetting;
359 
360  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
361  $this->form = new ilPropertyFormGUI();
362 
363  // Check whether password change is allowed
364  if ($this->allowPasswordChange())
365  {
366  // The current password needs to be checked for verification
367  // unless the user uses Shibboleth authentication with additional
368  // local authentication for WebDAV.
369  //if (
370  // ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local"))
371  //)
372  if($ilUser->getAuthMode(true) == AUTH_LOCAL)
373  {
374  // current password
375  $cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password");
376  $cpass->setRetype(false);
377  $cpass->setSkipSyntaxCheck(true);
378  // only if a password exists.
379  if($ilUser->getPasswd())
380  {
381  $cpass->setRequired(true);
382  }
383  $this->form->addItem($cpass);
384  }
385 
386  // new password
387  $ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password");
388  $ipass->setRequired(true);
389  $ipass->setInfo(ilUtil::getPasswordRequirementsInfo());
390 
391  $this->form->addItem($ipass);
392  $this->form->addCommandButton("savePassword", $lng->txt("save"));
393 
394  switch ($ilUser->getAuthMode(true))
395  {
396  case AUTH_LOCAL :
397  $this->form->setTitle($lng->txt("chg_password"));
398  break;
399 
400  case AUTH_SHIBBOLETH :
401  case AUTH_CAS:
402  require_once ('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
404  {
405  $this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password"));
406  }
407  else
408  {
409  $this->form->setTitle($lng->txt("chg_ilias_password"));
410  }
411  break;
412  default :
413  $this->form->setTitle($lng->txt("chg_ilias_password"));
414  break;
415  }
416  $this->form->setFormAction($this->ctrl->getFormAction($this));
417  }
418  }
This class represents a property form user interface.
const AUTH_CAS
const AUTH_SHIBBOLETH
static _isActive()
Static getter.
setRetype($a_val)
Set retype on/off.
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()
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
setRequired($a_required)
Set Required.
+ 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 879 of file class.ilPersonalSettingsGUI.php.

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

880  {
881  global $tpl, $lng, $ilCtrl, $ilUser;
882 
883  $this->initGeneralSettingsForm();
884  if ($this->form->checkInput())
885  {
886  if ($this->workWithUserSetting("skin_style"))
887  {
888  //set user skin and style
889  if ($_POST["skin_style"] != "")
890  {
891  $sknst = explode(":", $_POST["skin_style"]);
892 
893  if ($ilUser->getPref("style") != $sknst[1] ||
894  $ilUser->getPref("skin") != $sknst[0])
895  {
896  $ilUser->setPref("skin", $sknst[0]);
897  $ilUser->setPref("style", $sknst[1]);
898  }
899  }
900  }
901 
902  // language
903  if ($this->workWithUserSetting("language"))
904  {
905  $ilUser->setLanguage($_POST["language"]);
906  }
907 
908  // hits per page
909  if ($this->workWithUserSetting("hits_per_page"))
910  {
911  if ($_POST["hits_per_page"] != "")
912  {
913  $ilUser->setPref("hits_per_page",$_POST["hits_per_page"]);
914  }
915  }
916 
917  // set show users online
918  /*
919  if ($this->workWithUserSetting("show_users_online"))
920  {
921  $ilUser->setPref("show_users_online", $_POST["show_users_online"]);
922  }*/
923 
924  // store last visited?
925  global $ilNavigationHistory;
926  $ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
927  if ((int) $_POST["store_last_visited"] > 0)
928  {
929  $ilNavigationHistory->deleteDBEntries();
930  if ((int) $_POST["store_last_visited"] == 2)
931  {
932  $ilNavigationHistory->deleteSessionEntries();
933  }
934  }
935 
936  // set hide own online_status
937  if ($this->workWithUserSetting("hide_own_online_status"))
938  {
939  if ($_POST["hide_own_online_status"] == 1)
940  {
941  $ilUser->setPref("hide_own_online_status","y");
942  }
943  else
944  {
945  $ilUser->setPref("hide_own_online_status","n");
946  }
947  }
948 
949  require_once 'Services/Contact/BuddySystem/classes/class.ilBuddySystem.php';
950  if(ilBuddySystem::getInstance()->isEnabled() && $this->workWithUserSetting('bs_allow_to_contact_me'))
951  {
952  if(isset($_POST['bs_allow_to_contact_me']) && $_POST['bs_allow_to_contact_me'] == 1)
953  {
954  $ilUser->setPref('bs_allow_to_contact_me', 'y');
955  }
956  else
957  {
958  $ilUser->setPref('bs_allow_to_contact_me', 'n');
959  }
960  }
961 
962  // set show users online
963  if ($this->workWithUserSetting("screen_reader_optimization"))
964  {
965  $ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
966  }
967 
968  // session reminder
969  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
970  if(ilSessionReminder::isGloballyActivated())
971  {
972  $ilUser->setPref('session_reminder_enabled', (int)$this->form->getInput('session_reminder_enabled'));
973  $ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
974  }
975 
976  // starting point
977  include_once "Services/User/classes/class.ilUserUtil.php";
979  {
980  ilUserUtil::setPersonalStartingPoint($this->form->getInput('usr_start'),
981  $this->form->getInput('usr_start_ref_id'));
982  }
983 
984  // selector for unicode characters
985  global $ilSetting;
986  if ($ilSetting->get('char_selector_availability') > 0)
987  {
988  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
990  $char_selector->getFormValues($this->form);
991  $ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
992  $ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
993  }
994 
995  $ilUser->update();
996 
997  // calendar settings
998  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
999  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
1000  $user_settings->setTimeZone($this->form->getInput("timezone"));
1001  $user_settings->setDateFormat((int)$this->form->getInput("date_format"));
1002  $user_settings->setTimeFormat((int)$this->form->getInput("time_format"));
1003  $user_settings->save();
1004 
1005  ilUtil::sendSuccess($lng->txtlng("common", "msg_obj_modified", $ilUser->getLanguage()), true);
1006  $ilCtrl->redirect($this, "showGeneralSettings");
1007  }
1008 
1009  $this->form->setValuesByPost();
1010  $this->showGeneralSettings(true);
1011  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
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 443 of file class.ilPersonalSettingsGUI.php.

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

444  {
445  global $tpl, $lng, $ilCtrl, $ilUser, $ilSetting;
446 
447  // normally we should not end up here
448  if (!$this->allowPasswordChange())
449  {
450  $ilCtrl->redirect($this, "showPersonalData");
451  return;
452  }
453 
454  $this->initPasswordForm();
455  if ($this->form->checkInput())
456  {
457  $cp = $this->form->getItemByPostVar("current_password");
458  $np = $this->form->getItemByPostVar("new_password");
459  $error = false;
460 
461  // The old password needs to be checked for verification
462  // unless the user uses Shibboleth authentication with additional
463  // local authentication for WebDAV.
464  #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
465  if($ilUser->getAuthMode(true) == AUTH_LOCAL)
466  {
467  require_once 'Services/User/classes/class.ilUserPasswordManager.php';
468  if(!ilUserPasswordManager::getInstance()->verifyPassword($ilUser, ilUtil::stripSlashes($_POST['current_password'])))
469  {
470  $error = true;
471  $cp->setAlert($this->lng->txt('passwd_wrong'));
472  }
473  }
474 
475  if(!ilUtil::isPassword($_POST["new_password"],$custom_error))
476  {
477  $error = true;
478  if ($custom_error != '')
479  {
480  $np->setAlert($custom_error);
481  }
482  else
483  {
484  $np->setAlert($this->lng->txt("passwd_invalid"));
485  }
486  }
487  $error_lng_var = '';
488  if(!ilUtil::isPasswordValidForUserContext($_POST["new_password"], $ilUser, $error_lng_var))
489  {
490  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
491  $np->setAlert($this->lng->txt($error_lng_var));
492  $error = true;
493  }
494  if(
495  ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
496  $_POST["current_password"] == $_POST["new_password"])
497  {
498  $error = true;
499  $np->setAlert($this->lng->txt("new_pass_equals_old_pass"));
500  }
501 
502  if (!$error)
503  {
504  $ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]);
505  if ($_POST["current_password"] != $_POST["new_password"])
506  {
507  $ilUser->setLastPasswordChangeToNow();
508  }
509 
510  if(ilSession::get('orig_request_target'))
511  {
512  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
513  $target = ilSession::get('orig_request_target');
514  ilSession::set('orig_request_target', '');
515  ilUtil::redirect($target);
516  }
517  else
518  {
519  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
520  $this->showPassword(true, true);
521  return;
522  }
523  }
524  }
525  $this->form->setValuesByPost();
526  $this->showPassword(true);
527  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$error
Definition: Error.php:17
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)
http redirect to other script
$_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 306 of file class.ilPersonalSettingsGUI.php.

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

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

◆ setMailOptionsValuesByDB()

ilPersonalSettingsGUI::setMailOptionsValuesByDB ( )
private

Fetches data from model and loads this data into form.

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

References $data, $ilSetting, $ilUser, $lng, allowPasswordChange(), array, ilMailOptions\getIncomingType(), ilMailGlobalServices\getMailObjectRefId(), initMailOptionsForm(), and setHeader().

198  {
199  global $ilUser, $ilSetting;
200 
201  require_once 'Services/Mail/classes/class.ilMailOptions.php';
202  $mailOptions = new ilMailOptions($ilUser->getId());
203 
204  $data = array(
205  'linebreak' => $mailOptions->getLinebreak(),
206  'signature' => $mailOptions->getSignature(),
207  'cronjob_notification' => $mailOptions->getCronjobNotification()
208  );
209 
210  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
211  {
212  $data['incoming_type'] = $mailOptions->getIncomingType();
213  }
214 
215  $this->form->setValuesByArray($data);
216  }
Class UserMail this class handles user mails.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ showGeneralSettings()

ilPersonalSettingsGUI::showGeneralSettings (   $a_no_init = false)

General settings form.

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

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

Referenced by saveGeneralSettings().

586  {
587  global $ilTabs, $ilToolbar, $ilCtrl;
588 
589  // test to other base class
590 // $ilToolbar->addButton("test",
591 // $ilCtrl->getLinkTargetByClass(array("ilmailgui","ilmailformgui"), "mailUser"));
592 
593  $this->__initSubTabs("showPersonalData");
594  $ilTabs->activateTab("general_settings");
595 
596  $this->setHeader();
597 
598  if (!$a_no_init)
599  {
600  $this->initGeneralSettingsForm();
601  }
602  $this->tpl->setContent($this->form->getHTML());
603  $this->tpl->show();
604  }
initGeneralSettingsForm()
Init general settings form.
global $ilCtrl
Definition: ilias.php:18
+ 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 320 of file class.ilPersonalSettingsGUI.php.

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

Referenced by savePassword().

321  {
322  global $ilTabs, $ilUser;
323 
324  $this->__initSubTabs("showPersonalData");
325  $ilTabs->activateTab("password");
326 
327  $this->setHeader();
328  // check whether password of user have to be changed
329  // due to first login or password of user is expired
330  if($ilUser->isPasswordChangeDemanded())
331  {
333  $this->lng->txt('password_change_on_first_login_demand')
334  );
335  }
336  else if($ilUser->isPasswordExpired())
337  {
338  $msg = $this->lng->txt('password_expired');
339  $password_age = $ilUser->getPasswordAge();
340  ilUtil::sendInfo(sprintf($msg, $password_age));
341  }
342 
343  if (!$a_no_init && !$hide_form)
344  {
345  $this->initPasswordForm();
346  }
347  $this->tpl->setContent(!$hide_form ? $this->form->getHTML() : '');
348  $this->tpl->show();
349  }
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 572 of file class.ilPersonalSettingsGUI.php.

References $result, and settings().

573  {
574  $result = TRUE;
575  if ($this->settings["usr_settings_disable_".$setting] == 1)
576  {
577  $result = FALSE;
578  }
579  return $result;
580  }
$result
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

◆ userSettingVisible()

ilPersonalSettingsGUI::userSettingVisible (   $setting)

Returns TRUE if user setting is visible, FALSE otherwise.

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

References $result, and settings().

Referenced by initGeneralSettingsForm().

558  {
559  $result = TRUE;
560  if (isset($this->settings["usr_settings_hide_".$setting]) &&
561  $this->settings["usr_settings_hide_".$setting] == 1)
562  {
563  $result = FALSE;
564  }
565  return $result;
566  }
$result
settings()
Definition: settings.php:2
+ 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 539 of file class.ilPersonalSettingsGUI.php.

References $result, and settings().

Referenced by saveGeneralSettings().

540  {
541  $result = TRUE;
542  if ($this->settings["usr_settings_hide_".$setting] == 1)
543  {
544  $result = FALSE;
545  }
546  if ($this->settings["usr_settings_disable_".$setting] == 1)
547  {
548  $result = FALSE;
549  }
550  return $result;
551  }
$result
settings()
Definition: settings.php:2
+ 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

◆ $tpl

ilPersonalSettingsGUI::$tpl

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