<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Prefs overwrites modified Horde prefs in some cases</title> 
  <pubDate>Fri, 10 Apr 2026 13:09:14 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/2838</link> 
  <atom:link rel="self" type="application/rss+xml" title="Prefs overwrites modified Horde prefs in some cases" href="https://bugs.horde.org/ticket/2838/rss" /> 
  <description>Prefs overwrites modified Horde prefs in some cases</description> 
 
   
   
  <item> 
   <title>Background:

I&#039;m using the Horde-Framwork with imp and ingo.</title> 
   <description>Background:

I&#039;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&#039;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 &quot;dirty-value&quot; for last_login after setting it:



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

(Last line added)



     // Set the user&#039;s last_login information.

     $last_login = array(&#039;time&#039; =&gt; time(),

                                   &#039;host&#039; =&gt; @gethostbyaddr($_SERVER[&#039;REMOTE_ADDR&#039;]));

     $GLOBALS[&#039;prefs&#039;]-&gt;setValue(&#039;last_login&#039;, serialize($last_login));

     //NEW: ************************Store it ! *********************

     $GLOBALS[&#039;prefs&#039;]-&gt;store();

     //END NEW ************************</description> 
   <pubDate>Tue, 25 Oct 2005 14:38:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t12986</link> 
  </item> 
   
  <item> 
   <title>NO.  This is the exact same bug report as Bug #2829 which wa</title> 
   <description>NO.  This is the exact same bug report as Bug #2829 which was both marked bogus and provided the solution to your problem.</description> 
   <pubDate>Tue, 25 Oct 2005 15:53:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t12990</link> 
  </item> 
   
  <item> 
   <title>&gt; NO.  This is the exact same bug report as Bug #2829 which </title> 
   <description>&gt; NO.  This is the exact same bug report as Bug #2829 which was both 

&gt; marked bogus and provided the solution to your problem.

In BUG #2829 The reply was given as &quot;

last_login is not an IMP preference. You probably upgraded from an IMP 3 version and didn&#039;t follow the upgrade instructions.&quot;



This was a **NEW** and fresh installation ! Therefore the allocated state &quot;bogus&quot; 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 &lt;&lt;last_login&gt;&gt; is also a horde framework pref and not an Imp as implied by the response.





</description> 
   <pubDate>Mon, 07 Nov 2005 13:46:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t13504</link> 
  </item> 
   
  <item> 
   <title>Bug 3390 has a better description of what goes on here, thou</title> 
   <description>Bug 3390 has a better description of what goes on here, though - and calling store() explicitly is not the correct solution.</description> 
   <pubDate>Sun, 09 Apr 2006 00:16:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t18701</link> 
  </item> 
   
  <item> 
   <title>Merging in some comments for clarity:



&quot;I use ldap backend</title> 
   <description>Merging in some comments for clarity:



&quot;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,

&quot;display&quot; 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.&quot;



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



I&#039;m still puzzling out the best fix; your way does work, but I think we&#039;ll arrive at something a bit different eventually. Needs to be fixed for at least the SQL driver as well, possibly more.&quot;</description> 
   <pubDate>Wed, 22 Nov 2006 20:11:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t26488</link> 
  </item> 
   
  <item> 
   <title>actually I guess this wasn&#039;t necessarily limited to LDAP</title> 
   <description>actually I guess this wasn&#039;t necessarily limited to LDAP</description> 
   <pubDate>Wed, 22 Nov 2006 20:15:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t26491</link> 
  </item> 
   
  <item> 
   <title>Marking as resolved per my testing and this commit:



http:</title> 
   <description>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&#039;m just closing it so it doesn&#039;t get lost sitting in feedback.</description> 
   <pubDate>Thu, 23 Nov 2006 04:49:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/2838#t26496</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
