Solved

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

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
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 look for a specific file type in a local or remote server directory using PHP.

691 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