| 1 |
<?php |
| 2 |
|
| 3 |
namespace Codemanas\InactiveLogout\Requests; |
| 4 |
|
| 5 |
class GeneralSettingRequests { |
| 6 |
|
| 7 |
/** |
| 8 |
* Get main general settings data. |
| 9 |
* |
| 10 |
* @return array |
| 11 |
*/ |
| 12 |
public static function get(): array { |
| 13 |
return [ |
| 14 |
'logout_time' => filter_input( INPUT_POST, 'idle_timeout', FILTER_SANITIZE_NUMBER_INT ), |
| 15 |
'logout_message' => wp_kses_post( filter_input( INPUT_POST, 'idle_message_text' ) ), |
| 16 |
'after_logout_message' => wp_kses_post( filter_input( INPUT_POST, 'after_session_logout_message' ) ), |
| 17 |
'disable_countdown' => filter_input( INPUT_POST, 'idle_disable_countdown', FILTER_SANITIZE_NUMBER_INT ), |
| 18 |
'countdown_timeout' => filter_input( INPUT_POST, 'idle_countdown_timeout', FILTER_SANITIZE_NUMBER_INT ), |
| 19 |
'warn_message_enabled' => filter_input( INPUT_POST, 'ina_show_warn_message_only', FILTER_SANITIZE_NUMBER_INT ), |
| 20 |
'popup_behaviour' => filter_input( INPUT_POST, 'ina_popup_behaviour', FILTER_SANITIZE_NUMBER_INT ), |
| 21 |
'warn_message' => wp_kses_post( filter_input( INPUT_POST, 'ina_show_warn_message' ) ), |
| 22 |
'concurrent_login' => filter_input( INPUT_POST, 'ina_disable_multiple_login', FILTER_SANITIZE_NUMBER_INT ), |
| 23 |
'enable_redirect' => filter_input( INPUT_POST, 'ina_enable_redirect_link', FILTER_SANITIZE_NUMBER_INT ), |
| 24 |
'show_toast_notification' => filter_input( INPUT_POST, 'ina_show_toast_notification' ), |
| 25 |
'after_redirection_toast_message' => filter_input( INPUT_POST, 'ina_after_redirection_toast_message' ), |
| 26 |
'redirect_page_link' => filter_input( INPUT_POST, 'ina_redirect_page' ), |
| 27 |
'enable_debugger' => filter_input( INPUT_POST, 'ina_enable_debugger' ), |
| 28 |
'disable_close_without_reload' => filter_input( INPUT_POST, 'popup_modal_close_without_reload_hide' ), |
| 29 |
'disable_automatic_redirect_on_logout' => filter_input( INPUT_POST, 'ina_disable_automatic_redirect' ) |
| 30 |
]; |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* Get localization posted data |
| 35 |
* |
| 36 |
* @return array |
| 37 |
*/ |
| 38 |
public static function getLocalizations(): array { |
| 39 |
return [ |
| 40 |
'text_close' => filter_input( INPUT_POST, 'popup_modal_text_close' ), |
| 41 |
'text_ok' => filter_input( INPUT_POST, 'popup_modal_text_ok' ), |
| 42 |
'continue_browsing_text' => filter_input( INPUT_POST, 'popup_modal_text_continue_browsing' ), |
| 43 |
'popup_heading_text' => filter_input( INPUT_POST, 'popup_modal_text_popup_heading' ), |
| 44 |
'wakeup_cta' => filter_input( INPUT_POST, 'popup_modal_wakeup_continue_btn' ), |
| 45 |
'bottom_countdown_logout_text' => filter_input( INPUT_POST, 'bottom_countdown_logout_text' ), |
| 46 |
'bottom_countdown_last_active_text' => filter_input( INPUT_POST, 'bottom_countdown_last_active_text' ), |
| 47 |
]; |
| 48 |
} |
| 49 |
} |