Globals set to off - Sessions
| From: | Steve Jackson | Date: | Mon, 27 Oct 2003 11:30:35 +0000 |
| Subject: | Globals set to off - Sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-167700@lists.php.net to get a copy of this message | ||
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
stephen.jackson@violasystems.com
Mobile +358 50 343 5159