Authentication Problems
Posted: Thu Jul 27, 2006 2:00 pm
Ok i am trying to open a page that i want to secure when i open the page i get an Error:
I would assume that this would be a problem with the Function so i looked it over and everything seems to be allright.
Here is the code from the page im trying to secure
Can i use the Multiple Group 1's in the Function because the Access Level is only stored in group1?
Any other ideas will be appreciated
Code: Select all
Fatal error: Call to undefined function: allow_access()Code: Select all
function allow_access($group)
{
// Check the value of the session vars 'group1' 'group2' 'group3' or 'user_name'
if ($_SESSION['group1'] == $group ||
$_SESSION['group2'] == $group ||
$_SESSION['group3'] == $group ||
$_SESSION['group1'] == "Referrals" ||
$_SESSION['group1'] == "Patients" ||
$_SESSION['group1'] == "Employees" ||
$_SESSION['group1'] == "Administrators" ||
$_SESSION['user_name'] == $group)
{
// Set the var allowed to 'yes'
$allowed = "yes";
} else {
// Set the var allowed to 'no'
$allowed = "no";
}
// Return the var allowed
return $allowed;
}Here is the code from the page im trying to secure
Code: Select all
<?php
//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();
require('http://www.mydomain.com/secure/config.php');
require('http://www.mydomain.com/secure/functions.php');
//this is group name or username of the group or person that you wish to allow access to
// - please be advise that the Administrators Groups has access to all pages.
if (allow_access('Administrators') != "yes")
if (allow_access('Employees') != "no")
if (allow_access('Patients') != "no")
if (allow_access('Referrals') != "no")
if (allow_access('Users') != "no")
{
include ('http://www.mydomain.com/secure/no_access.html');
exit;
}
?>Can i use the Multiple Group 1's in the Function because the Access Level is only stored in group1?
Any other ideas will be appreciated