ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPersonalSettingsGUI Class Reference

GUI class for personal profile. More...

+ Collaboration diagram for ilPersonalSettingsGUI:

Public Member Functions

 executeCommand ()
 execute command More...
 
 setHeader ()
 
 workWithUserSetting (string $setting)
 
 userSettingVisible (string $setting)
 
 userSettingEnabled (string $setting)
 
 showGeneralSettings (bool $a_no_init=false)
 
 initGeneralSettingsForm ()
 
 saveGeneralSettings ()
 

Protected Member Functions

 deleteOwnAccountStep1 ()
 
 abortDeleteOwnAccount ()
 
 deleteOwnAccountLogout ()
 
 deleteOwnAccountStep2 ()
 
 deleteOwnAccountStep3 ()
 

Private Member Functions

 initSubTabs (string $a_cmd)
 
 checkPersonalStartingPoint ()
 

Private Attributes

ilPropertyFormGUI $form
 
ilGlobalTemplateInterface $tpl
 
UIFactory $ui_factory
 
Renderer $ui_renderer
 
ilLanguage $lng
 
ilCtrl $ctrl
 
LoggingServices $log
 
ilMailMimeSenderFactory $mail_sender_factory
 
ilHelpGUI $help
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ilSetting $settings
 
ilAuthSession $auth_session
 
ilRbacSystem $rbac_system
 
ilStyleDefinition $style_definition
 
ilNavigationHistory $navigation_history
 
ilUserSettingsConfig $user_settings_config
 
ilUserStartingPointRepository $starting_point_repository
 

Detailed Description

Member Function Documentation

◆ abortDeleteOwnAccount()

ilPersonalSettingsGUI::abortDeleteOwnAccount ( )
protected

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

509  : void
510  {
511  $this->user->removeDeletionFlag();
512 
513  $this->tpl->setOnScreenMessage('info', $this->lng->txt('user_delete_own_account_aborted'), true);
514  $this->ctrl->redirect($this, 'showGeneralSettings');
515  }
+ Here is the call graph for this function:

◆ checkPersonalStartingPoint()

ilPersonalSettingsGUI::checkPersonalStartingPoint ( )
private

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

References $ref_id, ilObject\_exists(), ILIAS\Repository\form(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilUserStartingPointRepository\START_REPOSITORY_OBJ.

Referenced by saveGeneralSettings().

460  : bool
461  {
462  if (!$this->starting_point_repository->isPersonalStartingPointEnabled()
463  || (int) $this->form->getInput('usr_start') !== ilUserStartingPointRepository::START_REPOSITORY_OBJ) {
464  return true;
465  }
466 
467  $ref_id = $this->form->getInput('usr_start_ref_id');
468  if (!is_numeric($ref_id) || !ilObject::_exists((int) $ref_id, true)) {
469  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('obj_ref_id_not_exist'), true);
470  return false;
471  }
472 
473  return true;
474  }
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
$ref_id
Definition: ltiauth.php:65
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteOwnAccountLogout()

ilPersonalSettingsGUI::deleteOwnAccountLogout ( )
protected

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

References ILIAS\Repository\ctrl(), ilSession\SESSION_CLOSE_USER, ilSession\setClosingContext(), and ILIAS\Repository\user().

517  : void
518  {
519  $this->user->activateDeletionFlag();
520 
522  $this->auth_session->logout();
523 
524  $this->ctrl->redirectToURL('login.php?cmd=force_login&target=usr_' . md5('usrdelown'));
525  }
const SESSION_CLOSE_USER
static setClosingContext(int $a_context)
set closing context (for statistics)
+ Here is the call graph for this function:

◆ deleteOwnAccountStep1()

ilPersonalSettingsGUI::deleteOwnAccountStep1 ( )
protected

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

References ILIAS\Repository\ctrl(), initSubTabs(), ILIAS\Repository\lng(), setHeader(), ILIAS\Repository\settings(), SYSTEM_USER_ID, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

