Jump to content

Adding multiple Page URL's


krlw

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.