ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPersonalSettingsGUI Class Reference

GUI class for personal profile. More...

+ Collaboration diagram for ilPersonalSettingsGUI:

Public Member Functions

 __construct ()
 constructor More...
 
executeCommand ()
 execute command More...
 
 changeUserPassword ()
 change user password More...
 
 setHeader ()
 Set header. More...
 
 showPassword ($a_no_init=false, $hide_form=false)
 
 initPasswordForm ()
 Init password form. More...
 
 allowPasswordChange ()
 Check, whether password change is allowed for user. 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

 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, and ilUserDefinedFields\_getInstance().

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) ...
+ Here is the call graph for this function:

Member Function Documentation

◆ abortDeleteOwnAccount()

ilPersonalSettingsGUI::abortDeleteOwnAccount ( )
protected

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

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

1326  {
1327  global $ilCtrl, $ilUser;
1328 
1329  $ilUser->removeDeletionFlag();
1330 
1331  ilUtil::sendInfo($this->lng->txt("user_delete_own_account_aborted"), true);
1332  $ilCtrl->redirect($this, "showGeneralSettings");
1333  }
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ allowPasswordChange()

ilPersonalSettingsGUI::allowPasswordChange ( )

Check, whether password change is allowed for user.

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

References $ilSetting, $ilUser, AUTH_CAS, AUTH_LOCAL, AUTH_OPENID, AUTH_SHIBBOLETH, AUTH_SOAP, ilAuthUtils\isPasswordModificationEnabled(), and userSettingVisible().

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

686  {
687  global $ilUser, $ilSetting;
688 
689 
690  return ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));
691 
692  // Moved to ilAuthUtils
693 
694  // do nothing if auth mode is not local database
695  if ($ilUser->getAuthMode(true) != AUTH_LOCAL &&
696  ($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get("cas_allow_local")) &&
697  ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local")) &&
698  ($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get("soap_auth_allow_local")) &&
699  ($ilUser->getAuthMode(true) != AUTH_OPENID)
700  )
701  {
702  return false;
703  }
704  if (!$this->userSettingVisible('password') ||
705  $this->ilias->getSetting('usr_settings_disable_password'))
706  {
707  return false;
708  }
709  return true;
710  }
const AUTH_OPENID
const AUTH_CAS
const AUTH_SHIBBOLETH
userSettingVisible($setting)
Returns TRUE if user setting is visible, FALSE otherwise.
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
const AUTH_SOAP
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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:

◆ changeUserPassword()

ilPersonalSettingsGUI::changeUserPassword ( )

change user password

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

References $_POST, $ilSetting, $ilUser, $lng, AUTH_CAS, AUTH_LOCAL, AUTH_SHIBBOLETH, AUTH_SOAP, ilMailGlobalServices\getMailObjectRefId(), initMailOptionsForm(), ilUtil\isPassword(), ilUtil\sendSuccess(), setHeader(), and ilUtil\stripSlashes().

