note 88822 modified in function.ldap-bind by danbrown

From: Date: Mon, 09 Feb 2009 22:42:12 +0000
Subject: note 88822 modified in function.ldap-bind by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-150430@lists.php.net to get a copy of this message
Just a quick and easy function to authenticate against an AD domain controller: <?php function ad_auth( $server, $username, $password ){ $ldap = @ldap_connect( $server ); if ( @ldap_bind( $ldap, $username, $password ) ){ ldap_unbind( $ldap ); return 1; } else{ return 0; } } ?> --was-- Just a quick and easy function to authenticate against an AD domain controller: <? function ad_auth( $server, $username, $password ){ $ldap = @ldap_connect( $server ); if ( @ldap_bind( $ldap, $username, $password ) ){ ldap_unbind( $ldap ); return 1; } else{ return 0; } } ?> http://php.net/manual/en/function.ldap-bind.php

« previous php.notes (#150430) next »