Capability Manager Enhanced - Version 1.5.2

Version Description

  • Fixed : Network Super Administrators without an Administrator role on a particular site could not assign an Administrator role to other users of that site
Download this release

Release Info

Developer kevinB
Plugin Icon 128x128 Capability Manager Enhanced
Version 1.5.2
Comparing to
See all releases

Code changes from version 1.5.1 to 1.5.2

capsman-enhanced.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Capability Manager Enhanced
4
  Plugin URI: http://presspermit.com/capability-manager
5
- Description: Manage WordPress role definitions. Organizes available capabilities by post type, status and source.
6
- Version: 1.5.1
7
  Author: Jordi Canals, Kevin Behrens
8
  Author URI: http://agapetry.net
9
  */
@@ -13,7 +13,7 @@ Author URI: http://agapetry.net
13
  * Plugin to create and manage Roles and Capabilities.
14
  *
15
  * @author Jordi Canals, Kevin Behrens
16
- * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2012-2013 Kevin Behrens
17
  * @license GNU General Public License version 3
18
  * @link http://agapetry.net
19
  *
@@ -32,8 +32,8 @@ Author URI: http://agapetry.net
32
  */
33
 
34
  if ( ! defined( 'CAPSMAN_VERSION' ) ) {
35
- define( 'CAPSMAN_VERSION', '1.5.1' );
36
- define( 'CAPSMAN_ENH_VERSION', '1.5.1' );
37
  }
38
 
39
  if ( cme_is_plugin_active( 'capsman.php' ) ) {
2
  /*
3
  Plugin Name: Capability Manager Enhanced
4
  Plugin URI: http://presspermit.com/capability-manager
5
+ Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
6
+ Version: 1.5.2
7
  Author: Jordi Canals, Kevin Behrens
8
  Author URI: http://agapetry.net
9
  */
13
  * Plugin to create and manage Roles and Capabilities.
14
  *
15
  * @author Jordi Canals, Kevin Behrens
16
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2012-2014 Kevin Behrens
17
  * @license GNU General Public License version 3
18
  * @link http://agapetry.net
19
  *
32
  */
33
 
34
  if ( ! defined( 'CAPSMAN_VERSION' ) ) {
35
+ define( 'CAPSMAN_VERSION', '1.5.2' );
36
+ define( 'CAPSMAN_ENH_VERSION', '1.5.2' );
37
  }
38
 
39
  if ( cme_is_plugin_active( 'capsman.php' ) ) {
includes/admin.php CHANGED
@@ -725,4 +725,3 @@ function cme_network_role_ui( $default ) {
725
  function cme_plugin_info_url( $plugin_slug ) {
726
  return self_admin_url( "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678" );
727
  }
728
- ?>
725
  function cme_plugin_info_url( $plugin_slug ) {
726
  return self_admin_url( "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678" );
727
  }
 
includes/backup-handler.php CHANGED
@@ -88,4 +88,3 @@ class Capsman_BackupHandler
88
  ak_admin_notify($msg);
89
  }
90
  }
91
- ?>
88
  ak_admin_notify($msg);
89
  }
90
  }
 
includes/handler.php CHANGED
@@ -348,4 +348,3 @@ if ( ! function_exists('boolval') ) {
348
  return (bool) $val;
349
  }
350
  }
351
- ?>
348
  return (bool) $val;
349
  }
350
  }
 
includes/manager.php CHANGED
@@ -5,13 +5,13 @@
5
  *
6
  * @version $Rev: 199485 $
7
  * @author Jordi Canals
8
- * @copyright Copyright (C) 2009, 2010 Jordi Canals; Copyright (C) 2012-2013 Kevin Behrens
9
  * @license GNU General Public License version 2
10
  * @link http://agapetry.net
11
  *
12
 
13
  Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
14
- Modifications Copyright 2012-2013 Kevin Behrens <kevin@agapetry.net>
15
 
16
  This program is free software; you can redistribute it and/or
17
  modify it under the terms of the GNU General Public License
@@ -391,7 +391,7 @@ class CapabilityManager extends akPluginAbstract
391
  */
392
  function generateNames ()
393
  {
394
- if ( current_user_can('administrator') ) {
395
  $this->generateSysNames();
396
  } else {
397
  global $user_ID;
5
  *
6
  * @version $Rev: 199485 $
7
  * @author Jordi Canals
8
+ * @copyright Copyright (C) 2009, 2010 Jordi Canals; Copyright (C) 2012-2014 Kevin Behrens
9
  * @license GNU General Public License version 2
10
  * @link http://agapetry.net
11
  *
12
 
13
  Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
14
+ Modifications Copyright 2012-2014 Kevin Behrens <kevin@agapetry.net>
15
 
16
  This program is free software; you can redistribute it and/or
17
  modify it under the terms of the GNU General Public License
391
  */
392
  function generateNames ()
393
  {
394
+ if ( current_user_can('administrator') || is_super_admin() ) {
395
  $this->generateSysNames();
396
  } else {
397
  global $user_ID;
includes/modify.php CHANGED
@@ -262,4 +262,3 @@ class CapsmanHandler
262
  }
263
  }
264
 
265
- ?>
262
  }
263
  }
264
 
 
includes/network.php CHANGED
@@ -53,11 +53,13 @@ function _cme_new_blog( $new_blog_id ) {
53
  $wp_roles->add_role( $role_name, $role_captions[$role_name], $caps );
54
  }
