?
Solved

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

Posted on 2014-12-11
2
Medium Priority
?
182 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
Let's recap what we learned from yesterday's Skyport Systems webinar.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Suggested Courses

770 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