[#2829] last_login preference not stored
Summary last_login preference not stored
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester heinz (at) htl-steyr (dot) ac (dot) at
Created 10/22/2005 (1174 days ago)
Due
Updated 10/22/2005 (1174 days ago)
Assigned
Resolved 10/22/2005 (1174 days ago)
Attachments
Milestone
Patch No

History
10/22/2005 Jan Schneider Comment #2
State ⇒ Not A Bug
Reply to this comment
last_login is not an IMP preference. You probably upgraded from an IMP 
3 version and didn't follow the upgrade instructions.
10/22/2005 heinz (at) htl-steyr (dot) ac (dot) at Comment #1
Priority ⇒ 2. Medium
Queue ⇒ Horde Framework Packages
Summary ⇒ last_login preference not stored
Type ⇒ Bug
State ⇒ Unconfirmed
Reply to this comment
Background:
I'm using the Horde-Framwork with imp-Authentification.
The preferencies backend is LDAP.

When I'm including ingo in imp then the last_login preference is not stored!

Reason:
- The imp-preferencies are loaded (old value for last_login is retrieved)
- Auth.php sets the new value for last_login
- Then the ingo-preferencies are loaded and overwrite the new value 
for last_login

Resolution:
Store the new "dirty-value" for last_login after setting it:

Code snippet:
      // Set the user's last_login information.
      $last_login = array('time' => time(),
                                    'host' => 
@gethostbyaddr($_SERVER['REMOTE_ADDR']));
      $GLOBALS['prefs']->setValue('last_login', serialize($last_login));
      //NEW: ************************Store it ! *********************
      $GLOBALS['prefs']->store();