function check_admin_user()
{
//global $admin_user;
//  if ( (session_is_registered("admin_user")) && (isset($admin_user)) )
if ( isset($_SESSION['admin_user']) )
     return true;
   else
     return false;

}


Steve Jackson wrote:
I am not sure what I have to do in order to  control sessions in PHP
4.33 when globals are set to off.
I used to use the following function to check if the user was of admin
status;

function check_admin_user()
// see if somebody is logged in as admin and notify them if not
{
global $admin_user;
if ( (session_is_registered("admin_user")) && (isset($admin_user)) )
return true;
else
return false;
}


Then in my protected pages I would say;
if (check_admin_user())
// if you're an admin user display the following
{
Session_register("admin_user");
// Do admin functions
}
Else
{
//Do login form
}

How do I adapt the check_admin_user() function and the pages to work in
4.33?
Thanks,

Steve Jackson
Web Development and Marketing
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to