476  : void
477  {
478  if (!(bool) $this->settings->get('user_delete_own_account') ||
479  $this->user->getId() === SYSTEM_USER_ID) {
480  $this->ctrl->redirect($this, 'showGeneralSettings');
481  }
482 
483  // to make sure
484  $this->user->removeDeletionFlag();
485 
486  $this->setHeader();
487  $this->initSubTabs('deleteOwnAccount');
488  $this->tabs->activateTab('delacc');
489 
490  $modal = $this->ui_factory->modal()->interruptive(
491  $this->lng->txt('delete_account'),
492  $this->lng->txt('user_delete_own_account_logout_confirmation'),
493  $this->ctrl->getFormActionByClass(ilPersonalSettingsGUI::class, 'deleteOwnAccountLogout')
494  )->withActionButtonLabel($this->lng->txt('user_delete_own_account_logout_button'));
495 
496  $this->tpl->setOnScreenMessage('info', $this->lng->txt('user_delete_own_account_info'));
497  $this->toolbar->addComponent(
498  $this->ui_factory->button()->standard(
499  $this->lng->txt('btn_next'),
500  $modal->getShowSignal()
501  )
502  );
503 
504  $this->tpl->setContent($this->ui_renderer->render($modal));
505 
506  $this->tpl->printToStdout();
507  }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
+ Here is the call graph for this function:

◆ deleteOwnAccountStep2()

ilPersonalSettingsGUI::deleteOwnAccountStep2 ( )
protected

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

References ILIAS\Repository\ctrl(), initSubTabs(), ILIAS\Repository\lng(), setHeader(), ILIAS\Repository\settings(), SYSTEM_USER_ID, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

527  : void
528  {
529  if (
530  !(bool) $this->settings->get('user_delete_own_account') ||
531  $this->user->getId() === SYSTEM_USER_ID ||
532  !$this->user->hasDeletionFlag()
533  ) {
534  $this->ctrl->redirect($this, 'showGeneralSettings');
535  }
536 
537  $this->setHeader();
538  $this->initSubTabs('deleteOwnAccount');
539  $this->tabs->activateTab('delacc');
540 
541  $this->tpl->setOnScreenMessage(
542  'question',
543  $this->lng->txt('user_delete_own_account_final_confirmation')
544  );
545 
546  $this->toolbar->addComponent(
547  $this->ui_factory->button()->standard(
548  $this->lng->txt('confirm'),
549  $this->ctrl->getLinkTargetByClass(self::class, 'deleteOwnAccountStep3')
550  )
551  );
552 
553  $this->toolbar->addComponent(
554  $this->ui_factory->button()->standard(
555  $this->lng->txt('cancel'),
556  $this->ctrl->getLinkTargetByClass(self::class, 'abortDeleteOwnAccount')
557  )
558  );
559  $this->tpl->printToStdout();
560  }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
+ Here is the call graph for this function:

◆ deleteOwnAccountStep3()

ilPersonalSettingsGUI::deleteOwnAccountStep3 ( )
protected

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

References $message, ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), null, ILIAS\Repository\settings(), ilDatePresentation\setUseRelativeDates(), SYSTEM_USER_ID, and ILIAS\Repository\user().

562  : void
563  {
564  if (
565  !(bool) $this->settings->get('user_delete_own_account') ||
566  $this->user->getId() === SYSTEM_USER_ID ||
567  !$this->user->hasDeletionFlag()
568  ) {
569  $this->ctrl->redirect($this, 'showGeneralSettings');
570  }
571 
572  // build notification
573 
574  $ntf = new ilSystemNotification();
575  $ntf->setLangModules(['user']);
576  $ntf->addAdditionalInfo('profile', $this->user->getProfileAsString($this->lng), true);
577 
578  // mail message
580  $ntf->setIntroductionDirect(
581  sprintf(
582  $this->lng->txt('user_delete_own_account_email_body'),
583  $this->user->getLogin(),
584  ILIAS_HTTP_PATH,
586  )
587  );
588 
589  $message = $ntf->composeAndGetMessage($this->user->getId(), null, 'read', true);
590  $subject = $this->lng->txt('user_delete_own_account_email_subject');
591 
592  // send notification
593  $user_email = $this->user->getEmail();
594  $admin_mail = $this->settings->get('user_delete_own_account_email');
595 
596  $mmail = new ilMimeMail();
597  $mmail->From($this->mail_sender_factory->system());
598 
599  if ($user_email !== '') {
600  $mmail->To($user_email);
601  $mmail->Bcc($admin_mail);
602  $mmail->Subject($subject, true);
603  $mmail->Body($message);
604  $mmail->Send();
605  } elseif ($admin_mail !== null || $admin_mail !== '') {
606  $mmail->To($admin_mail);
607  $mmail->Subject($subject, true);
608  $mmail->Body($message);
609  $mmail->Send();
610  }
611 
612  $this->log->root()->log('Account deleted: ' . $this->user->getLogin() . ' (' . $this->user->getId() . ')');
613 
614  $this->user->delete();
615 
616  // terminate session
617  $this->auth_session->logout();
618  $this->ctrl->redirectToURL('login.php?accdel=1');
619  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
const IL_CAL_UNIX
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
$message
Definition: xapiexit.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilPersonalSettingsGUI::executeCommand ( )

execute command

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

References ILIAS\Repository\ctrl(), ilMailGlobalServices\getMailObjectRefId(), initSubTabs(), ILIAS\Repository\lng(), setHeader(), and ILIAS\Repository\tabs().

92  : void
93  {
94  $next_class = $this->ctrl->getNextClass();
95 
96  switch ($next_class) {
97  case 'ilmailoptionsgui':
98  if (!$this->rbac_system->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
99  throw new ilPermissionException($this->lng->txt('permission_denied'));
100  }
101 
102  $this->initSubTabs('showMailOptions');
103  $this->tabs->activateTab('mail_settings');
104  $this->setHeader();
105  $this->ctrl->forwardCommand(new ilMailOptionsGUI());
106 
107  break;
108  case strtolower(ilLocalUserPasswordSettingsGUI::class):
109  $this->initSubTabs('showPersonalData');
110  $this->tabs->activateTab('password');
111  $this->setHeader();
112  $this->ctrl->forwardCommand(new ilLocalUserPasswordSettingsGUI());
113 
114  break;
115  default:
116  $cmd = $this->ctrl->getCmd('showGeneralSettings');
117  $this->$cmd();
118 
119  break;
120  }
121  }
+ Here is the call graph for this function:

◆ initGeneralSettingsForm()

ilPersonalSettingsGUI::initGeneralSettingsForm ( )

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

References $lang, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilSystemStyleSettings\_lookupActivatedStyle(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), ilSessionReminder\byLoggedInUser(), ILIAS\Repository\ctrl(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ILIAS\Repository\form(), ilSession\getSessionExpireValue(), ILIAS\Repository\help(), ILIAS\Repository\int(), ilSessionReminder\LEAD_TIME_DISABLED, ILIAS\Repository\lng(), ilDatePresentation\secondsToString(), ilRadioOption\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ILIAS\Repository\settings(), ilUserStartingPointRepository\START_REPOSITORY_OBJ, ilSessionReminder\SUGGESTED_LEAD_TIME, ilCalendarSettings\TIME_FORMAT_12, ilCalendarSettings\TIME_FORMAT_24, ILIAS\Repository\user(), userSettingVisible(), and workWithUserSetting().

Referenced by saveGeneralSettings(), and showGeneralSettings().

217  : void
218  {
219  $this->form = new ilPropertyFormGUI();
220 
221  // language
222  if ($this->userSettingVisible('language')) {
223  $languages = $this->lng->getInstalledLanguages();
224  $options = [];
225  foreach ($languages as $lang_key) {
226  $options[$lang_key] = $this->lng->txtlng('meta', 'meta_l_' . $lang_key, $lang_key);
227  }
228 
229  $lang = new ilSelectInputGUI($this->lng->txt('language'), 'language');
230  $lang->setOptionsLangAttribute(fn($options, $key) => $key);
231  $lang->setOptions($options);
232  $lang->setValue($this->user->getLanguage());
233  if (count($options) <= 1 || $this->settings->get('usr_settings_disable_language') === '1') {
234  $lang->setDisabled(true);
235  }
236  $this->form->addItem($lang);
237  }
238 
239  // skin/style
240  if ($this->userSettingVisible('skin_style')) {
241  $skins = $this->style_definition::getAllSkins();
242  if (is_array($skins)) {
243  $si = new ilSelectInputGUI($this->lng->txt('skin_style'), 'skin_style');
244 
245  $options = [];
246  foreach ($skins as $skin) {
247  foreach ($skin->getStyles() as $style) {
248  if (
249  !ilSystemStyleSettings::_lookupActivatedStyle($skin->getId(), $style->getId()) ||
250  $style->isSubstyle()
251  ) {
252  continue;
253  }
254 
255  $options[$skin->getId() . ':' . $style->getId()] = $skin->getName() . ' / ' . $style->getName();
256  }
257  }
258  $si->setOptions($options);
259  $si->setValue($this->user->skin . ':' . $this->user->prefs['style']);
260  $si->setDisabled((bool) $this->settings->get('usr_settings_disable_skin_style'));
261  $this->form->addItem($si);
262  }
263  }
264 
265  // help tooltips
266  $this->help->addPersonalSettingToLegacyForm($this->form);
267 
268  $lv = new ilSelectInputGUI($this->lng->txt('user_store_last_visited'), 'store_last_visited');
269  $options = [
270  0 => $this->lng->txt('user_lv_keep_entries'),
271  1 => $this->lng->txt('user_lv_keep_only_for_session'),
272  2 => $this->lng->txt('user_lv_do_not_store')
273  ];
274  $lv->setOptions($options);
275  $last_visited = (int) ($this->user->prefs['store_last_visited'] ?? 0);
276  $lv->setValue($last_visited);
277  $this->form->addItem($lv);
278 
279  if ($this->userSettingVisible('session_reminder')) {
280  $session_reminder = new ilNumberInputGUI(
281  $this->lng->txt('session_reminder_input'),
282  'session_reminder_lead_time'
283  );
284  $session_reminder_object = ilSessionReminder::byLoggedInUser();
286  $session_reminder->setInfo(
287  sprintf(
288  $this->lng->txt('session_reminder_lead_time_info'),
292  )
293  );
294  $session_reminder->setDisabled(!$this->workWithUserSetting('session_reminder'));
295  $session_reminder->setValue(
296  (string) $session_reminder_object->getEffectiveLeadTime()
297  );
298  $session_reminder->setSize(3);
299  $session_reminder->setMinValue(ilSessionReminder::LEAD_TIME_DISABLED);
300  $session_reminder->setMaxValue($session_reminder_object->getMaxPossibleLeadTime());
301  $this->form->addItem($session_reminder);
302  }
303 
304  // calendar settings (copied here to be reachable when calendar is inactive)
305  // they cannot be hidden/deactivated
306 
307  $this->lng->loadLanguageModule('dateplaner');
308  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($this->user->getId());
309 
310  $select = new ilSelectInputGUI($this->lng->txt('cal_user_timezone'), 'timezone');
312  $select->setInfo($this->lng->txt('cal_timezone_info'));
313  $select->setValue($user_settings->getTimeZone());
314  $this->form->addItem($select);
315 
316  $year = date('Y');
317  $select = new ilSelectInputGUI($this->lng->txt('cal_user_date_format'), 'date_format');
318  $select->setOptions([
319  ilCalendarSettings::DATE_FORMAT_DMY => '31.10.' . $year,
320  ilCalendarSettings::DATE_FORMAT_YMD => $year . '-10-31',
321  ilCalendarSettings::DATE_FORMAT_MDY => '10/31/' . $year
322  ]);
323  $select->setInfo($this->lng->txt('cal_date_format_info'));
324  $select->setValue($user_settings->getDateFormat());
325  $this->form->addItem($select);
326 
327  $select = new ilSelectInputGUI($this->lng->txt('cal_user_time_format'), 'time_format');
328  $select->setOptions([
331  ]);
332  $select->setInfo($this->lng->txt('cal_time_format_info'));
333  $select->setValue($user_settings->getTimeFormat());
334  $this->form->addItem($select);
335 
336  if ($this->starting_point_repository->isPersonalStartingPointEnabled()) {
337  $this->lng->loadLanguageModule('administration');
338  $si = new ilRadioGroupInputGUI($this->lng->txt('adm_user_starting_point'), 'usr_start');
339  $si->setRequired(true);
340  $si->setInfo($this->lng->txt('adm_user_starting_point_info'));
341  $def_opt = new ilRadioOption($this->lng->txt('adm_user_starting_point_inherit'), '0');
342  $def_opt->setInfo($this->lng->txt('adm_user_starting_point_inherit_info'));
343  $si->addOption($def_opt);
344  foreach ($this->starting_point_repository->getPossibleStartingPoints() as $value => $caption) {
346  continue;
347  }
348  $si->addOption(new ilRadioOption($this->lng->txt($caption), (string) $value));
349  }
350  $si->setValue((string) $this->starting_point_repository->getCurrentUserPersonalStartingPoint());
351  $this->form->addItem($si);
352 
353  // starting point: repository object
354  $repobj = new ilRadioOption(
355  $this->lng->txt('adm_user_starting_point_object'),
357  );
358  $repobj_id = new ilTextInputGUI($this->lng->txt('adm_user_starting_point_ref_id'), 'usr_start_ref_id');
359  $repobj_id->setInfo($this->lng->txt('adm_user_starting_point_ref_id_info'));
360  $repobj_id->setRequired(true);
361  $repobj_id->setSize(5);
363  $start_ref_id = $this->starting_point_repository->getCurrentUserPersonalStartingObject();
364  $repobj_id->setValue($start_ref_id);
365  if ($start_ref_id) {
366  $start_obj_id = ilObject::_lookupObjId($start_ref_id);
367  if ($start_obj_id) {
368  $repobj_id->setInfo(
369  $this->lng->txt('obj_' . ilObject::_lookupType($start_obj_id)) .
370  ': ' . ilObject::_lookupTitle($start_obj_id)
371  );
372  }
373  }
374  }
375  $repobj->addSubItem($repobj_id);
376  $si->addOption($repobj);
377  }
378 
379  $this->form->addCommandButton('saveGeneralSettings', $this->lng->txt('save'));
380  $this->form->setTitle($this->lng->txt('general_settings'));
381  $this->form->setFormAction($this->ctrl->getFormAction($this));
382  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
static _lookupActivatedStyle(string $a_skin, string $a_style)
lookup if a style is activated
setInfo(string $a_info)
setOptions(array $a_options)
static _getShortTimeZoneList()
get short timezone list
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static _getInstanceByUserId(int $a_user_id)
static _lookupObjId(int $ref_id)
This class represents a property in a property form.
static _lookupTitle(int $obj_id)
This class represents a number property in a property form.
setRequired(bool $a_required)
$lang
Definition: xapiexit.php:25
form( $class_path, string $cmd, string $submit_caption="")
static _lookupType(int $id, bool $reference=false)
static getSessionExpireValue()
Returns the session expiration value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubTabs()

ilPersonalSettingsGUI::initSubTabs ( string  $a_cmd)
private

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

References ILIAS\Repository\ctrl(), ilMailGlobalServices\getMailObjectRefId(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), SYSTEM_USER_ID, ILIAS\Repository\tabs(), and ILIAS\Repository\user().

Referenced by deleteOwnAccountStep1(), deleteOwnAccountStep2(), executeCommand(), and showGeneralSettings().

123  : void
124  {
125  $this->help->setScreenIdComponent('user');
126 
127  $showPassword = $a_cmd === 'showPassword';
128  $showGeneralSettings = $a_cmd === 'showGeneralSettings';
129 
130  $this->tabs->addTarget(
131  'general_settings',
132  $this->ctrl->getLinkTarget($this, 'showGeneralSettings'),
133  '',
134  '',
135  '',
136  $showGeneralSettings
137  );
138 
139  if (LocalUserPasswordManager::getInstance()->allowPasswordChange($this->user)) {
140  $this->tabs->addTarget(
141  'password',
142  $this->ctrl->getLinkTargetByClass(
143  [
144  ilDashboardGUI::class,
145  self::class,
146  ilLocalUserPasswordSettingsGUI::class
147  ],
148  'showPassword'
149  ),
150  '',
151  '',
152  '',
153  $showPassword
154  );
155  }
156 
157  if (
158  $this->settings->get('show_mail_settings')
159  && $this->rbac_system->checkAccess('internal_mail', ilMailGlobalServices::getMailObjectRefId())
160  ) {
161  $this->ctrl->setParameter($this, 'referrer', 'ilPersonalSettingsGUI');
162 
163  $this->tabs->addTarget(
164  'mail_settings',
165  $this->ctrl->getLinkTargetByClass('ilMailOptionsGUI'),
166  '',
167  ['ilMailOptionsGUI']
168  );
169  }
170 
171  if (
172  $this->settings->get('user_delete_own_account') &&
173  $this->user->getId() !== SYSTEM_USER_ID
174  ) {
175  $this->tabs->addTab(
176  'delacc',
177  $this->lng->txt('user_delete_own_account'),
178  $this->ctrl->getLinkTarget($this, 'deleteOwnAccountStep1')
179  );
180  }
181  }
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGeneralSettings()

ilPersonalSettingsGUI::saveGeneralSettings ( )

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

References ilCalendarUserSettings\_getInstanceByUserId(), checkPersonalStartingPoint(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ILIAS\Repository\help(), initGeneralSettingsForm(), ILIAS\Repository\lng(), null, showGeneralSettings(), ILIAS\Repository\user(), and workWithUserSetting().

384  : void
385  {
386  $this->initGeneralSettingsForm();
387  if ($this->form->checkInput()
388  && $this->checkPersonalStartingPoint()) {
389  if ($this->workWithUserSetting('skin_style')) {
390  // set user skin and style
391  if ($this->form->getInput('skin_style') != '') {
392  $sknst = explode(':', $this->form->getInput('skin_style'));
393 
394  if (
395  $this->user->getPref('style') != $sknst[1] ||
396  $this->user->getPref('skin') != $sknst[0]
397  ) {
398  $this->user->setPref('skin', $sknst[0]);
399  $this->user->setPref('style', $sknst[1]);
400  }
401  }
402  }
403 
404  // language
405  if ($this->workWithUserSetting('language')) {
406  $this->user->setLanguage($this->form->getInput('language'));
407  }
408 
409  // help tooltips
410  $this->help->savePersonalSettingFromLegacyForm($this->form);
411 
412  $this->user->setPref('store_last_visited', $this->form->getInput('store_last_visited'));
413  if ((int) $this->form->getInput('store_last_visited') > 0) {
414  $this->navigation_history->deleteDBEntries();
415  if ((int) $this->form->getInput('store_last_visited') === 2) {
416  $this->navigation_history->deleteSessionEntries();
417  }
418  }
419 
420  if ($this->workWithUserSetting('session_reminder')) {
421  $this->user->setPref(
422  'session_reminder_lead_time',
423  (string) $this->form->getInput('session_reminder_lead_time')
424  );
425  }
426 
427  if ($this->starting_point_repository->isPersonalStartingPointEnabled()) {
428  $s_ref_id = $this->form->getInput('usr_start_ref_id');
429  $s_ref_id = ($s_ref_id === '')
430  ? null
431  : (int) $s_ref_id;
432  $this->starting_point_repository->setCurrentUserPersonalStartingPoint(
433  (int) $this->form->getInput('usr_start'),
434  $s_ref_id
435  );
436  }
437 
438  $this->user->update();
439 
440  // calendar settings
441  $user_settings = ilCalendarUserSettings::_getInstanceByUserId($this->user->getId());
442  $user_settings->setTimeZone($this->form->getInput('timezone'));
443  $user_settings->setDateFormat((int) $this->form->getInput('date_format'));
444  $user_settings->setTimeFormat((int) $this->form->getInput('time_format'));
445  $user_settings->save();
446 
447  $this->tpl->setOnScreenMessage(
448  'success',
449  $this->lng->txtlng('common', 'msg_obj_modified', $this->user->getLanguage()),
450  true
451  );
452 
453  $this->ctrl->redirect($this, 'showGeneralSettings');
454  }
455 
456  $this->form->setValuesByPost();
457  $this->showGeneralSettings(true);
458  }
static _getInstanceByUserId(int $a_user_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
form( $class_path, string $cmd, string $submit_caption="")
showGeneralSettings(bool $a_no_init=false)
+ Here is the call graph for this function:

◆ setHeader()

ilPersonalSettingsGUI::setHeader ( )

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

References ILIAS\Repository\lng().

Referenced by deleteOwnAccountStep1(), deleteOwnAccountStep2(), executeCommand(), and showGeneralSettings().

183  : void
184  {
185  $this->tpl->setTitle($this->lng->txt('personal_settings'));
186  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showGeneralSettings()

ilPersonalSettingsGUI::showGeneralSettings ( bool  $a_no_init = false)

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

References ILIAS\Repository\form(), initGeneralSettingsForm(), initSubTabs(), setHeader(), and ILIAS\Repository\tabs().

Referenced by saveGeneralSettings().

203  : void
204  {
205  $this->initSubTabs('showPersonalData');
206  $this->tabs->activateTab('general_settings');
207 
208  $this->setHeader();
209 
210  if (!$a_no_init) {
211  $this->initGeneralSettingsForm();
212  }
213  $this->tpl->setContent($this->form->getHTML());
214  $this->tpl->printToStdout();
215  }
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ userSettingEnabled()

ilPersonalSettingsGUI::userSettingEnabled ( string  $setting)

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

198  : bool
199  {
200  return $this->user_settings_config->isChangeable($setting);
201  }

◆ userSettingVisible()

ilPersonalSettingsGUI::userSettingVisible ( string  $setting)

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

Referenced by initGeneralSettingsForm().

193  : bool
194  {
195  return $this->user_settings_config->isVisible($setting);
196  }
+ Here is the caller graph for this function:

◆ workWithUserSetting()

ilPersonalSettingsGUI::workWithUserSetting ( string  $setting)

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

Referenced by initGeneralSettingsForm(), and saveGeneralSettings().

188  : bool
189  {
190  return $this->user_settings_config->isVisibleAndChangeable($setting);
191  }
+ Here is the caller graph for this function:

Field Documentation

◆ $auth_session

ilAuthSession ilPersonalSettingsGUI::$auth_session
private

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

◆ $ctrl

ilCtrl ilPersonalSettingsGUI::$ctrl
private

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

◆ $form

ilPropertyFormGUI ilPersonalSettingsGUI::$form
private

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

◆ $help

ilHelpGUI ilPersonalSettingsGUI::$help
private

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

◆ $lng

ilLanguage ilPersonalSettingsGUI::$lng
private

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

◆ $log

LoggingServices ilPersonalSettingsGUI::$log
private

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

◆ $mail_sender_factory

ilMailMimeSenderFactory ilPersonalSettingsGUI::$mail_sender_factory
private

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

◆ $navigation_history

ilNavigationHistory ilPersonalSettingsGUI::$navigation_history
private

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

◆ $rbac_system

ilRbacSystem ilPersonalSettingsGUI::$rbac_system
private

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

◆ $settings

ilSetting ilPersonalSettingsGUI::$settings
private

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

◆ $starting_point_repository

ilUserStartingPointRepository ilPersonalSettingsGUI::$starting_point_repository
private

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

◆ $style_definition

ilStyleDefinition ilPersonalSettingsGUI::$style_definition
private

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

◆ $tabs

ilTabsGUI ilPersonalSettingsGUI::$tabs
private

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

◆ $toolbar

ilToolbarGUI ilPersonalSettingsGUI::$toolbar
private

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

◆ $tpl

ilGlobalTemplateInterface ilPersonalSettingsGUI::$tpl
private

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

◆ $ui_factory

UIFactory ilPersonalSettingsGUI::$ui_factory
private

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

◆ $ui_renderer

Renderer ilPersonalSettingsGUI::$ui_renderer
private

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

◆ $user

ilObjUser ilPersonalSettingsGUI::$user
private

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

◆ $user_settings_config

ilUserSettingsConfig ilPersonalSettingsGUI::$user_settings_config
private

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


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