Advanced Access Manager - Version 5.1

Version Description

  • Fixed sever minor bugs reported by users
  • Added free social login extension (alpha version undocumented)
  • Added ability to create a temporary user account
  • Moved all free extension to the Github repository
Download this release

Release Info

Developer vasyl_m
Plugin Icon 128x128 Advanced Access Manager
Version 5.1
Comparing to
See all releases

Code changes from version 5.0.8 to 5.1

Application/Backend/Feature/Extension/Manager.php CHANGED
@@ -56,11 +56,7 @@ class AAM_Backend_Feature_Extension_Manager extends AAM_Backend_Feature_Abstract
56
  $package = AAM_Core_Server::download($license);
57
 
58
  if (is_wp_error($package)) {
59
- $manually = sprintf(
60
- __('To install extension manually, check %sthis article%s.', AAM_KEY),
61
- '<a href="https://aamplugin.com/help/how-to-install-aam-extension-manually">',
62
- '</a>'
63
- );
64
  $response = array(
65
  'status' => 'failure',
66
  'error' => strip_tags($package->get_error_message()) . ' ' . $manually
56
  $package = AAM_Core_Server::download($license);
57
 
58
  if (is_wp_error($package)) {
59
+ $manually = __('You may try to install extension manually.', AAM_KEY);
 
 
 
 
60
  $response = array(
61
  'status' => 'failure',
62
  'error' => strip_tags($package->get_error_message()) . ' ' . $manually
Application/Backend/Feature/Subject/User.php CHANGED
@@ -25,39 +25,134 @@ class AAM_Backend_Feature_Subject_User {
25
  * @access public
26
  */
27
  public function getTable() {
 
 
 
 
 
 
 
28
  if (current_user_can('list_users')) {
29
  //get total number of users
30
  $total = count_users();
31
  $result = $this->query();
 
 
 
32
 
33
- $response = array(
34
- 'recordsTotal' => $total['total_users'],
35
- 'recordsFiltered' => $result->get_total(),
36
- 'draw' => AAM_Core_Request::request('draw'),
37
- 'data' => array(),
38
- );
39
-
40
- foreach ($result->get_results() as $user) {
41
- $response['data'][] = array(
42
- $user->ID,
43
- implode(', ', $this->getUserRoles($user->roles)),
44
- ($user->display_name ? $user->display_name : $user->user_nicename),
45
- implode(',', $this->prepareRowActions($user)),
46
- AAM_Core_API::maxLevel($user->allcaps)
47
  );
48
  }
49
- } else {
50
- $response = array(
51
- 'recordsTotal' => 0,
52
- 'recordsFiltered' => 0,
53
- 'draw' => AAM_Core_Request::request('draw'),
54
- 'data' => array(),
55
- );
56
  }
57
 
58
  return json_encode($response);
59
  }
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * Get list of user roles
63
  *
@@ -92,22 +187,18 @@ class AAM_Backend_Feature_Subject_User {
92
  *
93
  * @access protected
94
  */
95
- protected function prepareRowActions(WP_User $user) {
96
- $max = AAM_Core_API::maxLevel(wp_get_current_user()->allcaps);
97
-
98
- $allowed = ($max >= AAM_Core_API::maxLevel($user->allcaps));
99
-
100
- if ($allowed || ($user->ID == get_current_user_id())) {
101
  $actions = array('manage');
102
 
103
- if (AAM_Core_Config::get('secure-login', true)) {
104
- if (current_user_can('aam_toggle_users')) {
105
- $actions[] = ($user->user_status ? 'unlock' : 'lock');
106
- }
107
  }
108
 
109
  if (current_user_can('edit_users')) {
110
  $actions[] = 'edit';
 
111
  }
112
 
113
  if (current_user_can('aam_switch_users')) {
@@ -119,57 +210,56 @@ class AAM_Backend_Feature_Subject_User {
119
 
120
  return $actions;
121
  }
122
-
123
  /**
124
- * Query database for list of users
125
  *
126
- * Based on filters and settings get the list of users from database
 
 
127
  *
128
- * @return \WP_User_Query
129
  *
130
- * @access public
131
  */
132
- public function query() {
133
- $search = trim(AAM_Core_Request::request('search.value'));
134
-
135
- $args = array(
136
- 'blog_id' => get_current_blog_id(),
137
- 'fields' => 'all',
138
- 'number' => AAM_Core_Request::request('length'),
139
- 'offset' => AAM_Core_Request::request('start'),
140
- 'search' => ($search ? $search . '*' : ''),
141
- 'search_columns' => array(
142
- 'user_login', 'user_email', 'display_name'
143
- ),
144
- 'orderby' => 'user_nicename',
145
- 'order' => 'ASC'
146
- );
147
-
148
- return new WP_User_Query($args);
149
  }
150
-
151
  /**
152
- * Block user
 
 
153
  *
154
  * @return string
155
  *
156
- * @access public
157
  */
158
- public function block() {
159
- $result = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
- if (current_user_can('aam_toggle_users')) {
162
- $subject = AAM_Backend_Subject::getInstance();
163
-
164
- //user is not allowed to lock himself
165
- if ($subject->getId() != get_current_user_id()) {
166
- $result = $subject->block();
167
- }
168
- }
169
-
170
- return json_encode(
171
- array('status' => ($result ? 'success' : 'failure'))
172
- );
173
  }
174
 
175
  }
25
  * @access public
26
  */
27
  public function getTable() {
28
+ $response = array(
29
+ 'recordsTotal' => 0,
30
+ 'recordsFiltered' => 0,
31
+ 'draw' => AAM_Core_Request::request('draw'),
32
+ 'data' => array(),
33
+ );
34
+
35
  if (current_user_can('list_users')) {
36
  //get total number of users
37
  $total = count_users();
38
  $result = $this->query();
39
+
40
+ $response['recordsTotal'] = $total['total_users'];
41
+ $response['recordsFiltered'] = $result->get_total();
42
 
43
+ foreach ($result->get_results() as $row) {
44
+ $response['data'][] = $this->prepareRow(
45
+ new AAM_Core_Subject_User($row->ID)
 
 
 
 
 
 
 
 
 
 
 
46
  );
47
  }
 
 
 
 
 
 
 
48
  }
49
 
50
  return json_encode($response);
51
  }
52
 
53
+ /**
54
+ * Save user expiration
55
+ *
56
+ * @return string
57
+ *
58
+ * @access public
59
+ */
60
+ public function saveExpiration() {
61
+ $response = array(
62
+ 'status' => 'failure',
63
+ 'reason' => __('Operation is not permitted', AAM_KEY)
64
+ );
65
+
66
+ $userId = filter_input(INPUT_POST, 'user');
67
+ $expires = filter_input(INPUT_POST, 'expires');
68
+ $action = filter_input(INPUT_POST, 'after');
69
+
70
+ if (current_user_can('edit_users')) {
71
+ if ($userId != get_current_user_id()) {
72
+ if ($this->isAllowed(new AAM_Core_Subject_User($userId))) {
73
+ $this->updateUserExpiration($userId, $expires, $action);
74
+ $response['status'] = 'success';
75
+ }
76
+ } else {
77
+ $response['reason'] = __('You cannot set expiration to yourself', AAM_KEY);
78
+ }
79
+ }
80
+
81
+ return json_encode($response);
82
+ }
83
+
84
+ /**
85
+ * Query database for list of users
86
+ *
87
+ * Based on filters and settings get the list of users from database
88
+ *
89
+ * @return \WP_User_Query
90
+ *
91
+ * @access public
92
+ */
93
+ public function query() {
94
+ $search = trim(AAM_Core_Request::request('search.value'));
95
+
96
+ $args = array(
97
+ 'blog_id' => get_current_blog_id(),
98
+ 'fields' => 'all',
99
+ 'number' => AAM_Core_Request::request('length'),
100
+ 'offset' => AAM_Core_Request::request('start'),
101
+ 'search' => ($search ? $search . '*' : ''),
102
+ 'search_columns' => array(
103
+ 'user_login', 'user_email', 'display_name'
104
+ ),
105
+ 'orderby' => 'user_nicename',
106
+ 'order' => 'ASC'
107
+ );
108
+
109
+ return new WP_User_Query($args);
110
+ }
111
+
112
+ /**
113
+ * Block user
114
+ *
115
+ * @return string
116
+ *
117
+ * @access public
118
+ */
119
+ public function block() {
120
+ $result = false;
121
+
122
+ if (current_user_can('aam_toggle_users') && current_user_ca('edit_users')) {
123
+ $subject = AAM_Backend_Subject::getInstance();
124
+
125
+ if ($this->isAllowed($subject->get())) {
126
+ //user is not allowed to lock himself
127
+ if ($subject->getId() != get_current_user_id()) {
128
+ $result = $subject->block();
129
+ }
130
+ }
131
+ }
132
+
133
+ return json_encode(array('status' => ($result ? 'success' : 'failure')));
134
+ }
135
+
136
+ /**
137
+ * Prepare row
138
+ *
139
+ * @param AAM_Core_Subject_User $user
140
+ *
141
+ * @return array
142
+ *
143
+ * @access protected
144
+ */
145
+ protected function prepareRow(AAM_Core_Subject_User $user) {
146
+ return array(
147
+ $user->ID,
148
+ implode(', ', $this->getUserRoles($user->roles)),
149
+ ($user->display_name ? $user->display_name : $user->user_nicename),
150
+ implode(',', $this->prepareRowActions($user)),
151
+ AAM_Core_API::maxLevel($user->allcaps),
152
+ $this->getUserExpiration($user)
153
+ );
154
+ }
155
+
156
  /**
157
  * Get list of user roles
158
  *
187
  *
188
  * @access protected
189
  */
190
+ protected function prepareRowActions(AAM_Core_Subject_User $user) {
191
+ if ($this->isAllowed($user) || ($user->ID == get_current_user_id())) {
 
 
 
 
192
  $actions = array('manage');
193
 
194
+ if (AAM_Core_Config::get('secure-login', true)
195
+ && current_user_can('aam_toggle_users')) {
196
+ $actions[] = ($user->user_status ? 'unlock' : 'lock');
 
197
  }
198
 
199
  if (current_user_can('edit_users')) {
200
  $actions[] = 'edit';
201
+ $actions[] = 'ttl';
202
  }
203
 
204
  if (current_user_can('aam_switch_users')) {
210
 
211
  return $actions;
212
  }
213
+
214
  /**
215
+ * Update user expiration
216
  *
217
+ * @param int $user
218
+ * @param string $expires
219
+ * @param string $action
220
  *
221
+ * @return bool
222
  *
223
+ * @access protected
224
  */
225
+ protected function updateUserExpiration($user, $expires, $action) {
226
+ if (trim($expires)) {
227
+ update_user_meta(
228
+ $user,
229
+ 'aam_user_expiration',
230
+ date('Y-m-d H:i:s', strtotime($expires)) . "|" . ($action ? $action : 'delete')
231
+ );
232
+ } else {
233
+ delete_user_meta($user, 'aam_user_expiration');
234
+ }
 
 
 
 
 
 
 
235
  }
236
+
237
  /**
238
+ * Get user expiration
239
+ *
240
+ * @param WP_User $user
241
  *
242
  * @return string
243
  *
244
+ * @access protected
245
  */
246
+ protected function getUserExpiration(AAM_Core_Subject_User $user) {
247
+ return get_user_meta($user->ID, 'aam_user_expiration', true);
248
+ }
249
+
250
+ /**
251
+ * Check max user allowance
252
+ *
253
+ * @param AAM_Core_Subject_User $user
254
+ *
255
+ * @return boolean
256
+ *
257
+ * @access protected
258
+ */
259
+ protected function isAllowed(AAM_Core_Subject_User $user) {
260
+ $max = AAM_Core_API::maxLevel(AAM::getUser()->allcaps);
261
 
262
+ return $max >= AAM_Core_API::maxLevel($user->allcaps);
 
 
 
 
 
 
 
 
 
 
 
263
  }
264
 
265
  }
Application/Backend/phtml/extensions.phtml CHANGED
@@ -26,7 +26,7 @@
26
  <div>
27
  <ul class="nav nav-tabs" role="tablist">
28
  <?php if(count($commercial)) { ?><li role="presentation" class="active"><a href="#premium-extensions" aria-controls="premium-extensions" role="tab" data-toggle="tab"><i class='icon-basket'></i> <?php echo __('Premium', AAM_KEY); ?></a></li><?php } ?>
29
- <?php if(count($free)) { ?><li role="presentation" <?php echo (!count($commercial) ? 'class="active"' : ''); ?>><a href="#free-extensions" aria-controls="free-extensions" role="tab" data-toggle="tab"><i class='icon-download-cloud'></i> <?php echo __('Free', AAM_KEY); ?></a></li><?php } ?>
30
  <li class="aam-update-check"><a href="#" id="aam-update-check"><i class='icon-arrows-cw'></i> <?php echo __('Check for Updates', AAM_KEY); ?></a></li>
31
  </ul>
32
 
@@ -38,7 +38,7 @@
38
  <?php foreach ($commercial as $i => $product) { ?>
39
  <tr>
40
  <td width="80%">
41
- <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['new']) ? ' <span class="badge">NEW</span> ' : ''), (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''); ?></span>
42
  <?php if (!empty($product['license']) && $this->canShowLicense()) { ?><small class="aam-license-key"><b>License:</b> <?php echo $product['license'] . (!empty($product['expire']) ? " (updates expire on {$product['expire']})" : ''); ?></small><?php } ?>
43
  <p class="aam-extension-description">
44
  <?php echo $product['description']; ?>
@@ -66,7 +66,7 @@
66
  <?php foreach ($free as $product) { ?>
67
  <tr>
68
  <td width="80%">
69
- <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''), ' - ' . ('<span class="text-success">' . __('Free', AAM_KEY) . '</span>'); ?></span>
70
  <p class="aam-extension-description">
71
  <?php echo $product['description']; ?>
72
  </p>
26
  <div>
27
  <ul class="nav nav-tabs" role="tablist">
28
  <?php if(count($commercial)) { ?><li role="presentation" class="active"><a href="#premium-extensions" aria-controls="premium-extensions" role="tab" data-toggle="tab"><i class='icon-basket'></i> <?php echo __('Premium', AAM_KEY); ?></a></li><?php } ?>
29
+ <?php if(count($free)) { ?><li role="presentation" <?php echo (!count($commercial) ? 'class="active"' : ''); ?>><a href="#free-extensions" aria-controls="free-extensions" role="tab" data-toggle="tab"><i class='icon-download-cloud'></i> <?php echo __('Free', AAM_KEY); ?> <span class="badge sup">NEW</span></a></li><?php } ?>
30
  <li class="aam-update-check"><a href="#" id="aam-update-check"><i class='icon-arrows-cw'></i> <?php echo __('Check for Updates', AAM_KEY); ?></a></li>
31
  </ul>
32
 
38
  <?php foreach ($commercial as $i => $product) { ?>
39
  <tr>
40
  <td width="80%">
41
+ <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['tag']) ? '<sup><span class="badge sup">' . $product['tag'] . '</span></sup>' : ''), (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''); ?></span>
42
  <?php if (!empty($product['license']) && $this->canShowLicense()) { ?><small class="aam-license-key"><b>License:</b> <?php echo $product['license'] . (!empty($product['expire']) ? " (updates expire on {$product['expire']})" : ''); ?></small><?php } ?>
43
  <p class="aam-extension-description">
44
  <?php echo $product['description']; ?>
66
  <?php foreach ($free as $product) { ?>
67
  <tr>
68
  <td width="80%">
69
+ <span class='aam-setting-title'><?php echo $product['title'], (!empty($product['tag']) ? '<sup><span class="badge sup">' . $product['tag'] . '</span></sup>' : ''), (!empty($product['version']) ? ' <small class="text-muted">v' . $product['version'] . '</small>' : ''), ' - ' . ('<span class="text-success">' . __('Free', AAM_KEY) . '</span>'); ?></span>
70
  <p class="aam-extension-description">
71
  <?php echo $product['description']; ?>
72
  </p>
Application/Backend/phtml/index.phtml CHANGED
@@ -225,13 +225,44 @@
225
  <tr>
226
  <th>ID</th>
227
  <th>Roles</th>
228
- <th width="65%"><?php echo __('Username', AAM_KEY); ?></th>
229
  <th><?php echo __('Action', AAM_KEY); ?></th>
230
  <th>Level</th>
 
231
  </tr>
232
  </thead>
233
  <tbody></tbody>
234
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  </div>
236
  <?php } ?>
237
  <?php if (current_user_can('aam_manage_visitors')) { ?>
225
  <tr>
226
  <th>ID</th>
227
  <th>Roles</th>
228
+ <th width="60%"><?php echo __('Username', AAM_KEY); ?></th>
229
  <th><?php echo __('Action', AAM_KEY); ?></th>
230
  <th>Level</th>
231
+ <th>Expiration</th>
232
  </tr>
233
  </thead>
234
  <tbody></tbody>
235
  </table>
236
+
237
+ <div class="modal fade" id="edit-user-expiration-modal" tabindex="-1" role="dialog">
238
+ <div class="modal-dialog modal-sm" role="document">
239
+ <div class="modal-content">
240
+ <div class="modal-header">
241
+ <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', AAM_KEY); ?>"><span aria-hidden="true">&times;</span></button>
242
+ <h4 class="modal-title"><?php echo __('Manage User Expiration', AAM_KEY); ?></h4>
243
+ </div>
244
+ <div class="modal-body">
245
+ <div class="form-group">
246
+ <label for="user-expires"><?php echo __('Expires', AAM_KEY); ?> <a href="https://aamplugin.com/help/how-to-create-temporary-wordpress-user-account" target="_blank" data-toggle="tooltip" title="For how long the user can stay active. Click to learn more."><i class="icon-help-circled"></i></a></label>
247
+ <input type="text" class="form-control" id="user-expires" placeholder="<?php echo __('Enter Expiration', AAM_KEY); ?>" />
248
+ </div>
249
+ <div class="form-group">
250
+ <label><?php echo __('Action After Expiration', AAM_KEY); ?> </label>
251
+ <select class="form-control" id="action-after-expiration">
252
+ <option value=""><?php echo __('Select Action', AAM_KEY); ?></option>
253
+ <option value="delete"><?php echo __('Delete Account', AAM_KEY); ?></option>
254
+ <option value="lock"><?php echo __('Lock Account', AAM_KEY); ?></option>
255
+ </select>
256
+ </div>
257
+ </div>
258
+ <div class="modal-footer">
259
+ <button type="button" class="btn btn-warning hidden" id="reset-user-expiration-btn"><?php echo __('Reset', AAM_KEY); ?></button>
260
+ <button type="button" class="btn btn-success" id="edit-user-expiration-btn"><?php echo __('Save', AAM_KEY); ?></button>
261
+ <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', AAM_KEY); ?></button>
262
+ </div>
263
+ </div>
264
+ </div>
265
+ </div>
266
  </div>
267
  <?php } ?>
268
  <?php if (current_user_can('aam_manage_visitors')) { ?>
Application/Backend/phtml/main/menu.phtml CHANGED
@@ -20,63 +20,75 @@
20
  <?php
21
  $first = false;
22
  $object = AAM_Backend_Subject::getInstance()->getObject('menu');
23
- foreach ($this->getMenu() as $i => $menu) {
24
- ?>
25
- <div class="panel panel-default">
26
- <div class="panel-heading" role="tab" id="menu-<?php echo $i; ?>-heading">
27
- <h4 class="panel-title">
28
- <a role="button" data-toggle="collapse" data-parent="#admin-menu" href="#menu-<?php echo $i; ?>" aria-controls="menu-<?php echo $i; ?>" <?php if (!$first) { echo 'aria-expanded="true"'; } ?>>
29
- <?php echo $menu['name']; ?> <small class="aam-menu-capability"><?php echo $menu['capability']; ?></small>
30
- </a>
31
- <?php if ($object->has($menu['id'])) { ?>
32
- <i class="aam-panel-title-icon icon-eye-off text-danger"></i>
33
- <?php } elseif ($this->hasSubmenuChecked($object, $menu['submenu'])) { ?>
34
- <i class="aam-panel-title-icon icon-attention-circled text-warning"></i>
35
- <?php } ?>
36
- </h4>
37
- </div>
 
 
 
38
 
39
- <div id="menu-<?php echo $i; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
40
- <div class="panel-body">
41
- <?php if (!empty($menu['submenu'])) { ?>
42
- <div class="row">
43
- <?php echo ($object->has($menu['id']) ? '<div class="aam-lock"></div>' : ''); ?>
44
- <?php foreach ($menu['submenu'] as $j => $submenu) { ?>
45
- <?php if ($submenu['id'] == 'index.php') { ?>
46
- <div class="col-xs-12 col-md-6 aam-submenu-item">
47
- <label for="menu-item-<?php echo $i . $j; ?>"><?php echo $submenu['name']; ?> <small class="aam-menu-capability"><?php echo $submenu['capability']; ?></small></label>
48
- <a href="#dashboard-lockout-modal" data-toggle="modal"><i class="icon-help-circled"></i></a>
49
- </div>
50
- <?php } else { ?>
51
- <div class="col-xs-12 col-md-6 aam-submenu-item">
52
- <label for="menu-item-<?php echo $i . $j; ?>"><?php echo $submenu['name']; ?> <small class="aam-menu-capability"><?php echo $submenu['capability']; ?></small></label>
53
- <input type="checkbox" class="aam-checkbox-danger" id="menu-item-<?php echo $i . $j; ?>" data-menu-id="<?php echo $submenu['id']; ?>"<?php echo ($object->has($submenu['id']) ? ' checked="checked"' : ''); ?> />
54
- <label for="menu-item-<?php echo $i . $j; ?>" data-toggle="tooltip" title="<?php echo ($object->has($submenu['id']) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
55
- </div>
 
56
  <?php } ?>
57
- <?php } ?>
58
- </div>
59
-
60
- <hr class="aam-divider" />
61
- <?php } ?>
62
 
63
- <div class="row<?php echo (!empty($menu['submenu']) ? ' aam-margin-top-xs' : ''); ?>">
64
- <div class="col-xs-10 col-md-6 col-xs-offset-1 col-md-offset-3">
65
- <?php if ($object->has($menu['id'])) { ?>
66
- <a href="#" class="btn btn-primary btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
67
- <i class="icon-eye"></i> <?php echo __('Show Menu', AAM_KEY); ?>
68
- </a>
69
- <?php } else { ?>
70
- <a href="#" class="btn btn-danger btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
71
- <i class="icon-eye-off"></i> <?php echo __('Restrict Menu', AAM_KEY); ?>
72
- </a>
73
- <?php } ?>
 
74
  </div>
75
  </div>
76
  </div>
77
  </div>
 
 
 
 
 
 
 
 
78
  </div>
79
- <?php } ?>
80
  </div>
81
 
82
  <div class="modal fade" id="dashboard-lockout-modal" tabindex="-1" role="dialog">
20
  <?php
21
  $first = false;
22
  $object = AAM_Backend_Subject::getInstance()->getObject('menu');
23
+ $menuList = $this->getMenu();
24
+
25
+ if (!empty($menuList)) {
26
+ foreach ($menuList as $i => $menu) {
27
+ ?>
28
+ <div class="panel panel-default">
29
+ <div class="panel-heading" role="tab" id="menu-<?php echo $i; ?>-heading">
30
+ <h4 class="panel-title">
31
+ <a role="button" data-toggle="collapse" data-parent="#admin-menu" href="#menu-<?php echo $i; ?>" aria-controls="menu-<?php echo $i; ?>" <?php if (!$first) { echo 'aria-expanded="true"'; } ?>>
32
+ <?php echo $menu['name']; ?> <small class="aam-menu-capability"><?php echo $menu['capability']; ?></small>
33
+ </a>
34
+ <?php if ($object->has($menu['id'])) { ?>
35
+ <i class="aam-panel-title-icon icon-eye-off text-danger"></i>
36
+ <?php } elseif ($this->hasSubmenuChecked($object, $menu['submenu'])) { ?>
37
+ <i class="aam-panel-title-icon icon-attention-circled text-warning"></i>
38
+ <?php } ?>
39
+ </h4>
40
+ </div>
41
 
42
+ <div id="menu-<?php echo $i; ?>" class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>" role="tabpanel" aria-labelledby="menu-<?php echo $i; ?>-heading">
43
+ <div class="panel-body">
44
+ <?php if (!empty($menu['submenu'])) { ?>
45
+ <div class="row">
46
+ <?php echo ($object->has($menu['id']) ? '<div class="aam-lock"></div>' : ''); ?>
47
+ <?php foreach ($menu['submenu'] as $j => $submenu) { ?>
48
+ <?php if ($submenu['id'] == 'index.php') { ?>
49
+ <div class="col-xs-12 col-md-6 aam-submenu-item">
50
+ <label for="menu-item-<?php echo $i . $j; ?>"><?php echo $submenu['name']; ?> <small class="aam-menu-capability"><?php echo $submenu['capability']; ?></small></label>
51
+ <a href="#dashboard-lockout-modal" data-toggle="modal"><i class="icon-help-circled"></i></a>
52
+ </div>
53
+ <?php } else { ?>
54
+ <div class="col-xs-12 col-md-6 aam-submenu-item">
55
+ <label for="menu-item-<?php echo $i . $j; ?>"><?php echo $submenu['name']; ?> <small class="aam-menu-capability"><?php echo $submenu['capability']; ?></small></label>
56
+ <input type="checkbox" class="aam-checkbox-danger" id="menu-item-<?php echo $i . $j; ?>" data-menu-id="<?php echo $submenu['id']; ?>"<?php echo ($object->has($submenu['id']) ? ' checked="checked"' : ''); ?> />
57
+ <label for="menu-item-<?php echo $i . $j; ?>" data-toggle="tooltip" title="<?php echo ($object->has($submenu['id']) ? __('Uncheck to allow', AAM_KEY) : __('Check to restrict', AAM_KEY)); ?>"></label>
58
+ </div>
59
+ <?php } ?>
60
  <?php } ?>
61
+ </div>
62
+
63
+ <hr class="aam-divider" />
64
+ <?php } ?>
 
65
 
66
+ <div class="row<?php echo (!empty($menu['submenu']) ? ' aam-margin-top-xs' : ''); ?>">
67
+ <div class="col-xs-10 col-md-6 col-xs-offset-1 col-md-offset-3">
68
+ <?php if ($object->has($menu['id'])) { ?>
69
+ <a href="#" class="btn btn-primary btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
70
+ <i class="icon-eye"></i> <?php echo __('Show Menu', AAM_KEY); ?>
71
+ </a>
72
+ <?php } else { ?>
73
+ <a href="#" class="btn btn-danger btn-sm btn-block aam-restrict-menu" data-menu-id="<?php echo $menu['id']; ?>" data-target="#menu-<?php echo $i; ?>">
74
+ <i class="icon-eye-off"></i> <?php echo __('Restrict Menu', AAM_KEY); ?>
75
+ </a>
76
+ <?php } ?>
77
+ </div>
78
  </div>
79
  </div>
80
  </div>
81
  </div>
82
+ <?php }
83
+ } else { ?>
84
+ <div class="row">
85
+ <div class="col-xs-12">
86
+ <p class="aam-notification">
87
+ <?php echo __('Current user does not have enough capabilities to access any available dashboard page.', AAM_KEY); ?>
88
+ </p>
89
+ </div>
90
  </div>
91
+ <?php }?>
92
  </div>
93
 
94
  <div class="modal fade" id="dashboard-lockout-modal" tabindex="-1" role="dialog">
Application/Backend/phtml/widget/login-frontend.phtml CHANGED
@@ -28,6 +28,8 @@
28
  <input id="<?php echo $this->get_field_id('pwd'); ?>" class="input login-input" value="" size="20" type="password" />
29
  </label>
30
  </p>
 
 
31
 
32
  <p class="forgetmenot">
33
  <label for="rememberme">
28
  <input id="<?php echo $this->get_field_id('pwd'); ?>" class="input login-input" value="" size="20" type="password" />
29
  </label>
30
  </p>
31
+
32
+ <?php do_action('login_form'); ?>
33
 
34
  <p class="forgetmenot">
35
  <label for="rememberme">
Application/Core/Object/Menu.php CHANGED
@@ -154,7 +154,7 @@ class AAM_Core_Object_Menu extends AAM_Core_Object {
154
 
155
  $result = null;
156
 
157
- //if (is_array($submenu)) {
158
  foreach($submenu as $parent => $subs) {
159
  foreach($subs as $sub) {
160
  if ($sub[2] == $search) {
@@ -167,7 +167,7 @@ class AAM_Core_Object_Menu extends AAM_Core_Object {
167
  break;
168
  }
169
  }
170
- //}
171
 
172
  return $result;
173
  }
154
 
155
  $result = null;
156
 
157
+ if (is_array($submenu)) {
158
  foreach($submenu as $parent => $subs) {
159
  foreach($subs as $sub) {
160
  if ($sub[2] == $search) {
167
  break;
168
  }
169
  }
170
+ }
171
 
172
  return $result;
173
  }
Application/Core/Subject/User.php CHANGED
@@ -43,19 +43,57 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
43
  parent::__construct($id);
44
 
45
  if (get_current_user_id() == $id) {
 
 
 
 
 
 
 
 
 
46
  //check if user is locked
47
  if ($this->user_status == 1) {
48
  wp_logout();
49
  }
50
-
51
  //check if user's role expired
52
- $expire = get_user_option('aam-role-expires');
53
- if ($expire && ($expire <= time())) {
54
  $this->restoreRoles();
55
  }
56
  }
57
  }
58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  /**
60
  * Block User
61
  *
@@ -67,22 +105,19 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
67
  public function block() {
68
  global $wpdb;
69
 
70
- $response = false;
71
- if (current_user_can('edit_users')) {
72
- $status = ($this->getSubject()->user_status ? 0 : 1);
73
- $result = $wpdb->update(
74
- $wpdb->users,
75
- array('user_status' => $status),
76
- array('ID' => $this->getId())
77
- );
78
- if ($result) {
79
- $this->getSubject()->user_status = $status;
80
- clean_user_cache($this->getSubject());
81
- $response = true;
82
- }
83
  }
84
 
85
- return $response;
86
  }
87
 
88
  /**
@@ -105,7 +140,7 @@ class AAM_Core_Subject_User extends AAM_Core_Subject {
105
  delete_user_option($this->getId(), 'aam-role-expires');
106
  delete_user_option($this->getId(), 'aam-original-roles');
107
  }
108
-
109
  /**
110
  * Retrieve User based on ID
111
  *
43
  parent::__construct($id);
44
 
45
  if (get_current_user_id() == $id) {
46
+ //check if user is expired
47
+ $expired = get_user_option('aam_user_expiration');
48
+ if (!empty($expired)) {
49
+ $parts = explode('|', $expired);
50
+ if ($parts[0] <= date('Y-m-d H:i:s')) {
51
+ $this->expireUser($parts[1]);
52
+ }
53
+ }
54
+
55
  //check if user is locked
56
  if ($this->user_status == 1) {
57
  wp_logout();
58
  }
59
+
60
  //check if user's role expired
61
+ $roleExpire = get_user_option('aam-role-expires');
62
+ if ($roleExpire && ($roleExpire <= time())) {
63
  $this->restoreRoles();
64
  }
65
  }
66
  }
67
 
68
+ /**
69
+ * Expire user
70
+ *
71
+ * @param string $action
72
+ *
73
+ * @return void
74
+ *
75
+ * @access
76
+ */
77
+ public function expireUser($action) {
78
+ switch($action) {
79
+ case 'lock':
80
+ $this->block();
81
+ break;
82
+
83
+ case 'delete':
84
+ require_once(ABSPATH . 'wp-admin/includes/user.php' );
85
+ wp_delete_user(
86
+ $this->getId(), AAM_Core_Config::get('core.reasign.user')
87
+ );
88
+ wp_logout();
89
+ break;
90
+
91
+ default:
92
+ do_action('aam-expired-user-action', $this);
93
+ break;
94
+ }
95
+ }
96
+
97
  /**
98
  * Block User
99
  *
105
  public function block() {
106
  global $wpdb;
107
 
108
+ $status = ($this->getSubject()->user_status ? 0 : 1);
109
+ $result = $wpdb->update(
110
+ $wpdb->users,
111
+ array('user_status' => $status),
112
+ array('ID' => $this->getId())
113
+ );
114
+
115
+ if ($result) {
116
+ $this->getSubject()->user_status = $status;
117
+ clean_user_cache($this->getSubject());
 
 
 
118
  }
119
 
120
+ return $result;
121
  }
122
 
123
  /**
140
  delete_user_option($this->getId(), 'aam-role-expires');
141
  delete_user_option($this->getId(), 'aam-original-roles');
142
  }
143
+
144
  /**
145
  * Retrieve User based on ID
146
  *
Application/Extension/List.php CHANGED
@@ -69,7 +69,7 @@ class AAM_Extension_List {
69
  'id' => 'AAM_MULTISITE',
70
  'type' => 'GNU',
71
  'license' => 'AAMMULTISITE',
72
- 'description' => 'Convenient way to navigate between different sites in the Network Admin Panel.',
73
  'version' => (defined('AAM_MULTISITE') ? constant('AAM_MULTISITE') : null)
74
  ),
75
  'AAM_CONFIGPRESS' => array(
@@ -77,7 +77,7 @@ class AAM_Extension_List {
77
  'id' => 'AAM_CONFIGPRESS',
78
  'type' => 'GNU',
79
  'license' => 'AAMCONFIGPRESS',
80
- 'description' => 'Extension to manage AAM core functionality with advanced configuration settings.',
81
  'version' => (defined('AAM_CONFIGPRESS') ? constant('AAM_CONFIGPRESS') : null)
82
  ),
83
  'AAM_USER_ACTIVITY' => array(
@@ -85,9 +85,18 @@ class AAM_Extension_List {
85
  'id' => 'AAM_USER_ACTIVITY',
86
  'type' => 'GNU',
87
  'license' => 'AAMUSERACTIVITY',
88
- 'description' => 'Track any kind of user or visitor activity on your website. <a href="https://aamplugin.com/help/how-to-track-any-wordpress-user-activity" target="_blank">Read more.</a>',
89
  'version' => (defined('AAM_USER_ACTIVITY') ? constant('AAM_USER_ACTIVITY') : null)
90
  ),
 
 
 
 
 
 
 
 
 
91
  );
92
  }
93
  }
69
  'id' => 'AAM_MULTISITE',
70
  'type' => 'GNU',
71
  'license' => 'AAMMULTISITE',
72
+ 'description' => 'Convenient way to navigate between different sites in the Network Admin Panel. This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/multisite-extension" target="_blank">Github here</a>.',
73
  'version' => (defined('AAM_MULTISITE') ? constant('AAM_MULTISITE') : null)
74
  ),
75
  'AAM_CONFIGPRESS' => array(
77
  'id' => 'AAM_CONFIGPRESS',
78
  'type' => 'GNU',
79
  'license' => 'AAMCONFIGPRESS',
80
+ 'description' => 'Extension to manage AAM core functionality with advanced configuration settings. This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/configpress-extension" target="_blank">Github here</a>.',
81
  'version' => (defined('AAM_CONFIGPRESS') ? constant('AAM_CONFIGPRESS') : null)
82
  ),
83
  'AAM_USER_ACTIVITY' => array(
85
  'id' => 'AAM_USER_ACTIVITY',
86
  'type' => 'GNU',
87
  'license' => 'AAMUSERACTIVITY',
88
+ 'description' => 'Track any kind of user or visitor activity on your website. <a href="https://aamplugin.com/help/how-to-track-any-wordpress-user-activity" target="_blank">Read more.</a> This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/user-activity-extension" target="_blank">Github here</a>.',
89
  'version' => (defined('AAM_USER_ACTIVITY') ? constant('AAM_USER_ACTIVITY') : null)
90
  ),
91
+ 'AAM_SOCIAL_LOGIN' => array(
92
+ 'title' => 'Social Login',
93
+ 'id' => 'AAM_SOCIAL_LOGIN',
94
+ 'type' => 'GNU',
95
+ 'tag' => 'ALPHA',
96
+ 'license' => 'AAMSOCIALLOGIN',
97
+ 'description' => 'Login to your website with social networks like Facebook, Twitter, Instagram etc. This is the open source solution and you can find it on the <a href="https://github.com/aamplugin/social-login-extension" target="_blank">Github here</a>.',
98
+ 'version' => (defined('AAM_SOCIAL_LOGIN') ? constant('AAM_SOCIAL_LOGIN') : null)
99
+ ),
100
  );
101
  }
102
  }
Application/Frontend/phtml/login.phtml CHANGED
@@ -14,6 +14,8 @@
14
  <input id="<?php echo $this->args['id'] . '-pwd'; ?>" class="input login-input" value="" size="20" type="password" />
15
  </label>
16
  </p>
 
 
17
 
18
  <p class="forgetmenot">
19
  <label for="rememberme">
14
  <input id="<?php echo $this->args['id'] . '-pwd'; ?>" class="input login-input" value="" size="20" type="password" />
15
  </label>
16
  </p>
17
+
18
+ <?php do_action('login_form'); ?>
19
 
20
  <p class="forgetmenot">
21
  <label for="rememberme">
aam.php CHANGED
@@ -3,7 +3,7 @@
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
- Version: 5.0.8
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
3
  /**
4
  Plugin Name: Advanced Access Manager
5
  Description: All you need to manage access to your WordPress website
6
+ Version: 5.1
7
  Author: Vasyl Martyniuk <vasyl@vasyltech.com>
8
  Author URI: https://vasyltech.com
9
 
media/css/aam.css CHANGED
@@ -387,6 +387,10 @@ a.btn:focus, a.btn:active {
387
  background-color: #F7D3A1;
388
  }
389
 
 
 
 
 
390
  /** DATATABLES **/
391
  .dataTables_info {
392
  float: left;
387
  background-color: #F7D3A1;
388
  }
389
 
390
+ .badge.sup {
391
+ font-size: 8px;
392
+ }
393
+
394
  /** DATATABLES **/
395
  .dataTables_info {
396
  float: left;
media/js/aam-login.js CHANGED
@@ -42,7 +42,6 @@ if (typeof jQuery !== 'undefined') {
42
  }).val('Wait...');
43
  },
44
  success: function(response) {
45
- console.log(response);
46
  if (response.status === "success") {
47
  if (response.redirect) {
48
  location.href = response.redirect;
42
  }).val('Wait...');
43
  },
44
  success: function(response) {
 
45
  if (response.status === "success") {
46
  if (response.redirect) {
47
  location.href = response.redirect;
media/js/aam.js CHANGED
@@ -101,6 +101,7 @@
101
  dom: 'ftrip',
102
  pagingType: 'simple',
103
  processing: true,
 
104
  serverSide: false,
105
  ajax: {
106
  url: aamLocal.ajaxurl,
@@ -572,6 +573,7 @@
572
  autoWidth: false,
573
  ordering: false,
574
  dom: 'ftrip',
 
575
  pagingType: 'simple',
576
  serverSide: true,
577
  processing: true,
@@ -586,7 +588,7 @@
586
  }
587
  },
588
  columnDefs: [
589
- {visible: false, targets: [0, 1, 4]}
590
  ],
591
  language: {
592
  search: '_INPUT_',
@@ -651,59 +653,85 @@
651
  'title': aam.__('Manage User')
652
  })).prop('disabled', (isCurrent(data[0]) ? true: false));
653
  break;
654
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
655
  case 'edit':
656
  if (!aam.isUI()) {
657
- $(container).append($('<i/>', {
658
- 'class': 'aam-row-action icon-pencil text-info'
659
- }).bind('click', function () {
660
- window.open(
661
- aamLocal.url.editUser + '?user_id=' + data[0], '_blank'
662
- );
663
- }).attr({
664
- 'data-toggle': "tooltip",
665
- 'title': aam.__('Edit User')
666
- }));
667
- }
668
  break;
669
 
670
  case 'lock':
671
  if (!aam.isUI()) {
672
- $(container).append($('<i/>', {
673
- 'class': 'aam-row-action icon-lock-open-alt text-warning'
674
- }).bind('click', function () {
675
- blockUser(data[0], $(this));
676
- }).attr({
677
- 'data-toggle': "tooltip",
678
- 'title': aam.__('Lock User')
679
- }));
680
- }
681
  break;
682
 
683
  case 'unlock':
684
  if (!aam.isUI()) {
685
- $(container).append($('<i/>', {
686
- 'class': 'aam-row-action icon-lock text-danger'
687
- }).bind('click', function () {
688
- blockUser(data[0], $(this));
689
- }).attr({
690
- 'data-toggle': "tooltip",
691
- 'title': aam.__('Unlock User')
692
- }));
693
- }
694
  break;
695
 
696
  case 'switch':
697
  if (!aam.isUI()) {
698
- $(container).append($('<i/>', {
699
- 'class': 'aam-row-action icon-exchange text-success'
700
- }).bind('click', function () {
701
- switchToUser(data[0], $(this));
702
- }).attr({
703
- 'data-toggle': "tooltip",
704
- 'title': aam.__('Switch To User')
705
- }));
706
- }
707
  break;
708
 
709
  default:
@@ -718,6 +746,74 @@
718
  $('td:eq(1)', row).html(container);
719
  }
720
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
721
 
722
  //add setSubject hook
723
  aam.addHook('setSubject', function () {
101
  dom: 'ftrip',
102
  pagingType: 'simple',
103
  processing: true,
104
+ stateSave: true,
105
  serverSide: false,
106
  ajax: {
107
  url: aamLocal.ajaxurl,
573
  autoWidth: false,
574
  ordering: false,
575
  dom: 'ftrip',
576
+ stateSave: true,
577
  pagingType: 'simple',
578
  serverSide: true,
579
  processing: true,
588
  }
589
  },
590
  columnDefs: [
591
+ {visible: false, targets: [0, 1, 4, 5]}
592
  ],
593
  language: {
594
  search: '_INPUT_',
653
  'title': aam.__('Manage User')
654
  })).prop('disabled', (isCurrent(data[0]) ? true: false));
655
  break;
656
+
657
+ case 'ttl':
658
+ if (!aam.isUI()) {
659
+ $(container).append($('<i/>', {
660
+ 'class': 'aam-row-action icon-clock text-' + (data[5] ? 'danger' : 'warning')
661
+ }).bind('click', function () {
662
+ $('#edit-user-expiration-btn').attr('data-user-id', data[0]);
663
+ $('#reset-user-expiration-btn').attr('data-user-id', data[0]);
664
+
665
+ if (data[5]) {
666
+ $('#reset-user-expiration-btn').removeClass('hidden');
667
+ var settings = data[5].split('|');
668
+ $('#user-expires').val(settings[0]);
669
+ $('#action-after-expiration').val(settings[1]);
670
+ } else {
671
+ $('#reset-user-expiration-btn').addClass('hidden');
672
+ $('#user-expires, #action-after-expiration').val('');
673
+ }
674
+
675
+ $('#edit-user-expiration-modal').modal('show');
676
+ }).attr({
677
+ 'data-toggle': "tooltip",
678
+ 'title': aam.__('User Expiration')
679
+ }));
680
+ }
681
+ break;
682
+
683
  case 'edit':
684
  if (!aam.isUI()) {
685
+ $(container).append($('<i/>', {
686
+ 'class': 'aam-row-action icon-pencil text-info'
687
+ }).bind('click', function () {
688
+ window.open(
689
+ aamLocal.url.editUser + '?user_id=' + data[0], '_blank'
690
+ );
691
+ }).attr({
692
+ 'data-toggle': "tooltip",
693
+ 'title': aam.__('Edit User')
694
+ }));
695
+ }
696
  break;
697
 
698
  case 'lock':
699
  if (!aam.isUI()) {
700
+ $(container).append($('<i/>', {
701
+ 'class': 'aam-row-action icon-lock-open-alt text-warning'
702
+ }).bind('click', function () {
703
+ blockUser(data[0], $(this));
704
+ }).attr({
705
+ 'data-toggle': "tooltip",
706
+ 'title': aam.__('Lock User')
707
+ }));
708
+ }
709
  break;
710
 
711
  case 'unlock':
712
  if (!aam.isUI()) {
713
+ $(container).append($('<i/>', {
714
+ 'class': 'aam-row-action icon-lock text-danger'
715
+ }).bind('click', function () {
716
+ blockUser(data[0], $(this));
717
+ }).attr({
718
+ 'data-toggle': "tooltip",
719
+ 'title': aam.__('Unlock User')
720
+ }));
721
+ }
722
  break;
723
 
724
  case 'switch':
725
  if (!aam.isUI()) {
726
+ $(container).append($('<i/>', {
727
+ 'class': 'aam-row-action icon-exchange text-success'
728
+ }).bind('click', function () {
729
+ switchToUser(data[0], $(this));
730
+ }).attr({
731
+ 'data-toggle': "tooltip",
732
+ 'title': aam.__('Switch To User')
733
+ }));
734
+ }
735
  break;
736
 
737
  default:
746
  $('td:eq(1)', row).html(container);
747
  }
748
  });
749
+
750
+ //edit role button
751
+ $('#edit-user-expiration-btn').bind('click', function () {
752
+ var _this = this;
753
+
754
+ $.ajax(aamLocal.ajaxurl, {
755
+ type: 'POST',
756
+ dataType: 'json',
757
+ data: {
758
+ action: 'aam',
759
+ sub_action: 'Subject_User.saveExpiration',
760
+ _ajax_nonce: aamLocal.nonce,
761
+ user: $(_this).attr('data-user-id'),
762
+ expires: $('#user-expires').val(),
763
+ after: $('#action-after-expiration').val()
764
+ },
765
+ beforeSend: function () {
766
+ $(_this).text(aam.__('Saving...')).attr('disabled', true);
767
+ },
768
+ success: function (response) {
769
+ if (response.status === 'success') {
770
+ $('#user-list').DataTable().ajax.reload();
771
+ } else {
772
+ aam.notification('danger', response.reason);
773
+ }
774
+ },
775
+ error: function () {
776
+ aam.notification('danger', aam.__('Application error'));
777
+ },
778
+ complete: function () {
779
+ $('#edit-user-expiration-modal').modal('hide');
780
+ $(_this).text(aam.__('Save')).attr('disabled', false);
781
+ }
782
+ });
783
+ });
784
+
785
+ //reset user button
786
+ $('#reset-user-expiration-btn').bind('click', function () {
787
+ var _this = this;
788
+
789
+ $.ajax(aamLocal.ajaxurl, {
790
+ type: 'POST',
791
+ dataType: 'json',
792
+ data: {
793
+ action: 'aam',
794
+ sub_action: 'Subject_User.saveExpiration',
795
+ _ajax_nonce: aamLocal.nonce,
796
+ user: $(_this).attr('data-user-id')
797
+ },
798
+ beforeSend: function () {
799
+ $(_this).text(aam.__('Reseting...')).attr('disabled', true);
800
+ },
801
+ success: function (response) {
802
+ if (response.status === 'success') {
803
+ $('#user-list').DataTable().ajax.reload();
804
+ } else {
805
+ aam.notification('danger', response.reason);
806
+ }
807
+ },
808
+ error: function () {
809
+ aam.notification('danger', aam.__('Application error'));
810
+ },
811
+ complete: function () {
812
+ $('#edit-user-expiration-modal').modal('hide');
813
+ $(_this).text(aam.__('Reset')).attr('disabled', false);
814
+ }
815
+ });
816
+ });
817
 
818
  //add setSubject hook
819
  aam.addHook('setSubject', function () {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: vasyltech
3
  Tags: access, role, user, capability, page access, post access, comments, security, login redirect, brute force attack, double authentication, membership, backend lockdown, wp-admin, 404, activity tracking
4
  Requires at least: 3.8
5
  Tested up to: 4.9.4
6
- Stable tag: 5.0.8
7
 
8
  The most powerful access management plugin for WordPress websites.
9
 
@@ -24,6 +24,9 @@ https://www.youtube.com/watch?v=yiOhjaacNJc
24
 
25
  = The most popular features =
26
 
 
 
 
27
  * [free] Backend Lockdown. Restrict access to your website backend side for any user or role. Find out more from [How to lockdown WordPress backend](https://aamplugin.com/help/how-to-lockdown-wordpress-backend) article;
28
  * [free] Secure Login Widget & Shortcode. Drop AJAX login widget or shortcode anywhere on your website. Find out more from [How does AAM Secure Login works](https://aamplugin.com/help/how-does-aam-secure-login-works) article;
29
  * [limited] Content Access. Very granular access to unlimited number of post, page or custom post type ([19 different options](https://aamplugin.com/help#posts-and-pages)). With premium [Plus Package](https://aamplugin.com/extension/plus-package) extension also manage access to hierarchical taxonomies or setup the default access to all post types and taxonomies. Find out more from [How to manage access to the WordPress content](https://aamplugin.com/help/how-to-manage-access-to-the-wordpress-content) article;
@@ -31,8 +34,6 @@ https://www.youtube.com/watch?v=yiOhjaacNJc
31
  * [free] Login/Logout Redirects. Define custom login and logout redirect for any user or role;
32
  * [free] 404 Redirect. Redefine where user should be redirected when page does not exist. Find out more from [How to redirect on WordPress 404 error](https://aamplugin.com/help/how-to-redirect-on-wordpress-404-error);
33
  * [free] Access Denied Redirect. Define custom redirect for any role, user or visitors when access is denied for restricted area on your website;
34
- * [free] Manage Roles & Capabilities. Manage all your WordPress role and capabilities.
35
- * [free] Manage Backend Menu. Manage access to the backend menu for any user or role. Find out more from [How to manage WordPress backend menu](https://aamplugin.com/help/how-to-manage-wordpress-backend-menu) article;
36
  * [free] Manage Metaboxes and Widgets. Filter out restricted or unnecessary metaboxes and widgets on both frontend and backend for any user, role or visitors. Find out more from [How to hide WordPress metaboxes & widgets](https://aamplugin.com/help/how-to-hide-wordpress-metaboxes-and-widgets) article;
37
  * [paid] Manage Access Based On Geo Location or IP. Manage access to your website for all visitors based on referred host, IP address or geographical location. Find out more from [How to manage access to WordPress website based on location](https://aamplugin.com/help/how-to-manage-access-to-wordpress-website-based-on-location) article;
38
  * [paid] Monetize Access To You Content. Start selling access to your website content with premium [E-Commerce](https://aamplugin.com/extension/ecommerce) extension. Find out more from [How to monetize access to the WordPress content](https://aamplugin.com/help/how-to-monetize-access-to-the-wordpress-content) article;
@@ -60,6 +61,12 @@ https://www.youtube.com/watch?v=yiOhjaacNJc
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
 
63
  = 5.0.8 =
64
  * Fixed the bug to keep AAM compatible with older WP version
65
 
3
  Tags: access, role, user, capability, page access, post access, comments, security, login redirect, brute force attack, double authentication, membership, backend lockdown, wp-admin, 404, activity tracking
4
  Requires at least: 3.8
5
  Tested up to: 4.9.4
6
+ Stable tag: 5.1
7
 
8
  The most powerful access management plugin for WordPress websites.
9
 
24
 
25
  = The most popular features =
26
 
27
+ * [free] Manage Backend Menu. Manage access to the backend menu for any user or role. Find out more from [How to manage WordPress backend menu](https://aamplugin.com/help/how-to-manage-wordpress-backend-menu) article;
28
+ * [free] Manage Roles & Capabilities. Manage all your WordPress role and capabilities.
29
+ * [free] Manage temporary user accounts. Create and manage temporary user accounts. Find out more from [How to create temporary WordPress user account](https://aamplugin.com/help/how-to-create-temporary-wordpress-user-account);
30
  * [free] Backend Lockdown. Restrict access to your website backend side for any user or role. Find out more from [How to lockdown WordPress backend](https://aamplugin.com/help/how-to-lockdown-wordpress-backend) article;
31
  * [free] Secure Login Widget & Shortcode. Drop AJAX login widget or shortcode anywhere on your website. Find out more from [How does AAM Secure Login works](https://aamplugin.com/help/how-does-aam-secure-login-works) article;
32
  * [limited] Content Access. Very granular access to unlimited number of post, page or custom post type ([19 different options](https://aamplugin.com/help#posts-and-pages)). With premium [Plus Package](https://aamplugin.com/extension/plus-package) extension also manage access to hierarchical taxonomies or setup the default access to all post types and taxonomies. Find out more from [How to manage access to the WordPress content](https://aamplugin.com/help/how-to-manage-access-to-the-wordpress-content) article;
34
  * [free] Login/Logout Redirects. Define custom login and logout redirect for any user or role;
35
  * [free] 404 Redirect. Redefine where user should be redirected when page does not exist. Find out more from [How to redirect on WordPress 404 error](https://aamplugin.com/help/how-to-redirect-on-wordpress-404-error);
36
  * [free] Access Denied Redirect. Define custom redirect for any role, user or visitors when access is denied for restricted area on your website;
 
 
37
  * [free] Manage Metaboxes and Widgets. Filter out restricted or unnecessary metaboxes and widgets on both frontend and backend for any user, role or visitors. Find out more from [How to hide WordPress metaboxes & widgets](https://aamplugin.com/help/how-to-hide-wordpress-metaboxes-and-widgets) article;
38
  * [paid] Manage Access Based On Geo Location or IP. Manage access to your website for all visitors based on referred host, IP address or geographical location. Find out more from [How to manage access to WordPress website based on location](https://aamplugin.com/help/how-to-manage-access-to-wordpress-website-based-on-location) article;
39
  * [paid] Monetize Access To You Content. Start selling access to your website content with premium [E-Commerce](https://aamplugin.com/extension/ecommerce) extension. Find out more from [How to monetize access to the WordPress content](https://aamplugin.com/help/how-to-monetize-access-to-the-wordpress-content) article;
61
 
62
  == Changelog ==
63
 
64
+ = 5.1 =
65
+ * Fixed sever minor bugs reported by users
66
+ * Added free social login extension (alpha version undocumented)
67
+ * Added ability to create a temporary user account
68
+ * Moved all free extension to the Github repository
69
+
70
  = 5.0.8 =
71
  * Fixed the bug to keep AAM compatible with older WP version
72