build fixed
This commit is contained in:
		@@ -1,9 +1,7 @@
 | 
			
		||||
<?php
 | 
			
		||||
$realm = "MY REALM HERE";
 | 
			
		||||
$ldaphost = "my.ldap.host";
 | 
			
		||||
$base = "dc=my,dc=server,dc=com";
 | 
			
		||||
$userbase = "ou=people,".$base;
 | 
			
		||||
$groupbase = "ou=group,".$base;
 | 
			
		||||
$ldapbase = "dc=my,dc=server,dc=com";
 | 
			
		||||
if (!isset($_SERVER['PHP_AUTH_USER'])) {
 | 
			
		||||
    header('WWW-Authenticate: Basic realm="'.$REALM.'"');
 | 
			
		||||
    header('HTTP/1.0 401 Unauthorized');
 | 
			
		||||
@@ -17,7 +15,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {
 | 
			
		||||
        or error_die("failed to set LDAP protocol version 3");
 | 
			
		||||
    ldap_start_tls($ldapconn)
 | 
			
		||||
        or error_die($ldapconn, "cannot start LDAP TLS");
 | 
			
		||||
    $ldapbind = @ldap_bind($ldapconn, 'uid='.$tstusername.','.$userbase, $password)
 | 
			
		||||
    $ldapbind = @ldap_bind($ldapconn, 'uid='.$tstusername.','.$ldapbase, $password)
 | 
			
		||||
        or error_die("login failed for $username", '403 Forbidden');
 | 
			
		||||
    $username = $tstuserbname;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user