Yii Framework Forum: Ldap Within Yii Vs Outside It - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ldap Within Yii Vs Outside It Rate Topic: -----

#1 User is offline   wannabe geek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 21-September 12

Posted 17 March 2013 - 06:46 PM

Hi Everyone,

A quick query I hope you can help with.

External to the yii framework I can successfully bind to, search and add to an external ldap via:
$ds=ldap_connect($ldapoptions['host'],$ldapoptions['port']);
if ($ds) 
{
	echo 'LDAP CONNECTED';
	ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
    	ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
	ldap_set_option($ds, LDAP_OPT_DEBUG_LEVEL, 7);
        $r=ldap_bind($ds,$ldapoptions['binddn'],$ldapoptions['bindpass']);
        ...
}



within the yii framework, exactly the same code results in a:
ldap_bind(): Unable to bind to server: Can't contact LDAP server

Is there any reason this would be the case?

Thanks!
0

#2 User is offline   fr0d0z 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 25-February 11
  • Location:CO, USA

Posted 19 March 2013 - 12:28 AM

Shouldn't be. I've successfully wrapped an LDAP library in Yii and it works just fine.
0

#3 User is offline   Robban 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 19-March 13

Posted 19 March 2013 - 08:50 AM

 fr0d0z, on 19 March 2013 - 12:28 AM, said:

Shouldn't be. I've successfully wrapped an LDAP library in Yii and it works just fine.


What library did you use, and what modifications had to be done?
I have been using the ldaprecord extension, but poor documentation and somewhat buggy code has made me search for alternatives
0

#4 User is offline   fr0d0z 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 25-February 11
  • Location:CO, USA

Posted 19 March 2013 - 11:16 AM

I was needing to do AD authentication using LDAP, so ended up using this library: http://adldap.sourceforge.net

One thing I ran into with it was that it doesn't handle recursive queries (which my tool needed to support) through user groups. So I had to subclass it and extend it in a variety of ways. It got messy fast.

But the short version was that I got LDAP queries running against AD with IIS/PHP/MSSQL, so you should be able LDAP queries working if your stack is less weird and twisted :-)
0

#5 User is offline   fr0d0z 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 86
  • Joined: 25-February 11
  • Location:CO, USA

Posted 19 March 2013 - 11:16 AM

And you are running the code on the same server, right?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users