68  {
69  global $ilUser, $ilSetting;
70 
71  // do nothing if auth mode is not local database
72  if ($ilUser->getAuthMode(true) != AUTH_LOCAL &&
73  ($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get("cas_allow_local")) &&
74  ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local")) &&
75  ($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get("soap_auth_allow_local"))
76  )
77  {
78  $this->password_error = $this->lng->txt("not_changeable_for_non_local_auth");
79  }
80 
81  // select password from auto generated passwords
82  if ($this->ilias->getSetting("passwd_auto_generate") == 1)
83  {
84  // The old password needs to be checked for verification
85  // unless the user uses Shibboleth authentication with additional
86  // local authentication for WebDAV.
87  if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
88  {
89  // check old password
90  if (md5($_POST["current_password"]) != $ilUser->getPasswd())
91  {
92  $this->password_error = $this->lng->txt("passwd_wrong");
93  }
94  }
95  // validate transmitted password
96  if (!ilUtil::isPassword($_POST["new_passwd"]))
97  {
98  $this->password_error = $this->lng->txt("passwd_not_selected");
99  }
100 
101  if (empty($this->password_error))
102  {
103  ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
104  $ilUser->updatePassword($_POST["current_password"], $_POST["new_passwd"], $_POST["new_passwd"]);
105  }
106  }
107  else
108  {
109  // check old password
110  if (md5($_POST["current_password"]) != $ilUser->getPasswd())
111  {
112  $this->password_error = $this->lng->txt("passwd_wrong");
113  }
114  // check new password
115  else if ($_POST["desired_password"] != $_POST["retype_password"])
116  {
117  $this->password_error = $this->lng->txt("passwd_not_match");
118  }
119  // validate password
120  else if (!ilUtil::isPassword($_POST["desired_password"],$custom_error))
121  {
122  if( $custom_error != '' )
123  $this->password_error = $custom_error;
124  else $this->password_error = $this->lng->txt("passwd_invalid");
125  }
126  else if ($_POST["current_password"] != "" and empty($this->password_error))
127  {
128  if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
129  {
130  if( $_POST["current_password"] != $_POST["desired_password"] )
131  {
132  if( $ilUser->updatePassword($_POST["current_password"], $_POST["desired_password"], $_POST["retype_password"]) )
133  {
134  ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
135  $ilUser->setLastPasswordChangeToNow();
136  }
137  }
138  else
139  {
140  $this->password_error = $this->lng->txt("new_pass_equals_old_pass");
141  }
142  }
143  else
144  {
145  ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
146  $ilUser->updatePassword($_POST["current_password"], $_POST["desired_password"], $_POST["retype_password"]);
147  $ilUser->setLastPasswordChangeToNow();
148  }
149  }
150  }
151 
152  $this->saveProfile();
153  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
const AUTH_CAS
const AUTH_SHIBBOLETH
static isPassword($a_passwd, &$customError=null)
validates a password public
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
const AUTH_SOAP
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ deleteOwnAccount1()

ilPersonalSettingsGUI::deleteOwnAccount1 ( )
protected

Delete own account dialog - 1st confirmation.

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

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

1275  {
1276  global $ilTabs, $ilToolbar, $ilUser, $ilSetting;
1277 
1278  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1279  $ilUser->getId() == SYSTEM_USER_ID)
1280  {
1281  $this->ctrl->redirect($this, "showGeneralSettings");
1282  }
1283 
1284  // too make sure
1285  $ilUser->removeDeletionFlag();
1286 
1287  $this->setHeader();
1288  $this->__initSubTabs("deleteOwnAccount");
1289  $ilTabs->activateTab("delacc");
1290 
1291  ilUtil::sendInfo($this->lng->txt('user_delete_own_account_info'));
1292  $ilToolbar->addButton($this->lng->txt('btn_next'),
1293  $this->ctrl->getLinkTarget($this, 'deleteOwnAccount2'));
1294 
1295  $this->tpl->show();
1296  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ deleteOwnAccount2()

ilPersonalSettingsGUI::deleteOwnAccount2 ( )
protected

Delete own account dialog - login redirect.

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

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

1302  {
1303  global $ilTabs, $ilUser, $ilSetting;
1304 
1305  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1306  $ilUser->getId() == SYSTEM_USER_ID)
1307  {
1308  $this->ctrl->redirect($this, "showGeneralSettings");
1309  }
1310 
1311  $this->setHeader();
1312  $this->__initSubTabs("deleteOwnAccount");
1313  $ilTabs->activateTab("delacc");
1314 
1315  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1316  $cgui = new ilConfirmationGUI();
1317  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_logout_confirmation'));
1318  $cgui->setFormAction($this->ctrl->getFormAction($this));
1319  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
1320  $cgui->setConfirm($this->lng->txt("user_delete_own_account_logout_button"), "deleteOwnAccountLogout");
1321  $this->tpl->setContent($cgui->getHTML());
1322  $this->tpl->show();
1323  }
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteOwnAccount3()

ilPersonalSettingsGUI::deleteOwnAccount3 ( )
protected

Delete own account dialog - final confirmation.

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

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

1355  {
1356  global $ilTabs, $ilUser, $ilSetting;
1357 
1358  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1359  $ilUser->getId() == SYSTEM_USER_ID ||
1360  !$ilUser->hasDeletionFlag())
1361  {
1362  $this->ctrl->redirect($this, "showGeneralSettings");
1363  }
1364 
1365  $this->setHeader();
1366  $this->__initSubTabs("deleteOwnAccount");
1367  $ilTabs->activateTab("delacc");
1368 
1369  include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
1370  $cgui = new ilConfirmationGUI();
1371  $cgui->setHeaderText($this->lng->txt('user_delete_own_account_final_confirmation'));
1372  $cgui->setFormAction($this->ctrl->getFormAction($this));
1373  $cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
1374  $cgui->setConfirm($this->lng->txt("confirm"), "deleteOwnAccount4");
1375  $this->tpl->setContent($cgui->getHTML());
1376  $this->tpl->show();
1377  }
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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 1382 of file class.ilPersonalSettingsGUI.php.

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

