r1626 + make authenticated_via_ldap() really work
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 30 Jan 2008 17:33:11 +0000 (17:33 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 30 Jan 2008 17:33:11 +0000 (17:33 +0000)
ChangeLog
inc/auth.php

index 0b142c126415021dd85fd6b2204132af976a39d8..95eafab935b12238ff2a01954ba1eecd11737a50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+0.14.10
+       new feature: LDAP authentication
 0.14.9 2008-01-30
        bugfix: upgrade to 0.14.8 broke IPv4 prefix creation
        bugfix: more DB cleanups
index 56bbd0146151981da7bee39a1ca8ddee44491487..76795f8e2190afafb88f9acff3e9f2332c124a35 100644 (file)
@@ -64,6 +64,14 @@ function authenticated ($username, $password)
 
 function authenticated_via_ldap ($username, $password)
 {
+       global $ldap_server, $ldap_domain;
+       if ($connect = @ldap_connect ($ldap_server))
+               if ($bind = @ldap_bind ($connect, "${username}@${ldap_domain}", $password))
+               {
+                       @ldap_close ($connect);
+                       return TRUE;
+               }
+       @ldap_close ($connect);
        return FALSE;
 }