LiveUser - lastLogin update, Automatic?
| From: | Hector Partidas | Date: | Fri, 07 Apr 2006 20:21:44 +0000 |
| Subject: | LiveUser - lastLogin update, Automatic? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23581@lists.php.net to get a copy of this message | ||
I've been playing around with liveuser some more today, and i've been
reading the examples that come with the bundle (when i mean reading, i meant
the code), and was wondering if the lastlogin value is updated automatically
(which it seems like because i can't find a method or any line that updates
it) or is it set externally? on the example4 that is brought with the
bundle, lastlogin gets updated, while on the example i have doesn't and the
code is just about the same:
Mine (really from gvngroup example):
$LU =& LiveUser::singleton($conf);
$LU->init();
if (!$LU->init()) {
var_dump($LU->getErrors());
die();
}
$handle = (array_key_exists('handle', $_POST)) ? $_POST['handle'] : NULL;
$passwd = (array_key_exists('passwd', $_POST)) ? $_POST['passwd'] : NULL;
$logout = (array_key_exists('logout', $_GET)) ? $_GET['logout'] : false;
$remember = (array_key_exists('rememberMe', $_POST)) ? $_POST['rememberMe']
: false;
if ($logout)
{
$LU->logout(true); // does not delete the RememberMe
cookie
}
elseif(!$LU->isLoggedIn() || ($handle && $LU->getProperty('handle') !=
$handle))
{
if (!$handle)
{
$LU->login(NULL, NULL, true);
}
else
{
$LU->login($handle, $passwd, false);
}
}
Example4 from bundle:
$LU =& LiveUser::factory($LUOptions);
$LU->dispatcher->addObserver('forceLogin', 'forceLogin');
if (!$LU->init()) {
var_dump($LU->getErrors());
die();
}
$logout = (array_key_exists('logout', $_REQUEST)) ? $_REQUEST['logout'] :
false;
if ($logout) {
$LU->logout(true);
showLoginForm($LU);
}
--
Atentamente,
Héctor Partidas
Desarrollador
tuWebFacil.com