User Role Editor - Version 3.2.1

Version Description

  • 01.08.2011
  • This is minor bug-fix update. If you didn't meet this bug you can skip this update. "usermeta" table doesn't exist bug appearing on some multi-site blogs is fixed. Read this post for more information. Thanks to harpinder for discovering this bug and for the help with testing updated code. "usermeta" Db table name is define by more universal way now.
Download this release

Release Info

Developer shinephp
Plugin Icon 128x128 User Role Editor
Version 3.2.1
Comparing to
See all releases

Code changes from version 3.2 to 3.2.1

Files changed (3) hide show
  1. readme.txt +5 -1
  2. ure-lib.php +5 -10
  3. user-role-editor.php +1 -1
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.shinephp.com/donate/
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
- Stable tag: 3.2
8
 
9
  User Role Editor WordPress plugin makes the role capabilities changing easy. You can change any standard WordPress user role (except administrator).
10
 
@@ -77,6 +77,10 @@ Share with me new ideas about plugin further development and link to your site w
77
 
78
 
79
  == Changelog ==
 
 
 
 
80
  = 3.2 =
81
  * 25.07.2011
82
  * If you run multi-site WordPress network, User Role Editor will automatically duplicate all roles from the main blog (blog with mininal ID) to every new created blog.
4
  Tags: user, role, editor, security, access, permission, capability
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
+ Stable tag: 3.2.1
8
 
9
  User Role Editor WordPress plugin makes the role capabilities changing easy. You can change any standard WordPress user role (except administrator).
10
 
77
 
78
 
79
  == Changelog ==
80
+ = 3.2.1 =
81
+ * 01.08.2011
82
+ * This is minor bug-fix update. If you didn't meet this bug you can skip this update. "usermeta" table doesn't exist bug appearing on some multi-site blogs is fixed. Read [this post](http://wordpress.org/support/topic/multisite-setup-gives-usermeta-table-error) for more information. Thanks to harpinder for discovering this bug and for the help with testing updated code. "usermeta" Db table name is define by more universal way now.
83
+
84
  = 3.2 =
85
  * 25.07.2011
86
  * If you run multi-site WordPress network, User Role Editor will automatically duplicate all roles from the main blog (blog with mininal ID) to every new created blog.
ure-lib.php CHANGED
@@ -21,11 +21,6 @@ define('URE_ERROR', 'Error is encountered');
21
  define('URE_SPACE_REPLACER', '_URE-SR_');
22
  define('URE_PARENT', 'users.php');
23
 
24
- /*
25
- global $wpdb, $ure_roles, $ure_capabilitiesToSave, $ure_currentRole, $ure_currentRoleName, $ure_toldAboutBackup, $ure_apply_to_all,
26
- $ure_userToEdit, $fullCapabilities;
27
- */
28
-
29
  $ure_roles = false; $ure_capabilitiesToSave = false;
30
  $ure_currentRole = false; $ure_currentRoleName = false;
31
  $ure_toldAboutBackup = false; $ure_apply_to_all = false;
@@ -61,8 +56,8 @@ function ure_has_administrator_role($user_id) {
61
  return false;
62
  }
63
 
64
- $tableName = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : $wpdb->prefix.'usermeta';
65
- $metaKey = $wpdb->prefix.'capabilities';
66
  $query = "SELECT count(*)
67
  FROM $tableName
68
  WHERE user_id=$user_id AND meta_key='$metaKey' AND meta_value like '%administrator%'";
@@ -73,7 +68,7 @@ function ure_has_administrator_role($user_id) {
73
  $result = false;
74
  }
75
  $ure_userToCheck[$user_id] = $result;
76
-
77
  return $result;
78
  }
79
  // end of ure_has_administrator_role()
@@ -342,8 +337,8 @@ function ure_newRoleCreate(&$ure_currentRole) {
342
  function getRolesCanDelete($ure_roles) {
343
  global $wpdb;
344
 
345
- $tableName = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : $wpdb->prefix.'usermeta';
346
- $metaKey = $wpdb->prefix.'capabilities';
347
  $defaultRole = get_option('default_role');
348
  $standardRoles = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
349
  $ure_rolesCanDelete = array();
21
  define('URE_SPACE_REPLACER', '_URE-SR_');
22
  define('URE_PARENT', 'users.php');
23
 
 
 
 
 
 
24
  $ure_roles = false; $ure_capabilitiesToSave = false;
25
  $ure_currentRole = false; $ure_currentRoleName = false;
26
  $ure_toldAboutBackup = false; $ure_apply_to_all = false;
56
  return false;
57
  }
58
 
59
+ $tableName = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : $wpdb->usermeta;
60
+ $metaKey = $wpdb->base_prefix.'capabilities';
61
  $query = "SELECT count(*)
62
  FROM $tableName
63
  WHERE user_id=$user_id AND meta_key='$metaKey' AND meta_value like '%administrator%'";
68
  $result = false;
69
  }
70
  $ure_userToCheck[$user_id] = $result;
71
+
72
  return $result;
73
  }
74
  // end of ure_has_administrator_role()
337
  function getRolesCanDelete($ure_roles) {
338
  global $wpdb;
339
 
340
+ $tableName = defined('CUSTOM_USER_META_TABLE') ? CUSTOM_USER_META_TABLE : $wpdb->usermeta;
341
+ $metaKey = $wpdb->base_prefix.'capabilities';
342
  $defaultRole = get_option('default_role');
343
  $standardRoles = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
344
  $ure_rolesCanDelete = array();
user-role-editor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: User Role Editor
4
  Plugin URI: http://www.shinephp.com/user-role-editor-wordpress-plugin/
5
  Description: It allows you to change any standard WordPress user roles (except administrator) capabilities list with a few clicks.
6
- Version: 3.2
7
  Author: Vladimir Garagulya
8
  Author URI: http://www.shinephp.com
9
  Text Domain: ure
3
  Plugin Name: User Role Editor
4
  Plugin URI: http://www.shinephp.com/user-role-editor-wordpress-plugin/
5
  Description: It allows you to change any standard WordPress user roles (except administrator) capabilities list with a few clicks.
6
+ Version: 3.2.1
7
  Author: Vladimir Garagulya
8
  Author URI: http://www.shinephp.com
9
  Text Domain: ure