Solved

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

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

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

856 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