[dev] session problem fixed?

Amith Varghese amith at xalan.com
Fri Oct 3 14:59:49 PDT 2003


I was getting this error

Notice: unserialize() [function.unserialize]: Argument is not an string in
/home/www/html/amith.xalan.com/horde/services/portal/edit.php on line 227

Warning: Invalid argument supplied for foreach() in
/home/www/html/amith.xalan.com/horde/services/portal/edit.php on line 628

Basically I was unable to find the preference 'portal_layout' even though it is
defined in horde/config/prefs.php

I painstakingly put print statements starting from the initial login and traced
my way through Horde/IMP.  I have IMP performing my authentication in my setup
and when I got to imp/lib/Session.php it was authenticating the user (using the
imp/lib/Auth/imp.php class.  At the end of the authenticate function it calls
parent::authenticate.  This takes us to horde/lib/Auth.php and the function
setAuth().  In there it reloads the prefs of the user who just logged in.
However in loadPrefs, the application scope is "imp" because IMP was used for
authentication and I think this is why portal_layout wasn't getting defined.
I've made the change where I pass in 'horde' to loadPrefs and that seems to get
the right application scope when reloading the user's prefs.

I've attached the patch.  Please let me know if there are any problems.

Amith

-------------- next part --------------
Index: Auth.php
===================================================================
RCS file: /repository/horde/lib/Auth.php,v
retrieving revision 1.100
diff -u -r1.100 Auth.php
--- Auth.php	30 Sep 2003 22:11:50 -0000	1.100
+++ Auth.php	3 Oct 2003 22:13:28 -0000
@@ -425,7 +425,7 @@
                                     'remote_addr' => $_SERVER['REMOTE_ADDR']);
 
         // Reload preferences for the new user.
-        $registry->loadPrefs();
+        $registry->loadPrefs('horde');
         global $prefs;
 
         /* Display user's last login time if requested. */


More information about the dev mailing list