[Tickets #3390] NEW: ldap code overwrite last_login pref

bugs@bugs.horde.org bugs at bugs.horde.org
Thu Feb 2 06:05:55 PST 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=3390
-----------------------------------------------------------------------
 Ticket             | 3390
 Created By         | marjan.blatnik at gov.si
 Summary            | ldap code overwrite last_login pref
 Queue              | Horde Base
 Version            | 3.0.9
 State              | Unconfirmed
 Priority           | 2. Medium
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


marjan.blatnik at gov.si (2006-02-02 06:05) wrote:

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);
                  }




More information about the bugs mailing list