1383  {
1384  global $ilUser, $ilAuth, $ilSetting, $ilLog;
1385 
1386  if(!(bool)$ilSetting->get('user_delete_own_account') ||
1387  $ilUser->getId() == SYSTEM_USER_ID ||
1388  !$ilUser->hasDeletionFlag())
1389  {
1390  $this->ctrl->redirect($this, "showGeneralSettings");
1391  }
1392 
1393  // build notification
1394 
1395  include_once "./Services/Notification/classes/class.ilSystemNotification.php";
1396  $ntf = new ilSystemNotification();
1397  $ntf->setLangModules(array("user"));
1398  $ntf->addAdditionalInfo("profile", $ilUser->getProfileAsString($this->lng), true);
1399 
1400  // mail message
1402  $ntf->setIntroductionDirect(
1403  sprintf($this->lng->txt("user_delete_own_account_email_body"),
1404  $ilUser->getLogin(),
1405  ILIAS_HTTP_PATH,
1407 
1408  $message = $ntf->composeAndGetMessage($ilUser->getId(), null, null, true);
1409  $subject = $this->lng->txt("user_delete_own_account_email_subject");
1410 
1411 
1412  // send notification
1413 
1414  include_once "Services/Mail/classes/class.ilMail.php";
1415  $mail = new ilMail(ANONYMOUS_USER_ID);
1416 
1417  $user_email = $ilUser->getEmail();
1418  $admin_mail = $ilSetting->get("user_delete_own_account_email");
1419 
1420  // to user, admin as bcc
1421  if($user_email)
1422  {
1423  $mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
1424  }
1425  // admin only
1426  else if($admin_mail)
1427  {
1428  $mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
1429  }
1430 
1431  $ilLog->write("Account deleted: ".$ilUser->getLogin()." (".$ilUser->getId().")");
1432 
1433  $ilUser->delete();
1434 
1435  // terminate session
1436  $ilAuth->logout();
1437  session_destroy();
1438 
1439  ilUtil::redirect("login.php?accdel=1");
1440  }
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
Class Mail this class handles base functions for mail handling.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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 1335 of file class.ilPersonalSettingsGUI.php.

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

1336  {
1337  global $ilAuth, $ilUser;
1338 
1339  // we are setting the flag and ending the session in the same step
1340 
1341  $ilUser->activateDeletionFlag();
1342 
1343  // see ilStartupGUI::showLogout()
1345  $ilAuth->logout();
1346  session_destroy();
1347 
1348  ilUtil::redirect("login.php?target=usr_".md5("usrdelown"));
1349  }
const SESSION_CLOSE_USER
global $ilUser
Definition: imgupload.php:15
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 $cmd, $ilCtrl, $ilUser, $lng, and $tpl.

46  {
47  global $ilUser, $ilCtrl, $tpl, $ilTabs, $lng;
48 
49  $next_class = $this->ctrl->getNextClass();
50 
51  switch($next_class)
52  {
53 
54  default:
55  $cmd = $this->ctrl->getCmd("showGeneralSettings");
56  $this->$cmd();
57  break;
58  }
59  return true;
60  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

◆ initGeneralSettingsForm()

ilPersonalSettingsGUI::initGeneralSettingsForm ( )

Init general settings form.

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

References $ilSetting, $ilUser, $lng, $options, $si, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilObjStyleSettings\_lookupActivatedStyle(), ilLanguage\_lookupEntry(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilFormat\_secondsToString(), ilCharSelectorConfig\CONTEXT_USER, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilUserUtil\getPersonalStartingObject(), ilUserUtil\getPersonalStartingPoint(), ilUserUtil\getPossibleStartingPoints(), ilSession\getSessionExpireValue(), ilUserUtil\hasPersonalStartingPoint(), ilSessionReminder\MIN_LEAD_TIME, 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().

898  {
899  global $lng, $ilUser, $styleDefinition, $ilSetting;
900 
901 
902  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
903  $this->form = new ilPropertyFormGUI();
904 
905  // language
906  if ($this->userSettingVisible("language"))
907  {
908  $languages = $this->lng->getInstalledLanguages();
909  $options = array();
910  foreach($languages as $lang_key)
911  {
912  $options[$lang_key] = ilLanguage::_lookupEntry($lang_key,"meta", "meta_l_".$lang_key);
913  }
914 
915  $si = new ilSelectInputGUI($this->lng->txt("language"), "language");
916  $si->setOptions($options);
917  $si->setValue($ilUser->getLanguage());
918  $si->setDisabled($ilSetting->get("usr_settings_disable_language"));
919  $this->form->addItem($si);
920  }
921 
922  // skin/style
923  include_once("./Services/Style/classes/class.ilObjStyleSettings.php");
924  if ($this->userSettingVisible("skin_style"))
925  {
926  $templates = $styleDefinition->getAllTemplates();
927  if (is_array($templates))
928  {
929  $si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
930 
931  $options = array();
932  foreach($templates as $template)
933  {
934  // get styles information of template
935  $styleDef = new ilStyleDefinition($template["id"]);
936  $styleDef->startParsing();
937  $styles = $styleDef->getStyles();
938 
939  foreach($styles as $style)
940  {
941  if (!ilObjStyleSettings::_lookupActivatedStyle($template["id"],$style["id"]))
942  {
943  continue;
944  }
945 
946  $options[$template["id"].":".$style["id"]] =
947  $styleDef->getTemplateName()." / ".$style["name"];
948  }
949  }
950  $si->setOptions($options);
951  $si->setValue($ilUser->skin.":".$ilUser->prefs["style"]);
952  $si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
953  $this->form->addItem($si);
954  }
955  }
956 
957  // screen reader optimization
958  if ($this->userSettingVisible("screen_reader_optimization"))
959  {
960  $cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
961  $cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
962  $cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
963  $cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
964  $this->form->addItem($cb);
965  }
966 
967  // hits per page
968  if ($this->userSettingVisible("hits_per_page"))
969  {
970  $si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
971 
972  $hits_options = array(10,15,20,30,40,50,100,9999);
973  $options = array();
974 
975  foreach($hits_options as $hits_option)
976  {
977  $hstr = ($hits_option == 9999)
978  ? $this->lng->txt("no_limit")
979  : $hits_option;
980  $options[$hits_option] = $hstr;
981  }
982  $si->setOptions($options);
983  $si->setValue($ilUser->prefs["hits_per_page"]);
984  $si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
985  $this->form->addItem($si);
986  }
987 
988  // Users Online
989  if ($this->userSettingVisible("show_users_online"))
990  {
991  $si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
992 
993  $options = array(
994  "y" => $this->lng->txt("users_online_show_y"),
995  "associated" => $this->lng->txt("users_online_show_associated"),
996  "n" => $this->lng->txt("users_online_show_n"));
997  $si->setOptions($options);
998  $si->setValue($ilUser->prefs["show_users_online"]);
999  $si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
1000  $this->form->addItem($si);
1001  }
1002 
1003  // Store last visited
1004  $lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
1005  $options = array(
1006  0 => $this->lng->txt("user_lv_keep_entries"),
1007  1 => $this->lng->txt("user_lv_keep_only_for_session"),
1008  2 => $this->lng->txt("user_lv_do_not_store"));
1009  $lv->setOptions($options);
1010  $lv->setValue((int) $ilUser->prefs["store_last_visited"]);
1011  $this->form->addItem($lv);
1012 
1013  // hide_own_online_status
1014  if ($this->userSettingVisible("hide_own_online_status"))
1015  {
1016  $cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
1017  $cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
1018  $cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
1019  $this->form->addItem($cb);
1020  }
1021 
1022  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
1023  if(ilSessionReminder::isGloballyActivated())
1024  {
1025  $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
1026  $cb->setInfo($this->lng->txt('session_reminder_info'));
1027  $cb->setValue(1);
1028  $cb->setChecked((int)$ilUser->getPref('session_reminder_enabled'));
1029 
1030  $expires = ilSession::getSessionExpireValue();
1031  $lead_time_gui = new ilNumberInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
1032  $lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
1033 
1034  $min_value = ilSessionReminder::MIN_LEAD_TIME;
1035  $max_value = max($min_value, ((int)$expires / 60) - 1);
1036 
1037  $current_user_value = $ilUser->getPref('session_reminder_lead_time');
1038  if($current_user_value < $min_value ||
1039  $current_user_value > $max_value)
1040  {
1041  $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME;
1042  }
1043  $value = min(
1044  max(
1045  $min_value, $current_user_value
1046  ),
1047  $max_value
1048  );
1049 
1050  $lead_time_gui->setValue($value);
1051  $lead_time_gui->setSize(3);
1052  $lead_time_gui->setMinValue($min_value);
1053  $lead_time_gui->setMaxValue($max_value);
1054  $cb->addSubItem($lead_time_gui);
1055 
1056  $this->form->addItem($cb);
1057  }
1058 
1059  // calendar settings (copied here to be reachable when calendar is inactive)
1060  // they cannot be hidden/deactivated
1061 
1062  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
1063  include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
1064  $lng->loadLanguageModule("dateplaner");
1065  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
1066 
1067  $select = new ilSelectInputGUI($lng->txt('cal_user_timezone'),'timezone');
1069  $select->setInfo($lng->txt('cal_timezone_info'));
1070  $select->setValue($user_settings->getTimeZone());
1071  $this->form->addItem($select);
1072 
1073  $year = date("Y");
1074  $select = new ilSelectInputGUI($lng->txt('cal_user_date_format'),'date_format');
1075  $select->setOptions(array(
1076  ilCalendarSettings::DATE_FORMAT_DMY => '31.10.'.$year,
1077  ilCalendarSettings::DATE_FORMAT_YMD => $year."-10-31",
1078  ilCalendarSettings::DATE_FORMAT_MDY => "10/31/".$year));
1079  $select->setInfo($lng->txt('cal_date_format_info'));
1080  $select->setValue($user_settings->getDateFormat());
1081  $this->form->addItem($select);
1082 
1083  $select = new ilSelectInputGUI($lng->txt('cal_user_time_format'),'time_format');
1084  $select->setOptions(array(
1086  ilCalendarSettings::TIME_FORMAT_12 => '1:00pm'));
1087  $select->setInfo($lng->txt('cal_time_format_info'));
1088  $select->setValue($user_settings->getTimeFormat());
1089  $this->form->addItem($select);
1090 
1091 
1092  // starting point
1093  include_once "Services/User/classes/class.ilUserUtil.php";
1095  {
1096  $this->lng->loadLanguageModule("administration");
1097  $si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
1098  $si->setRequired(true);
1099  $si->setInfo($this->lng->txt("adm_user_starting_point_info"));
1100  foreach(ilUserUtil::getPossibleStartingPoints() as $value => $caption)
1101  {
1102  $si->addOption(new ilRadioOption($caption, $value));
1103  }
1105  $this->form->addItem($si);
1106 
1107  // starting point: repository object
1108  $repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
1109  $repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
1110  $repobj_id->setRequired(true);
1111  $repobj_id->setSize(5);
1112  if($si->getValue() == ilUserUtil::START_REPOSITORY_OBJ)
1113  {
1114  $start_ref_id = ilUserUtil::getPersonalStartingObject();
1115  $repobj_id->setValue($start_ref_id);
1116  if($start_ref_id)
1117  {
1118  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
1119  if($start_obj_id)
1120  {
1121  $repobj_id->setInfo($lng->txt("obj_".ilObject::_lookupType($start_obj_id)).
1122  ": ".ilObject::_lookupTitle($start_obj_id));
1123  }
1124  }
1125  }
1126  $repobj->addSubItem($repobj_id);
1127  $si->addOption($repobj);
1128  }
1129 
1130  // selector for unicode characters
1131  global $ilSetting;
1132  if ($ilSetting->get('char_selector_availability') > 0)
1133  {
1134  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1136  $char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));
1137  $char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));
1138  $char_selector->addFormProperties($this->form);
1139  $char_selector->setFormValues($this->form);
1140  }
1141 
1142  $this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
1143  $this->form->setTitle($lng->txt("general_settings"));
1144  $this->form->setFormAction($this->ctrl->getFormAction($this));
1145 
1146  }
This class represents an option in a radio group.
_lookupEntry($a_lang_key, $a_mod, $a_id)
This class represents a selection list property in a property form.
This class represents a property form user interface.
This shows a character selector.
_lookupActivatedStyle($a_skin, $a_style)
lookup if a style is activated
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 _getShortTimeZoneList()
get short timezone list
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
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.
if(!is_array($argv)) $options
This class represents a number property in a property form.
static _lookupObjId($a_id)
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
parses the template.xml that defines all styles of the current template
const START_REPOSITORY_OBJ
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 223 of file class.ilPersonalSettingsGUI.php.

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

