Re: Globals set to off - Sessions
| From: | pete M | Date: | Mon, 27 Oct 2003 12:24:22 +0000 |
| Subject: | Re: Globals set to off - Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167705@lists.php.net to get a copy of this message | ||
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;elsereturn 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