55
 
56
- if ( in_array( $role_name, $main_pp_only ) ) {
57
- _cme_pp_default_pattern_role( $role_name );
58
- $blog_pp_only []= $role_name;
59
- } else
60
- array_diff( $blog_pp_only, array( $role_name ) );
 
 
61
  }
62
 
63
  if ( defined('PP_ACTIVE') )
@@ -71,4 +73,3 @@ function _cme_new_blog( $new_blog_id ) {
71
  }
72
  }
73
 
74
- ?>
53
  $wp_roles->add_role( $role_name, $role_captions[$role_name], $caps );
54
  }
55
 
56
+ if ( defined('PP_ACTIVE') ) {
57
+ if ( in_array( $role_name, $main_pp_only ) ) {
58
+ _cme_pp_default_pattern_role( $role_name );
59
+ $blog_pp_only []= $role_name;
60
+ } else
61
+ array_diff( $blog_pp_only, array( $role_name ) );
62
+ }
63
  }
64
 
65
  if ( defined('PP_ACTIVE') )
73
  }
74
  }
75
 
 
includes/pp-handler.php CHANGED
@@ -62,4 +62,3 @@ function _cme_update_pp_usage() {
62
  return $updated;
63
  }
64
 
65
- ?>
62
  return $updated;
63
  }
64
 
 
includes/pp-ui.php CHANGED
@@ -35,9 +35,10 @@ class Capsman_PP_UI {
35
  if ( pp_get_option('display_hints') ) {
36
  $cme_id = 'capsman';
37
 
38
- echo '<ul class="ul-disc" style="margin-top:10px"><li>';
39
 
40
  if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) || in_array( $default, array( 'subscriber', 'contributor', 'author', 'editor' ) ) ) {
 
41
  if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) ) {
42
  if ( pp_get_option( 'advanced_options' ) )
43
  $parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'pp' ), "<a href='" . admin_url('admin.php?page=pp-role-usage') . "'>", '</a>' ) . ')';
@@ -50,6 +51,7 @@ class Capsman_PP_UI {
50
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical ) ;
51
  else
52
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
 
53
  echo '</li>';
54
  }
55
 
@@ -166,4 +168,3 @@ class Capsman_PP_UI {
166
  }
167
  }
168
 
169
- ?>
35
  if ( pp_get_option('display_hints') ) {
36
  $cme_id = 'capsman';
37
 
38
+ echo '<ul class="ul-disc" style="margin-top:10px">';
39
 
40
  if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) || in_array( $default, array( 'subscriber', 'contributor', 'author', 'editor' ) ) ) {
41
+ echo '<li>';
42
  if ( defined( 'PPCE_VERSION' ) || ! defined( 'PPC_VERSION' ) ) {
43
  if ( pp_get_option( 'advanced_options' ) )
44
  $parenthetical = ' (' . sprintf( __( 'see %1$sRole Usage%2$s: "Pattern Roles"', 'pp' ), "<a href='" . admin_url('admin.php?page=pp-role-usage') . "'>", '</a>' ) . ')';
51
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permission Groups%s.', $cme_id ), $parenthetical ) ;
52
  else
53
  printf( __( '"Posts" capabilities selected here also define type-specific role assignment for Permit Groups%s.', $cme_id ), $parenthetical ) ;
54
+
55
  echo '</li>';
56
  }
57
 
168
  }
169
  }
170
 
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Capability Manager Enhanced===
2
  Contributors: txanny, kevinB
3
  Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JWZVFUDLLYQBA
4
- Tags: roles, capabilities, manager, editor, rights, role, capability, types, taxonomies
5
  Requires at least: 3.1
6
- Tested up to: 3.7
7
- Stable tag: 1.5.1
8
 
9
  A simple way to manage WordPress roles and capabilities.
10
 
@@ -95,7 +95,7 @@ Probably because your custom post type definition not having map_meta_cap set tr
95
  == License ==
96
 
97
  Copyright 2009, 2010 Jordi Canals
98
- Copyright 2013, Kevin Behrens
99
 
100
  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
101
 
@@ -105,6 +105,9 @@ You should have received a copy of the GNU General Public License along with thi
105
 
106
  == Changelog ==
107
 
 
 
 
108
  = 1.5.1 =
109
  * Fixed : Non-administrators with user editing capabilities could give new users a role with a higher level than their own (including Administrator)
110
 
1
  === Capability Manager Enhanced===
2
  Contributors: txanny, kevinB
3
  Donate Link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JWZVFUDLLYQBA
4
+ Tags: roles, capabilities, manager, editor, rights, role, capability, types, taxonomies, network, multisite, default
5
  Requires at least: 3.1
6
+ Tested up to: 4.0
7
+ Stable tag: 1.5.2
8
 
9
  A simple way to manage WordPress roles and capabilities.
10
 
95
  == License ==
96
 
97
  Copyright 2009, 2010 Jordi Canals
98
+ Copyright 2013-2014, Kevin Behrens
99
 
100
  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
101
 
105
 
106
  == Changelog ==
107
 
108
+ = 1.5.2 =
109
+ * Fixed : Network Super Administrators without an Administrator role on a particular site could not assign an Administrator role to other users of that site
110
+
111
  = 1.5.1 =
112
  * Fixed : Non-administrators with user editing capabilities could give new users a role with a higher level than their own (including Administrator)
113