> On Fri, Nov 27, 2009 at 4:57 PM, Eric Helgeson <[email protected]>
> wrote:
>> Try adding some common_log statements in the plugin to see if the code
>> is
>> actually reached.
>
> Still trying...
> It seems that the host definition as an element in an array in
> config.php doesn't get set properly in the function
> onInitializePlugin()
> I see that the value of the key 'host' gets set to 'Array' in the
> function ldap_get_config()
> So I changed my config.php defintion
> #'host'=>array('ldap.company.com'),
> 'host'=>'ldap.company.com',

That's correct. Host can either be an array, or a single string. If it is
an array, the first server is tried, then if it doesn't work, the next is
tried, and so on. See
http://pear.php.net/manual/en/package.networking.net-ldap2.connecting.php
for precisely how it works.

>
> Now that seems to be getting set correctly. But still no go..
>
> LdapAuthenticationPlugin.php
> //cannot use Net_LDAP2::connect() as StatusNet uses
> //PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handleError');
> //PEAR handling can be overridden on instance objects, so we do that.
> $ldap = new Net_LDAP2(isset($config)?$config:$this->ldap_get_config());
> $ldap->setErrorHandling(PEAR_ERROR_RETURN);
> common_log(LOG_INFO, 'ldap log3');
> $err=$ldap->bind();
> common_log(LOG_INFO, 'ldap log4');
>
> log4 message doesn't get written so I guest the problem happens with
> bind().
>
> I installed LDAP2 with 'pear install Net_LDAP2' and everything seems
> to be in it's place in /usr/share/php/
> Looking at the Net_LDAP2 documentation the defaults plus the host and
> basedn should be enough.
>
> Any pointers to how I should go from here on in?

My guess is that you don't have the LDAP PHP PECL extension installed. If
you're using Debian, try apt-get install php5-ldap then restarting apache.

I had a lot of trouble getting any kind of error reporting to work due to
StatusNet's default PEAR error handling... I would love some help on
improving the error reporting so that whatever this problem turns out to
be could be more easily discovered by future users.

~Craig

_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev

Reply via email to