Re: LiveUser - lastLogin update, Automatic?

From: Date: Fri, 07 Apr 2006 20:51:30 +0000
Subject: Re: LiveUser - lastLogin update, Automatic?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23582@lists.php.net to get a copy of this message
Bonsoir, Hector Partidas wrote:
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), play ?
better is to try / test it. youngs call it "extreme programming" you write the test first , without the package. it fails. then you put the package, it should still fail. you arrange it till it works. I trust LU has plenty of helps around. Naturally , it uses several means , you should also be clever on them.
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 Too much code for a post.
How could LU people reproduce that ? Regards -- toggg

« previous php.pear.general (#23582) next »