2718.us blog » dashboard http://2718.us/blog Miscellaneous Technological Geekery Tue, 18 May 2010 02:42:55 +0000 en hourly 1 http://wordpress.org/?v=3.0.4 Hiding the WordPress Dashboard http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/ http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/#comments Thu, 10 Jul 2008 20:34:55 +0000 2718.us http://2718.us/blog/?p=48 I use WordPress as the backbone of a site I run, including using it for user authentication.  This means a lot of people who aren’t invovled in running the site are logging in and could see the dashboard.  Now, it’s not that there’s anything really secret there, but it makes things look a lot less “finished” to have users deposited on a page that has no relevance to them.  This is where the Hide Dashboard plugin from Patrick/DeepWave comes in.  It does a nice job of getting users to their profile page and generally hiding most of the dashboard things that regular users don’t need to see.

I, however, wanted a little more.  I wanted to make sure that regular users who might be, well, “curious” about the inner workings of the site and who have some knowledge of wp-admin URL structure to be unable to get at anything but their profile page.  To this end, I added a little to the code:

  1. // add after line 41, which reads:  if(!current_user_can('level_10')){
  2. if (strpos($_SERVER['REQUEST_URI'],'/wp-admin') !== FALSE
  3.     and strpos($_SERVER['REQUEST_URI'],'/wp-admin/profile.php') !== 0){
  4.         wp_safe_redirect('/wp-admin/profile.php');
  5. }

This should redirect any non-admin user off of any /wp-admin* page to /wp-admin/profile.php. This might, however, cause issues for mid-level users (i.e. authors/editors/etc may not be able to access needed functions) and I haven’t tested it thoroughly and there might be a better way to do this. YMMV.  See also some comment-discussion on these changes at the plugin’s own page: me Patrick me.

]]>
http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/feed/ 4