I have a CMS environment where there are administrator users and I need a way to redirect users who are either not administrators or do not own the document they're trying to edit. It looks something like this, but my administrators cannot access the page this way and Im unsure why:
$cannotpass=0;
if ($reportsusername != $usersusername) {
$cannotpass++;
}
if ($usersadmin != $admin) {
$cannotpass++;
}
if ($cannotpass >= 1) {
header("location:http://decibeldesignstudios.com/blackbirdsecurity/adminlanding");
}
Why do you need a counter?
You can simplify it as follows:
if ($reportsusername != $usersusername && $usersadmin != $admin) {
header("location:http://decibeldesignstudios.com/blackbirdsecurity/adminlanding");
}