On Sun, Nov 29, 2009 at 12:54 AM, Craig Andrews
<[email protected]> wrote:
>> 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.
>
You're right. Silly me, I thought the pear install brought down the
dependencies too.
ok. 'apt-get install php5-ldap'
Now I can see a conection made with the ldap server, a user gets
created in the 'user' table , but it ends in an error which has
recently been posted on the list 'DB_DataObject Error: insert:No table
definition for user_username'. Seems strange because the table is
created. I'll try to understand that on monday.
Cheers.

> 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.
>
I don't know enough about php to help you, sorry.
Thankyou veny much for your work all the same.

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

Reply via email to