Version Description
- Fixed Bug: PHP Warning: preg_match(): Compilation failed https://github.com/aamplugin/advanced-access-manager/issues/163
- Added New: Thx to @sigysmund. Support for OpenSSL RSA private keys, to have a passphrase https://github.com/aamplugin/advanced-access-manager/issues/165
- Changed: Remove Support Message Modal from UI https://github.com/aamplugin/advanced-access-manager/issues/164
Download this release
Release Info
Developer | vasyltech |
Plugin | Advanced Access Manager |
Version | 6.7.2 |
Comparing to | |
See all releases |
Code changes from version 6.7.1 to 6.7.2
- aam.php +2 -2
- application/Backend/Feature/Settings/Manager.php +2 -36
- application/Backend/tmpl/metabox/main-iframe.php +2 -45
- application/Core/Jwt/Issuer.php +7 -2
- application/Service/Route.php +7 -3
- media/js/aam.js +0 -72
- readme.txt +7 -2
aam.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
/**
|
4 |
* Plugin Name: Advanced Access Manager
|
5 |
* Description: Collection of features to manage your WordPress website authentication, authorization and monitoring
|
6 |
-
* Version: 6.7.
|
7 |
* Author: Vasyl Martyniuk <vasyl@vasyltech.com>
|
8 |
* Author URI: https://vasyltech.com
|
9 |
* Text Domain: advanced-access-manager
|
@@ -264,7 +264,7 @@ if (defined('ABSPATH')) {
|
|
264 |
//define few common constants
|
265 |
define('AAM_MEDIA', plugins_url('/media', __FILE__));
|
266 |
define('AAM_KEY', 'advanced-access-manager');
|
267 |
-
define('AAM_VERSION', '6.7.
|
268 |
define('AAM_BASEDIR', __DIR__);
|
269 |
|
270 |
//load vendor
|
3 |
/**
|
4 |
* Plugin Name: Advanced Access Manager
|
5 |
* Description: Collection of features to manage your WordPress website authentication, authorization and monitoring
|
6 |
+
* Version: 6.7.2
|
7 |
* Author: Vasyl Martyniuk <vasyl@vasyltech.com>
|
8 |
* Author URI: https://vasyltech.com
|
9 |
* Text Domain: advanced-access-manager
|
264 |
//define few common constants
|
265 |
define('AAM_MEDIA', plugins_url('/media', __FILE__));
|
266 |
define('AAM_KEY', 'advanced-access-manager');
|
267 |
+
define('AAM_VERSION', '6.7.2');
|
268 |
define('AAM_BASEDIR', __DIR__);
|
269 |
|
270 |
//load vendor
|
application/Backend/Feature/Settings/Manager.php
CHANGED
@@ -10,6 +10,7 @@
|
|
10 |
/**
|
11 |
* Backend Settings area abstract manager
|
12 |
*
|
|
|
13 |
* @since 6.7.0 https://github.com/aamplugin/advanced-access-manager/issues/150
|
14 |
* @since 6.6.0 https://github.com/aamplugin/advanced-access-manager/issues/130
|
15 |
* @since 6.5.0 https://github.com/aamplugin/advanced-access-manager/issues/109
|
@@ -18,7 +19,7 @@
|
|
18 |
* @since 6.0.0 Initial implementation of the class
|
19 |
*
|
20 |
* @package AAM
|
21 |
-
* @version 6.7.
|
22 |
*/
|
23 |
class AAM_Backend_Feature_Settings_Manager extends AAM_Backend_Feature_Abstract
|
24 |
{
|
@@ -86,41 +87,6 @@ class AAM_Backend_Feature_Settings_Manager extends AAM_Backend_Feature_Abstract
|
|
86 |
return wp_json_encode(array('status' => 'success'));
|
87 |
}
|
88 |
|
89 |
-
/**
|
90 |
-
* Aggregate support request metadata
|
91 |
-
*
|
92 |
-
* @return string
|
93 |
-
*
|
94 |
-
* @since 6.5.0 https://github.com/aamplugin/advanced-access-manager/issues/106
|
95 |
-
* @since 6.3.0 Optimized AAM_Core_API::getOption call
|
96 |
-
* @since 6.2.0 Initial implementation of the method
|
97 |
-
*
|
98 |
-
* @access public
|
99 |
-
* @version 6.5.0
|
100 |
-
*/
|
101 |
-
public function getSupportMetadata()
|
102 |
-
{
|
103 |
-
global $wp_version;
|
104 |
-
|
105 |
-
return wp_json_encode(array(
|
106 |
-
'wpVersion' => $wp_version,
|
107 |
-
'aamVersion' => AAM_VERSION,
|
108 |
-
'settings' => AAM_Core_API::getOption(AAM_Core_AccessSettings::DB_OPTION),
|
109 |
-
'config' => AAM_Core_API::getOption(AAM_Core_Config::DB_OPTION),
|
110 |
-
'configpress' => AAM_Core_API::getOption(AAM_Core_ConfigPress::DB_OPTION),
|
111 |
-
'roles' => AAM_Core_API::getOption(AAM_Core_API::getRoles()->role_key),
|
112 |
-
'addons' => AAM_Addon_Repository::getInstance()->getRegistry(),
|
113 |
-
'plugins' => array_map(function($plugin) {
|
114 |
-
return array(
|
115 |
-
'Name' => (isset($plugin['Name']) ? $plugin['Name'] : null),
|
116 |
-
'PluginURI' => (isset($plugin['PluginURI']) ? $plugin['PluginURI'] : null),
|
117 |
-
'Version' => (isset($plugin['Version']) ? $plugin['Version'] : null),
|
118 |
-
'AuthorURI' => (isset($plugin['AuthorURI']) ? $plugin['AuthorURI'] : null),
|
119 |
-
);
|
120 |
-
}, get_plugins())
|
121 |
-
));
|
122 |
-
}
|
123 |
-
|
124 |
/**
|
125 |
* Export AAM settings as JSON
|
126 |
*
|
10 |
/**
|
11 |
* Backend Settings area abstract manager
|
12 |
*
|
13 |
+
* @since 6.7.2 https://github.com/aamplugin/advanced-access-manager/issues/164
|
14 |
* @since 6.7.0 https://github.com/aamplugin/advanced-access-manager/issues/150
|
15 |
* @since 6.6.0 https://github.com/aamplugin/advanced-access-manager/issues/130
|
16 |
* @since 6.5.0 https://github.com/aamplugin/advanced-access-manager/issues/109
|
19 |
* @since 6.0.0 Initial implementation of the class
|
20 |
*
|
21 |
* @package AAM
|
22 |
+
* @version 6.7.2
|
23 |
*/
|
24 |
class AAM_Backend_Feature_Settings_Manager extends AAM_Backend_Feature_Abstract
|
25 |
{
|
87 |
return wp_json_encode(array('status' => 'success'));
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
/**
|
91 |
* Export AAM settings as JSON
|
92 |
*
|
application/Backend/tmpl/metabox/main-iframe.php
CHANGED
@@ -72,9 +72,9 @@
|
|
72 |
</a>
|
73 |
<?php } ?>
|
74 |
<?php if (current_user_can('aam_view_help_btn')) { ?>
|
75 |
-
<a href="
|
76 |
<i class="icon-chat"></i>
|
77 |
-
<span><?php echo __('
|
78 |
</a>
|
79 |
<?php } ?>
|
80 |
</div>
|
@@ -82,49 +82,6 @@
|
|
82 |
</div>
|
83 |
</div>
|
84 |
|
85 |
-
<?php if (current_user_can('aam_view_help_btn')) { ?>
|
86 |
-
<div class="modal fade" id="modal-support" tabindex="-1" role="dialog">
|
87 |
-
<div class="modal-dialog" role="document">
|
88 |
-
<div class="modal-content">
|
89 |
-
<div class="modal-header">
|
90 |
-
<button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">×</span></button>
|
91 |
-
<h4 class="modal-title text-left"><?php echo __('Ask For Help', AAM_KEY); ?></h4>
|
92 |
-
</div>
|
93 |
-
<div class="modal-body">
|
94 |
-
<p class="alert alert-warning"><?php echo sprintf(__('Before submitting a support request, please get familiar with %show AAM support works%s so you can set the right expectations. Especially pay attention to how do we prioritize support.', AAM_KEY), '<a href="https://aamplugin.com/support" target="_blank">', '</a>'); ?></p>
|
95 |
-
|
96 |
-
<div class="form-group aam-outer-top-xxs">
|
97 |
-
<label><?php echo __('Name', AAM_KEY); ?></label>
|
98 |
-
<input type="text" class="form-control" placeholder="<?php echo __('How should we call you', AAM_KEY); ?>" id="support-name" />
|
99 |
-
</div>
|
100 |
-
|
101 |
-
<div class="form-group">
|
102 |
-
<label><?php echo __('Email', AAM_KEY); ?> <sup class="text-danger">*</sup></label>
|
103 |
-
<input type="email" class="form-control" placeholder="<?php echo __('Enter your email', AAM_KEY); ?>" id="support-email" />
|
104 |
-
<span class="hint text-muted"><?php echo __('The rest of the conversation will be conducted via provided email', AAM_KEY); ?></span>
|
105 |
-
</div>
|
106 |
-
|
107 |
-
<div class="form-group">
|
108 |
-
<label><?php echo __('Message', AAM_KEY); ?> <sup class="text-danger">*</sup></label>
|
109 |
-
<textarea class="form-control" placeholder="<?php echo __('Enter your message here...', AAM_KEY); ?>" rows="5" id="support-message"></textarea>
|
110 |
-
<span class="hint text-muted"><?php echo AAM_Backend_View_Helper::preparePhrase('Please be [kind], [specific] and [patient], and let us do the rest', 'strong', 'strong', 'strong'); ?></span>
|
111 |
-
</div>
|
112 |
-
|
113 |
-
<div class="checkbox">
|
114 |
-
<label>
|
115 |
-
<input type="checkbox" checked id="support-details" /> <?php echo sprintf(__('Attach system details (%slearn more here%s)', AAM_KEY), '<a href="https://forum.aamplugin.com/d/454-support-request-with-attached-system-details" target="_blank">', '</a>'); ?>
|
116 |
-
</label>
|
117 |
-
</div>
|
118 |
-
</div>
|
119 |
-
<div class="modal-footer">
|
120 |
-
<button type="button" class="btn btn-success" id="submit-support"><?php echo __('Request Support', AAM_KEY); ?></button>
|
121 |
-
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
|
122 |
-
</div>
|
123 |
-
</div>
|
124 |
-
</div>
|
125 |
-
</div>
|
126 |
-
<?php } ?>
|
127 |
-
|
128 |
<?php if (current_user_can('aam_manage_settings')) { ?>
|
129 |
<div class="metabox-holder settings-metabox" style="display:none;">
|
130 |
<div class="postbox">
|
72 |
</a>
|
73 |
<?php } ?>
|
74 |
<?php if (current_user_can('aam_view_help_btn')) { ?>
|
75 |
+
<a href="https://aamplugin.com/support" target="_blank" title="Ask For Help">
|
76 |
<i class="icon-chat"></i>
|
77 |
+
<span><?php echo __('Support', AAM_KEY); ?></span>
|
78 |
</a>
|
79 |
<?php } ?>
|
80 |
</div>
|
82 |
</div>
|
83 |
</div>
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
<?php if (current_user_can('aam_manage_settings')) { ?>
|
86 |
<div class="metabox-holder settings-metabox" style="display:none;">
|
87 |
<div class="postbox">
|
application/Core/Jwt/Issuer.php
CHANGED
@@ -206,8 +206,13 @@ class AAM_Core_Jwt_Issuer
|
|
206 |
);
|
207 |
|
208 |
if (strpos($alg, 'RS') === 0) {
|
209 |
-
$path
|
210 |
-
$key
|
|
|
|
|
|
|
|
|
|
|
211 |
} else {
|
212 |
$key = AAM_Core_Config::get('authentication.jwt.secret', SECURE_AUTH_KEY);
|
213 |
}
|
206 |
);
|
207 |
|
208 |
if (strpos($alg, 'RS') === 0) {
|
209 |
+
$path = AAM_Core_Config::get('authentication.jwt.privateKeyPath');
|
210 |
+
$key = (is_readable($path) ? file_get_contents($path) : null);
|
211 |
+
$passphrase = AAM_Core_Config::get('authentication.jwt.passphrase', false);
|
212 |
+
|
213 |
+
if($passphrase && extension_loaded('openssl')) {
|
214 |
+
$key = openssl_pkey_get_private($key, $passphrase);
|
215 |
+
}
|
216 |
} else {
|
217 |
$key = AAM_Core_Config::get('authentication.jwt.secret', SECURE_AUTH_KEY);
|
218 |
}
|
application/Service/Route.php
CHANGED
@@ -10,13 +10,14 @@
|
|
10 |
/**
|
11 |
* API Route service
|
12 |
*
|
|
|
13 |
* @since 6.7.0 https://github.com/aamplugin/advanced-access-manager/issues/153
|
14 |
* @since 6.4.0 Enhanced https://github.com/aamplugin/advanced-access-manager/issues/71
|
15 |
* Fixed https://github.com/aamplugin/advanced-access-manager/issues/76
|
16 |
* @since 6.0.0 Initial implementation of the class
|
17 |
*
|
18 |
* @package AAM
|
19 |
-
* @version 6.7.
|
20 |
*/
|
21 |
class AAM_Service_Route
|
22 |
{
|
@@ -192,8 +193,11 @@ class AAM_Service_Route
|
|
192 |
*
|
193 |
* @return WP_Error|null
|
194 |
*
|
|
|
|
|
|
|
195 |
* @access public
|
196 |
-
* @version 6.
|
197 |
*/
|
198 |
public function authorizeRequest($response, $server, $request)
|
199 |
{
|
@@ -203,7 +207,7 @@ class AAM_Service_Route
|
|
203 |
$method = $request->get_method();
|
204 |
|
205 |
foreach (array_keys($server->get_routes()) as $route) {
|
206 |
-
if ($route === $matched || preg_match(
|
207 |
if ($object->isRestricted('restful', $route, $method)) {
|
208 |
$response = new WP_Error(
|
209 |
'rest_access_denied',
|
10 |
/**
|
11 |
* API Route service
|
12 |
*
|
13 |
+
* @since 6.7.2 https://github.com/aamplugin/advanced-access-manager/issues/163
|
14 |
* @since 6.7.0 https://github.com/aamplugin/advanced-access-manager/issues/153
|
15 |
* @since 6.4.0 Enhanced https://github.com/aamplugin/advanced-access-manager/issues/71
|
16 |
* Fixed https://github.com/aamplugin/advanced-access-manager/issues/76
|
17 |
* @since 6.0.0 Initial implementation of the class
|
18 |
*
|
19 |
* @package AAM
|
20 |
+
* @version 6.7.2
|
21 |
*/
|
22 |
class AAM_Service_Route
|
23 |
{
|
193 |
*
|
194 |
* @return WP_Error|null
|
195 |
*
|
196 |
+
* @since 6.7.2 https://github.com/aamplugin/advanced-access-manager/issues/163
|
197 |
+
* @since 6.0.0 Initial implementation of the method
|
198 |
+
*
|
199 |
* @access public
|
200 |
+
* @version 6.7.2
|
201 |
*/
|
202 |
public function authorizeRequest($response, $server, $request)
|
203 |
{
|
207 |
$method = $request->get_method();
|
208 |
|
209 |
foreach (array_keys($server->get_routes()) as $route) {
|
210 |
+
if ($route === $matched || preg_match('#^' . preg_quote($route) . '$#i', $matched)) {
|
211 |
if ($object->isRestricted('restful', $route, $method)) {
|
212 |
$response = new WP_Error(
|
213 |
'rest_access_denied',
|
media/js/aam.js
CHANGED
@@ -4686,78 +4686,6 @@
|
|
4686 |
}
|
4687 |
})(jQuery);
|
4688 |
|
4689 |
-
/**
|
4690 |
-
* Support message
|
4691 |
-
*/
|
4692 |
-
(function ($) {
|
4693 |
-
|
4694 |
-
function setRequest(payload) {
|
4695 |
-
$.ajax(`${getLocal().system.apiEndpoint}/message`, {
|
4696 |
-
type: 'POST',
|
4697 |
-
dataType: 'json',
|
4698 |
-
data: JSON.stringify(payload),
|
4699 |
-
contentType: 'application/json',
|
4700 |
-
headers: {
|
4701 |
-
"Accept": "application/json"
|
4702 |
-
},
|
4703 |
-
success: function () {
|
4704 |
-
getAAM().notification(
|
4705 |
-
'success', getAAM().__('Message has been sent')
|
4706 |
-
);
|
4707 |
-
$('input,textarea', '#modal-support').val('');
|
4708 |
-
$('#modal-support').modal('hide');
|
4709 |
-
},
|
4710 |
-
error: function (response) {
|
4711 |
-
getAAM().notification(
|
4712 |
-
'danger', response.responseJSON.reason
|
4713 |
-
);
|
4714 |
-
}
|
4715 |
-
});
|
4716 |
-
}
|
4717 |
-
|
4718 |
-
$('#submit-support').bind('click', function() {
|
4719 |
-
// Prepare request model
|
4720 |
-
let request = {
|
4721 |
-
'email': $.trim($('#support-email').val()),
|
4722 |
-
'fullname': $.trim($('#support-name').val()),
|
4723 |
-
'message': $.trim($('#support-message').val()),
|
4724 |
-
}
|
4725 |
-
|
4726 |
-
// Validate the data
|
4727 |
-
let error = false;
|
4728 |
-
|
4729 |
-
const regex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w+)+$/;
|
4730 |
-
if (!request.email || !regex.test(request.email)) {
|
4731 |
-
error = true;
|
4732 |
-
$('#support-email').focus();
|
4733 |
-
}
|
4734 |
-
|
4735 |
-
if (!request.message) {
|
4736 |
-
error = true;
|
4737 |
-
$('#support-message').focus();
|
4738 |
-
}
|
4739 |
-
|
4740 |
-
if (error === false) {
|
4741 |
-
if ($('#support-details').prop('checked')) {
|
4742 |
-
$.ajax(getLocal().ajaxurl, {
|
4743 |
-
type: 'POST',
|
4744 |
-
dataType: 'json',
|
4745 |
-
data: {
|
4746 |
-
action: 'aam',
|
4747 |
-
sub_action: 'Settings_Manager.getSupportMetadata',
|
4748 |
-
_ajax_nonce: getLocal().nonce,
|
4749 |
-
},
|
4750 |
-
success: function(response) {
|
4751 |
-
request.metadata = response;
|
4752 |
-
setRequest(request);
|
4753 |
-
}
|
4754 |
-
});
|
4755 |
-
}
|
4756 |
-
}
|
4757 |
-
});
|
4758 |
-
|
4759 |
-
})(jQuery);
|
4760 |
-
|
4761 |
/**
|
4762 |
* Top subject bar
|
4763 |
*/
|
4686 |
}
|
4687 |
})(jQuery);
|
4688 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4689 |
/**
|
4690 |
* Top subject bar
|
4691 |
*/
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: vasyltech
|
|
3 |
Tags: access control, membership, backend menu, user role, restricted content, security, jwt
|
4 |
Requires at least: 4.7.0
|
5 |
Requires PHP: 5.6.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 6.7.
|
8 |
|
9 |
All you need to manage access to WordPress websites on the frontend, backend and API levels for any role, user or visitors.
|
10 |
|
@@ -91,6 +91,11 @@ We take security and privacy very seriously, that is why there are several non-n
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
94 |
= 6.7.1 =
|
95 |
* Fixed Bug: PHP Fatal error: Uncaught Error: Class name must be a valid object or a string [https://github.com/aamplugin/advanced-access-manager/issues/156](https://github.com/aamplugin/advanced-access-manager/issues/156)
|
96 |
|
3 |
Tags: access control, membership, backend menu, user role, restricted content, security, jwt
|
4 |
Requires at least: 4.7.0
|
5 |
Requires PHP: 5.6.0
|
6 |
+
Tested up to: 5.6.0
|
7 |
+
Stable tag: 6.7.2
|
8 |
|
9 |
All you need to manage access to WordPress websites on the frontend, backend and API levels for any role, user or visitors.
|
10 |
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 6.7.2 =
|
95 |
+
* Fixed Bug: PHP Warning: preg_match(): Compilation failed [https://github.com/aamplugin/advanced-access-manager/issues/163](https://github.com/aamplugin/advanced-access-manager/issues/163)
|
96 |
+
* Added New: Thx to [@sigysmund](https://github.com/sigysmund). Support for OpenSSL RSA private keys, to have a passphrase [https://github.com/aamplugin/advanced-access-manager/issues/165](https://github.com/aamplugin/advanced-access-manager/issues/165)
|
97 |
+
* Changed: Remove Support Message Modal from UI [https://github.com/aamplugin/advanced-access-manager/issues/164](https://github.com/aamplugin/advanced-access-manager/issues/164)
|
98 |
+
|
99 |
= 6.7.1 =
|
100 |
* Fixed Bug: PHP Fatal error: Uncaught Error: Class name must be a valid object or a string [https://github.com/aamplugin/advanced-access-manager/issues/156](https://github.com/aamplugin/advanced-access-manager/issues/156)
|
101 |
|