diff --git a/components/ILIAS/Authentication/classes/class.ilSessionReminder.php b/components/ILIAS/Authentication/classes/class.ilSessionReminder.php index f63506a51c02..78edf6cc64bc 100755 --- a/components/ILIAS/Authentication/classes/class.ilSessionReminder.php +++ b/components/ILIAS/Authentication/classes/class.ilSessionReminder.php @@ -18,22 +18,35 @@ declare(strict_types=1); -use ILIAS\Data\Factory as DataFactory; use ILIAS\Data\Clock\ClockInterface; +use ILIAS\Data\Factory as DataFactory; class ilSessionReminder { - public const MIN_LEAD_TIME = 2; + public const LEAD_TIME_DISABLED = 0; + public const MIN_LEAD_TIME = 1; public const SUGGESTED_LEAD_TIME = 5; - private ClockInterface $clock; private ilObjUser $user; + private ilSetting $settings; private int $lead_time = self::SUGGESTED_LEAD_TIME; private int $expiration_time = 0; private int $current_time = 0; private int $seconds_until_expiration = 0; private int $seconds_until_reminder = 0; + public function __construct( + ilObjUser $user, + ClockInterface $clock, + ilSetting $settings + ) { + $this->user = $user; + $this->clock = $clock; + $this->settings = $settings; + + $this->init(); + } + public static function byLoggedInUser(): self { global $DIC; @@ -47,37 +60,62 @@ public static function byLoggedInUser(): self $reminder = new self( $user, - (new DataFactory())->clock()->utc() + (new DataFactory())->clock()->utc(), + $DIC->settings() ); return $reminder; } - public static function isGloballyActivated(): bool + public function getGlobalSessionReminderLeadTime(): int { - /** @var ilSetting $ilSetting */ - global $DIC; + return $this->buildValidLeadTime( + (int) $this->settings->get('session_reminder_lead_time') + ); + } - $ilSetting = $DIC['ilSetting']; + private function buildValidLeadTime(int $lead_time): int + { + $min_value = self::MIN_LEAD_TIME; + $max_value = $this->getMaxPossibleLeadTime(); + + if ( + $lead_time !== self::LEAD_TIME_DISABLED && + ($lead_time < $min_value || $lead_time > $max_value) + ) { + $lead_time = self::SUGGESTED_LEAD_TIME; + } - return (bool) $ilSetting->get('session_reminder_enabled'); + return $lead_time !== self::LEAD_TIME_DISABLED ? min( + max( + $min_value, + $lead_time + ), + $max_value + ) : self::LEAD_TIME_DISABLED; } - public function __construct(ilObjUser $user, ClockInterface $clock) + public function getEffectiveLeadTime(): int { - $this->user = $user; - $this->clock = $clock; + return $this->buildValidLeadTime( + (int) ilObjUser::_lookupPref( + $this->getUser()->getId(), + 'session_reminder_lead_time' + ) ?: $this->getGlobalSessionReminderLeadTime() + ); + } - $this->init(); + public function getMaxPossibleLeadTime(): int + { + $expires = ilSession::getSessionExpireValue(); + + return max(self::MIN_LEAD_TIME, ($expires / 60) - 1); } private function init(): void { $this->setLeadTime( - ((int) max( - self::MIN_LEAD_TIME, - (float) $this->getUser()->getPref('session_reminder_lead_time') - )) * 60 + $this->getEffectiveLeadTime() * 60 ); $this->setExpirationTime(ilSession::getIdleValue() + $this->clock->now()->getTimestamp()); @@ -104,13 +142,11 @@ private function isEnoughTimeLeftForReminder(): bool public function isActive(): bool { - return ( - self::isGloballyActivated() && + return !$this->getUser()->isAnonymous() && $this->getUser()->getId() > 0 && - (int) $this->getUser()->getPref('session_reminder_enabled') && - $this->isEnoughTimeLeftForReminder() - ); + $this->getEffectiveLeadTime() !== self::LEAD_TIME_DISABLED && + $this->isEnoughTimeLeftForReminder(); } public function setUser(ilObjUser $user): self diff --git a/components/ILIAS/Authentication/classes/class.ilSessionReminderCheck.php b/components/ILIAS/Authentication/classes/class.ilSessionReminderCheck.php index 21a47a7004e6..6782d488ba2b 100755 --- a/components/ILIAS/Authentication/classes/class.ilSessionReminderCheck.php +++ b/components/ILIAS/Authentication/classes/class.ilSessionReminderCheck.php @@ -42,7 +42,7 @@ public function __construct( ilDBInterface $db, ilIniFile $clientIni, ilLogger $logger, - ClockInterface $utcClock + ClockInterface $utcClock, ) { $this->http = $http; $this->refinery = $refinery; @@ -93,13 +93,13 @@ public function handle(): ResponseInterface return $this->toJsonResponse($response); } - $expirationTime = (int) $data['expires']; - if (null === $expirationTime) { + $expiration_time = (int) $data['expires']; + if (null === $expiration_time) { $response['message'] = 'ILIAS could not determine the expiration time from the session data.'; return $this->toJsonResponse($response); } - if ($this->isSessionAlreadyExpired($expirationTime)) { + if ($this->isSessionAlreadyExpired($expiration_time)) { $response['message'] = 'The session is already expired. The client should have received a remind command before.'; return $this->toJsonResponse($response); } @@ -111,18 +111,16 @@ public function handle(): ResponseInterface return $this->toJsonResponse($response); } - $reminderTime = $expirationTime - ((int) max( - ilSessionReminder::MIN_LEAD_TIME, - (float) $ilUser->getPref('session_reminder_lead_time') - )) * 60; - if ($reminderTime > $this->clock->now()->getTimestamp()) { + $session_reminder = ilSessionReminder::byLoggedInUser(); + $reminder_time = $expiration_time - ($session_reminder->getEffectiveLeadTime() * 60); + if ($reminder_time > $this->clock->now()->getTimestamp()) { // session will expire in minutes $response['message'] = 'Lead time not reached, yet. Current time: ' . - date('Y-m-d H:i:s') . ', Reminder time: ' . date('Y-m-d H:i:s', $reminderTime); + date('Y-m-d H:i:s') . ', Reminder time: ' . date('Y-m-d H:i:s', $reminder_time); return $this->toJsonResponse($response); } - $dateTime = new ilDateTime($expirationTime, IL_CAL_UNIX); + $dateTime = new ilDateTime($expiration_time, IL_CAL_UNIX); switch ($ilUser->getTimeFormat()) { case ilCalendarSettings::TIME_FORMAT_12: $formatted_expiration_time = $dateTime->get(IL_CAL_FKT_DATE, 'g:ia', $ilUser->getTimeZone()); @@ -141,7 +139,7 @@ public function handle(): ResponseInterface '%0A', sprintf( $this->lng->txt('session_reminder_alert'), - ilDatePresentation::secondsToString($expirationTime - $this->clock->now()->getTimestamp()), + ilDatePresentation::secondsToString($expiration_time - $this->clock->now()->getTimestamp()), $formatted_expiration_time, $this->clientIni->readVariable('client', 'name') . ' | ' . ilUtil::_getHttpPath() ) diff --git a/components/ILIAS/Authentication/resources/sessioncheck.php b/components/ILIAS/Authentication/resources/sessioncheck.php index 7621b928fa97..154fe92cf67a 100644 --- a/components/ILIAS/Authentication/resources/sessioncheck.php +++ b/components/ILIAS/Authentication/resources/sessioncheck.php @@ -40,7 +40,7 @@ $DIC->database(), $DIC['ilClientIniFile'], $DIC->logger()->auth(), - (new DataFactory())->clock()->utc() + (new DataFactory())->clock()->utc(), ) )->handle() ); diff --git a/components/ILIAS/User/classes/Settings/class.ilPersonalSettingsGUI.php b/components/ILIAS/User/classes/Settings/class.ilPersonalSettingsGUI.php index 80f4b8f17688..e9320b867ac7 100755 --- a/components/ILIAS/User/classes/Settings/class.ilPersonalSettingsGUI.php +++ b/components/ILIAS/User/classes/Settings/class.ilPersonalSettingsGUI.php @@ -276,46 +276,29 @@ public function initGeneralSettingsForm(): void $lv->setValue($last_visited); $this->form->addItem($lv); - if (ilSessionReminder::isGloballyActivated()) { - $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled'); - $cb->setInfo($this->lng->txt('session_reminder_info')); - $cb->setValue('1'); - $cb->setChecked((bool) $this->user->getPref('session_reminder_enabled')); - - $expires = ilSession::getSessionExpireValue(); - $lead_time_gui = new ilNumberInputGUI( - $this->lng->txt('session_reminder_lead_time'), + if ($this->userSettingVisible('session_reminder')) { + $session_reminder = new ilNumberInputGUI( + $this->lng->txt('session_reminder_input'), 'session_reminder_lead_time' ); - $lead_time_gui->setInfo( + $session_reminder_object = ilSessionReminder::byLoggedInUser(); + $expires = ilSession::getSessionExpireValue(); + $session_reminder->setInfo( sprintf( $this->lng->txt('session_reminder_lead_time_info'), + ilSessionReminder::LEAD_TIME_DISABLED, + ilSessionReminder::SUGGESTED_LEAD_TIME, ilDatePresentation::secondsToString($expires, true) ) ); - - $min_value = ilSessionReminder::MIN_LEAD_TIME; - $max_value = max($min_value, ($expires / 60) - 1); - - $current_user_value = $this->user->getPref('session_reminder_lead_time'); - if ($current_user_value < $min_value || $current_user_value > $max_value) { - $current_user_value = ilSessionReminder::SUGGESTED_LEAD_TIME; - } - $value = min( - max( - $min_value, - $current_user_value - ), - $max_value + $session_reminder->setDisabled(!$this->workWithUserSetting('session_reminder')); + $session_reminder->setValue( + (string) $session_reminder_object->getEffectiveLeadTime() ); - - $lead_time_gui->setValue((string) $value); - $lead_time_gui->setSize(3); - $lead_time_gui->setMinValue($min_value); - $lead_time_gui->setMaxValue($max_value); - $cb->addSubItem($lead_time_gui); - - $this->form->addItem($cb); + $session_reminder->setSize(3); + $session_reminder->setMinValue(ilSessionReminder::LEAD_TIME_DISABLED); + $session_reminder->setMaxValue($session_reminder_object->getMaxPossibleLeadTime()); + $this->form->addItem($session_reminder); } // calendar settings (copied here to be reachable when calendar is inactive) @@ -434,8 +417,7 @@ public function saveGeneralSettings(): void } } - if (ilSessionReminder::isGloballyActivated()) { - $this->user->setPref('session_reminder_enabled', $this->form->getInput('session_reminder_enabled')); + if ($this->workWithUserSetting('session_reminder')) { $this->user->setPref( 'session_reminder_lead_time', (string) $this->form->getInput('session_reminder_lead_time') diff --git a/components/ILIAS/User/classes/class.ilObjUserFolderGUI.php b/components/ILIAS/User/classes/class.ilObjUserFolderGUI.php index b1b41bf75398..ed72919c52fb 100755 --- a/components/ILIAS/User/classes/class.ilObjUserFolderGUI.php +++ b/components/ILIAS/User/classes/class.ilObjUserFolderGUI.php @@ -24,7 +24,6 @@ use ILIAS\User\Profile\ChangeListeners\UserFieldAttributesChangeListener; use ILIAS\User\Profile\ChangeListeners\InterestedUserFieldChangeListener; use ILIAS\User\Profile\ChangeListeners\ChangedUserFieldAttribute; - use ILIAS\DI\Container as DIContainer; use ILIAS\Filesystem\Filesystem; use ILIAS\FileUpload\FileUpload; @@ -1746,8 +1745,6 @@ protected function generalSettingsObject(): void 'dpro_withdrawal_usr_deletion' => (bool) $this->settings->get('dpro_withdrawal_usr_deletion'), 'tos_withdrawal_usr_deletion' => (bool) $this->settings->get('tos_withdrawal_usr_deletion'), - 'session_reminder_enabled' => $this->settings->get('session_reminder_enabled'), - 'login_max_attempts' => $security->getLoginMaxAttempts(), 'ps_prevent_simultaneous_logins' => (int) $security->isPreventionOfSimultaneousLoginsEnabled(), 'password_assistance' => (bool) $this->settings->get('password_assistance'), @@ -1896,14 +1893,6 @@ public function saveGeneralSettingsObject(): void $this->form->getInput('password_assistance') ); - // BEGIN SESSION SETTINGS - - $this->settings->set( - 'session_reminder_enabled', - $this->form->getInput('session_reminder_enabled') - ); - - // END SESSION SETTINGS $this->settings->set( 'letter_avatars', $this->form->getInput('letter_avatars') @@ -2035,45 +2024,6 @@ protected function initFormGeneralSettings(): void (string) ilSessionControl::DEFAULT_ALLOW_CLIENT_MAINTENANCE ); - - // create session reminder subform - $session_reminder = new ilCheckboxInputGUI( - $this->lng->txt('session_reminder'), - 'session_reminder_enabled' - ); - $expires = ilSession::getSessionExpireValue(); - $time = ilDatePresentation::secondsToString( - $expires, - true - ); - $session_reminder->setInfo( - $this->lng->txt('session_reminder_info') . '
' . - sprintf( - $this->lng->txt('session_reminder_session_duration'), - $time - ) - ); - - // add radio group to form - if ($allow_client_maintenance) { - // just shows the status wether the session - //setting maintenance is allowed by setup - $this->form->addItem($session_reminder); - } else { - // just shows the status wether the session - //setting maintenance is allowed by setup - $session_config = new ilNonEditableValueGUI( - $this->lng->txt('session_config'), - 'session_config' - ); - $session_config->setValue($this->lng->txt('session_config_maintenance_disabled')); - $session_reminder->setDisabled(true); - $session_config->addSubItem($session_reminder); - $this->form->addItem($session_config); - } - - // END SESSION SETTINGS - $this->lng->loadLanguageModule('ps'); $pass = new ilFormSectionHeaderGUI(); @@ -2447,6 +2397,11 @@ public function saveGlobalUserSettingsObject(string $action = ''): void } } + $this->ilias->setSetting( + 'session_reminder_lead_time', + $this->user_request->getDefaultSessionReminder() + ); + if (isset($checked['export_preferences']) && $checked['export_preferences'] === 1) { $this->ilias->setSetting( 'usr_settings_export_preferences', diff --git a/components/ILIAS/User/classes/class.ilObjUserGUI.php b/components/ILIAS/User/classes/class.ilObjUserGUI.php index 18c9abb2ae9c..c5b46bf0f1da 100755 --- a/components/ILIAS/User/classes/class.ilObjUserGUI.php +++ b/components/ILIAS/User/classes/class.ilObjUserGUI.php @@ -19,7 +19,6 @@ declare(strict_types=1); use ILIAS\User\UserGUIRequest; - use ILIAS\Language\Language; use ILIAS\FileUpload\FileUpload; use ILIAS\ResourceStorage\Services as ResourceStorageServices; @@ -429,6 +428,9 @@ public function saveObject(): void $user_object->setPref('style', $sknst[1]); } } + if ($this->isSettingChangeable('session_reminder')) { + $user_object->setPref('session_reminder_lead_time', (string) $this->form_gui->getInput('session_reminder_lead_time')); + } if ($this->isSettingChangeable('hide_own_online_status')) { $user_object->setPref( 'hide_own_online_status', @@ -453,12 +455,6 @@ public function saveObject(): void $this->form_gui->getInput('chat_broadcast_typing') ? 'y' : 'n' ); } - if ($this->settings->get('session_reminder_enabled') === '1') { - $user_object->setPref( - 'session_reminder_enabled', - $this->form_gui->getInput('session_reminder_enabled') - ); - } $user_object->writePrefs(); //set role entries @@ -743,6 +739,11 @@ public function updateObject(): void $this->object->setPref('style', $sknst[1]); } } + + if ($this->isSettingChangeable('session_reminder')) { + $this->object->setPref('session_reminder_lead_time', (string) $this->form_gui->getInput('session_reminder_lead_time')); + } + if ($this->isSettingChangeable('hide_own_online_status')) { $this->object->setPref( 'hide_own_online_status', @@ -772,13 +773,6 @@ public function updateObject(): void // this ts is needed by ilSecuritySettings $this->object->setLastPasswordChangeTS(time()); - if ($this->settings->get('session_reminder_enabled') === '1') { - $this->object->setPref( - 'session_reminder_enabled', - $this->form_gui->getInput('session_reminder_enabled') - ); - } - // #10054 - profile may have been completed, check below is only for incomplete $this->object->setProfileIncomplete(false); @@ -895,11 +889,13 @@ public function getValues(): void $data['language'] = $this->object->getLanguage(); $data['skin_style'] = $this->object->skin . ':' . $this->object->prefs['style']; + $data['session_reminder_lead_time'] = + $this->object->prefs['session_reminder_lead_time'] ?? + ilSessionReminder::byLoggedInUser()->getGlobalSessionReminderLeadTime(); $data['hide_own_online_status'] = $this->object->prefs['hide_own_online_status'] ?? ''; $data['bs_allow_to_contact_me'] = ($this->object->prefs['bs_allow_to_contact_me'] ?? '') == 'y'; $data['chat_osc_accept_msg'] = ($this->object->prefs['chat_osc_accept_msg'] ?? '') == 'y'; $data['chat_broadcast_typing'] = ($this->object->prefs['chat_broadcast_typing'] ?? '') == 'y'; - $data['session_reminder_enabled'] = (int) ($this->object->prefs['session_reminder_enabled'] ?? 0); $data['send_mail'] = (($this->object->prefs['send_info_mails'] ?? '') == 'y'); @@ -1252,6 +1248,7 @@ public function initForm(string $a_mode): void || $this->isSettingChangeable('bs_allow_to_contact_me') || $this->isSettingChangeable('chat_osc_accept_msg') || $this->isSettingChangeable('chat_broadcast_typing') + || ($this->isSettingChangeable('session_reminder')) ) { $sec_st = new ilFormSectionHeaderGUI(); $sec_st->setTitle($this->lng->txt('settings')); @@ -1353,10 +1350,28 @@ public function initForm(string $a_mode): void $this->form_gui->addItem($chat_osc_acm); } - if ((int) $this->settings->get('session_reminder_enabled')) { - $cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled'); - $cb->setValue('1'); - $this->form_gui->addItem($cb); + if ($this->isSettingChangeable('session_reminder')) { + $session_reminder = new ilNumberInputGUI( + $this->lng->txt('session_reminder_input'), + 'session_reminder_lead_time' + ); + $expires = ilSession::getSessionExpireValue(); + $session_reminder_object = ilSessionReminder::byLoggedInUser(); + $session_reminder->setInfo( + sprintf( + $this->lng->txt('session_reminder_lead_time_info'), + ilSessionReminder::LEAD_TIME_DISABLED, + ilSessionReminder::SUGGESTED_LEAD_TIME, + ilDatePresentation::secondsToString($expires, true) + ) + ); + $session_reminder->setValue( + (string) $session_reminder_object->getGlobalSessionReminderLeadTime() + ); + $session_reminder->setSize(3); + $session_reminder->setMinValue(ilSessionReminder::LEAD_TIME_DISABLED); + $session_reminder->setMaxValue($session_reminder_object->getMaxPossibleLeadTime()); + $this->form_gui->addItem($session_reminder); } if ($this->isSettingChangeable('send_mail')) { diff --git a/components/ILIAS/User/classes/class.ilUserDataSet.php b/components/ILIAS/User/classes/class.ilUserDataSet.php index 4d19d02ac0fd..3a4ecdb76c56 100755 --- a/components/ILIAS/User/classes/class.ilUserDataSet.php +++ b/components/ILIAS/User/classes/class.ilUserDataSet.php @@ -243,7 +243,7 @@ public function readData(string $a_entity, string $a_version, array $a_ids): voi "public_profile", "public_sel_country", "public_street", "public_title", "public_upload", "public_zipcode", "screen_reader_optimization", "show_users_online", "store_last_visited", "time_format", "user_tz", "weekstart", - "session_reminder_enabled", "session_reminder_lead_time", "usr_starting_point", + "session_reminder_lead_time", "usr_starting_point", "chat_broadcast_typing"]; if (version_compare($a_version, '5.2.0', '>=')) { diff --git a/components/ILIAS/User/classes/class.ilUserFieldSettingsTableGUI.php b/components/ILIAS/User/classes/class.ilUserFieldSettingsTableGUI.php index 26d974f9368b..6c91a2f86de4 100755 --- a/components/ILIAS/User/classes/class.ilUserFieldSettingsTableGUI.php +++ b/components/ILIAS/User/classes/class.ilUserFieldSettingsTableGUI.php @@ -186,6 +186,18 @@ protected function fillRow(array $a_set): void $this->tpl->setCurrentBlock("def_selection"); $this->tpl->setVariable("PROFILE_OPTION_DEFAULT_VALUE", "default_" . $field); $this->tpl->parseCurrentBlock(); + break; + case 'numeric': + $this->tpl->setCurrentBlock('def_input'); + + $this->tpl->setVariable('PROFILE_OPTION_DEFAULT_VALUE', 'default_' . $field); + $session_reminder = ilSessionReminder::byLoggedInUser(); + $this->tpl->setVariable('CURRENT_OPTION_VISIBLE', $session_reminder->getGlobalSessionReminderLeadTime()); + $this->tpl->setVariable('CURRENT_OPTION_MAXIMUM', $session_reminder->getMaxPossibleLeadTime()); + $this->tpl->setVariable('CURRENT_OPTION_MINIMUM', ilSessionReminder::LEAD_TIME_DISABLED); + + $this->tpl->parseCurrentBlock(); + break; } $this->tpl->setCurrentBlock("default"); diff --git a/components/ILIAS/User/src/Profile/DefaultFields.php b/components/ILIAS/User/src/Profile/DefaultFields.php index 6d34a0133bb0..f30d86144cea 100755 --- a/components/ILIAS/User/src/Profile/DefaultFields.php +++ b/components/ILIAS/User/src/Profile/DefaultFields.php @@ -390,6 +390,17 @@ class DefaultFields 'prg_export_hide' => true, 'search_hide' => true, 'group' => 'settings' + ], + 'session_reminder' => [ + 'input' => 'numeric', + 'default' => 'y', + 'required_hide' => true, + 'visib_reg_hide' => true, + 'course_export_hide' => true, + 'group_export_hide' => true, + 'prg_export_hide' => true, + 'search_hide' => true, + 'group' => 'settings' ] ]; diff --git a/components/ILIAS/User/src/Setup/DBUpdateSteps10.php b/components/ILIAS/User/src/Setup/DBUpdateSteps10.php index bc0fcfc489e7..cf7c7e9e41cb 100755 --- a/components/ILIAS/User/src/Setup/DBUpdateSteps10.php +++ b/components/ILIAS/User/src/Setup/DBUpdateSteps10.php @@ -79,4 +79,42 @@ public function step_2(): void $this->db->addPrimaryKey(ChangeMailTokenDBRepository::TABLE_NAME, ['token']); } } + + public function step_3(): void + { + $query = 'SELECT * FROM settings WHERE module = %s AND keyword = %s'; + $result = $this->db->queryF( + $query, + [\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT], + ['common', 'session_reminder_enabled'] + ); + $session_reminder = $result->numRows() ? (bool) $this->db->fetchAssoc($result)['value'] : false; + $query = 'SELECT * FROM settings WHERE module = %s AND keyword = %s'; + $result = $this->db->queryF( + $query, + [\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT], + ['common', 'session_reminder_lead_time'] + ); + $session_reminder_lead_time = $result->numRows() ? (int) $this->db->fetchAssoc($result)['value'] : null; + if ($session_reminder && !isset($session_reminder_lead_time)) { + $query = 'INSERT INTO settings (module, keyword, value) VALUES (%s, %s, %s)'; + $this->db->manipulateF( + $query, + [\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT, \ilDBConstants::T_INTEGER], + ['common', 'session_reminder_lead_time', \ilSessionReminder::SUGGESTED_LEAD_TIME] + ); + } + $query = 'DELETE FROM settings WHERE module = %s AND keyword = %s'; + $this->db->manipulateF( + $query, + [\ilDBConstants::T_TEXT, \ilDBConstants::T_TEXT], + ['common', 'session_reminder_enabled'] + ); + $query = 'DELETE FROM usr_pref WHERE keyword = %s'; + $this->db->manipulateF( + $query, + [\ilDBConstants::T_TEXT], + ['session_reminder_enabled'] + ); + } } diff --git a/components/ILIAS/User/src/UserGUIRequest.php b/components/ILIAS/User/src/UserGUIRequest.php index 628e33a81520..a16898942c52 100755 --- a/components/ILIAS/User/src/UserGUIRequest.php +++ b/components/ILIAS/User/src/UserGUIRequest.php @@ -137,6 +137,11 @@ public function getSelect(): array return $this->strArray('select'); } + public function getDefaultSessionReminder(): ?string + { + return $this->str('default_session_reminder') ?: (string) \ilSessionReminder::LEAD_TIME_DISABLED; + } + public function getFiles(): array { return $this->strArray('file'); diff --git a/components/ILIAS/User/templates/default/tpl.std_fields_settings_row.html b/components/ILIAS/User/templates/default/tpl.std_fields_settings_row.html index 54e18f2d2322..7da84af7fcae 100755 --- a/components/ILIAS/User/templates/default/tpl.std_fields_settings_row.html +++ b/components/ILIAS/User/templates/default/tpl.std_fields_settings_row.html @@ -61,7 +61,10 @@ - + + + +
{TXT_CMD}
diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index b8bc9ae0f0df..0856700cdce1 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -5569,8 +5569,9 @@ common#:#session_mail_subject_registered#:#Registrierung von Benutzer/in „%s common#:#session_reminder#:#Session-Reminder common#:#session_reminder_alert#:#Ihre Sitzung läuft in %1$s um %2$s ab! Klicken Sie auf OK, um Ihre Sitzung zu verlängern! Wollen Sie dagegen in der aktuellen Browser-Sitzung nicht mehr erinnert werden, wählen Sie bitte Abbrechen. Betroffene Installation: %3$s. common#:#session_reminder_info#:#Wenn aktiviert, erhalten Sie eine Erinnerung, bevor Ihre Sitzung abläuft. +common#:#session_reminder_input#:#Session-Reminder (in Minuten) common#:#session_reminder_lead_time#:#Vorlaufzeit -common#:#session_reminder_lead_time_info#:#Hier können Sie festlegen, wann ILIAS Sie vor dem Ablauf Ihrer Sitzung warnen soll. Sie erhalten dann einen Hinweis und können einfach per Mausklick die Sitzung verlängern. Geben Sie einen Wert in Minuten ein. Empfohlen sind 5 Minuten.
Der aktuelle Wert für die Dauer einer Sitzung in diesem ILIAS beträgt %s. +common#:#session_reminder_lead_time_info#:#Bitte geben Sie an, wie viele Minuten vor Ablauf einer Sitzung Sie eine Erinnerung erhalten möchten.
Die Funktion ist deaktiviert, wenn der Wert „%s“ ist. Der empfohlene Wert ist %s.
Ihre aktuelle Dauer einer Sitzung ist %s. common#:#session_reminder_session_duration#:#(Aktuelle Sessiondauer: %s). common#:#set#:#Setzen common#:#setSystemLanguage#:#Systemsprache ändern diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 66116ab41c5f..0e01e985d41d 100755 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -5565,8 +5565,9 @@ common#:#session_mail_subject_registered#:#Registration of user "%s" for session common#:#session_reminder#:#Session Reminder common#:#session_reminder_alert#:#Your session expires in %1$s at %2$s! Choose OK to continue your session. If you click Cancel you will not be reminded during the current browser session anymore. Installation: %3$s. common#:#session_reminder_info#:#Receive a reminder before your online-session expires. +common#:#session_reminder_input#:#Session Reminder (in Minutes) common#:#session_reminder_lead_time#:#Leadtime -common#:#session_reminder_lead_time_info#:#Please specify the lead time for the session reminder in minutes. The reminder displays a warning when only this time span is left before the session expires. Recommended value is 5 (minutes)
The current length of a user session is %s. +common#:#session_reminder_lead_time_info#:#Please specify how many minutes before the expiration of a session you would like to receive a reminder.
The function is deactivated when the value is '%s'. Recommended value is %s.
Your current length of a session is %s. common#:#session_reminder_session_duration#:#(Session duration: %s). common#:#set#:#Set common#:#setSystemLanguage#:#Set System Language