ConfigPress.php
1 year ago
Content.php
1 year ago
Core.php
1 year ago
Manager.php
1 year ago
Multisite.php
1 year ago
Security.php
1 year ago
Service.php
1 year ago
Security.php
80 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 | * @version 7.0.0 |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Settings_Security extends AAM_Backend_Feature_Abstract |
| 17 | { |
| 18 | |
| 19 | /** |
| 20 | * Default access capability to the collection of settings |
| 21 | * |
| 22 | * @version 7.0.0 |
| 23 | */ |
| 24 | const ACCESS_CAPABILITY = 'aam_manage_settings'; |
| 25 | |
| 26 | /** |
| 27 | * HTML template to render |
| 28 | * |
| 29 | * @version 7.0.0 |
| 30 | */ |
| 31 | const TEMPLATE = 'settings/security.php'; |
| 32 | |
| 33 | /** |
| 34 | * Get list of security options |
| 35 | * |
| 36 | * @return array |
| 37 | * @access public |
| 38 | * |
| 39 | * @version 7.0.0 |
| 40 | */ |
| 41 | public static function getList() |
| 42 | { |
| 43 | $configs = AAM::api()->config; |
| 44 | $settings = array( |
| 45 | 'service.secure_login.single_session' => array( |
| 46 | 'title' => __('One Session Per User', 'advanced-access-manager'), |
| 47 | 'description' => 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 refer to the %sOne Session Per User%s page.', 'strong', 'strong'), '<a href="https://aamportal.com/reference/advanced-access-manager/setting/one-session-per-user?ref=plugin" target="_blank">', '</a>'), |
| 48 | 'value' => $configs->get('service.secure_login.single_session') |
| 49 | ), |
| 50 | 'service.secure_login.brute_force_lockout' => array( |
| 51 | 'title' => __('Brute Force Lockout', 'advanced-access-manager'), |
| 52 | 'description' => sprintf(AAM_Backend_View_Helper::preparePhrase('Automatically reject login request if number of unsuccessful attempts exceeds 20 over the period of 2 minutes (both values are configurable). For more information refer to the %sBrute Force Lockout%s page.', 'strong', 'strong'), '<a href="https://aamportal.com/reference/advanced-access-manager/setting/bruteforce-lockout?ref=plugin" target="_blank">', '</a>'), |
| 53 | 'value' => $configs->get('service.secure_login.brute_force_lockout') |
| 54 | ), |
| 55 | ); |
| 56 | |
| 57 | return apply_filters('aam_settings_list_filter', $settings, 'security'); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Register security settings |
| 62 | * |
| 63 | * @return void |
| 64 | * @access public |
| 65 | * |
| 66 | * @version 7.0.0 |
| 67 | */ |
| 68 | public static function register() |
| 69 | { |
| 70 | AAM_Backend_Feature::registerFeature((object) array( |
| 71 | 'uid' => 'settings-security', |
| 72 | 'position' => 6, |
| 73 | 'title' => __('Security Settings', 'advanced-access-manager'), |
| 74 | 'capability' => self::ACCESS_CAPABILITY, |
| 75 | 'type' => 'settings', |
| 76 | 'view' => __CLASS__ |
| 77 | )); |
| 78 | } |
| 79 | |
| 80 | } |