science-ation/committee_auth.php
dave 2715d67aef - Fix login check for an expired password
- Allow user_personal.php to handle committee members
- Add password field if the editer in user_personal has access_super
- Allow a committee member to edit anyone in user_personal.php
- Convert auth_required to user_auth_required, and check for both a user type
  and an access level (if committee)
- Convert the committee to the new user system (BIG change :)
- Remove the ^M from admin/committees.php
2007-11-17 21:59:59 +00:00

68 lines
1.3 KiB
PHP

<?
require_once('committee.inc.php');
require_once('user.inc.php');
function auth_has_access($access="")
{
return committee_auth_has_access($access);
}
function auth_required($access="")
{
return user_auth_required('committee', $access);
}
/*
$accesscache=array();
function auth_has_access($access="")
{
global $accesscache;
if(in_array($access,$accesscache))
{
if($accesscache[$access]=='Y') return true;
else return false;
}
else
{
$q=mysql_query("SELECT access_admin, access_config, access_super FROM committees_members WHERE email='".mysql_escape_string($_SESSION['email'])."' AND id='".$_SESSION['committee_member_id']."' AND deleted='N'");
$r=mysql_fetch_object($q);
echo mysql_error();
$accesscache['admin']=$r->access_admin;
$accesscache['config']=$r->access_config;
$accesscache['super']=$r->access_super;
switch($access)
{
case "config": if($r->access_config=='Y') return true; break;
case "admin": if($r->access_admin=='Y') return true; break;
case "super": if($r->access_super=='Y') return true; break;
default:
return false;
break;
}
}
return false;
}
function auth_required($access="")
{
global $config;
if(!auth_has_access($access))
{
header("Location: ".$config['SFIABDIRECTORY']."/committee_login.php");
exit;
}
}
*/
?>