Referenced by changeUserPassword(), and setMailOptionsValuesByDB().

224  {
225  global $ilCtrl, $ilSetting, $lng, $ilUser;
226 
227  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
228  $this->form = new ilPropertyFormGUI();
229 
230  $this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));
231  $this->form->setTitle($lng->txt('mail_settings'));
232 
233  // BEGIN INCOMING
234  include_once 'Services/Mail/classes/class.ilMailOptions.php';
235  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
236  {
237  $options = array(
238  IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'),
239  IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),
240  IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')
241  );
242  $si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
243  $si->setOptions($options);
244  if(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||
245  $ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')
246  {
247  $si->setDisabled(true);
248  }
249  $this->form->addItem($si);
250  }
251 
252  // BEGIN LINEBREAK_OPTIONS
253  $options = array();
254  for($i = 50; $i <= 80; $i++)
255  {
256  $options[$i] = $i;
257  }
258  $si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
259  $si->setOptions($options);
260  $this->form->addItem($si);
261 
262  // BEGIN SIGNATURE
263  $ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
264  $ta->setRows(10);
265  $ta->setCols(60);
266  $this->form->addItem($ta);
267 
268  // BEGIN CRONJOB NOTIFICATION
269  if($ilSetting->get('mail_notification'))
270  {
271  $cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
272  $cb->setInfo($lng->txt('mail_cronjob_notification_info'));
273  $cb->setValue(1);
274  $this->form->addItem($cb);
275  }
276 
277  $this->form->addCommandButton('saveMailOptions', $lng->txt('save'));
278  }
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
_lookupEmail($a_user_id)
Lookup email.
setOptions($a_options)
Set Options.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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 607 of file class.ilPersonalSettingsGUI.php.

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

