Location: PHPKode > projects > Opensheet > opensheet/functions/ldap.inc.php
<?php 

#include ('classes/global.class.php');
$settings = new getSetting();	

define("SERVER",$settings->getValue('ldap_host'));
define("DOMAIN",$settings->getValue('ldap_domain'));


function ad_auth( $username, $password ){ 
        $ldap = @ldap_connect(SERVER); 
   		        if ( @ldap_bind( $ldap, DOMAIN."\\".$username, $password ) ){ 

		        	ldap_unbind( $ldap ); 
                return '1'; 
                }  else{ 
                return '0'; 
                } 
        } 

#remove count from ad answer
#function rCountRemover($array) {
 # foreach($array as $key=>$value) {
 #   if($key === "count") 
#      unset($array[$key]);
#    elseif(is_array($value))
#      $array[$key] = rCountRemover($array[$key]);
#  }
#  return $array;
#} 
   
 ?>
Return current item: Opensheet