ConfigPress.php
7 years ago
Content.php
7 years ago
Core.php
7 years ago
Manager.php
7 years ago
Security.php
7 years ago
Security.php
74 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Backend security settings |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @author Vasyl Martyniuk <vasyl@vasyltech.com> |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Settings_Security extends AAM_Backend_Feature_Abstract { |
| 17 | |
| 18 | /** |
| 19 | * @inheritdoc |
| 20 | */ |
| 21 | public static function getTemplate() { |
| 22 | return 'settings/security.phtml'; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * |
| 27 | * @return type |
| 28 | */ |
| 29 | protected function getList() { |
| 30 | $settings = array( |
| 31 | 'core.settings.loginTimeout' => array( |
| 32 | 'title' => __('Login Timeout', AAM_KEY), |
| 33 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('Delay the login process for 1 second (the value is configurable) to significantly reduce the chance for brute force or dictionary attack. For more information about this option please refer to %sHow does AAM Secure Login works%s.', 'strong', 'strong'), '<a href="https://aamplugin.com/help/how-does-aam-secure-login-works" target="_blank">', '</a>'), |
| 34 | 'value' => AAM_Core_Config::get('core.settings.loginTimeout', false) |
| 35 | ), |
| 36 | 'core.settings.loginTimeout' => array( |
| 37 | 'title' => __('Login Timeout', AAM_KEY), |
| 38 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('Delay the login process for 1 second (the value is configurable) to significantly reduce the chance for brute force or dictionary attack. For more information about this option please refer to %sHow does AAM Secure Login works%s.', 'strong', 'strong'), '<a href="https://aamplugin.com/help/how-does-aam-secure-login-works" target="_blank">', '</a>'), |
| 39 | 'value' => AAM_Core_Config::get('core.settings.loginTimeout', false) |
| 40 | ), |
| 41 | 'core.settings.singleSession' => array( |
| 42 | 'title' => __('One Session Per User', AAM_KEY), |
| 43 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('Automatically destroy all other sessions for a user if he/she tries to login from different location. For more information about this option please refer to %sHow does AAM Secure Login works%s.', 'strong', 'strong'), '<a href="https://aamplugin.com/help/how-does-aam-secure-login-works" target="_blank">', '</a>'), |
| 44 | 'value' => AAM_Core_Config::get('core.settings.singleSession', false) |
| 45 | ), |
| 46 | 'core.settings.bruteForceLockout' => array( |
| 47 | 'title' => __('Brute Force Lockout', AAM_KEY), |
| 48 | 'descr' => sprintf(AAM_Backend_View_Helper::preparePhrase('Automatically reject login attempts if number of unsuccessful login attempts is more than 20 over the period of 2 minutes (both values are configurable). For more information about this option please refer to %sHow does AAM Secure Login works%s.', 'strong', 'strong'), '<a href="https://aamplugin.com/help/how-does-aam-secure-login-works" target="_blank">', '</a>'), |
| 49 | 'value' => AAM_Core_Config::get('core.settings.bruteForceLockout', false) |
| 50 | ), |
| 51 | ); |
| 52 | |
| 53 | return apply_filters('aam-settings-filter', $settings, 'security'); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Register Contact/Hire feature |
| 58 | * |
| 59 | * @return void |
| 60 | * |
| 61 | * @access public |
| 62 | */ |
| 63 | public static function register() { |
| 64 | AAM_Backend_Feature::registerFeature((object) array( |
| 65 | 'uid' => 'settings-security', |
| 66 | 'position' => 6, |
| 67 | 'title' => __('Security Settings', AAM_KEY), |
| 68 | 'capability' => 'aam_manage_settings', |
| 69 | 'type' => 'settings', |
| 70 | 'view' => __CLASS__ |
| 71 | )); |
| 72 | } |
| 73 | |
| 74 | } |