krlw Posted August 28, 2011 Share Posted August 28, 2011 Hi everybody. I am new to PHP and trying to alter a wordpress site. I am using a plugin called backend restrictor and it is a blanket restrictor of all backend functions except profile. I want to add some more urls other than the profile.php page to be allowed but I can't get it right. Can anybody assist? add_action('admin_init', 'bur_plugin_enforceRestriction'); function bur_plugin_enforceRestriction() { global $current_user; if (current_user_can('manage_options')) { } else{ $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80"): $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; else: $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; endif; // allowed path(s) if ($pageURL == get_bloginfo('wpurl')."/wp-admin/profile.php"){ }else{ header("Location:".get_bloginfo('url')."/"); } } } ?> Link to comment https://forums.phpfreaks.com/topic/245858-adding-multiple-page-urls/ Share on other sites More sharing options...
darkfreaks Posted August 28, 2011 Share Posted August 28, 2011 you activate the plugin, it just works – unless you want to specify specific pages which aren’t affected – which if so, you have to edit the code, and add them into line 44. http://www.lloydengland.com/blog/wordpress-plugin-backend-user-restrictor/ Link to comment https://forums.phpfreaks.com/topic/245858-adding-multiple-page-urls/#findComment-1262758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.