connecting to LDAP with bind_dn and password

Andreas Oster aoster at novanetwork.de
Tue Jul 4 12:29:44 CEST 2006


Hello,

I am new to this list and want to share the changes I have
made to the rcube_ldap.inc to access our LDAP directory
(bind to LDAp with a dedicated readonly user)

I saw that there is a already a bind function but since I could
not figure out how to use it ( i have only little programming skills)
i have put the code directly into the connect function.

At the moment it is just a hardcoded hack :)

< rcube_ldap.diff >

32a33,36
>  
>   // modified by Andreas Thuesday 04 07 2006
>   var $ldapbind;
>   // end modification
56a61,66
>      
>      
>     // modified by Andreas Thuesday 04 07 2006
>     $ldaprdn  = 'binddn';         // bind rdn or dn
>     $ldappass = 'bindpassword';     // bind password
>     // end modification
66a77,92
>     }
>    
>     // modified by Andreas Thuesday 04 07 2006
>     if ($this->conn) {
>         // binden zum ldap server
>         if (ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, 3)) {
>         $ldapbind = ldap_bind($lc, $ldaprdn, $ldappass);
>             // check bind
>         if (!$ldapbind) {
>                 raise_error(array("type" => "ldap", "message" =>
"Could not bind to LDAP server"),TRUE);
>             }
>         }
>         else
>         raise_error(array("type" => "ldap", "message" => "Could not
bind to LDAP server with LDAP_v3"),TRUE);
>     // end modification
>

maybe it is of use for somebody.

-- 
Mit freundlichen Grüßen

Andreas Oster
NOVA Elektroanlagen GmbH
Carl-Zeiss-Str. 3

D-76275 Ettlingen

Tel: 07243/5490-22
FAX: 07243/5490-55
Web: http://www.novanetwork.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: aoster.vcf
Type: text/x-vcard
Size: 353 bytes
Desc: not available
URL: <http://lists.roundcube.net/pipermail/dev/attachments/20060704/79997c5f/attachment.vcf>


More information about the Dev mailing list