Call to a member function isUser() on a non-object on line 7
Posted: Thu Jan 27, 2011 12:17 am
the $GLOBALS['core']->killAllSessions(); in the following code is not working. the code works good without it but i need it to work. is there another way to write it?
the error i get with $GLOBALS['core']->killAllSessions(); in the code is at the topic of this message.
if (!isset($GLOBALS['core'])){
header("location:../../");
exit();
}
$GLOBALS['core']->killAllSessions();
if (!$_SESSION['OBJ_user']->isUser()) {
$settings = $_SESSION["OBJ_user"]->getSettings();
if($settings["show_remember_me"])
$myCookie = PHPWS_User_Cookie::cookie_read("mod_users", "rememberme");
if(isset($myCookie)) {
$myCookie = preg_replace('/\W/', '', $myCookie);
$id = $GLOBALS["core"]->getOne("select user_id from mod_users where cookie='$myCookie'", TRUE);
if($id)
$_SESSION['OBJ_user']->loadUser($id, 1);
else
PHPWS_User::login_box();
} else {
PHPWS_User::login_box();
}
}
the error i get with $GLOBALS['core']->killAllSessions(); in the code is at the topic of this message.
if (!isset($GLOBALS['core'])){
header("location:../../");
exit();
}
$GLOBALS['core']->killAllSessions();
if (!$_SESSION['OBJ_user']->isUser()) {
$settings = $_SESSION["OBJ_user"]->getSettings();
if($settings["show_remember_me"])
$myCookie = PHPWS_User_Cookie::cookie_read("mod_users", "rememberme");
if(isset($myCookie)) {
$myCookie = preg_replace('/\W/', '', $myCookie);
$id = $GLOBALS["core"]->getOne("select user_id from mod_users where cookie='$myCookie'", TRUE);
if($id)
$_SESSION['OBJ_user']->loadUser($id, 1);
else
PHPWS_User::login_box();
} else {
PHPWS_User::login_box();
}
}