Remove Dashboard Access - Version 0.4

Version Description

Refined DOING_AJAX check for logged-out users, props @nacin and @BoiteAWeb

Download this release

Release Info

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

Code changes from version 0.3 to 0.4

Files changed (2) hide show
  1. readme.txt +5 -1
  2. remove-wp-dashboard-access.php +2 -2
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.3
8
 
9
  This plugin completely removes non-admin user access to the Dashboard. Non-admins are automatically redirected the site's homepage.
10
 
@@ -29,6 +29,8 @@ Non-admin users will be automatically redirected to the site's homepage
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.
@@ -37,6 +39,8 @@ Non-admin users will be automatically redirected to the site's homepage
37
 
38
  == Upgrade Notice ==
39
 
 
 
40
  = 0.3 = Improved function.
41
 
42
  = 0.2 = No additional files were added.
4
  Tags: dashboard, access, users, administration
5
  Requires at least: 3.0
6
  Tested up to: 3.2.1
7
+ Stable tag: 0.4
8
 
9
  This plugin completely removes non-admin user access to the Dashboard. Non-admins are automatically redirected the site's homepage.
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 0.4 = Refined DOING_AJAX check for logged-out users, props @nacin and @BoiteAWeb
33
+
34
  = 0.3 = Changed cap to manage_options, replaced PHP_SELF with DOING_AJAX
35
 
36
  = 0.2 = Replaced preg_match with admin-ajax test. Added compatibility with rewritten dashboard URLs.
39
 
40
  == Upgrade Notice ==
41
 
42
+ = 0.4 = Refined DOING_AJAX check for logged-out users
43
+
44
  = 0.3 = Improved function.
45
 
46
  = 0.2 = No additional files were added.
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.3
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('manage_options') && $_SERVER['DOING_AJAX'] != '/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.4
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') && !defined('DOING_AJAX') ) {
15
  wp_redirect(site_url()); exit;
16
  }
17
  }