Changeset 737396
- Timestamp:
- 07/07/2013 03:45:21 PM (13 years ago)
- Location:
- developer-mode/trunk
- Files:
-
- 6 edited
-
developer-mode.php (modified) (2 diffs)
-
lib/admin.php (modified) (3 diffs)
-
lib/adminmenupage/options.php (modified) (5 diffs)
-
lib/functions.php (modified) (1 diff)
-
lib/roles.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
developer-mode/trunk/developer-mode.php
r735377 r737396 3 3 Plugin Name: Developer Mode 4 4 Description: Limit access to the WordPress admin panel for your clients. Block functionality like updating plugins and viewing menu items for administrators, while keeping all these options for the developer users. The developer mode plugin automatically adds a developer user role, allowing you to keep in control of the entire system while making sure your clients can only use what they need. 5 Version: 0.4.1. 15 Version: 0.4.1.3 6 6 Author: Jesper van Engelen 7 7 Author URI: http://www.jepps.nl … … 10 10 11 11 // Plugin information 12 define('JWDM_VERSION', '0.4.1. 1');12 define('JWDM_VERSION', '0.4.1.3'); 13 13 14 14 // Paths -
developer-mode/trunk/lib/admin.php
r688320 r737396 121 121 $options = get_option('jwdm_options'); 122 122 123 if ( $options['prevent_developeruser_edit'] && isset($roles['developer'])) {123 if ( !empty( $options['prevent_developeruser_edit'] ) && isset( $roles['developer'] ) ) { 124 124 $user = wp_get_current_user(); 125 125 … … 142 142 $options = get_option('jwdm_options'); 143 143 144 if ( !$options['prevent_developeruser_edit']) {144 if ( empty( $options['prevent_developeruser_edit'] ) ) { 145 145 return $allcaps; 146 146 } … … 154 154 155 155 // Make sure the requested capability and the user ID are set 156 if ( !$args[0] || !in_array($args[0], array('edit_user', 'delete_user')) || !$args[1] || !$args[2]) {156 if ( empty( $args[0] ) || !in_array($args[0], array('edit_user', 'delete_user')) || empty( $args[1] ) || empty( $args[2] ) ) { 157 157 return $allcaps; 158 158 } -
developer-mode/trunk/lib/adminmenupage/options.php
r688320 r737396 67 67 $options = get_option('jwdm_options'); 68 68 ?> 69 <input type="checkbox" name="jwdm_options[prevent_developeruser_edit]" value="1" <?php checked( $options['prevent_developeruser_edit']); ?> />69 <input type="checkbox" name="jwdm_options[prevent_developeruser_edit]" value="1" <?php checked( !empty( $options['prevent_developeruser_edit'] ) ); ?> /> 70 70 <span class="description"> 71 71 <?php _e('By checking this box, you can prevent anyone that does not have the developer role from creating, editing or deleting users with the developer role.', 'developermode'); ?> … … 83 83 $options = get_option('jwdm_options'); 84 84 ?> 85 <input type="checkbox" name="jwdm_options[disable_core_update]" value="1" <?php checked( $options['disable_core_update']); ?> />85 <input type="checkbox" name="jwdm_options[disable_core_update]" value="1" <?php checked( !empty( $options['disable_core_update'] ) ); ?> /> 86 86 <?php 87 87 } … … 94 94 $options = get_option('jwdm_options'); 95 95 ?> 96 <input type="checkbox" name="jwdm_options[disable_plugin_update]" value="1" <?php checked( $options['disable_plugin_update']); ?> />96 <input type="checkbox" name="jwdm_options[disable_plugin_update]" value="1" <?php checked( !empty( $options['disable_plugin_update'] ) ); ?> /> 97 97 <?php 98 98 } … … 105 105 $options = get_option('jwdm_options'); 106 106 ?> 107 <input type="checkbox" name="jwdm_options[disable_theme_update]" value="1" <?php checked( $options['disable_theme_update']); ?> />107 <input type="checkbox" name="jwdm_options[disable_theme_update]" value="1" <?php checked( !empty( $options['disable_theme_update'] ) ); ?> /> 108 108 <?php 109 109 } … … 116 116 $options = get_option('jwdm_options'); 117 117 ?> 118 <input type="checkbox" name="jwdm_options[disable_adminbar_frontend]" value="1" <?php checked( $options['disable_adminbar_frontend']); ?> />118 <input type="checkbox" name="jwdm_options[disable_adminbar_frontend]" value="1" <?php checked( !empty( $options['disable_adminbar_frontend'] ) ); ?> /> 119 119 <?php 120 120 } -
developer-mode/trunk/lib/functions.php
r704696 r737396 34 34 $options = get_option('jwdm_options'); 35 35 36 if ( !current_user_can('view_developer_content') && $options['disable_adminbar_frontend']) {36 if ( !current_user_can( 'view_developer_content' ) && !empty( $options['disable_adminbar_frontend'] ) ) { 37 37 show_admin_bar(false); 38 38 } -
developer-mode/trunk/lib/roles.php
r735377 r737396 72 72 public function filter_user_has_cap($capabilities, $cap, $name) 73 73 { 74 $options['general'] = get_option('jwdm_options');75 76 74 if ( empty( $capabilities['developer_updates'] ) ) { 75 if ( !empty( $capabilities['update_core'] ) || !empty( $capabilities['update_plugins'] ) || !empty( $capabilities['update_themes'] ) ) { 76 $options['general'] = get_option('jwdm_options'); 77 } 78 77 79 if ( !empty( $options['general']['disable_core_update'] ) && !empty( $capabilities['update_core'] ) ) { 78 80 $capabilities['update_core'] = false; -
developer-mode/trunk/readme.txt
r735377 r737396 7 7 Requires at least: 3.1 8 8 Tested up to: 3.5.1 9 Stable tag: 0.4.1. 19 Stable tag: 0.4.1.3 10 10 11 11 Limit access to the WordPress admin panel for your clients. Block functionality like updating plugins and viewing menu items for administrators, while keeping all these options for the developer users. The developer mode plugin automatically adds a developer user role, allowing you to keep in control of the entire system while making sure your clients can only use what they need. … … 55 55 == Changelog == 56 56 57 = 0.4.1.3 = 58 59 * Minor bug fixes 60 61 = 0.4.1.2 = 62 63 * Minor bug fixes 64 57 65 = 0.4.1.1 = 58 66
Note: See TracChangeset
for help on using the changeset viewer.