  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                เราลองเชื่อมต่อกับเซิฟ Lotus Notes ได้แล้ว 
 
แต่ติดปัญหาเรื่องค้นหาฟิลด์หรือชื่ออีเมล 
 
ฟิลด์ 
 
InternetAddress // อีเมล์ 
JobTitle 
JrnFile 
 
Code (PHP) 
<?php
$host = '10.1.1.52';
$post = '389';
$user = 'admin99';
$pass = '1622P9';
$ldap_dn = "dc=holinefisher,dc=co,dc=th";
$con = ldap_connect($host,$post) or die (" Can't LDAP ");
			
ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($con, $user, $pass) or die (" Can't Server ");
 //GET Form User
$name = '[email protected]';
  
	try{
	 $attributes = array("InternetAddress","JobTitle","JrnFile");
	$filter = "(&(objectCategory=person)(sAMAccountName=$name))";
	$result = ldap_search($con, $ldap_dn, $filter, $attributes);
	$entries = ldap_get_entries($con, $result);
	if($entries["count"] > 0){
	for ($x=0; $x<$entries["count"]; $x++) {  
		echo "A : " . $entries[$x]["InternetAddress"][0] . "<br />";
		echo "B : " . $entries[$x]["JobTitle"][0] . "<br />";
		echo "C : " . $entries[$x]["JrnFile"][0] . "<br />";
   	   }
   }
}
catch(Exception $e){
ldap_unbind($con);
return;
}
?>
 
 
  Tag : PHP, CakePHP               
                        | 
           
          
            
		
  ประวัติการแก้ไข 2018-01-29 14:42:59	
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2018-01-29 14:40:19 | 
                      By :
                          nattkhanesha | 
                      View :
                          1579 | 
                      Reply :
                          6 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |