6.0.0-beta1
7/31/25

[#3390] ldap code overwrite last_login pref
Summary ldap code overwrite last_login pref
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Duplicate
Priority 3. High
Owners Horde Developers (at)
Requester marjan.blatnik (at) gov (dot) si
Created 02/02/2006 (7119 days ago)
Due
Updated 04/09/2006 (7053 days ago)
Assigned 02/02/2006 (7119 days ago)
Resolved 04/09/2006 (7053 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/09/2006 12:11:33 AM Chuck Hagenbuch Comment #4
State ⇒ Duplicate
Reply to this comment
Duplicate of bug 2838.
04/06/2006 08:42:36 PM heinz (at) htl-steyr (dot) ac (dot) at Comment #3 Reply to this comment
This is exacly the same bug I''ve metioned in bug #2838 und #2829

Both marked as "bogus" !?!?!

Because some "Horde-people" (e.g. Michael Slusarz) are not able do 
find out differences between bufg #2838 und #2829 the second  bug is 
state bugus.



However bug #3390 is marked as bug with priority HIGH although a real 
simple bugfix (and the final solution for this problem) was provided 
in bug #2838  (163 days ago)!



Nevertheless this would be my last post on this stupid buf tracker list.



LecksMichAmOrsch
02/02/2006 07:55:43 PM Chuck Hagenbuch Assigned to Horde DevelopersHorde Developers
 
02/02/2006 07:55:32 PM Chuck Hagenbuch Comment #2
State ⇒ Assigned
Priority ⇒ 3. High
Queue ⇒ Horde Framework Packages
Version ⇒ HEAD
Reply to this comment
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.
02/02/2006 02:05:54 PM marjan (dot) blatnik (at) gov (dot) si Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ ldap code overwrite last_login pref
Queue ⇒ Horde Base
State ⇒ Unconfirmed
Reply to this comment
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.



If my workaround is usefull you can use it,

modify it, ...



------------------------------------------------------------

*** ldap.php.orig       Thu Feb  2 09:41:30 2006

--- ldap.php    Thu Feb  2 14:34:01 2006

***************

*** 382,389 ****



                   /* Retrieve this preference. */

                   if (isset($this->_prefs[$pref])) {

!                     $this->_setValue($pref, base64_decode($val), false);

!                     $this->setDefault($pref, false);

                   } else {

                       $this->add($pref, base64_decode($val), _PREF_SHARED);

                   }

--- 382,398 ----



                   /* Retrieve this preference. */

                   if (isset($this->_prefs[$pref])) {

!                     # when imp loads, the last_login is read from ldap

!                     # then imp set new value for last_login, but it 
does not write it to ldap yet

!                     # then ingo loads and last_login is read from 
ldap: last_login is overwriten with old value

!                     # so we need to check if last_login is globaly 
dirty and use global last_login value instead

!                     if ($GLOBALS['prefs']->isDirty($pref)) {

!                        $this->_setValue($pref, 
$GLOBALS['prefs']->getValue($pref), false);

!                        $this->setDefault($pref, false);

!                     } else {

!                        $this->_setValue($pref, base64_decode($val), false);

!                        $this->setDefault($pref, false);

!                     }

                   } else {

                       $this->add($pref, base64_decode($val), _PREF_SHARED);

                   }

Saved Queries