[Tickets #11683] Core/Topbar creates Prefs object twice
bugs at horde.org
bugs at horde.org
Fri Nov 9 19:28:36 UTC 2012
BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE
E-MAIL-ADRESSE WERDEN NICHT GELESEN.
Ticket-URL: http://bugs.horde.org/ticket/11683
------------------------------------------------------------------------------
Ticket | 11683
Erstellt Von | heinz at htl-steyr.ac.at
Zusammenfassung | Core/Topbar creates Prefs object twice
Warteschlange | Horde Framework Packages
Version | Git master
Typ | Bug
Status | Unconfirmed
Priorität | 2. Medium
Milestone |
Patch |
Zuständige |
------------------------------------------------------------------------------
heinz at htl-steyr.ac.at (2012-11-09 19:28) hat geschrieben:
Hi
In function getTree() of the class Horde_Core_Topbar the menuentry
for preferences is conditionaly created by
checking $registry->showService('prefs') and the type of the backend
by calling:
($GLOBALS['injector']->getInstance('Horde_Core_Factory_Prefs')->create()
instanceof Horde_Prefs_Session))
Here Horde_Core_Factory_Prefs->create() is called without parameters!
Because of the missing $opts, the Factory creates a new Prefs object
and don't return
a previously created e.g. by the Auth system.
Some underlaying Preference Storage Drivers may require at least
username and password,
which are set empty at the beginning of
Horde_Core_Factor_Prefs->create() in the case of not
providing username and password by $opts.
So, with an empty username the Preference Storage Driver may fail
eg a database backend driver trying to bind as user (eg LDAP directory, ...)
Should a blank username be handled by the Preference Storage Driver ?!? No.
Instead of calling
$GLOBALS['injector']->getInstance('Horde_Core_Factory_Prefs')->create()
i think
$registry->loadPrefs()
would have the same effect (but sets a correct username/password)
Sincerely,
Heinz Schweiger
More information about the bugs
mailing list