Solved

How to format an array to pass as an option to adLDAP

Posted on 2014-12-11
2
164 Views
Last Modified: 2014-12-13
Using the adLDAP code, with documentation  


that says:

You can alternatively override the configuration when the class is called by specifying an array with the options.

Called like $adldap = new adLDAP($options); Where $options is an array with one or more of the following keys

account_suffix base_dn domain_controllers admin_username admin_password real_primarygroup use_ssl use_tls recursive_groups ad_port sso

See the 'examples' and 'connecting and disconnecting' section for more information


My problem is that I don't know how to construct the array in the proper format to become the array known as  $options.

Here's what I've tried, and it fails.

-----

I am trying like:

		include ('mk16/lib/adLDAP/src/adLDAP.php');
		
		$options = array(
        "account_suffix" => "@esc1.net",
        "base_dn" => "DC=esc1,DC=net",
		"domain_controllers" => array("64.209.45.117"),
		"admin_username" => "username",
		"admin_password" => "mypassword",
		"use_ssl" => true,
		);
		
		$adldap = new adLDAP($options);

Open in new window



------


I should not that If I hard code the values into the adLdap.php, it works just fine. But I need to ability to use more than one setup, so I need to figure out how to pass these values in to override the defaults.

Thank you in advance!
0
Comment
Question by:Dallas Smetter
2 Comments
 

Author Comment

by:Dallas Smetter
ID: 40494758
The documentation to the open source project "adLDAP" is at

http://adldap.sourceforge.net/wiki/doku.php?id=documentation
0
 
LVL 20

Accepted Solution

by:
Mark Brady earned 500 total points
ID: 40497965
It shouldn't be that difficult. Please post a small example of code where you hard code the values in the script and also post what error you are getting when you try to pass in the $options array.

It would help if you posted the class you are trying to instantiate with options.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question