Referenced by savePassword(), and showPassword().

608  {
609  global $lng, $ilUser, $ilSetting;
610 
611  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
612  $this->form = new ilPropertyFormGUI();
613 
614  // Check whether password change is allowed
615  if ($this->allowPasswordChange())
616  {
617  // The current password needs to be checked for verification
618  // unless the user uses Shibboleth authentication with additional
619  // local authentication for WebDAV.
620  //if (
621  // ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local"))
622  //)
623  if($ilUser->getAuthMode(true) == AUTH_LOCAL)
624  {
625  // current password
626  $cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password");
627  $cpass->setRetype(false);
628  $cpass->setSkipSyntaxCheck(true);
629  // only if a password exists.
630  if($ilUser->getPasswd())
631  {
632  $cpass->setRequired(true);
633  }
634  $this->form->addItem($cpass);
635  }
636 
637  // new password
638  $ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password");
639  $ipass->setRequired(true);
640  $ipass->setInfo(ilUtil::getPasswordRequirementsInfo());
641 
642  if ($ilSetting->get("passwd_auto_generate") == 1) // auto generation list
643  {
644  $ipass->setPreSelection(true);
645 
646  $this->form->addItem($ipass);
647  $this->form->addCommandButton("savePassword", $lng->txt("save"));
648  $this->form->addCommandButton("showPassword", $lng->txt("new_list_password"));
649  }
650  else // user enters password
651  {
652  $this->form->addItem($ipass);
653  $this->form->addCommandButton("savePassword", $lng->txt("save"));
654  }
655 
656  switch ($ilUser->getAuthMode(true))
657  {
658  case AUTH_LOCAL :
659  $this->form->setTitle($lng->txt("chg_password"));
660  break;
661 
662  case AUTH_SHIBBOLETH :
663  case AUTH_CAS:
664  require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
666  {
667  $this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password"));
668  }
669  else
670  {
671  $this->form->setTitle($lng->txt("chg_ilias_password"));
672  }
673  break;
674  default :
675  $this->form->setTitle($lng->txt("chg_ilias_password"));
676  break;
677  }
678  $this->form->setFormAction($this->ctrl->getFormAction($this));
679  }
680  }
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.
const AUTH_LOCAL
global $ilUser
Definition: imgupload.php:15
allowPasswordChange()
Check, whether password change is allowed for user.
global $ilSetting
Definition: privfeed.php:40
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 1151 of file class.ilPersonalSettingsGUI.php.

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

