Hi,

Thanks a lot! It' works :)
Problem was in $useTable value (not mentioned in blog post at all).
Name of the model added to search string if it's empty and therefore
ldap_search() returns empty set.
By the way, $additionalFilter not applicable to version of ldap source
from you blog, $defaultObjectClass there.
I have another problem there. read method of ldap source take
attributes names with ldap_get_entries() and it lowered the case of
it' names. I've found, that OpenLDAP sometimes treat attributes in
case-sensetive way, therefore  "update" and "create" isn't work
properly. I've change calls to ldap_get_entries() with
ldap_get_attrbiutes() and make read to take case-sensetive attribute
names. I may submit patch, if you interesting in.



On 17 июн, 15:33, "Gonzalo Servat" <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 17, 2008 at 5:48 AM, Toppka <[EMAIL PROTECTED]> wrote:
>
> > Hi
>
> > I've interesting in this topic too. I've started to dive into LDAP
> > wrapper for cake php for a few days. Have you find how to map LDAP
> > data source to cake php app model in cake php 1.2?
>
> Hi,
>
> You simply need to configure the LDAP connection in your
> app/config/database.php. For example:
>
>         var $ldap = array(
>                 'database' => '',
>                 'datasource' => 'ldap',
>                 'host' => '127.0.0.1',
>                 'port' => 389,
>                 'basedn' => 'dc=example,dc=com',
>                 'login' => 'cn=admin,dc=example,dc=com',
>                 'password' => 'your-bind-password',
>                 'version' => 3
>         );
>
> In your app/model/whatever.php, you make it look something similar to:
>
>   var $useDbConfig = 'ldap';
>   var $useTable = ''; // can be used to strict searching to, say,
> ou=Something
>   var $primaryKey = 'uid';   // unique attribute in your LDAP records
>   var $additionalFilter = 'objectclass='inetOrgPerson';   // additional
> strict searching to, for example, only return records that contain this
> objectclass
>
> You then need to setup the LDAP datasource itself. Please see the following
> link:
>
> http://memdump.wordpress.com/2008/04/26/ldap-data-source-now-with-ful...
>
> The class is far from perfect, but IWFM. If you find any bugs, it'd be great
> if you can report them and/or supply patches to improve it.
>
> Good luck!
>
> - Gonzalo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to