WPFront User Role Editor - Version 2.10

Version Description

  • User level permissions added. Documentation.
  • UI enhancements.
Download this release

Release Info

Developer syammohanm
Plugin Icon 128x128 WPFront User Role Editor
Version 2.10
Comparing to
See all releases

Code changes from version 2.9.1 to 2.10

classes/base/class-wpfront-base.php CHANGED
@@ -72,6 +72,7 @@ if (!class_exists('WPFront_Base_URE')) {
72
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
73
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
74
  }
 
75
  }
76
 
77
  protected function plugin_dir_suffix() {
@@ -110,6 +111,10 @@ if (!class_exists('WPFront_Base_URE')) {
110
  WPFront_Base_Menu::admin_menu(self::$menu_data);
111
  }
112
 
 
 
 
 
113
  public static function submenu_compare($a, $b) {
114
  return strcmp($a[0], $b[0]);
115
  }
72
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_styles'));
73
  add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
74
  }
75
+ add_action('wp_before_admin_bar_render', array($this, 'admin_bar'));
76
  }
77
 
78
  protected function plugin_dir_suffix() {
111
  WPFront_Base_Menu::admin_menu(self::$menu_data);
112
  }
113
 
114
+ public function admin_bar() {
115
+
116
+ }
117
+
118
  public static function submenu_compare($a, $b) {
119
  return strcmp($a[0], $b[0]);
120
  }
classes/class-wpfront-user-role-editor-assign-roles.php CHANGED
@@ -77,13 +77,13 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
77
  }
78
 
79
  public function user_row_actions($actions, $user_object) {
80
- if ($this->can_assign_roles() && $user_object->ID !== wp_get_current_user()->ID)
81
  $actions['assign_roles'] = sprintf('<a href="%s">%s</a>', $this->get_assign_role_url($user_object), $this->__('Assign Roles'));
82
  return $actions;
83
  }
84
 
85
  public function edit_user_profile($user) {
86
- if(is_multisite() && is_network_admin())
87
  return;
88
 
89
  if (!$this->can_assign_roles())
@@ -92,6 +92,9 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
92
  if ($user->ID === wp_get_current_user()->ID)
93
  return;
94
 
 
 
 
95
  $this->populate_roles_array();
96
  $roles = array_values($user->roles);
97
  array_shift($roles);
@@ -114,7 +117,7 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
114
  }
115
 