1152  {
1153  global $tpl, $lng, $ilCtrl, $ilUser;
1154 
1155  $this->initGeneralSettingsForm();
1156  if ($this->form->checkInput())
1157  {
1158  if ($this->workWithUserSetting("skin_style"))
1159  {
1160  //set user skin and style
1161  if ($_POST["skin_style"] != "")
1162  {
1163  $sknst = explode(":", $_POST["skin_style"]);
1164 
1165  if ($ilUser->getPref("style") != $sknst[1] ||
1166  $ilUser->getPref("skin") != $sknst[0])
1167  {
1168  $ilUser->setPref("skin", $sknst[0]);
1169  $ilUser->setPref("style", $sknst[1]);
1170  }
1171  }
1172  }
1173 
1174  // language
1175  if ($this->workWithUserSetting("language"))
1176  {
1177  $ilUser->setLanguage($_POST["language"]);
1178  }
1179 
1180  // hits per page
1181  if ($this->workWithUserSetting("hits_per_page"))
1182  {
1183  if ($_POST["hits_per_page"] != "")
1184  {
1185  $ilUser->setPref("hits_per_page",$_POST["hits_per_page"]);
1186  }
1187  }
1188 
1189  // set show users online
1190  if ($this->workWithUserSetting("show_users_online"))
1191  {
1192  $ilUser->setPref("show_users_online", $_POST["show_users_online"]);
1193  }
1194 
1195  // store last visited?
1196  global $ilNavigationHistory;
1197  $ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
1198  if ((int) $_POST["store_last_visited"] > 0)
1199  {
1200  $ilNavigationHistory->deleteDBEntries();
1201  if ((int) $_POST["store_last_visited"] == 2)
1202  {
1203  $ilNavigationHistory->deleteSessionEntries();
1204  }
1205  }
1206 
1207  // set hide own online_status
1208  if ($this->workWithUserSetting("hide_own_online_status"))
1209  {
1210  if ($_POST["hide_own_online_status"] == 1)
1211  {
1212  $ilUser->setPref("hide_own_online_status","y");
1213  }
1214  else
1215  {
1216  $ilUser->setPref("hide_own_online_status","n");
1217  }
1218  }
1219 
1220  // set show users online
1221  if ($this->workWithUserSetting("screen_reader_optimization"))
1222  {
1223  $ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
1224  }
1225 
1226  // session reminder
1227  include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
1228  if(ilSessionReminder::isGloballyActivated())
1229  {
1230  $ilUser->setPref('session_reminder_enabled', (int)$this->form->getInput('session_reminder_enabled'));
1231  $ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
1232  }
1233 
1234  // starting point
1235  include_once "Services/User/classes/class.ilUserUtil.php";
1237  {
1238  ilUserUtil::setPersonalStartingPoint($this->form->getInput('usr_start'),
1239  $this->form->getInput('usr_start_ref_id'));
1240  }
1241 
1242  // selector for unicode characters
1243  global $ilSetting;
1244  if ($ilSetting->get('char_selector_availability') > 0)
1245  {
1246  require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
1248  $char_selector->getFormValues($this->form);
1249  $ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
1250  $ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
1251  }
1252 
1253  $ilUser->update();
1254 
1255  // calendar settings
1256  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
1257  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
1258  $user_settings->setTimeZone($this->form->getInput("timezone"));
1259  $user_settings->setDateFormat((int)$this->form->getInput("date_format"));
1260  $user_settings->setTimeFormat((int)$this->form->getInput("time_format"));
1261  $user_settings->save();
1262 
1263  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1264  $ilCtrl->redirect($this, "showGeneralSettings");
1265  }
1266 
1267  $this->form->setValuesByPost();
1268  $this->showGeneralSettings(true);
1269  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
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.
showGeneralSettings($a_no_init=false)
General settings form.
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
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 716 of file class.ilPersonalSettingsGUI.php.

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

717  {
718  global $tpl, $lng, $ilCtrl, $ilUser, $ilSetting;
719 
720  // normally we should not end up here
721  if (!$this->allowPasswordChange())
722  {
723  $ilCtrl->redirect($this, "showPersonalData");
724  return;
725  }
726 
727  $this->initPasswordForm();
728  if ($this->form->checkInput())
729  {
730  $cp = $this->form->getItemByPostVar("current_password");
731  $np = $this->form->getItemByPostVar("new_password");
732  $error = false;
733 
734  // The old password needs to be checked for verification
735  // unless the user uses Shibboleth authentication with additional
736  // local authentication for WebDAV.
737  #if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
738  if($ilUser->getAuthMode(true) == AUTH_LOCAL)
739  {
740  // check current password
741  if (md5($_POST["current_password"]) != $ilUser->getPasswd() and
742  $ilUser->getPasswd())
743  {
744  $error = true;
745  $cp->setAlert($this->lng->txt("passwd_wrong"));
746  }
747  }
748 
749  // select password from auto generated passwords
750  if ($this->ilias->getSetting("passwd_auto_generate") == 1 &&
751  (!ilUtil::isPassword($_POST["new_password"])))
752  {
753  $error = true;
754  $np->setAlert($this->lng->txt("passwd_not_selected"));
755  }
756 
757 
758  if ($this->ilias->getSetting("passwd_auto_generate") != 1 &&
759  !ilUtil::isPassword($_POST["new_password"],$custom_error))
760  {
761  $error = true;
762  if ($custom_error != '')
763  {
764  $np->setAlert($custom_error);
765  }
766  else
767  {
768  $np->setAlert($this->lng->txt("passwd_invalid"));
769  }
770  }
771  $error_lng_var = '';
772  if(
773  $this->ilias->getSetting("passwd_auto_generate") != 1 &&
774  !ilUtil::isPasswordValidForUserContext($_POST["new_password"], $ilUser, $error_lng_var)
775  )
776  {
777  ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
778  $np->setAlert($this->lng->txt($error_lng_var));
779  $error = true;
780  }
781  if ($this->ilias->getSetting("passwd_auto_generate") != 1 &&
782  ($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
783  ($_POST["current_password"] == $_POST["new_password"]))
784  {
785  $error = true;
786  $np->setAlert($this->lng->txt("new_pass_equals_old_pass"));
787  }
788 
789  if (!$error)
790  {
791  $ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]);
792  if ($_POST["current_password"] != $_POST["new_password"])
793  {
794  $ilUser->setLastPasswordChangeToNow();
795  }
796 
797  if(ilSession::get('orig_request_target'))
798  {
799  ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
800  $target = ilSession::get('orig_request_target');
801  ilSession::set('orig_request_target', '');
802  ilUtil::redirect($target);
803  }
804  else
805  {
806  ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
807  $this->showPassword(true, true);
808  return;
809  }
810  }
811  }
812  $this->form->setValuesByPost();
813  $this->showPassword(true);
814  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
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.
redirection script todo: (a better solution should control the processing via a xml file) ...
const AUTH_LOCAL
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
allowPasswordChange()
Check, whether password change is allowed for user.
global $ilSetting
Definition: privfeed.php:40
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ setHeader()

ilPersonalSettingsGUI::setHeader ( )

Set header.

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

References $ilCtrl, and $ilUser.

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

515  {
516  $this->tpl->setVariable('HEADER', $this->lng->txt('personal_settings'));
517  }
+ 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 283 of file class.ilPersonalSettingsGUI.php.

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

284  {
285  global $ilUser, $ilSetting;
286 
287  require_once 'Services/Mail/classes/class.ilMailOptions.php';
288  $mailOptions = new ilMailOptions($ilUser->getId());
289 
290  $data = array(
291  'linebreak' => $mailOptions->getLinebreak(),
292  'signature' => $mailOptions->getSignature(),
293  'cronjob_notification' => $mailOptions->getCronjobNotification()
294  );
295 
296  if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
297  {
298  $data['incoming_type'] = $mailOptions->getIncomingType();
299  }
300 
301  $this->form->setValuesByArray($data);
302  }
Class UserMail this class handles user mails.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
global $ilUser
Definition: imgupload.php:15
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ showGeneralSettings()

ilPersonalSettingsGUI::showGeneralSettings (   $a_no_init = false)

General settings form.

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

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

Referenced by saveGeneralSettings().

873  {
874  global $ilTabs, $ilToolbar, $ilCtrl;
875 
876  // test to other base class
877 // $ilToolbar->addButton("test",
878 // $ilCtrl->getLinkTargetByClass(array("ilmailgui","ilmailformgui"), "mailUser"));
879 
880  $this->__initSubTabs("showPersonalData");
881  $ilTabs->activateTab("general_settings");
882 
883  $this->setHeader();
884 
885  if (!$a_no_init)
886  {
887  $this->initGeneralSettingsForm();
888  }
889  $this->tpl->setContent($this->form->getHTML());
890  $this->tpl->show();
891  }
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 571 of file class.ilPersonalSettingsGUI.php.

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

Referenced by savePassword().

572  {
573  global $ilTabs, $ilUser;
574 
575  $this->__initSubTabs("showPersonalData");
576  $ilTabs->activateTab("password");
577 
578  $this->setHeader();
579  // check whether password of user have to be changed
580  // due to first login or password of user is expired
581  if($ilUser->isPasswordChangeDemanded())
582  {
584  $this->lng->txt('password_change_on_first_login_demand')
585  );
586  }
587  else if($ilUser->isPasswordExpired())
588  {
589  $msg = $this->lng->txt('password_expired');
590  $password_age = $ilUser->getPasswordAge();
591  ilUtil::sendInfo(sprintf($msg, $password_age));
592  }
593 
594  if (!$a_no_init && !$hide_form)
595  {
596  $this->initPasswordForm();
597  }
598  $this->tpl->setContent(!$hide_form ? $this->form->getHTML() : '');
599  $this->tpl->show();
600  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initPasswordForm()
Init password form.
global $ilUser
Definition: imgupload.php:15
+ 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 859 of file class.ilPersonalSettingsGUI.php.

References $result.

860  {
861  $result = TRUE;
862  if ($this->settings["usr_settings_disable_".$setting] == 1)
863  {
864  $result = FALSE;
865  }
866  return $result;
867  }
$result

◆ userSettingVisible()

ilPersonalSettingsGUI::userSettingVisible (   $setting)

Returns TRUE if user setting is visible, FALSE otherwise.

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

References $result.

Referenced by allowPasswordChange(), and initGeneralSettingsForm().

845  {
846  $result = TRUE;
847  if (isset($this->settings["usr_settings_hide_".$setting]) &&
848  $this->settings["usr_settings_hide_".$setting] == 1)
849  {
850  $result = FALSE;
851  }
852  return $result;
853  }
$result
+ 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 826 of file class.ilPersonalSettingsGUI.php.

References $result.

Referenced by saveGeneralSettings().

827  {
828  $result = TRUE;
829  if ($this->settings["usr_settings_hide_".$setting] == 1)
830  {
831  $result = FALSE;
832  }
833  if ($this->settings["usr_settings_disable_".$setting] == 1)
834  {
835  $result = FALSE;
836  }
837  return $result;
838  }
$result
+ 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: