Version Description
Replaced preg_match with admin-ajax test. Added compatibility with rewritten dashboard URLs.
Download this release
Release Info
Developer | DrewAPicture |
Plugin | Remove Dashboard Access |
Version | 0.2 |
Comparing to | |
See all releases |
Version 0.2
- readme.txt +43 -0
- remove-wp-dashboard-access.php +19 -0
readme.txt
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: DrewAPicture
|
3 |
+
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.
|
17 |
+
|
18 |
+
== Installation ==
|
19 |
+
|
20 |
+
1. Upload `remove-wp-dashboard-access.php` to the `/wp-content/plugins/` directory
|
21 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
22 |
+
|
23 |
+
== Frequently Asked Questions ==
|
24 |
+
|
25 |
+
= What happens to non-admin users who try to login to the Dashboard? =
|
26 |
+
|
27 |
+
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
|
40 |
+
|
41 |
+
== Screenshots ==
|
42 |
+
|
43 |
+
1. No screenshots.
|
remove-wp-dashboard-access.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
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
|
10 |
+
*/
|
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 |
+
}
|
18 |
+
|
19 |
+
?>
|