Solved

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

Posted on 2014-12-11
2
155 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now