mirror of
				https://bitbucket.org/jsuto/piler.git
				synced 2025-11-04 03:42:27 +01:00 
			
		
		
		
	Merged in master (pull request #27)
Use LDAP over StartTLS if option LDAP_USE_START_TLS is set. Approved-by: Janos SUTO
This commit is contained in:
		@@ -88,6 +88,7 @@ $config['LDAP_MAIL_ATTR'] = 'mail';
 | 
				
			|||||||
$config['LDAP_AUDITOR_MEMBER_DN'] = '';
 | 
					$config['LDAP_AUDITOR_MEMBER_DN'] = '';
 | 
				
			||||||
$config['LDAP_ADMIN_MEMBER_DN'] = '';
 | 
					$config['LDAP_ADMIN_MEMBER_DN'] = '';
 | 
				
			||||||
$config['LDAP_BASE_DN'] = '';
 | 
					$config['LDAP_BASE_DN'] = '';
 | 
				
			||||||
 | 
					$config['LDAP_USE_START_TLS'] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// AD specific settings
 | 
					// AD specific settings
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,10 @@ class LDAP {
 | 
				
			|||||||
      ldap_set_option($this->link, LDAP_OPT_PROTOCOL_VERSION, 3);
 | 
					      ldap_set_option($this->link, LDAP_OPT_PROTOCOL_VERSION, 3);
 | 
				
			||||||
      ldap_set_option($this->link, LDAP_OPT_REFERRALS, 0);
 | 
					      ldap_set_option($this->link, LDAP_OPT_REFERRALS, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (LDAP_USE_START_TLS == 1) {
 | 
				
			||||||
 | 
					         ldap_start_tls($this->link);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if(@ldap_bind($this->link, $binddn, $bindpw)) {
 | 
					      if(@ldap_bind($this->link, $binddn, $bindpw)) {
 | 
				
			||||||
         $this->bind = 1;
 | 
					         $this->bind = 1;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user