Version Description
- Fixed Bug: https://forum.aamplugin.com/d/367-authentication-jwt-expires-fatal-error
- Fixed Bug: JWT validation endpoint did not check token's expiration based on UTC timezone
- Fixed Bug: Removed unnecessary console.log invocations from the aam.js library
- Fixed Bug: Fixed the potential bug with improperly merged options when access policy Param's Value is defined as multi-dimensional array
- Fixed Bug: https://forum.aamplugin.com/d/339-problem-with-login-shortcode-and-widget
- Fixed Bug: https://forum.aamplugin.com/d/371-you-are-not-allowed-to-manage-any-aam-subject
- Fixed Bug: Incompatibility with plugins that are extremely aggressive and modify the WP_Query "suppress_filters" flag. Shame on you guys!
Download this release
Release Info
Developer | vasyltech |
Plugin | Advanced Access Manager |
Version | 6.0.4 |
Comparing to | |
See all releases |
Code changes from version 6.0.3 to 6.0.4
- aam.php +2 -2
- application/Backend/tmpl/widget/login-frontend.php +6 -5
- application/Core/Jwt/Issuer.php +25 -9
- application/Core/Object/Post.php +3 -2
- application/Core/Policy/Manager.php +9 -4
- application/Service/Content.php +14 -3
- application/Service/Core.php +9 -5
- media/js/aam.js +0 -2
- readme.txt +10 -1
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.0.
|
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.0.
|
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.0.4
|
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.0.4');
|
268 |
define('AAM_BASEDIR', __DIR__);
|
269 |
|
270 |
//load vendor
|
application/Backend/tmpl/widget/login-frontend.php
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<?php /** @version 6.0.
|
2 |
|
3 |
<?php if (defined('AAM_KEY')) { ?>
|
4 |
<?php
|
@@ -82,10 +82,11 @@
|
|
82 |
a.setRequestHeader("Content-Type", "application/json");
|
83 |
a.setRequestHeader("Accept", "application/json");
|
84 |
a.send(JSON.stringify({
|
85 |
-
username:
|
86 |
-
password:
|
87 |
-
redirect:
|
88 |
-
remember:
|
|
|
89 |
}))
|
90 |
})
|
91 |
})();
|
1 |
+
<?php /** @version 6.0.4 */ ?>
|
2 |
|
3 |
<?php if (defined('AAM_KEY')) { ?>
|
4 |
<?php
|
82 |
a.setRequestHeader("Content-Type", "application/json");
|
83 |
a.setRequestHeader("Accept", "application/json");
|
84 |
a.send(JSON.stringify({
|
85 |
+
username: document.getElementById("aam-login-username").value,
|
86 |
+
password: document.getElementById("aam-login-password").value,
|
87 |
+
redirect: document.getElementById("aam-login-redirect").value,
|
88 |
+
remember: document.getElementById("aam-login-remember").checked,
|
89 |
+
returnAuthCookies: true
|
90 |
}))
|
91 |
})
|
92 |
})();
|
application/Core/Jwt/Issuer.php
CHANGED
@@ -5,15 +5,16 @@
|
|
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 |
-
* @version 6.0.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* AAM JWT Issuer
|
14 |
*
|
|
|
|
|
|
|
15 |
* @package AAM
|
16 |
-
* @version 6.0.
|
17 |
*/
|
18 |
class AAM_Core_Jwt_Issuer
|
19 |
{
|
@@ -27,8 +28,11 @@ class AAM_Core_Jwt_Issuer
|
|
27 |
*
|
28 |
* @return object
|
29 |
*
|
|
|
|
|
|
|
30 |
* @access public
|
31 |
-
* @version 6.0.
|
32 |
*/
|
33 |
public function validateToken($token)
|
34 |
{
|
@@ -44,6 +48,11 @@ class AAM_Core_Jwt_Issuer
|
|
44 |
);
|
45 |
}
|
46 |
|
|
|
|
|
|
|
|
|
|
|
47 |
// Step #1. Check if token is actually valid
|
48 |
$response = Firebase\JWT\JWT::decode(
|
49 |
$token, $key, array_keys(Firebase\JWT\JWT::$supported_algs)
|
@@ -80,19 +89,26 @@ class AAM_Core_Jwt_Issuer
|
|
80 |
*
|
81 |
* @return object
|
82 |
*
|
|
|
|
|
|
|
|
|
83 |
* @access public
|
84 |
* @throws Exception
|
85 |
-
* @version 6.0.
|
86 |
*/
|
87 |
public function issueToken($args = array(), $expires = null)
|
88 |
{
|
89 |
if (!empty($expires)) {
|
90 |
$time = $expires;
|
91 |
} else {
|
92 |
-
$
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
96 |
}
|
97 |
|
98 |
$claims = apply_filters(
|
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 |
* AAM JWT Issuer
|
12 |
*
|
13 |
+
* @since 6.0.4 Bug fixing. Timezone was handled incorrectly and ttl did not take in
|
14 |
+
* consideration numeric "in seconds" value
|
15 |
+
* @since 6.0.0 Initial implementation of the class
|
16 |
* @package AAM
|
17 |
+
* @version 6.0.4
|
18 |
*/
|
19 |
class AAM_Core_Jwt_Issuer
|
20 |
{
|
28 |
*
|
29 |
* @return object
|
30 |
*
|
31 |
+
* @since 6.0.4 Making sure that JWT expiration is checked with UTC timezone
|
32 |
+
* @since 6.0.0 Initial implementation of the method
|
33 |
+
*
|
34 |
* @access public
|
35 |
+
* @version 6.0.4
|
36 |
*/
|
37 |
public function validateToken($token)
|
38 |
{
|
48 |
);
|
49 |
}
|
50 |
|
51 |
+
// Making sure that timestamp is UTC
|
52 |
+
Firebase\JWT\JWT::$timestamp = (new DateTime(
|
53 |
+
'now', new DateTimeZone('UTC')
|
54 |
+
))->getTimestamp();
|
55 |
+
|
56 |
// Step #1. Check if token is actually valid
|
57 |
$response = Firebase\JWT\JWT::decode(
|
58 |
$token, $key, array_keys(Firebase\JWT\JWT::$supported_algs)
|
89 |
*
|
90 |
* @return object
|
91 |
*
|
92 |
+
* @since 6.0.4 Fixed the bug when `authentication.jwt.expires` is defined in
|
93 |
+
* seconds
|
94 |
+
* @since 6.0.0 Initial implementation of the method
|
95 |
+
*
|
96 |
* @access public
|
97 |
* @throws Exception
|
98 |
+
* @version 6.0.4
|
99 |
*/
|
100 |
public function issueToken($args = array(), $expires = null)
|
101 |
{
|
102 |
if (!empty($expires)) {
|
103 |
$time = $expires;
|
104 |
} else {
|
105 |
+
$ttl = AAM_Core_Config::get('authentication.jwt.expires', '+24 hours');
|
106 |
+
|
107 |
+
if (is_numeric($ttl)) {
|
108 |
+
$ttl = "+{$ttl} seconds";
|
109 |
+
}
|
110 |
+
|
111 |
+
$time = new DateTime($ttl, new DateTimeZone('UTC'));
|
112 |
}
|
113 |
|
114 |
$claims = apply_filters(
|
application/Core/Object/Post.php
CHANGED
@@ -49,8 +49,9 @@ class AAM_Core_Object_Post extends AAM_Core_Object
|
|
49 |
* @access public
|
50 |
* @version 6.0.0
|
51 |
*/
|
52 |
-
public function __construct(
|
53 |
-
|
|
|
54 |
$this->setSubject($subject);
|
55 |
$this->setSuppressFilters($suppressFilters);
|
56 |
|
49 |
* @access public
|
50 |
* @version 6.0.0
|
51 |
*/
|
52 |
+
public function __construct(
|
53 |
+
AAM_Core_Subject $subject, $post, $suppressFilters = false
|
54 |
+
) {
|
55 |
$this->setSubject($subject);
|
56 |
$this->setSuppressFilters($suppressFilters);
|
57 |
|
application/Core/Policy/Manager.php
CHANGED
@@ -5,15 +5,16 @@
|
|
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 |
-
* @version 6.0.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* AAM policy manager for a specific subject
|
14 |
*
|
|
|
|
|
|
|
15 |
* @package AAM
|
16 |
-
* @version 6.0.
|
17 |
*/
|
18 |
class AAM_Core_Policy_Manager
|
19 |
{
|
@@ -197,6 +198,10 @@ class AAM_Core_Policy_Manager
|
|
197 |
*
|
198 |
* @return mixed
|
199 |
*
|
|
|
|
|
|
|
|
|
200 |
* @access public
|
201 |
* @see AAM_Core_Policy_Manager::updatePolicyTree
|
202 |
* @version 6.0.0
|
@@ -207,7 +212,7 @@ class AAM_Core_Policy_Manager
|
|
207 |
|
208 |
if ($this->isApplicable($param)) {
|
209 |
if (is_array($res) && is_array($param['Value'])) {
|
210 |
-
$res =
|
211 |
} else {
|
212 |
$res = $param['Value'];
|
213 |
}
|
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 |
* AAM policy manager for a specific subject
|
12 |
*
|
13 |
+
* @since 6.0.4 Potential bug fix with improperly merged Param option:* values
|
14 |
+
* @since 6.0.0 Initial implementation of the class
|
15 |
+
*
|
16 |
* @package AAM
|
17 |
+
* @version 6.0.4
|
18 |
*/
|
19 |
class AAM_Core_Policy_Manager
|
20 |
{
|
198 |
*
|
199 |
* @return mixed
|
200 |
*
|
201 |
+
* @since 6.0.4 Fixed the potential bug with improperly merged options when Value
|
202 |
+
* is defined as multi-dimensional array
|
203 |
+
* @since 6.0.0 Initial implementation of the method
|
204 |
+
*
|
205 |
* @access public
|
206 |
* @see AAM_Core_Policy_Manager::updatePolicyTree
|
207 |
* @version 6.0.0
|
212 |
|
213 |
if ($this->isApplicable($param)) {
|
214 |
if (is_array($res) && is_array($param['Value'])) {
|
215 |
+
$res = array_replace_recursive($res, $param['Value']);
|
216 |
} else {
|
217 |
$res = $param['Value'];
|
218 |
}
|
application/Service/Content.php
CHANGED
@@ -10,13 +10,14 @@
|
|
10 |
/**
|
11 |
* Posts & Terms service
|
12 |
*
|
|
|
13 |
* @since 6.0.2 Refactored the way access to posts is managed. No more pseudo caps
|
14 |
* aam|...
|
15 |
* @since 6.0.1 Bug fixing
|
16 |
* @since 6.0.0 Initial implementation of the class
|
17 |
*
|
18 |
* @package AAM
|
19 |
-
* @version 6.0.
|
20 |
*/
|
21 |
class AAM_Service_Content
|
22 |
{
|
@@ -457,12 +458,20 @@ class AAM_Service_Content
|
|
457 |
*
|
458 |
* @return array
|
459 |
*
|
|
|
|
|
|
|
|
|
460 |
* @access public
|
461 |
-
* @version 6.0.
|
462 |
*/
|
463 |
public function filterPostQuery($clauses, $wp_query)
|
464 |
{
|
465 |
-
|
|
|
|
|
|
|
|
|
466 |
$object = AAM::getUser()->getObject(
|
467 |
AAM_Core_Object_Visibility::OBJECT_TYPE
|
468 |
);
|
@@ -472,6 +481,8 @@ class AAM_Service_Content
|
|
472 |
$clauses['where'] .= apply_filters(
|
473 |
'aam_content_visibility_where_clause_filter', $query, $wp_query
|
474 |
);
|
|
|
|
|
475 |
}
|
476 |
|
477 |
return $clauses;
|
10 |
/**
|
11 |
* Posts & Terms service
|
12 |
*
|
13 |
+
* @since 6.0.4 Fixed incompatibility with some quite aggressive plugins
|
14 |
* @since 6.0.2 Refactored the way access to posts is managed. No more pseudo caps
|
15 |
* aam|...
|
16 |
* @since 6.0.1 Bug fixing
|
17 |
* @since 6.0.0 Initial implementation of the class
|
18 |
*
|
19 |
* @package AAM
|
20 |
+
* @version 6.0.4
|
21 |
*/
|
22 |
class AAM_Service_Content
|
23 |
{
|
458 |
*
|
459 |
* @return array
|
460 |
*
|
461 |
+
* @since 6.0.4 Fixed incompatibility with some quite aggressive plugins that
|
462 |
+
* mutate global state of the WP_Query args
|
463 |
+
* @since 6.0.0 Initial implementation of the method
|
464 |
+
*
|
465 |
* @access public
|
466 |
+
* @version 6.0.4
|
467 |
*/
|
468 |
public function filterPostQuery($clauses, $wp_query)
|
469 |
{
|
470 |
+
static $executing = false;
|
471 |
+
|
472 |
+
if (!$wp_query->is_singular && !$executing) {
|
473 |
+
$executing = true;
|
474 |
+
|
475 |
$object = AAM::getUser()->getObject(
|
476 |
AAM_Core_Object_Visibility::OBJECT_TYPE
|
477 |
);
|
481 |
$clauses['where'] .= apply_filters(
|
482 |
'aam_content_visibility_where_clause_filter', $query, $wp_query
|
483 |
);
|
484 |
+
|
485 |
+
$executing = false;
|
486 |
}
|
487 |
|
488 |
return $clauses;
|
application/Service/Core.php
CHANGED
@@ -5,15 +5,16 @@
|
|
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 |
-
* @version 6.0.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* AAM core service
|
14 |
*
|
|
|
|
|
|
|
15 |
* @package AAM
|
16 |
-
* @version 6.0.
|
17 |
*/
|
18 |
class AAM_Service_Core
|
19 |
{
|
@@ -32,8 +33,12 @@ class AAM_Service_Core
|
|
32 |
*
|
33 |
* @access protected
|
34 |
*
|
|
|
|
|
|
|
|
|
35 |
* @return void
|
36 |
-
* @version 6.0.
|
37 |
*/
|
38 |
protected function __construct()
|
39 |
{
|
@@ -47,7 +52,6 @@ class AAM_Service_Core
|
|
47 |
|
48 |
if (is_admin()) {
|
49 |
if (AAM_Core_Config::get('ui.settings.renderAccessMetabox', true)) {
|
50 |
-
add_action('show_user_profile', array($this, 'renderAccessWidget'));
|
51 |
add_action('edit_user_profile', array($this, 'renderAccessWidget'));
|
52 |
}
|
53 |
|
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 |
* AAM core service
|
12 |
*
|
13 |
+
* @since 6.0.4 Bug fixing. Unwanted "Access Denied" metabox on the Your Profile page
|
14 |
+
* @since 6.0.0 Initial implementation of the class
|
15 |
+
*
|
16 |
* @package AAM
|
17 |
+
* @version 6.0.4
|
18 |
*/
|
19 |
class AAM_Service_Core
|
20 |
{
|
33 |
*
|
34 |
* @access protected
|
35 |
*
|
36 |
+
* @since 6.0.4 Fixed bug when Access Manager metabox is rendered on profile edit
|
37 |
+
* page
|
38 |
+
* @since 6.0.0 Initial implementation of the method
|
39 |
+
*
|
40 |
* @return void
|
41 |
+
* @version 6.0.4
|
42 |
*/
|
43 |
protected function __construct()
|
44 |
{
|
52 |
|
53 |
if (is_admin()) {
|
54 |
if (AAM_Core_Config::get('ui.settings.renderAccessMetabox', true)) {
|
|
|
55 |
add_action('edit_user_profile', array($this, 'renderAccessWidget'));
|
56 |
}
|
57 |
|
media/js/aam.js
CHANGED
@@ -3802,7 +3802,6 @@
|
|
3802 |
},
|
3803 |
createdRow: function (row, data) {
|
3804 |
// Render status
|
3805 |
-
console.log(data[2]);
|
3806 |
if (data[2] === true) {
|
3807 |
$('td:eq(0)', row).html(
|
3808 |
'<i class="icon-ok-circled text-success"></i>'
|
@@ -4500,7 +4499,6 @@
|
|
4500 |
AAM.prototype.initialize = function () {
|
4501 |
// Read default subject and set it for AAM object
|
4502 |
if ($('#aam-subject-type').length > 0) {
|
4503 |
-
console.log('Here');
|
4504 |
this.setSubject(
|
4505 |
$('#aam-subject-type').val(),
|
4506 |
$('#aam-subject-id').val(),
|
3802 |
},
|
3803 |
createdRow: function (row, data) {
|
3804 |
// Render status
|
|
|
3805 |
if (data[2] === true) {
|
3806 |
$('td:eq(0)', row).html(
|
3807 |
'<i class="icon-ok-circled text-success"></i>'
|
4499 |
AAM.prototype.initialize = function () {
|
4500 |
// Read default subject and set it for AAM object
|
4501 |
if ($('#aam-subject-type').length > 0) {
|
|
|
4502 |
this.setSubject(
|
4503 |
$('#aam-subject-type').val(),
|
4504 |
$('#aam-subject-id').val(),
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: access control, membership, backend menu, user role, restricted content, s
|
|
4 |
Requires at least: 4.7.0
|
5 |
Requires PHP: 5.6.0
|
6 |
Tested up to: 5.3
|
7 |
-
Stable tag: 6.0.
|
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,15 @@ We take security and privacy very seriously, that is why there are several non-n
|
|
91 |
|
92 |
== Changelog ==
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
= 6.0.3 =
|
95 |
* Fixed Bug: Fatal Error - Class 'AAM_Core_Server' not found. https://forum.aamplugin.com/d/358-uncaught-error-class-aam-core-server-not-found
|
96 |
* Fixed Bug: Fixed the bug where post types that do not have Gutenberg enabled are not shown on the Metaboxes & Widgets tab https://wordpress.org/support/topic/in-metaboxes-widgets-no-pages/
|
4 |
Requires at least: 4.7.0
|
5 |
Requires PHP: 5.6.0
|
6 |
Tested up to: 5.3
|
7 |
+
Stable tag: 6.0.4
|
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.0.4 =
|
95 |
+
* Fixed Bug: https://forum.aamplugin.com/d/367-authentication-jwt-expires-fatal-error
|
96 |
+
* Fixed Bug: JWT validation endpoint did not check token's expiration based on UTC timezone
|
97 |
+
* Fixed Bug: Removed unnecessary console.log invocations from the aam.js library
|
98 |
+
* Fixed Bug: Fixed the potential bug with improperly merged options when access policy Param's Value is defined as multi-dimensional array
|
99 |
+
* Fixed Bug: https://forum.aamplugin.com/d/339-problem-with-login-shortcode-and-widget
|
100 |
+
* Fixed Bug: https://forum.aamplugin.com/d/371-you-are-not-allowed-to-manage-any-aam-subject
|
101 |
+
* Fixed Bug: Incompatibility with plugins that are extremely aggressive and modify the WP_Query "suppress_filters" flag. Shame on you guys!
|
102 |
+
|
103 |
= 6.0.3 =
|
104 |
* Fixed Bug: Fatal Error - Class 'AAM_Core_Server' not found. https://forum.aamplugin.com/d/358-uncaught-error-class-aam-core-server-not-found
|
105 |
* Fixed Bug: Fixed the bug where post types that do not have Gutenberg enabled are not shown on the Metaboxes & Widgets tab https://wordpress.org/support/topic/in-metaboxes-widgets-no-pages/
|