[#4501] Object of class PEAR_Error to string conversion in C:\PHP5\PEAR\Horde\Auth.php on line 139
Summary Object of class PEAR_Error to string conversion in C:\PHP5\PEAR\Horde\Auth.php on line 139
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester mwhitlock@whitsoftdev.com
Created 2006-10-07 (5030 days ago)
Due
Updated 2006-10-18 (5019 days ago)
Assigned 2006-10-07 (5030 days ago)
Resolved 2006-10-18 (5019 days ago)
Milestone
Patch No

Comments
mwhitlock@whitsoftdev.com 2006-10-07 17:17:56
All authenticated pages in Horde have this notice at the top:



Notice: Object of class PEAR_Error to string conversion in 
C:\PHP5\PEAR\Horde\Auth.php on line 139



This is especially bad because it is also present in the binary 
streams returned by file attachment downloads, which of course 
corrupts the file.

Chuck Hagenbuch <chuck@horde.org> 2006-10-07 18:41:17
So the question is, why is your system passing an error to 
Auth::authenticate instead of a username? Are you using hooks, perhaps?

mwhitlock@whitsoftdev.com 2006-10-08 02:20:28
I don't know.  I use IMAP for authentication, if that makes any difference.

mwhitlock@whitsoftdev.com 2006-10-08 02:22:46
Here's the only hook I'm using:



if (!function_exists('_username_hook_frombackend')) {

        function _username_hook_frombackend($userID) {

                if (strpos($userID, '@') === FALSE) {

                        $userID .= '@oxmoor.com';

                }

                return String::lower($userID);

        }

}



Jan Schneider <jan@horde.org> 2006-10-09 15:34:32
I can't see any place in the code that could lead to a PEAR_Error 
being passed to that line of code. Make sure that all your code is 
uptodate, the newest framework packages installed and any bytecode 
cache disabled.

mwhitlock@whitsoftdev.com 2006-10-09 17:12:25
I did a cvs update -dPCAR to update everything recursively, replacing 
everything with clean copies from HEAD, building new directories, and 
pruning empty directories.



I then ran the install-packages.php script from framework.  Everything 
installed okay, with the following informational messages:



horde/Horde_Auth can optionally use PHP extension "pam_auth"

horde/Horde_Auth can optionally use PHP extension "sasl"

horde/Horde_Browser can optionally use package "horde/PEAR"

horde/Horde_MIME can optionally use package "horde/Horde_Identity"

pear/Net_SMS can optionally use package "pear/Net_SMPP_Client"

horde/Horde_Secret can optionally use PHP extension "mcrypt"

warning: horde/Horde_Share requires package "horde/Horde_Identity"

warning: horde/SyncML requires package "pear/XML_WBXML"

horde/Text_Diff can optionally use PHP extension "xdiff"



I don't know where "horde/Horde_Identity" is supposed to come from.   
Also, I don't know why horde/SyncML complains about XML_WBXML because 
XML_WBXML is installed okay.  Maybe SyncML should be depending on 
"horde/XML_WBXML" instead of "pear/XML_WBXML"?  Just a guess.



I added a var_dump right before the line in question in Auth.php, and 
I've attached the output from it (with my password stripped out).

Jan Schneider <jan@horde.org> 2006-10-18 22:01:25
The error messages says it can't find the hook 
_username_hook_tobackend. Either you activated the wrong hook in 
Horde's configuration, or you gave your hook method the wrong name.