116
  public function edit_user_profile_update($user_id) {
117
- if(is_multisite() && is_network_admin())
118
  return;
119
 
120
  if (!$this->can_assign_roles())
@@ -123,6 +126,9 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
123
  if ($user_id === wp_get_current_user()->ID)
124
  return;
125
 
 
 
 
126
  //$user = get_user_to_edit($user_id); //fatal error - function not defined.
127
  $user = get_userdata($user_id);
128
  if (empty($user))
@@ -165,7 +171,13 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
165
 
166
  private function populate_roles_array() {
167
  global $wp_roles;
168
- $roles = $wp_roles->get_names();
 
 
 
 
 
 
169
 
170
  $this->primary_roles = $roles;
171
  $this->primary_roles[''] = '&mdash;' . $this->__('No role for this site') . '&mdash;';
@@ -184,6 +196,7 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
184
  }
185
 
186
  $this->users = get_users(array('exclude' => array(wp_get_current_user()->ID)));
 
187
  $this->populate_roles_array();
188
 
189
  if (!empty($_POST['assignroles']) && !empty($_POST['assign-user'])) {
@@ -197,6 +210,13 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
197
  $this->result->message = $this->__('Invalid user.');
198
  }
199
 
 
 
 
 
 
 
 
200
  if ($this->user != NULL) {
201
  $primary_role = NULL;
202
  if (isset($_POST['assign-primary-role'])) {
@@ -263,7 +283,7 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
263
  }
264
 
265
  $users = get_users(array('exclude' => array(wp_get_current_user()->ID), 'role' => $this->migrateFromPrimaryRole));
266
- $users = array_filter($users, array($this, 'array_filter_user'));
267
 
268
  foreach ($users as $user) {
269
  $user->set_role($this->migrateToPrimaryRole);
@@ -281,7 +301,7 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
281
 
282
  if ($this->user == NULL && !empty($_GET['assign_roles'])) {
283
  $this->user = get_userdata($_GET['assign_roles']);
284
- if ($this->user === FALSE || $this->user->ID === wp_get_current_user()->ID)
285
  $this->user = NULL;
286
  }
287
 
@@ -302,6 +322,10 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
302
  }
303
 
304
  private function array_filter_user($user) {
 
 
 
 
305
  if ($this->migrateFromPrimaryRole === '') {
306
  if (empty($user->roles))
307
  return TRUE;
@@ -310,6 +334,9 @@ if (!class_exists('WPFront_User_Role_Editor_Assign_Roles')) {
310
  if (empty($user->roles))
311
  return FALSE;
312
 
 
 
 
313
  $roles = $user->roles;
314
  $role = array_shift($roles);
315
  return $role === $this->migrateFromPrimaryRole;
77
  }
78
 
79
  public function user_row_actions($actions, $user_object) {
80
+ if ($this->can_assign_roles() && $user_object->ID !== wp_get_current_user()->ID && current_user_can('promote_user', $user_object->ID))
81
  $actions['assign_roles'] = sprintf('<a href="%s">%s</a>', $this->get_assign_role_url($user_object), $this->__('Assign Roles'));
82
  return $actions;
83
  }
84
 
85
  public function edit_user_profile($user) {
86
+ if (is_multisite() && is_network_admin())
87
  return;
88
 
89
  if (!$this->can_assign_roles())
92
  if ($user->ID === wp_get_current_user()->ID)
93
  return;
94
 
95
+ if (!current_user_can('promote_user', $user->ID))
96
+ return;
97
+
98
  $this->populate_roles_array();
99
  $roles = array_values($user->roles);
100
  array_shift($roles);
117
  }
118
 
119
  public function edit_user_profile_update($user_id) {
120
+ if (is_multisite() && is_network_admin())
121
  return;
122
 
123
  if (!$this->can_assign_roles())
126
  if ($user_id === wp_get_current_user()->ID)
127
  return;
128
 
129
+ if (!current_user_can('promote_user', $user_id))
130
+ return;
131
+
132
  //$user = get_user_to_edit($user_id); //fatal error - function not defined.
133
  $user = get_userdata($user_id);
134
  if (empty($user))
171
 
172
  private function populate_roles_array() {
173
  global $wp_roles;
174
+ $roles_names = $wp_roles->get_names();
175
+ $assignable_roles = $this->main->get_assignable_roles();
176
+
177
+ $roles = array();
178
+ foreach ($assignable_roles as $key => $value) {
179
+ $roles[$key] = $roles_names[$key];
180
+ }
181
 
182
  $this->primary_roles = $roles;
183
  $this->primary_roles[''] = '&mdash;' . $this->__('No role for this site') . '&mdash;';
196
  }
197
 
198
  $this->users = get_users(array('exclude' => array(wp_get_current_user()->ID)));
199
+ $this->users = array_filter($this->users, array($this, 'array_filter_user'));
200
  $this->populate_roles_array();
201
 
202
  if (!empty($_POST['assignroles']) && !empty($_POST['assign-user'])) {
210
  $this->result->message = $this->__('Invalid user.');
211
  }
212
 
213
+ if ($this->user != NULL) {
214
+ if (!current_user_can('promote_user', $this->user->ID)) {
215
+ $this->user = NULL;
216
+ $this->result->message = $this->__('Permission denied.');
217
+ }
218
+ }
219
+
220
  if ($this->user != NULL) {
221
  $primary_role = NULL;
222
  if (isset($_POST['assign-primary-role'])) {
283
  }
284
 
285
  $users = get_users(array('exclude' => array(wp_get_current_user()->ID), 'role' => $this->migrateFromPrimaryRole));
286
+ $users = array_filter($users, array($this, 'array_migrate_filter_user'));
287
 
288
  foreach ($users as $user) {
289
  $user->set_role($this->migrateToPrimaryRole);
301
 
302
  if ($this->user == NULL && !empty($_GET['assign_roles'])) {
303
  $this->user = get_userdata($_GET['assign_roles']);
304
+ if ($this->user === FALSE || $this->user->ID === wp_get_current_user()->ID || !current_user_can('promote_user', $this->user->ID))
305
  $this->user = NULL;
306
  }
307
 
322
  }
323
 
324
  private function array_filter_user($user) {
325
+ return current_user_can('promote_user', $user->ID);
326
+ }
327
+
328
+ private function array_migrate_filter_user($user) {
329
  if ($this->migrateFromPrimaryRole === '') {
330
  if (empty($user->roles))
331
  return TRUE;
334
  if (empty($user->roles))
335
  return FALSE;
336
 
337
+ if (!current_user_can('promote_user', $user->ID))
338
+ return FALSE;
339
+
340
  $roles = $user->roles;
341
  $role = array_shift($roles);
342
  return $role === $this->migrateFromPrimaryRole;
classes/class-wpfront-user-role-editor-attachment-permissions.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront User Role Editor Plugin
5
+ Copyright (C) 2014, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ if (!defined('ABSPATH')) {
26
+ exit();
27
+ }
28
+
29
+ if (!class_exists('WPFront_User_Role_Editor_Attachment_Permissions')) {
30
+
31
+ /**
32
+ * Attachment Permissions
33
+ *
34
+ * @author Syam Mohan <syam@wpfront.com>
35
+ * @copyright 2014 WPFront.com
36
+ */
37
+ class WPFront_User_Role_Editor_Attachment_Permissions extends WPFront_User_Role_Editor_Controller_Base {
38
+
39
+ private static $attachment_capabilities = array('edit_attachments', 'delete_attachments', 'read_others_attachments', 'edit_others_attachments', 'delete_others_attachments');
40
+
41
+ public function __construct($main) {
42
+ parent::__construct($main);
43
+
44
+ $media = WPFront_User_Role_Editor::$STANDARD_CAPABILITIES['Media'];
45
+ foreach (self::$attachment_capabilities as $value) {
46
+ $media[$value] = $media['upload_files'];
47
+ }
48
+ WPFront_User_Role_Editor::$STANDARD_CAPABILITIES['Media'] = $media;
49
+
50
+ add_filter('user_has_cap', array($this, 'user_has_cap'), 10, 3);
51
+ add_filter('posts_where', array($this, 'posts_where'), 10, 2);
52
+
53
+ add_action('admin_init', array($this, 'admin_init'));
54
+ }
55
+
56
+ public function user_has_cap($allcaps, $caps, $args) {
57
+ return $allcaps;
58
+ }
59
+
60
+ public function posts_where($where, $query) {
61
+ return $where;
62
+ }
63
+
64
+ public function admin_init() {
65
+ $option_key = 'attachment_capabilities_processed';
66
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
67
+
68
+ $processed = $entity->get_option($option_key);
69
+ if (!empty($processed))
70
+ return;
71
+
72
+ global $wp_roles;
73
+
74
+ foreach ($wp_roles->role_objects as $key => $role) {
75
+ if ($role->has_cap('upload_files')) {
76
+ foreach (self::$attachment_capabilities as $cap) {
77
+ $role->add_cap($cap);
78
+ }
79
+ }
80
+ }
81
+
82
+ $entity->update_option($option_key, TRUE);
83
+ }
84
+
85
+ }
86
+
87
+ }
88
+
classes/class-wpfront-user-role-editor-user-permissions.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ WPFront User Role Editor Plugin
5
+ Copyright (C) 2014, WPFront.com
6
+ Website: wpfront.com
7
+ Contact: syam@wpfront.com
8
+
9
+ WPFront User Role Editor Plugin is distributed under the GNU General Public License, Version 3,
10
+ June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin
11
+ St, Fifth Floor, Boston, MA 02110, USA
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
17
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ */
24
+
25
+ if (!defined('ABSPATH')) {
26
+ exit();
27
+ }
28
+
29
+ if (!class_exists('WPFront_User_Role_Editor_User_Permissions')) {
30
+
31
+ /**
32
+ * User Permissions
33
+ *
34
+ * @author Syam Mohan <syam@wpfront.com>
35
+ * @copyright 2015 WPFront.com
36
+ */
37
+ class WPFront_User_Role_Editor_User_Permissions extends WPFront_User_Role_Editor_Controller_Base {
38
+
39
+ private static $user_capabilities = array(
40
+ 'edit_users_higher_level' => 'edit_users',
41
+ 'delete_users_higher_level' => 'delete_users',
42
+ 'promote_users_higher_level' => 'promote_users',
43
+ 'promote_users_to_higher_level' => 'promote_users'
44
+ );
45
+
46
+ public function __construct($main) {
47
+ parent::__construct($main);
48
+
49
+ $users = WPFront_User_Role_Editor::$STANDARD_CAPABILITIES['Users'];
50
+ foreach (self::$user_capabilities as $key => $value) {
51
+ $users[$key] = $users[$value];
52
+ }
53
+ WPFront_User_Role_Editor::$STANDARD_CAPABILITIES['Users'] = $users;
54
+
55
+ add_filter('user_has_cap', array($this, 'user_has_cap'), 10, 3);
56
+ add_filter('editable_roles', array($this, 'assignable_roles'));
57
+
58
+ add_action('admin_init', array($this, 'admin_init'));
59
+ }
60
+
61
+ public function assignable_roles($all_roles) {
62
+ return $all_roles;
63
+ }
64
+
65
+ public function user_has_cap($allcaps, $caps, $args) {
66
+ if (!empty($args) && count($args) === 3) {
67
+ switch ($args[0]) {
68
+ case 'edit_user':
69
+ if (!$this->can_edit_user($args[1], $args[2])) {
70
+ foreach ($caps as $value) {
71
+ unset($allcaps[$value]);
72
+ }
73
+ }
74
+ break;
75
+
76
+ case 'delete_user':
77
+ if (!$this->can_delete_user($args[1], $args[2])) {
78
+ foreach ($caps as $value) {
79
+ unset($allcaps[$value]);
80
+ }
81
+ }
82
+ break;
83
+
84
+ case 'promote_user':
85
+ if (!$this->can_promote_user($args[1], $args[2])) {
86
+ foreach ($caps as $value) {
87
+ unset($allcaps[$value]);
88
+ }
89
+ }
90
+ break;
91
+ }
92
+ }
93
+
94
+ return $allcaps;
95
+ }
96
+
97
+ protected function can_edit_user($user_id, $edit_user_id) {
98
+ return TRUE;
99
+ }
100
+
101
+ protected function can_delete_user($user_id, $edit_user_id) {
102
+ return TRUE;
103
+ }
104
+
105
+ protected function can_promote_user($user_id, $edit_user_id) {
106
+ return TRUE;
107
+ }
108
+
109
+ public function admin_init() {
110
+ $option_key = 'user_permission_capabilities_processed';
111
+ $entity = new WPFront_User_Role_Editor_Entity_Options();
112
+
113
+ $processed = $entity->get_option($option_key);
114
+ if (!empty($processed))
115
+ return;
116
+
117
+ global $wp_roles;
118
+
119
+ foreach ($wp_roles->role_objects as $key => $role) {
120
+ foreach (self::$user_capabilities as $u_cap => $cap) {
121
+ if ($role->has_cap($cap)) {
122
+ $role->add_cap($u_cap);
123
+ }
124
+ }
125
+ }
126
+
127
+ $entity->update_option($option_key, TRUE);
128
+ }
129
+
130
+ }
131
+
132
+ }
133
+
classes/class-wpfront-user-role-editor.php CHANGED
@@ -38,7 +38,7 @@ if (!class_exists('WPFront_User_Role_Editor')) {
38
  class WPFront_User_Role_Editor extends WPFront_Base_URE {
39
 
40
  //Constants
41
- const VERSION = '2.9.1';
42
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
43
  const OPTION_NAME = 'wpfront-user-role-editor-options';
44
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
@@ -154,6 +154,8 @@ if (!class_exists('WPFront_User_Role_Editor')) {
154
  protected $objGoPro;
155
  protected $objNavMenu = NULL;
156
  protected $objLoginRedirect = NULL;
 
 
157
 
158
  function __construct() {
159
  parent::__construct(__FILE__, self::PLUGIN_SLUG);
@@ -173,6 +175,10 @@ if (!class_exists('WPFront_User_Role_Editor')) {
173
  $this->objNavMenu = new WPFront_User_Role_Editor_Nav_Menu($this);
174
  if ($this->objLoginRedirect === NULL)
175
  $this->objLoginRedirect = new WPFront_User_Role_Editor_Login_Redirect($this);
 
 
 
 
176
  }
177
  }
178
 
@@ -193,13 +199,13 @@ if (!class_exists('WPFront_User_Role_Editor')) {
193
  $this->rename_role_capabilities();
194
  }
195
 
196
- protected function add_submenu_page($position, $title, $name, $capability, $slug, $func, $scripts = NULL, $styles = NULL, $controller = NULL) {
197
  if ($scripts === NULL)
198
  $scripts = 'enqueue_role_scripts';
199
  if ($styles === NULL)
200
  $styles = 'enqueue_role_styles';
201
 
202
- $this->admin_menu[$position] = array($title, $name, $capability, $slug, $func, $scripts, $styles, $controller);
203
  }
204
 
205
  protected function add_pro_page() {
@@ -222,7 +228,7 @@ if (!class_exists('WPFront_User_Role_Editor')) {
222
 
223
  if ($this->objGoPro->has_license()) {
224
  $this->add_submenu_page(10, $this->__('Roles'), $this->__('All Roles'), $this->get_capability_string('list'), WPFront_User_Role_Editor_List::MENU_SLUG, array($this->objList, 'list_roles'), NULL, NULL, $this->objList);
225
- $this->add_submenu_page(20, $this->__('Add New Role'), $this->__('Add New'), $this->get_capability_string('create'), WPFront_User_Role_Editor_Add_Edit::MENU_SLUG, array($this->objAddEdit, 'add_edit_role'), NULL, NULL, $this->objAddEdit);
226
  $this->add_submenu_page(30, $this->__('Restore Role'), $this->__('Restore'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Restore::MENU_SLUG, array($this->objRestore, 'restore_role'), NULL, NULL, $this->objRestore);
227
  $this->add_submenu_page(35, $this->__('Add/Remove Capability'), $this->__('Add/Remove Cap'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Add_Remove_Capability::MENU_SLUG, array($this->objAddRemoveCap, 'add_remove_capability'), NULL, NULL, $this->objAddRemoveCap);
228
  $this->add_submenu_page(37, $this->__('Login Redirect'), $this->__('Login Redirect'), 'edit_login_redirects', WPFront_User_Role_Editor_Login_Redirect::MENU_SLUG, array($this->objLoginRedirect, 'login_redirect'), NULL, NULL, $this->objLoginRedirect);
@@ -253,6 +259,24 @@ if (!class_exists('WPFront_User_Role_Editor')) {
253
  }
254
  }
255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  //add scripts
257
  public function enqueue_role_scripts() {
258
  // $jsRoot = $this->pluginURLRoot . 'js/';
@@ -538,6 +562,22 @@ if (!class_exists('WPFront_User_Role_Editor')) {
538
  return FALSE;
539
  }
540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  private function rename_role_capabilities() {
542
  global $wp_roles;
543
 
@@ -606,6 +646,8 @@ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-assign-
606
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-go-pro.php");
607
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-nav-menu.php");
608
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-login-redirect.php");
 
 
609
  require_once(plugin_dir_path(__FILE__) . "integration/plugins/class-wpfront-user-role-editor-plugin-integration.php");
610
 
611
 
38
  class WPFront_User_Role_Editor extends WPFront_Base_URE {
39
 
40
  //Constants
41
+ const VERSION = '2.10';
42
  const OPTIONS_GROUP_NAME = 'wpfront-user-role-editor-options-group';
43
  const OPTION_NAME = 'wpfront-user-role-editor-options';
44
  const PLUGIN_SLUG = 'wpfront-user-role-editor';
154
  protected $objGoPro;
155
  protected $objNavMenu = NULL;
156
  protected $objLoginRedirect = NULL;
157
+ protected $objAttachmentPermissions = NULL;
158
+ protected $objUserPermissions = NULL;
159
 
160
  function __construct() {
161
  parent::__construct(__FILE__, self::PLUGIN_SLUG);
175
  $this->objNavMenu = new WPFront_User_Role_Editor_Nav_Menu($this);
176
  if ($this->objLoginRedirect === NULL)
177
  $this->objLoginRedirect = new WPFront_User_Role_Editor_Login_Redirect($this);
178
+ if ($this->objAttachmentPermissions === NULL)
179
+ $this->objAttachmentPermissions = new WPFront_User_Role_Editor_Attachment_Permissions($this);
180
+ if ($this->objUserPermissions === NULL)
181
+ $this->objUserPermissions = new WPFront_User_Role_Editor_User_Permissions($this);
182
  }
183
  }
184
 
199
  $this->rename_role_capabilities();
200
  }
201
 
202
+ protected function add_submenu_page($position, $title, $name, $capability, $slug, $func, $scripts = NULL, $styles = NULL, $controller = NULL, $admin_bar_parent = NULL, $admin_bar_title = NULL) {
203
  if ($scripts === NULL)
204
  $scripts = 'enqueue_role_scripts';
205
  if ($styles === NULL)
206
  $styles = 'enqueue_role_styles';
207
 
208
+ $this->admin_menu[$position] = array($title, $name, $capability, $slug, $func, $scripts, $styles, $controller, $admin_bar_parent, $admin_bar_title);
209
  }
210
 
211
  protected function add_pro_page() {
228
 
229
  if ($this->objGoPro->has_license()) {
230
  $this->add_submenu_page(10, $this->__('Roles'), $this->__('All Roles'), $this->get_capability_string('list'), WPFront_User_Role_Editor_List::MENU_SLUG, array($this->objList, 'list_roles'), NULL, NULL, $this->objList);
231
+ $this->add_submenu_page(20, $this->__('Add New Role'), $this->__('Add New'), $this->get_capability_string('create'), WPFront_User_Role_Editor_Add_Edit::MENU_SLUG, array($this->objAddEdit, 'add_edit_role'), NULL, NULL, $this->objAddEdit, 'new-content', $this->__('Role'));
232
  $this->add_submenu_page(30, $this->__('Restore Role'), $this->__('Restore'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Restore::MENU_SLUG, array($this->objRestore, 'restore_role'), NULL, NULL, $this->objRestore);
233
  $this->add_submenu_page(35, $this->__('Add/Remove Capability'), $this->__('Add/Remove Cap'), $this->get_capability_string('edit'), WPFront_User_Role_Editor_Add_Remove_Capability::MENU_SLUG, array($this->objAddRemoveCap, 'add_remove_capability'), NULL, NULL, $this->objAddRemoveCap);
234
  $this->add_submenu_page(37, $this->__('Login Redirect'), $this->__('Login Redirect'), 'edit_login_redirects', WPFront_User_Role_Editor_Login_Redirect::MENU_SLUG, array($this->objLoginRedirect, 'login_redirect'), NULL, NULL, $this->objLoginRedirect);
259
  }
260
  }
261
 
262
+ public function admin_bar() {
263
+ global $wp_admin_bar;
264
+
265
+ foreach ($this->admin_menu as $key => $value) {
266
+ if (!empty($value[8])) {
267
+ if (current_user_can($value[2])) {
268
+ $wp_admin_bar->add_menu(array(
269
+ 'parent' => $value[8],
270
+ 'id' => $value[3],
271
+ 'title' => $value[9],
272
+ 'href' => admin_url('admin.php?page=' . $value[3]),
273
+ )
274
+ );
275
+ }
276
+ }
277
+ }
278
+ }
279
+
280
  //add scripts
281
  public function enqueue_role_scripts() {
282
  // $jsRoot = $this->pluginURLRoot . 'js/';
562
  return FALSE;
563
  }
564
 
565
+ public function get_assignable_roles($roles = NULL) {
566
+ if ($roles === NULL) {
567
+ global $wp_roles;
568
+ $roles = $wp_roles->roles;
569
+ }
570
+
571
+ $roles = $this->objUserPermissions->assignable_roles($roles);
572
+ $all_roles = array();
573
+
574
+ foreach ($roles as $key => $value) {
575
+ $all_roles[$key] = get_role($key);
576
+ }
577
+
578
+ return $all_roles;
579
+ }
580
+
581
  private function rename_role_capabilities() {
582
  global $wp_roles;
583
 
646
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-go-pro.php");
647
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-nav-menu.php");
648
  require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-login-redirect.php");
649
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-attachment-permissions.php");
650
+ require_once(plugin_dir_path(__FILE__) . "class-wpfront-user-role-editor-user-permissions.php");
651
  require_once(plugin_dir_path(__FILE__) . "integration/plugins/class-wpfront-user-role-editor-plugin-integration.php");
652
 
653
 
languages/wpfront-user-role-editor.mo CHANGED
Binary file
languages/wpfront-user-role-editor.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
- "POT-Creation-Date: 2015-04-10 10:33-0700\n"
5
- "PO-Revision-Date: 2015-04-10 10:33-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
@@ -94,21 +94,21 @@ msgid "Installed"
94
  msgstr "Installed"
95
 
96
  #: ../classes/base/class-wpfront-base-menu.php:179
97
- #: ../classes/base/class-wpfront-base.php:119
98
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:108
99
  #: ../classes/class-wpfront-user-role-editor-options.php:262
100
- #: ../classes/class-wpfront-user-role-editor.php:229
101
  msgid "Settings"
102
  msgstr "Settings"
103
 
104
  #: ../classes/base/class-wpfront-base-menu.php:181
105
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:110
106
  #: ../templates/go-pro.php:71 ../templates/go-pro.php:72
107
  msgid "Activate"
108
  msgstr "Activate"
109
 
110
  #: ../classes/base/class-wpfront-base-menu.php:203
111
- #: ../classes/class-wpfront-user-role-editor.php:344
112
  msgid "Feedback"
113
  msgstr "Feedback"
114
 
@@ -120,12 +120,12 @@ msgstr "WPFront"
120
  msgid "All Plugins"
121
  msgstr "All Plugins"
122
 
123
- #: ../classes/base/class-wpfront-base.php:148
124
- #: ../classes/class-wpfront-user-role-editor.php:293
125
  msgid "You do not have sufficient permissions to access this page."
126
  msgstr "You do not have sufficient permissions to access this page."
127
 
128
- #: ../classes/base/class-wpfront-base.php:168
129
  msgid ""
130
  "If you have a caching plugin, clear the cache for the new settings to take "
131
  "effect."
@@ -133,7 +133,7 @@ msgstr ""
133
  "If you have a caching plugin, clear the cache for the new settings to take "
134
  "effect."
135
 
136
- #: ../classes/base/class-wpfront-base.php:215
137
  #: ../templates/personal-pro/menu-editor.php:232
138
  msgid "Save Changes"
139
  msgstr "Save Changes"
@@ -142,8 +142,8 @@ msgstr "Save Changes"
142
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:88
143
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:80
144
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:152
145
- #: ../classes/class-wpfront-user-role-editor.php:224
146
- #: ../classes/class-wpfront-user-role-editor.php:237
147
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes-list-table.php:87
148
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes.php:431
149
  #: ../templates/add-remove-capability.php:85 ../templates/list-roles.php:43
@@ -152,20 +152,20 @@ msgstr "Roles"
152
 
153
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:88
154
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:154
155
- #: ../classes/class-wpfront-user-role-editor.php:224
156
  #: ../templates/add-remove-capability.php:90
157
  msgid "All Roles"
158
  msgstr "All Roles"
159
 
160
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:93
161
- #: ../classes/class-wpfront-user-role-editor.php:225
162
  #: ../templates/add-edit-role.php:41 ../templates/add-edit-role.php:140
163
  msgid "Add New Role"
164
  msgstr "Add New Role"
165
 
166
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:93
167
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:83
168
- #: ../classes/class-wpfront-user-role-editor.php:225
169
  #: ../templates/add-edit-role.php:43 ../templates/list-roles.php:46
170
  #: ../templates/login-redirect.php:41
171
  #: ../templates/personal-pro/content-shortcodes.php:10
@@ -173,13 +173,13 @@ msgid "Add New"
173
  msgstr "Add New"
174
 
175
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:98
176
- #: ../classes/class-wpfront-user-role-editor.php:226
177
  #: ../templates/restore-role.php:40
178
  msgid "Restore Role"
179
  msgstr "Restore Role"
180
 
181
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:98
182
- #: ../classes/class-wpfront-user-role-editor.php:226
183
  #: ../templates/restore-role.php:52
184
  msgid "Restore"
185
  msgstr "Restore"
@@ -195,7 +195,7 @@ msgid "Sync"
195
  msgstr "Sync"
196
 
197
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:114
198
- #: ../classes/class-wpfront-user-role-editor.php:210
199
  msgid "Go Pro"
200
  msgstr "Go Pro"
201
 
@@ -217,7 +217,7 @@ msgstr ""
217
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:227
218
  #: ../classes/class-wpfront-user-role-editor-add-edit.php:324
219
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:128
220
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:366
221
  #: ../classes/class-wpfront-user-role-editor-list.php:361
222
  #: ../classes/class-wpfront-user-role-editor-list.php:395
223
  #: ../classes/class-wpfront-user-role-editor-list.php:412
@@ -232,7 +232,7 @@ msgstr ""
232
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes.php:404
233
  #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:130
234
  #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:229
235
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:592
236
  msgid "Overview"
237
  msgstr "Overview"
238
 
@@ -549,6 +549,7 @@ msgid "ERROR"
549
  msgstr "ERROR"
550
 
551
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:48
 
552
  msgid "Permission denied."
553
  msgstr "Permission denied."
554
 
@@ -834,47 +835,47 @@ msgid "Documentation on Add/Remove Capability"
834
  msgstr "Documentation on Add/Remove Capability"
835
 
836
  #: ../classes/class-wpfront-user-role-editor-assign-roles.php:66
837
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:340
838
  msgid "Secondary Roles"
839
  msgstr "Secondary Roles"
840
 
841
  #: ../classes/class-wpfront-user-role-editor-assign-roles.php:81
842
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:373
843
  #: ../templates/assign-roles.php:42 ../templates/assign-roles.php:94
844
  msgid "Assign Roles"
845
  msgstr "Assign Roles"
846
 
847
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:171
848
  msgid "No role for this site"
849
  msgstr "No role for this site"
850
 
851
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:197
852
  msgid "Invalid user."
853
  msgstr "Invalid user."
854
 
855
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:225
856
  msgid "Roles updated successfully."
857
  msgstr "Roles updated successfully."
858
 
859
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:227
860
  msgid "Invalid primary role specified."
861
  msgstr "Invalid primary role specified."
862
 
863
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:245
864
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:255
865
  msgid "Invalid primary role."
866
  msgstr "Invalid primary role."
867
 
868
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:277
869
  #, php-format
870
  msgid "%d user(s) migrated."
871
  msgstr "%d user(s) migrated."
872
 
873
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:322
874
  msgid "Primary Role"
875
  msgstr "Primary Role"
876
 
877
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:368
878
  msgid ""
879
  "This screen allows you to assign multiple roles to a user and also allows "
880
  "you to migrate users from a role to another role."
@@ -882,7 +883,7 @@ msgstr ""
882
  "This screen allows you to assign multiple roles to a user and also allows "
883
  "you to migrate users from a role to another role."
884
 
885
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:375
886
  msgid ""
887
  "To assign multiple roles to a user, select that user within the User drop "
888
  "down list and select the primary role you want for that user using the "
@@ -894,12 +895,12 @@ msgstr ""
894
  "Primary Role drop down list. Select the secondary roles using the check "
895
  "boxes below, then click Assign Roles."
896
 
897
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:380
898
  #: ../templates/assign-roles.php:99 ../templates/assign-roles.php:132
899
  msgid "Migrate Users"
900
  msgstr "Migrate Users"
901
 
902
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:382
903
  msgid ""
904
  "To migrate users from one role to another role or to add secondary roles to "
905
  "users belonging to a particular primary role, use the migrate users "
@@ -909,7 +910,7 @@ msgstr ""
909
  "users belonging to a particular primary role, use the migrate users "
910
  "functionality."
911
 
912
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:385
913
  msgid ""
914
  "Select the users using the From Primary Role drop down, to primary role "
915
  "using the Primary Role drop down and secondary roles using the check boxes "
@@ -919,7 +920,7 @@ msgstr ""
919
  "using the Primary Role drop down and secondary roles using the check boxes "
920
  "then click Migrate Users."
921
 
922
- #: ../classes/class-wpfront-user-role-editor-assign-roles.php:394
923
  msgid "Documentation on Assign / Migrate Users"
924
  msgstr "Documentation on Assign / Migrate Users"
925
 
@@ -1097,7 +1098,7 @@ msgstr ""
1097
  "Allows you to set that role as the default role for new user registration."
1098
 
1099
  #: ../classes/class-wpfront-user-role-editor-list.php:486
1100
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:584
1101
  msgid "Edit Menu"
1102
  msgstr "Edit Menu"
1103
 
@@ -1126,6 +1127,7 @@ msgid "No login redirects found."
1126
  msgstr "No login redirects found."
1127
 
1128
  #: ../classes/class-wpfront-user-role-editor-login-redirect-list-table.php:84
 
1129
  #: ../templates/delete-role.php:49 ../templates/login-redirect.php:99
1130
  msgid "Role"
1131
  msgstr "Role"
@@ -1213,7 +1215,7 @@ msgid "Add/Edit a new login redirect."
1213
  msgstr "Add/Edit a new login redirect."
1214
 
1215
  #: ../classes/class-wpfront-user-role-editor-login-redirect.php:448
1216
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:605
1217
  msgid "Fields"
1218
  msgstr "Fields"
1219
 
@@ -1452,29 +1454,29 @@ msgstr "Documentation on Settings"
1452
  msgid "Documentation on Restore"
1453
  msgstr "Documentation on Restore"
1454
 
1455
- #: ../classes/class-wpfront-user-role-editor.php:227
1456
  #: ../templates/add-remove-capability.php:40
1457
  msgid "Add/Remove Capability"
1458
  msgstr "Add/Remove Capability"
1459
 
1460
- #: ../classes/class-wpfront-user-role-editor.php:227
1461
  msgid "Add/Remove Cap"
1462
  msgstr "Add/Remove Cap"
1463
 
1464
- #: ../classes/class-wpfront-user-role-editor.php:228
1465
  #: ../templates/login-redirect.php:40
1466
  msgid "Login Redirect"
1467
  msgstr "Login Redirect"
1468
 
1469
- #: ../classes/class-wpfront-user-role-editor.php:249
1470
  msgid "Assign Roles | Migrate Users"
1471
  msgstr "Assign Roles | Migrate Users"
1472
 
1473
- #: ../classes/class-wpfront-user-role-editor.php:249
1474
  msgid "Assign / Migrate"
1475
  msgstr "Assign / Migrate"
1476
 
1477
- #: ../classes/class-wpfront-user-role-editor.php:346
1478
  msgid "Buy me a Beer"
1479
  msgstr "Buy me a Beer"
1480
 
@@ -1755,7 +1757,7 @@ msgstr "Menu defaults restored."
1755
  msgid "No editable roles found on this site."
1756
  msgstr "No editable roles found on this site."
1757
 
1758
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:594
1759
  msgid ""
1760
  "This screen allows you to enable and disable admin menus for a particular "
1761
  "role."
@@ -1763,11 +1765,11 @@ msgstr ""
1763
  "This screen allows you to enable and disable admin menus for a particular "
1764
  "role."
1765
 
1766
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:597
1767
  msgid "Deselect a menu from the grid to remove that menu."
1768
  msgstr "Deselect a menu from the grid to remove that menu."
1769
 
1770
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:600
1771
  msgid ""
1772
  "Disabled menu items are already hidden, because the selected role doesn't "
1773
  "have the capability to display that menu. Grid displays menus which the "
@@ -1777,21 +1779,21 @@ msgstr ""
1777
  "have the capability to display that menu. Grid displays menus which the "
1778
  "current user has access to."
1779
 
1780
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:607
1781
  #: ../templates/personal-pro/menu-editor.php:39
1782
  msgid "Override Role"
1783
  msgstr "Override Role"
1784
 
1785
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:609
1786
  msgid "The role you want to override."
1787
  msgstr "The role you want to override."
1788
 
1789
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:612
1790
  #: ../templates/personal-pro/menu-editor.php:56
1791
  msgid "Override Type"
1792
  msgstr "Override Type"
1793
 
1794
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:614
1795
  msgid ""
1796
  "Soft - Pages may be available through directly typing the URL. Hard - Even "
1797
  "URLs will be blocked."
@@ -1799,72 +1801,72 @@ msgstr ""
1799
  "Soft - Pages may be available through directly typing the URL. Hard - Even "
1800
  "URLs will be blocked."
1801
 
1802
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:617
1803
  #: ../templates/personal-pro/menu-editor.php:67
1804
  msgid "Hide New Menus"
1805
  msgstr "Hide New Menus"
1806
 
1807
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:619
1808
  msgid "Allow you to hide future menus."
1809
  msgstr "Allow you to hide future menus."
1810
 
1811
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:622
1812
  #: ../templates/personal-pro/menu-editor.php:75
1813
  msgid "Disable For Secondary Role"
1814
  msgstr "Disable For Secondary Role"
1815
 
1816
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:624
1817
  msgid "Disables menu settings while the selected role is a secondary role."
1818
  msgstr "Disables menu settings while the selected role is a secondary role."
1819
 
1820
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:629
1821
  msgid "Restore Default"
1822
  msgstr "Restore Default"
1823
 
1824
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:631
1825
  msgid ""
1826
  "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1827
  msgstr ""
1828
  "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1829
 
1830
- #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:640
1831
  msgid "Documentation on Menu Editor"
1832
  msgstr "Documentation on Menu Editor"
1833
 
1834
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:86
1835
  #: ../templates/personal-pro/menu-editor.php:9
1836
  msgid "Menu Editor"
1837
  msgstr "Menu Editor"
1838
 
1839
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:87
1840
  #: ../templates/personal-pro/content-shortcodes.php:9
1841
  msgid "Content Shortcodes"
1842
  msgstr "Content Shortcodes"
1843
 
1844
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:87
1845
  msgid "Shortcodes"
1846
  msgstr "Shortcodes"
1847
 
1848
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:88
1849
  #: ../templates/personal-pro/export-roles.php:9
1850
  msgid "Export Roles"
1851
  msgstr "Export Roles"
1852
 
1853
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:88
1854
  msgid "Export"
1855
  msgstr "Export"
1856
 
1857
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:89
1858
  #: ../templates/personal-pro/import-roles.php:9
1859
  #: ../templates/personal-pro/import-roles.php:88
1860
  msgid "Import Roles"
1861
  msgstr "Import Roles"
1862
 
1863
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:89
1864
  msgid "Import"
1865
  msgstr "Import"
1866
 
1867
- #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:109
1868
  #, php-format
1869
  msgid "%s license not activated."
1870
  msgstr "%s license not activated."
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: WPFront Notification Bar\n"
4
+ "POT-Creation-Date: 2015-05-21 15:30-0700\n"
5
+ "PO-Revision-Date: 2015-05-21 15:31-0700\n"
6
  "Last-Translator: \n"
7
  "Language-Team: WPFront <contact@wpfront.com>\n"
8
  "Language: en\n"
94
  msgstr "Installed"
95
 
96
  #: ../classes/base/class-wpfront-base-menu.php:179
97
+ #: ../classes/base/class-wpfront-base.php:124
98
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:108
99
  #: ../classes/class-wpfront-user-role-editor-options.php:262
100
+ #: ../classes/class-wpfront-user-role-editor.php:235
101
  msgid "Settings"
102
  msgstr "Settings"
103
 
104
  #: ../classes/base/class-wpfront-base-menu.php:181
105
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:113
106
  #: ../templates/go-pro.php:71 ../templates/go-pro.php:72
107
  msgid "Activate"
108
  msgstr "Activate"
109
 
110
  #: ../classes/base/class-wpfront-base-menu.php:203
111
+ #: ../classes/class-wpfront-user-role-editor.php:368
112
  msgid "Feedback"
113
  msgstr "Feedback"
114
 
120
  msgid "All Plugins"
121
  msgstr "All Plugins"
122
 
123
+ #: ../classes/base/class-wpfront-base.php:153
124
+ #: ../classes/class-wpfront-user-role-editor.php:317
125
  msgid "You do not have sufficient permissions to access this page."
126
  msgstr "You do not have sufficient permissions to access this page."
127
 
128
+ #: ../classes/base/class-wpfront-base.php:173
129
  msgid ""
130
  "If you have a caching plugin, clear the cache for the new settings to take "
131
  "effect."
133
  "If you have a caching plugin, clear the cache for the new settings to take "
134
  "effect."
135
 
136
+ #: ../classes/base/class-wpfront-base.php:220
137
  #: ../templates/personal-pro/menu-editor.php:232
138
  msgid "Save Changes"
139
  msgstr "Save Changes"
142
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:88
143
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:80
144
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:152
145
+ #: ../classes/class-wpfront-user-role-editor.php:230
146
+ #: ../classes/class-wpfront-user-role-editor.php:243
147
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes-list-table.php:87
148
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes.php:431
149
  #: ../templates/add-remove-capability.php:85 ../templates/list-roles.php:43
152
 
153
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:88
154
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:154
155
+ #: ../classes/class-wpfront-user-role-editor.php:230
156
  #: ../templates/add-remove-capability.php:90
157
  msgid "All Roles"
158
  msgstr "All Roles"
159
 
160
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:93
161
+ #: ../classes/class-wpfront-user-role-editor.php:231
162
  #: ../templates/add-edit-role.php:41 ../templates/add-edit-role.php:140
163
  msgid "Add New Role"
164
  msgstr "Add New Role"
165
 
166
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:93
167
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-list.php:83
168
+ #: ../classes/class-wpfront-user-role-editor.php:231
169
  #: ../templates/add-edit-role.php:43 ../templates/list-roles.php:46
170
  #: ../templates/login-redirect.php:41
171
  #: ../templates/personal-pro/content-shortcodes.php:10
173
  msgstr "Add New"
174
 
175
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:98
176
+ #: ../classes/class-wpfront-user-role-editor.php:232
177
  #: ../templates/restore-role.php:40
178
  msgid "Restore Role"
179
  msgstr "Restore Role"
180
 
181
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:98
182
+ #: ../classes/class-wpfront-user-role-editor.php:232
183
  #: ../templates/restore-role.php:52
184
  msgid "Restore"
185
  msgstr "Restore"
195
  msgstr "Sync"
196
 
197
  #: ../classes/business-pro/class-wpfront-user-role-editor-business-pro.php:114
198
+ #: ../classes/class-wpfront-user-role-editor.php:216
199
  msgid "Go Pro"
200
  msgstr "Go Pro"
201
 
217
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-sync.php:227
218
  #: ../classes/class-wpfront-user-role-editor-add-edit.php:324
219
  #: ../classes/class-wpfront-user-role-editor-add-remove-capability.php:128
220
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:393
221
  #: ../classes/class-wpfront-user-role-editor-list.php:361
222
  #: ../classes/class-wpfront-user-role-editor-list.php:395
223
  #: ../classes/class-wpfront-user-role-editor-list.php:412
232
  #: ../classes/personal-pro/class-wpfront-user-role-editor-content-shortcodes.php:404
233
  #: ../classes/personal-pro/class-wpfront-user-role-editor-export.php:130
234
  #: ../classes/personal-pro/class-wpfront-user-role-editor-import.php:229
235
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:601
236
  msgid "Overview"
237
  msgstr "Overview"
238
 
549
  msgstr "ERROR"
550
 
551
  #: ../classes/business-pro/class-wpfront-user-role-editor-ms-restore.php:48
552
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:216
553
  msgid "Permission denied."
554
  msgstr "Permission denied."
555
 
835
  msgstr "Documentation on Add/Remove Capability"
836
 
837
  #: ../classes/class-wpfront-user-role-editor-assign-roles.php:66
838
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:367
839
  msgid "Secondary Roles"
840
  msgstr "Secondary Roles"
841
 
842
  #: ../classes/class-wpfront-user-role-editor-assign-roles.php:81
843
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:400
844
  #: ../templates/assign-roles.php:42 ../templates/assign-roles.php:94
845
  msgid "Assign Roles"
846
  msgstr "Assign Roles"
847
 
848
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:183
849
  msgid "No role for this site"
850
  msgstr "No role for this site"
851
 
852
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:210
853
  msgid "Invalid user."
854
  msgstr "Invalid user."
855
 
856
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:245
857
  msgid "Roles updated successfully."
858
  msgstr "Roles updated successfully."
859
 
860
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:247
861
  msgid "Invalid primary role specified."
862
  msgstr "Invalid primary role specified."
863
 
864
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:265
865
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:275
866
  msgid "Invalid primary role."
867
  msgstr "Invalid primary role."
868
 
869
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:297
870
  #, php-format
871
  msgid "%d user(s) migrated."
872
  msgstr "%d user(s) migrated."
873
 
874
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:349
875
  msgid "Primary Role"
876
  msgstr "Primary Role"
877
 
878
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:395
879
  msgid ""
880
  "This screen allows you to assign multiple roles to a user and also allows "
881
  "you to migrate users from a role to another role."
883
  "This screen allows you to assign multiple roles to a user and also allows "
884
  "you to migrate users from a role to another role."
885
 
886
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:402
887
  msgid ""
888
  "To assign multiple roles to a user, select that user within the User drop "
889
  "down list and select the primary role you want for that user using the "
895
  "Primary Role drop down list. Select the secondary roles using the check "
896
  "boxes below, then click Assign Roles."
897
 
898
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:407
899
  #: ../templates/assign-roles.php:99 ../templates/assign-roles.php:132
900
  msgid "Migrate Users"
901
  msgstr "Migrate Users"
902
 
903
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:409
904
  msgid ""
905
  "To migrate users from one role to another role or to add secondary roles to "
906
  "users belonging to a particular primary role, use the migrate users "
910
  "users belonging to a particular primary role, use the migrate users "
911
  "functionality."
912
 
913
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:412
914
  msgid ""
915
  "Select the users using the From Primary Role drop down, to primary role "
916
  "using the Primary Role drop down and secondary roles using the check boxes "
920
  "using the Primary Role drop down and secondary roles using the check boxes "
921
  "then click Migrate Users."
922
 
923
+ #: ../classes/class-wpfront-user-role-editor-assign-roles.php:421
924
  msgid "Documentation on Assign / Migrate Users"
925
  msgstr "Documentation on Assign / Migrate Users"
926
 
1098
  "Allows you to set that role as the default role for new user registration."
1099
 
1100
  #: ../classes/class-wpfront-user-role-editor-list.php:486
1101
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:593
1102
  msgid "Edit Menu"
1103
  msgstr "Edit Menu"
1104
 
1127
  msgstr "No login redirects found."
1128
 
1129
  #: ../classes/class-wpfront-user-role-editor-login-redirect-list-table.php:84
1130
+ #: ../classes/class-wpfront-user-role-editor.php:231
1131
  #: ../templates/delete-role.php:49 ../templates/login-redirect.php:99
1132
  msgid "Role"
1133
  msgstr "Role"
1215
  msgstr "Add/Edit a new login redirect."
1216
 
1217
  #: ../classes/class-wpfront-user-role-editor-login-redirect.php:448
1218
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:614
1219
  msgid "Fields"
1220
  msgstr "Fields"
1221
 
1454
  msgid "Documentation on Restore"
1455
  msgstr "Documentation on Restore"
1456
 
1457
+ #: ../classes/class-wpfront-user-role-editor.php:233
1458
  #: ../templates/add-remove-capability.php:40
1459
  msgid "Add/Remove Capability"
1460
  msgstr "Add/Remove Capability"
1461
 
1462
+ #: ../classes/class-wpfront-user-role-editor.php:233
1463
  msgid "Add/Remove Cap"
1464
  msgstr "Add/Remove Cap"
1465
 
1466
+ #: ../classes/class-wpfront-user-role-editor.php:234
1467
  #: ../templates/login-redirect.php:40
1468
  msgid "Login Redirect"
1469
  msgstr "Login Redirect"
1470
 
1471
+ #: ../classes/class-wpfront-user-role-editor.php:255
1472
  msgid "Assign Roles | Migrate Users"
1473
  msgstr "Assign Roles | Migrate Users"
1474
 
1475
+ #: ../classes/class-wpfront-user-role-editor.php:255
1476
  msgid "Assign / Migrate"
1477
  msgstr "Assign / Migrate"
1478
 
1479
+ #: ../classes/class-wpfront-user-role-editor.php:370
1480
  msgid "Buy me a Beer"
1481
  msgstr "Buy me a Beer"
1482
 
1757
  msgid "No editable roles found on this site."
1758
  msgstr "No editable roles found on this site."
1759
 
1760
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:603
1761
  msgid ""
1762
  "This screen allows you to enable and disable admin menus for a particular "
1763
  "role."
1765
  "This screen allows you to enable and disable admin menus for a particular "
1766
  "role."
1767
 
1768
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:606
1769
  msgid "Deselect a menu from the grid to remove that menu."
1770
  msgstr "Deselect a menu from the grid to remove that menu."
1771
 
1772
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:609
1773
  msgid ""
1774
  "Disabled menu items are already hidden, because the selected role doesn't "
1775
  "have the capability to display that menu. Grid displays menus which the "
1779
  "have the capability to display that menu. Grid displays menus which the "
1780
  "current user has access to."
1781
 
1782
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:616
1783
  #: ../templates/personal-pro/menu-editor.php:39
1784
  msgid "Override Role"
1785
  msgstr "Override Role"
1786
 
1787
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:618
1788
  msgid "The role you want to override."
1789
  msgstr "The role you want to override."
1790
 
1791
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:621
1792
  #: ../templates/personal-pro/menu-editor.php:56
1793
  msgid "Override Type"
1794
  msgstr "Override Type"
1795
 
1796
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:623
1797
  msgid ""
1798
  "Soft - Pages may be available through directly typing the URL. Hard - Even "
1799
  "URLs will be blocked."
1801
  "Soft - Pages may be available through directly typing the URL. Hard - Even "
1802
  "URLs will be blocked."
1803
 
1804
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:626
1805
  #: ../templates/personal-pro/menu-editor.php:67
1806
  msgid "Hide New Menus"
1807
  msgstr "Hide New Menus"
1808
 
1809
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:628
1810
  msgid "Allow you to hide future menus."
1811
  msgstr "Allow you to hide future menus."
1812
 
1813
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:631
1814
  #: ../templates/personal-pro/menu-editor.php:75
1815
  msgid "Disable For Secondary Role"
1816
  msgstr "Disable For Secondary Role"
1817
 
1818
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:633
1819
  msgid "Disables menu settings while the selected role is a secondary role."
1820
  msgstr "Disables menu settings while the selected role is a secondary role."
1821
 
1822
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:638
1823
  msgid "Restore Default"
1824
  msgstr "Restore Default"
1825
 
1826
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:640
1827
  msgid ""
1828
  "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1829
  msgstr ""
1830
  "Select \"Restore default\" from the \"Copy from\" drop down and click apply."
1831
 
1832
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-menu-editor.php:649
1833
  msgid "Documentation on Menu Editor"
1834
  msgstr "Documentation on Menu Editor"
1835
 
1836
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:89
1837
  #: ../templates/personal-pro/menu-editor.php:9
1838
  msgid "Menu Editor"
1839
  msgstr "Menu Editor"
1840
 
1841
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:90
1842
  #: ../templates/personal-pro/content-shortcodes.php:9
1843
  msgid "Content Shortcodes"
1844
  msgstr "Content Shortcodes"
1845
 
1846
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:90
1847
  msgid "Shortcodes"
1848
  msgstr "Shortcodes"
1849
 
1850
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1851
  #: ../templates/personal-pro/export-roles.php:9
1852
  msgid "Export Roles"
1853
  msgstr "Export Roles"
1854
 
1855
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:91
1856
  msgid "Export"
1857
  msgstr "Export"
1858
 
1859
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1860
  #: ../templates/personal-pro/import-roles.php:9
1861
  #: ../templates/personal-pro/import-roles.php:88
1862
  msgid "Import Roles"
1863
  msgstr "Import Roles"
1864
 
1865
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:92
1866
  msgid "Import"
1867
  msgstr "Import"
1868
 
1869
+ #: ../classes/personal-pro/class-wpfront-user-role-editor-personal-pro.php:112
1870
  #, php-format
1871
  msgid "%s license not activated."
1872
  msgstr "%s license not activated."
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: syammohanm
3
  Donate link: https://wpfront.com/donate/
4
  Tags: WordPress user role editor, user role editor, role editor, user role, role, WordPress user roles, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager, custom post types, custom post type permissions, custom post type capabilities, post type permissions, post type capabilities, menu editor, role menu, role menu editor, multisite roles, multisite role editor, multisite user roles, import roles, export roles
5
  Requires at least: 3.5
6
- Tested up to: 4.2
7
- Stable tag: 2.9.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -29,6 +29,7 @@ You can create, edit or delete user roles and manage role capabilities.
29
  * Login redirect basic.
30
  * [Admin menu editor.](https://wpfront.com/user-role-editor-pro/menu-editor/) [PRO]
31
  * [Media library permissions.](https://wpfront.com/user-role-editor-pro/media-attachment-file-permissions/) [PRO]
 
32
  * [Navigation menu permissions advanced.](https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/) [PRO]
33
  * [Login redirect advanced.](https://wpfront.com/user-role-editor-pro/login-redirect/) [PRO]
34
  * [Post/Page extended permissions.](https://wpfront.com/user-role-editor-pro/posts-pages-extended-permissions/) [PRO]
@@ -81,9 +82,18 @@ Please visit [WPFront User Role Editor FAQ](https://wpfront.com/user-role-editor
81
  15. Media library permissions
82
  16. Content restriction shortcodes
83
  17. Login redirect
 
84
 
85
  == Changelog ==
86
 
 
 
 
 
 
 
 
 
87
  = 2.9.1 =
88
  * Show toolbar inheritance bug fix.
89
 
@@ -167,6 +177,12 @@ Please visit [WPFront User Role Editor FAQ](https://wpfront.com/user-role-editor
167
 
168
  == Upgrade Notice ==
169
 
 
 
 
 
 
 
170
  = 2.9.1 =
171
  * Bug fix.
172
 
3
  Donate link: https://wpfront.com/donate/
4
  Tags: WordPress user role editor, user role editor, role editor, user role, role, WordPress user roles, user roles, roles, user roles editor, roles editor, role manager, roles manager, manage roles, manage role, access, capability, editor, permission, role, security, user, capability editor, capability manager, custom post types, custom post type permissions, custom post type capabilities, post type permissions, post type capabilities, menu editor, role menu, role menu editor, multisite roles, multisite role editor, multisite user roles, import roles, export roles
5
  Requires at least: 3.5
6
+ Tested up to: 4.3
7
+ Stable tag: 2.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
29
  * Login redirect basic.
30
  * [Admin menu editor.](https://wpfront.com/user-role-editor-pro/menu-editor/) [PRO]
31
  * [Media library permissions.](https://wpfront.com/user-role-editor-pro/media-attachment-file-permissions/) [PRO]
32
+ * [User level permissions.](https://wpfront.com/user-role-editor-pro/user-level-permissions/) [PRO]
33
  * [Navigation menu permissions advanced.](https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/) [PRO]
34
  * [Login redirect advanced.](https://wpfront.com/user-role-editor-pro/login-redirect/) [PRO]
35
  * [Post/Page extended permissions.](https://wpfront.com/user-role-editor-pro/posts-pages-extended-permissions/) [PRO]
82
  15. Media library permissions
83
  16. Content restriction shortcodes
84
  17. Login redirect
85
+ 18. User level permissions
86
 
87
  == Changelog ==
88
 
89
+ = 2.10 =
90
+ * User level permissions added. [Documentation](https://wpfront.com/user-role-editor-pro/user-level-permissions/).
91
+ * UI enhancements.
92
+
93
+ = 2.9.3 =
94
+ * Menu editor bug fix.
95
+ * Menu editor WP4.2 compatibility fix.
96
+
97
  = 2.9.1 =
98
  * Show toolbar inheritance bug fix.
99
 
177
 
178
  == Upgrade Notice ==
179
 
180
+ = 2.10 =
181
+ * User level permissions.
182
+
183
+ = 2.9.3 =
184
+ * Bug fix.
185
+
186
  = 2.9.1 =
187
  * Bug fix.
188
 
templates/assign-roles.php CHANGED
@@ -39,53 +39,53 @@ $this->main->verify_nonce();
39
 
40
  <div class="wrap assign-roles">
41
  <h2 id="assign-roles">
42
- <?php echo $this->__('Assign Roles'); ?>
43
  </h2>
44
 
45
- <?php
46
- if ($this->result != NULL) {
47
- if ($this->result->success) {
48
- ?>
49
  <div class="updated">
50
  <p><?php echo $this->result->message; ?></p>
51
  </div>
52
- <?php } else { ?>
53
 
54
  <div class="error">
55
  <p><?php echo $this->result->message; ?></p>
56
  </div>
57
- <?php
 
58
  }
59
- }
60
- ?>
61
 
62
  <form method="POST">
63
- <?php $this->main->create_nonce(); ?>
64
  <table class="form-table">
65
  <tbody>
66
  <tr>
67
  <th scope="row">
68
- <?php echo $this->__('User'); ?>
69
  </th>
70
  <td>
71
  <select id="assign_users_list" name="assign-user">
72
- <?php
73
- foreach ($this->users as $user) {
74
- $select = FALSE;
75
- if ($this->user != NULL && $this->user->ID == $user->ID)
76
- $select = TRUE;
77
- ?>
78
  <option <?php echo $select ? 'selected' : ''; ?> value="<?php echo $user->ID; ?>">
79
- <?php echo $user->display_name . ' [' . $user->user_login . ']' ; ?>
80
  </option>
81
- <?php
82
- }
83
- ?>
84
  </select>
85
  </td>
86
  </tr>
87
 
88
- <?php $this->primary_secondary_section('assign', $this->userPrimaryRole, $this->userSecondaryRoles); ?>
89
 
90
  </tbody>
91
  </table>
@@ -96,34 +96,34 @@ foreach ($this->users as $user) {
96
  </form>
97
 
98
  <h2 id="migrate-users">
99
- <?php echo $this->__('Migrate Users'); ?>
100
  </h2>
101
 
102
  <form method="POST">
103
- <?php $this->main->create_nonce(); ?>
104
 
105
  <table class="form-table">
106
  <tbody>
107
  <tr>
108
  <th scope="row">
109
- <?php echo $this->__('From Primary Role'); ?>
110
  </th>
111
  <td>
112
  <select id="migrate_from_role" name="migrate-from-primary-role">
113
- <?php
114
- foreach ($this->primary_roles as $key => $role) {
115
- ?>
116
  <option value="<?php echo $key; ?>" <?php echo $this->migrateFromPrimaryRole === $key ? 'selected' : ''; ?>>
117
- <?php echo $role; ?>
118
  </option>
119
- <?php
120
- }
121
- ?>
122
  </select>
123
  </td>
124
  </tr>
125
 
126
- <?php $this->primary_secondary_section('migrate', $this->migrateToPrimaryRole, $this->migrateToSecondaryRoles); ?>
127
 
128
  </tbody>
129
  </table>
@@ -137,21 +137,23 @@ foreach ($this->primary_roles as $key => $role) {
137
 
138
  <script type="text/javascript">
139
 
140
- (function($) {
141
 
142
  var page_url = '<?php echo $this->get_assign_role_url(); ?>';
143
 
144
- $('#assign_users_list').change(function() {
145
  window.location.replace(page_url + $(this).val());
146
  });
147
 
148
- $('#assign_roles_list, #migrate_roles_list').change(function() {
149
  var $this = $(this);
150
  if ($this.val() == '') {
151
  $this.closest('table').find('div.role-list-item input').prop('disabled', true);
 
152
  }
153
  else {
154
  $this.closest('table').find('div.role-list-item input').prop('disabled', false);
 
155
  }
156
  }).change();
157
 
39
 
40
  <div class="wrap assign-roles">
41
  <h2 id="assign-roles">
42
+ <?php echo $this->__('Assign Roles'); ?>
43
  </h2>
44
 
45
+ <?php
46
+ if ($this->result != NULL) {
47
+ if ($this->result->success) {
48
+ ?>
49
  <div class="updated">
50
  <p><?php echo $this->result->message; ?></p>
51
  </div>
52
+ <?php } else { ?>
53
 
54
  <div class="error">
55
  <p><?php echo $this->result->message; ?></p>
56
  </div>
57
+ <?php
58
+ }
59
  }
60
+ ?>
 
61
 
62
  <form method="POST">
63
+ <?php $this->main->create_nonce(); ?>
64
  <table class="form-table">
65
  <tbody>
66
  <tr>
67
  <th scope="row">
68
+ <?php echo $this->__('User'); ?>
69
  </th>
70
  <td>
71
  <select id="assign_users_list" name="assign-user">
72
+ <?php
73
+ foreach ($this->users as $user) {
74
+ $select = FALSE;
75
+ if ($this->user != NULL && $this->user->ID == $user->ID)
76
+ $select = TRUE;
77
+ ?>
78
  <option <?php echo $select ? 'selected' : ''; ?> value="<?php echo $user->ID; ?>">
79
+ <?php echo $user->display_name . ' [' . $user->user_login . ']'; ?>
80
  </option>
81
+ <?php
82
+ }
83
+ ?>
84
  </select>
85
  </td>
86
  </tr>
87
 
88
+ <?php $this->primary_secondary_section('assign', $this->userPrimaryRole, $this->userSecondaryRoles); ?>
89
 
90
  </tbody>
91
  </table>
96
  </form>
97
 
98
  <h2 id="migrate-users">
99
+ <?php echo $this->__('Migrate Users'); ?>
100
  </h2>
101
 
102
  <form method="POST">
103
+ <?php $this->main->create_nonce(); ?>
104
 
105
  <table class="form-table">
106
  <tbody>
107
  <tr>
108
  <th scope="row">
109
+ <?php echo $this->__('From Primary Role'); ?>
110
  </th>
111
  <td>
112
  <select id="migrate_from_role" name="migrate-from-primary-role">
113
+ <?php
114
+ foreach ($this->primary_roles as $key => $role) {
115
+ ?>
116
  <option value="<?php echo $key; ?>" <?php echo $this->migrateFromPrimaryRole === $key ? 'selected' : ''; ?>>
117
+ <?php echo $role; ?>
118
  </option>
119
+ <?php
120
+ }
121
+ ?>
122
  </select>
123
  </td>
124
  </tr>
125
 
126
+ <?php $this->primary_secondary_section('migrate', $this->migrateToPrimaryRole, $this->migrateToSecondaryRoles); ?>
127
 
128
  </tbody>
129
  </table>
137
 
138
  <script type="text/javascript">
139
 
140
+ (function ($) {
141
 
142
  var page_url = '<?php echo $this->get_assign_role_url(); ?>';
143
 
144
+ $('#assign_users_list').change(function () {
145
  window.location.replace(page_url + $(this).val());
146
  });
147
 
148
+ $('#assign_roles_list, #migrate_roles_list').change(function () {
149
  var $this = $(this);
150
  if ($this.val() == '') {
151
  $this.closest('table').find('div.role-list-item input').prop('disabled', true);
152
+ $this.closest('table').next().find('input').prop('disabled', true);
153
  }
154
  else {
155
  $this.closest('table').find('div.role-list-item input').prop('disabled', false);
156
+ $this.closest('table').next().find('input').prop('disabled', false);
157
  }
158
  }).change();
159
 
templates/go-pro-table CHANGED
@@ -71,7 +71,10 @@
71
  <div class="cell">
72
  <i class="fa fa-times"></i>
73
  </div>
74
- <div class="cell">
 
 
 
75
  <i class="fa fa-times"></i>
76
  </div>
77
  <div class="cell">
@@ -95,7 +98,7 @@
95
  <div class="cell">
96
  <i class="fa fa-times"></i>
97
  </div>
98
- <div class="cell">
99
  <i class="fa fa-times"></i>
100
  </div>
101
  <div class="cell">
@@ -118,7 +121,7 @@
118
  <div class="cell">
119
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/">Navigation Menu Advanced</a>
120
  </div>
121
- <div class="cell">
122
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/login-redirect/">Login Redirect Advanced</a>
123
  </div>
124
  <div class="cell">
@@ -127,7 +130,10 @@
127
  <div class="cell">
128
  <a target="_blank" href="https://wpfront.com/media-attachment-file-permissions/">Media Library Permissions</a>
129
  </div>
130
- <div class="cell">
 
 
 
131
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/content-restriction-shortcodes/">Content Restriction Shortcodes</a>
132
  </div>
133
  <div class="cell">
@@ -168,7 +174,7 @@
168
  <div class="cell">
169
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/">Navigation Menu Advanced</a>
170
  </div>
171
- <div class="cell">
172
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/login-redirect/">Login Redirect Advanced</a>
173
  </div>
174
  <div class="cell">
@@ -177,7 +183,10 @@
177
  <div class="cell">
178
  <a target="_blank" href="https://wpfront.com/media-attachment-file-permissions/">Media Library Permissions</a>
179
  </div>
180
- <div class="cell">
 
 
 
181
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/content-restriction-shortcodes/">Content Restriction Shortcodes</a>
182
  </div>
183
  <div class="cell">
@@ -203,4 +212,40 @@
203
  </div>
204
  </div>
205
  <img src="https://wpfront.com/uret" style="width:1px;height:1px;" />
206
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  <div class="cell">
72
  <i class="fa fa-times"></i>
73
  </div>
74
+ <div class="cell">
75
+ <i class="fa fa-times"></i>
76
+ </div>
77
+ <div class="cell">
78
  <i class="fa fa-times"></i>
79
  </div>
80
  <div class="cell">
98
  <div class="cell">
99
  <i class="fa fa-times"></i>
100
  </div>
101
+ <div class="cell">
102
  <i class="fa fa-times"></i>
103
  </div>
104
  <div class="cell">
121
  <div class="cell">
122
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/">Navigation Menu Advanced</a>
123
  </div>
124
+ <div class="cell">
125
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/login-redirect/">Login Redirect Advanced</a>
126
  </div>
127
  <div class="cell">
130
  <div class="cell">
131
  <a target="_blank" href="https://wpfront.com/media-attachment-file-permissions/">Media Library Permissions</a>
132
  </div>
133
+ <div class="cell">
134
+ <a target="_blank" href="https://wpfront.com/user-level-permissions/">User Level Permissions</a>
135
+ </div>
136
+ <div class="cell">
137
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/content-restriction-shortcodes/">Content Restriction Shortcodes</a>
138
  </div>
139
  <div class="cell">
174
  <div class="cell">
175
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/navigation-menu-permissions/">Navigation Menu Advanced</a>
176
  </div>
177
+ <div class="cell">
178
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/login-redirect/">Login Redirect Advanced</a>
179
  </div>
180
  <div class="cell">
183
  <div class="cell">
184
  <a target="_blank" href="https://wpfront.com/media-attachment-file-permissions/">Media Library Permissions</a>
185
  </div>
186
+ <div class="cell">
187
+ <a target="_blank" href="https://wpfront.com/user-level-permissions/">User Level Permissions</a>
188
+ </div>
189
+ <div class="cell">
190
  <a target="_blank" href="https://wpfront.com/user-role-editor-pro/content-restriction-shortcodes/">Content Restriction Shortcodes</a>
191
  </div>
192
  <div class="cell">
212
  </div>
213
  </div>
214
  <img src="https://wpfront.com/uret" style="width:1px;height:1px;" />
215
+ </div>
216
+
217
+
218
+ <!-- Begin MailChimp Signup Form -->
219
+ <link href="//cdn-images.mailchimp.com/embedcode/classic-081711.css" rel="stylesheet" type="text/css">
220
+ <style type="text/css">
221
+ #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
222
+ </style>
223
+ <div id="mc_embed_signup" style="max-width:602px;margin-top:5px;">
224
+ <form action="//wpfront.us10.list-manage.com/subscribe/post?u=025ec8aba76cfe3dcb048824b&amp;id=40d9eecd94" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
225
+ <div id="mc_embed_signup_scroll">
226
+ <h2>Get notified on new features and releases</h2>
227
+ <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
228
+ <div class="mc-field-group">
229
+ <label for="mce-EMAIL">Email Address <span class="asterisk">*</span>
230
+ </label>
231
+ <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
232
+ </div>
233
+ <div class="mc-field-group">
234
+ <label for="mce-FNAME">First Name </label>
235
+ <input type="text" value="" name="FNAME" class="" id="mce-FNAME">
236
+ </div>
237
+ <div class="mc-field-group">
238
+ <label for="mce-LNAME">Last Name </label>
239
+ <input type="text" value="" name="LNAME" class="" id="mce-LNAME">
240
+ </div>
241
+ <div id="mce-responses" class="clear">
242
+ <div class="response" id="mce-error-response" style="display:none"></div>
243
+ <div class="response" id="mce-success-response" style="display:none"></div>
244
+ </div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
245
+ <div style="position: absolute; left: -5000px;"><input type="text" name="b_025ec8aba76cfe3dcb048824b_40d9eecd94" tabindex="-1" value=""></div>
246
+ <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="background-color:#00a0d2;"></div>
247
+ </div>
248
+ </form>
249
+ </div>
250
+ <script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script><script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
251
+ <!--End mc_embed_signup-->
wpfront-user-role-editor.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: WPFront User Role Editor
5
  * Plugin URI: http://wpfront.com/user-role-editor-pro/
6
  * Description: Allows you to manage user roles.
7
- * Version: 2.9.1
8
  * Author: Syam Mohan
9
  * Author URI: http://wpfront.com
10
  * License: GPL v3
4
  * Plugin Name: WPFront User Role Editor
5
  * Plugin URI: http://wpfront.com/user-role-editor-pro/
6
  * Description: Allows you to manage user roles.
7
+ * Version: 2.10
8
  * Author: Syam Mohan
9
  * Author URI: http://wpfront.com
10
  * License: GPL v3