[bugs] [Bug 998] New - Possible bug in LDAP prefs code.
bugs@bugs.horde.org
bugs@bugs.horde.org
Tue, 23 Jul 2002 04:29:02 -0300
http://bugs.horde.org/show_bug.cgi?id=998
*** shadow/998 Tue Jul 23 04:29:02 2002
--- shadow/998.tmp.13546 Tue Jul 23 04:29:02 2002
***************
*** 0 ****
--- 1,49 ----
+ Bug#: 998
+ Product: Horde
+ Version: 2.1 Unstable
+ Platform: PHP Code
+ OS/Version: Linux
+ Status: NEW
+ Resolution:
+ Severity: normal
+ Priority: P2
+ Component: Core
+ Area: BUILD
+ AssignedTo: chuck@horde.org
+ ReportedBy: jaaskela@ksao.fi
+ URL:
+ Summary: Possible bug in LDAP prefs code.
+
+ In my directory there ain't any hordePrefs or any other *Prefs before user has
+ saved them. As user first time logs in they get strange errors about invalid
+ indexes. I made following patch that worked that out.
+
+ diff -r -p -u horde-2.1/lib/Prefs/ldap.php /www/horde/lib/Prefs/ldap.php
+ --- horde-2.1/lib/Prefs/ldap.php Fri May 31 18:39:35 2002
+ +++ /www/horde/lib/Prefs/ldap.php Tue Jul 23 19:42:53 2002
+ @@ -320,10 +320,22 @@ class Prefs_ldap extends Prefs {
+ $prefs = array_merge($result[0][$field],
+ $result[0]['hordeprefs']);
+ } else {
+ - $prefs = $result[0]['hordeprefs'];
+ + if (isset($result[0]['hordeprefs']))
+ + {
+ + $prefs = $result[0]['hordeprefs'];
+ + } else
+ + {
+ + $prefs = array();
+ + }
+ }
+ } else {
+ - $prefs = $result[0][$field];
+ + if (isset($result[0][$field]))
+ + {
+ + $prefs = $result[0][$field];
+ + } else
+ + {
+ + $prefs = array();
+ + }
+ }
+
+ foreach ($prefs as $prefstr) {
+