Abstract.php
9 years ago
Capability.php
9 years ago
Contact.php
9 years ago
Extension.php
9 years ago
LoginRedirect.php
9 years ago
Menu.php
9 years ago
Metabox.php
9 years ago
Post.php
9 years ago
Redirect.php
9 years ago
Role.php
9 years ago
Security.php
9 years ago
Teaser.php
9 years ago
User.php
9 years ago
Utility.php
9 years ago
Security.php
83 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 manager |
| 12 | * |
| 13 | * @package AAM |
| 14 | * @author Vasyl Martyniuk <vasyl@vasyltech.com> |
| 15 | */ |
| 16 | class AAM_Backend_Feature_Security extends AAM_Backend_Feature_Abstract { |
| 17 | |
| 18 | /** |
| 19 | * @inheritdoc |
| 20 | */ |
| 21 | public static function getAccessOption() { |
| 22 | return 'feature.security.capability'; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * @inheritdoc |
| 27 | */ |
| 28 | public static function getTemplate() { |
| 29 | return 'security.phtml'; |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Save AAM utility options |
| 34 | * |
| 35 | * @return string |
| 36 | * |
| 37 | * @access public |
| 38 | */ |
| 39 | public function save() { |
| 40 | $param = AAM_Core_Request::post('param'); |
| 41 | $value = stripslashes(AAM_Core_Request::post('value')); |
| 42 | |
| 43 | AAM_Core_Config::set($param, $value); |
| 44 | |
| 45 | return json_encode(array('status' => 'success')); |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * |
| 50 | * @return type |
| 51 | */ |
| 52 | public function getOptionList() { |
| 53 | $filename = dirname(__FILE__) . '/../View/SecurityOptionList.php'; |
| 54 | $options = include $filename; |
| 55 | |
| 56 | return apply_filters('aam-security-option-list-filter', $options); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Register Contact/Hire feature |
| 61 | * |
| 62 | * @return void |
| 63 | * |
| 64 | * @access public |
| 65 | */ |
| 66 | public static function register() { |
| 67 | if (is_main_site()) { |
| 68 | $cap = AAM_Core_Config::get(self::getAccessOption(), 'administrator'); |
| 69 | |
| 70 | AAM_Backend_Feature::registerFeature((object) array( |
| 71 | 'uid' => 'security', |
| 72 | 'position' => 90, |
| 73 | 'title' => __('Security', AAM_KEY), |
| 74 | 'capability' => $cap, |
| 75 | 'subjects' => array( |
| 76 | 'AAM_Core_Subject_Role' |
| 77 | ), |
| 78 | 'view' => __CLASS__ |
| 79 | )); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | } |