6.0.0-git
2021-01-19

[#2838] Prefs overwrites modified Horde prefs in some cases
Summary Prefs overwrites modified Horde prefs in some cases
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 2. Medium
Owners Horde Developers (at) , chuck (at) horde (dot) org
Requester heinz (at) htl-steyr (dot) ac (dot) at
Created 2005-10-25 (5565 days ago)
Due
Updated 2006-11-23 (5171 days ago)
Assigned 2006-04-09 (5399 days ago)
Resolved 2006-11-23 (5171 days ago)
Milestone
Patch No

History
2006-11-23 04:49:05 Chuck Hagenbuch Comment #7
State ⇒ Resolved
Reply to this comment
Marking as resolved per my testing and this commit:



http://lists.horde.org/archives/cvs/Week-of-Mon-20061120/063224.html



However there was a lot of code changed, so please feel free to 
re-open this. I'm just closing it so it doesn't get lost sitting in 
feedback.
2006-11-22 20:15:42 Chuck Hagenbuch Comment #6
Summary ⇒ Prefs overwrites modified Horde prefs in some cases
Reply to this comment
actually I guess this wasn't necessarily limited to LDAP
2006-11-22 20:11:34 Chuck Hagenbuch Comment #5
Summary ⇒ LDAP prefs driver overwrites modified Horde prefs in some cases
Reply to this comment
Merging in some comments for clarity:



"I use ldap backend for preferences.

In horde+imp last_login works.

In horde+imp+ingo last_login does not work anymore.



When imp loads preferences, it load horde preferences as well.

In that step it set last_login with the ldap value,

"display" last_login value

and set last_login to current time.



When ingo loads preferences, it load horde preferences as well.

In that step it set last_login with the ldap value and the

last_login value from imp is lost."



"I think this is actually a general flaw in the Prefs code, in that it 
will load Horde preferences regardless of whether they're already 
loaded. This is a waste and also, as you diagnosed, can result in 
overwriting unwritten values.



I'm still puzzling out the best fix; your way does work, but I think 
we'll arrive at something a bit different eventually. Needs to be 
fixed for at least the SQL driver as well, possibly more."
2006-05-18 20:56:11 Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
2006-04-09 00:16:10 Chuck Hagenbuch Comment #4 Reply to this comment
Bug 3390 has a better description of what goes on here, though - and 
calling store() explicitly is not the correct solution.
2006-04-09 00:11:14 Chuck Hagenbuch Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
2005-11-07 13:46:57 heinz (at) htl-steyr (dot) ac (dot) at Comment #3 Reply to this comment
NO.  This is the exact same bug report as Bug #2829 which was both
marked bogus and provided the solution to your problem.
In BUG #2829 The reply was given as "

last_login is not an IMP preference. You probably upgraded from an IMP 
3 version and didn't follow the upgrade instructions."



This was a **NEW** and fresh installation ! Therefore the allocated 
state "bogus" is incorrect. Also the Solution is definitely not 
applicable. Would request the team to look at this problem again .



The full details are explained in bug # 2829, we would like to point 
out that the <<last_login>> is also a horde framework pref and not an 
Imp as implied by the response.






2005-10-25 15:53:11 Michael Slusarz Comment #2
State ⇒ Not A Bug
Reply to this comment
NO.  This is the exact same bug report as Bug #2829 which was both 
marked bogus and provided the solution to your problem.
2005-10-25 14:38:03 heinz (at) htl-steyr (dot) ac (dot) at Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ hordes last_login preference not stored
Queue ⇒ Horde Framework Packages
Reply to this comment
Background:

I'm using the Horde-Framwork with imp and ingo.

In the Horde configuration I have choosen (Authentication):

   Let a Horde application handle authentication: imp



The preferencies backend is LDAP.







When I'm including ingo in imp then the last_login preference from 
Horde is not stored in the preferencies-backend!



Reason:

- When imp comes up the preferencies are retrieved  (Horde and IMP prefs)

   The old value for last_login is retrieved

- horde/lib/Horde/Auth.php sets the new value for last_login

- Then Ingo retrieves the preferencies (ingo is used in imp)

   The preferencies from HORDE and INGO are retrieved

- At this time the HORDE-Prefs are retrieved a second time and the 
previous set last_login attribute is overwritten!

- After this the HORDE-preferencies are stored back to LDAP the first 
time in this session.



Resolution:

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



Code snippet from horde/lib/Horde/Auth.php:

(Last line added)



      // 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();

      //END NEW ************************

Saved Queries