adLDAP help

Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
Post Reply
DarkRanger
Registered User
Posts: 8346
Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:

adLDAP help

Post by DarkRanger »

Hi guys,

I am using adLDAP to connect to our Active Directory (2003) in order to check the username and password as well as the group of a user (to set permissions appropriately) for our intraweb. I am having some difficulty though enabling it to work if the user is outside of the office.

The intraweb is currently hosted on a local machine running Ubuntu Server. When direct my browser to the local machine and log in to the intraweb, it logs in perfectly and does everything I want it to do. I then change the adLDAP code (adLDAP.php - is used to log in using AD). I change the code on the local intraweb server to test if it will work when I upload it externally. Before the change, the code looks like this:

Code: Select all

 /**
    * The account suffix for your domain, can be set when the class is invoked
    * 
    * @var string
    */   
	protected $_account_suffix = "@3bm.local";
    
    /**
    * The base dn for your domain
    * 
    * @var string
    */
	protected $_base_dn = "DC=3bm,DC=local"; 
	
    /**
    * Array of domain controllers. Specifiy multiple controllers if you
    * would like the class to balance the LDAP queries amongst multiple servers
    * 
    * @var array
    */
    protected $_domain_controllers = array ("3bmserver.3bm.local");
Then I change it to this:

Code: Select all

 /**
    * The account suffix for your domain, can be set when the class is invoked
    * 
    * @var string
    */   
	protected $_account_suffix = "@3bm.co.za";
    
    /**
    * The base dn for your domain
    * 
    * @var string
    */
	protected $_base_dn = "DC=3bm,DC=co.za"; 
	
    /**
    * Array of domain controllers. Specifiy multiple controllers if you
    * would like the class to balance the LDAP queries amongst multiple servers
    * 
    * @var array
    */
    protected $_domain_controllers = array ("mail.3bm.co.za","41.134.44.217"); //41.134.44.217 is the AD servers external IP
I then get an error when I try to log on:

Code: Select all

exception 'adLDAPException' with message 'Bind to Active Directory failed. Check the login credentials and/or server details. AD said: Can't contact LDAP server' in C:\xampp\htdocs\intraweb\dynam_code\adLDAP.php:383 Stack trace: #0 C:\xampp\htdocs\intraweb\dynam_code\adLDAP.php(341): adLDAP->connect() #1 C:\xampp\htdocs\intraweb\index.php(24): adLDAP->__construct() #2 {main}
Does anyone know how to fix this?
Image
Post Reply