Remove Dashboard Access - Version 0.3

Version Description

Changed cap to manage_options, replaced PHP_SELF with DOING_AJAX

Download this release

Release Info

Developer DrewAPicture
Plugin Icon 128x128 Remove Dashboard Access
Version 0.3
Comparing to
See all releases

Code changes from version 0.2 to 0.3

Files changed (2) hide show
  1. readme.txt +7 -2
  2. remove-wp-dashboard-access.php +2 -2
readme.txt CHANGED
@@ -4,13 +4,14 @@ Donate link: http://www.werdswords.com
4
  Tags: dashboard, access, users, administration
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
- Stable tag: 0.2
8
 
9
  This plugin completely removes non-admin user access to the Dashboard. Non-admins are automatically redirected the site's homepage.
10
 
11
  == Description ==
12
 
13
- This plugin uses the 'delete_themes' capability to check whether users are administrators or not. Users lacking this capability will be automatically redirected to the site's homepage.
 
14
  A full list of capabilities and their associated roles can be found here: http://codex.wordpress.org/Roles_and_Capabilities
15
 
16
  TODO: Provide options to choose your own capability type.
@@ -28,12 +29,16 @@ Non-admin users will be automatically redirected to the site's homepage
28
 
29
  == Changelog ==
30
 
 
 
31
  = 0.2 = Replaced preg_match with admin-ajax test. Added compatibility with rewritten dashboard URLs.
32
 
33
  = 0.1 = Submitted to repository
34
 
35
  == Upgrade Notice ==
36
 
 
 
37
  = 0.2 = No additional files were added.
38
 
39
  = 0.1 = Initial submission
4
  Tags: dashboard, access, users, administration
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
+ Stable tag: 0.3
8
 
9
  This plugin completely removes non-admin user access to the Dashboard. Non-admins are automatically redirected the site's homepage.
10
 
11
  == Description ==
12
 
13
+ This plugin uses the 'manage_options' capability to check whether users are administrators or not. Users lacking this capability will be automatically redirected to the site's homepage.
14
+
15
  A full list of capabilities and their associated roles can be found here: http://codex.wordpress.org/Roles_and_Capabilities
16
 
17
  TODO: Provide options to choose your own capability type.
29
 
30
  == Changelog ==
31
 
32
+ = 0.3 = Changed cap to manage_options, replaced PHP_SELF with DOING_AJAX
33
+
34
  = 0.2 = Replaced preg_match with admin-ajax test. Added compatibility with rewritten dashboard URLs.
35
 
36
  = 0.1 = Submitted to repository
37
 
38
  == Upgrade Notice ==
39
 
40
+ = 0.3 = Improved function.
41
+
42
  = 0.2 = No additional files were added.
43
 
44
  = 0.1 = Initial submission
remove-wp-dashboard-access.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Remove Dashboard Access for Non-Admins
4
  Plugin URI: http://www.werdswords.com
5
  Description: Removes Dashboard access for non-admin users
6
- Version: 0.2
7
  Author: DrewAPicture
8
  Author URI: http://www.werdswords.com
9
  License: GPLv2
@@ -11,7 +11,7 @@ License: GPLv2
11
 
12
  add_action('admin_init', 'no_mo_dashboard');
13
  function no_mo_dashboard() {
14
- if (!current_user_can('delete_themes') && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php') {
15
  wp_redirect(site_url()); exit;
16
  }
17
  }
3
  Plugin Name: Remove Dashboard Access for Non-Admins
4
  Plugin URI: http://www.werdswords.com
5
  Description: Removes Dashboard access for non-admin users
6
+ Version: 0.3
7
  Author: DrewAPicture
8
  Author URI: http://www.werdswords.com
9
  License: GPLv2
11
 
12
  add_action('admin_init', 'no_mo_dashboard');
13
  function no_mo_dashboard() {
14
+ if (!current_user_can('manage_options') && $_SERVER['DOING_AJAX'] != '/wp-admin/admin-ajax.php') {
15
  wp_redirect(site_url()); exit;
16
  }
17
  }