3 ** Make sure that <?php is the FIRST line of this file!
4 ** IE: There should NOT be any blank lines or spaces BEFORE <?php
8 * The phpLDAPadmin config file
10 * This is where you can customise some of the phpLDAPadmin defaults
11 * that are defined in config_default.php.
13 * To override a default, use the $config->custom variable to do so.
14 * For example, the default for defining the language in config_default.php
16 * $this->default->appearance['lang'] = array(
20 * to override this, use $config->custom->appearance['lang'] = 'en';
22 * This file is also used to configure your LDAP server connections.
24 * You must specify at least one LDAP server there. You may add
25 * as many as you like. You can also specify your language, and
28 * NOTE: Commented out values in this file prefixed by //, represent the
29 * defaults that have been defined in config_default.php.
30 * Commented out values prefixed by #, dont reflect their default value, you can
31 * check config_default.php if you want to see what the default is.
33 * DONT change config_default.php, you changes will be lost by the next release
34 * of PLA. Instead change this file - as it will NOT be replaced by a new
35 * version of phpLDAPadmin.
38 /*********************************************/
39 /* Useful important configuration overrides */
40 /*********************************************/
42 /* If you are asked to put pla in debug mode, this is how you do it: */
43 # $config->custom->debug['level'] = 255;
44 # $config->custom->debug['syslog'] = true;
45 # $config->custom->debug['file'] = '/tmp/pla_debug.log';
47 /* phpLDAPadmin can encrypt the content of sensitive cookies if you set this
48 to a big random string. */
49 // $config->custom->session['blowfish'] = null;
51 /* The language setting. If you set this to 'auto', phpLDAPadmin will attempt
52 to determine your language automatically. Otherwise, available lanaguages
53 are: 'ct', 'de', 'en', 'es', 'fr', 'it', 'nl', and 'ru'
54 Localization is not complete yet, but most strings have been translated.
55 Please help by writing language files. See lang/en.php for an example. */
56 // $config->custom->appearance['language'] = 'auto';
58 /* The temporary storage directory where we will put jpegPhoto data
59 This directory must be readable and writable by your web server. */
60 // $config->custom->jpeg['tmpdir'] = "/tmp"; // Example for Unix systems
61 # $config->custom->jpeg['tmpdir'] = "c:\\temp"; // Example for Windows systems
63 /* Set this to (bool)true if you do NOT want a random salt used when
64 calling crypt(). Instead, use the first two letters of the user's
65 password. This is insecure but unfortunately needed for some older
67 # $config->custom->password['no_random_crypt_salt'] = true;
69 /* PHP script timeout control. If php runs longer than this many seconds then
70 PHP will stop with an Maximum Execution time error. Increase this value from
71 the default if queries to your LDAP server are slow. The default is either
72 30 seconds or the setting of max_exection_time if this is null. */
73 // $config->custom->session['timelimit'] = 30;
75 /*********************************************/
77 /*********************************************/
79 /* Command availability ; if you don't authorize a command the command
80 links will not be shown and the command action will not be permitted.
81 For better security, set also ACL in your ldap directory. */
84 $config->custom->commands['all'] = array(
86 'external_links' => array('feature' => true,
96 'search' => array('simple_search' => true,
97 'predefined_search' => true,
98 'advanced_search' => true),
99 'server_refresh' => true,
100 'server_info' => true,
101 'entry_refresh' => true,
102 'entry_move' => true,
103 'entry_internal_attributes_show' => true,
104 'entry_delete' => array('simple_delete' => true,
105 'mass_delete' => false),
106 'entry_rename' => true,
107 'entry_compare' => true,
108 'entry_create' => true,
109 'attribute_add' => true,
110 'attribute_add_value' => true,
111 'attribute_delete' => true,
112 'attribute_delete_value' => true);
115 /*********************************************/
117 /*********************************************/
119 /* If you want to choose the appearance of the tree, specify a class name which
120 inherits from the Tree class. */
121 // $config->custom->appearance['tree'] = "AJAXTree";
122 # $config->custom->appearance['tree'] = "HTMLTree";
124 /* If you want to customise the entry view/edition, specify your factory name which
125 inherits from the EntryFactory class.
126 The 'DefaultEntryFactory' draws all the attributes of an entry according this
127 config file and the ldap schema definition ; the 'TemplateEntryFactory' draws
128 an entry according to the template whose regexp matches with the dn. */
129 # $config->custom->appearance['entry_factory'] = "DefaultEntryFactory";
130 // $config->custom->appearance['entry_factory'] = "TemplateEntryFactory";
132 /* If you want to customise an attribute view/edition, specify your factory name which
133 inherits from the AttributeFactory class.
134 An AttributeFactory defines which class to use to represent a given attribute */
135 // $config->custom->appearance['attribute_factory'] = "AttributeFactory";
137 /* Configure what objects are shown in left hand tree */
138 // $config->custom->appearance['tree_filter'] = '(objectclass=*)';
140 /* The height and width of the tree. If these values are not set, then
141 no tree scroll bars are provided.
142 // $config->custom->appearance['tree_height'] = null;
143 # $config->custom->appearance['tree_height'] = 600;
144 // $config->custom->appearance['tree_width'] = null;
145 # $config->custom->appearance['tree_width'] = 250;
147 /*********************************************/
148 /* Define your LDAP servers in this section */
149 /*********************************************/
152 $ldapservers = new LDAPServers;
154 /* A convenient name that will appear in the tree viewer and throughout
155 phpLDAPadmin to identify this LDAP server to users. */
156 $ldapservers->SetValue($i,'server','name','My LDAP Server');
160 'ldaps://ldap.example.com/',
161 'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
162 (Unix socket at /usr/local/var/run/ldap) */
163 $ldapservers->SetValue($i,'server','host','ldap.drsnuggles.stderr.nl');
165 /* The port your LDAP server listens on (no quotes). 389 is standard. */
166 // $ldapservers->SetValue($i,'server','port','389');
168 /* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
169 auto-detect it for you. */
170 $ldapservers->SetValue($i,'server','base',array('dc=drsnuggles,dc=stderr,dc=nl'));
172 /* Four options for auth_type:
173 1. 'cookie': you will login via a web form, and a client-side cookie will
174 store your login dn and password.
175 2. 'session': same as cookie but your login dn and password are stored on the
176 web server in a persistent session variable.
177 3. 'http': same as session but your login dn and password are retrieved via
179 4. 'config': specify your login dn and password here in this config file. No
180 login will be required to use phpLDAPadmin for this server.
182 Choose wisely to protect your authentication information appropriately for
183 your situation. If you choose 'cookie', your cookie contents will be
184 encrypted using blowfish and the secret your specify above as
185 session['blowfish']. */
186 $ldapservers->SetValue($i,'server','auth_type','session');
188 /* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or
189 'cookie' or 'session' auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If
190 you specify a login_attr in conjunction with a cookie or session auth_type,
191 then you can also specify the login_dn/login_pass here for searching the
192 directory for users (ie, if your LDAP server does not allow anonymous binds. */
193 // $ldapservers->SetValue($i,'login','dn','');
194 $ldapservers->SetValue($i,'login','dn','cn=admin,dc=drsnuggles,dc=stderr,dc=nl');
196 /* Your LDAP password. If you specified an empty login_dn above, this MUST also
198 // $ldapservers->SetValue($i,'login','pass','');
199 $ldapservers->SetValue($i,'login','pass','');
201 /* Use TLS (Transport Layer Security) to connect to the LDAP server. */
202 // $ldapservers->SetValue($i,'server','tls',false);
204 /************************************
205 * SASL Authentication *
206 ************************************/
208 /* Enable SASL authentication LDAP SASL authentication requires PHP 5.x
209 configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to
210 false), then all other sasl options are ignored. */
211 // $ldapservers->SetValue($i,'server','sasl_auth',false);
213 /* SASL auth mechanism */
214 // $ldapservers->SetValue($i,'server','sasl_mech','PLAIN');
216 /* SASL authentication realm name */
217 // $ldapservers->SetValue($i,'server','sasl_realm','');
218 # $ldapservers->SetValue($i,'server','sasl_realm',"example.com");
220 /* SASL authorization ID name
221 If this option is undefined, authorization id will be computed from bind DN,
222 using sasl_authz_id_regex and sasl_authz_id_replacement. */
223 // $ldapservers->SetValue($i,'server','sasl_authz_id', null);
225 /* SASL authorization id regex and replacement
226 When sasl_authz_id property is not set (default), phpLDAPAdmin will try to
227 figure out authorization id by itself from bind distinguished name (DN).
229 This procedure is done by calling preg_replace() php function in the
232 $authz_id = preg_replace($sasl_authz_id_regex,$sasl_authz_id_replacement,
235 For info about pcre regexes, see:
237 - http://www.php.net/preg_replace */
238 // $ldapservers->SetValue($i,'server','sasl_authz_id_regex',null);
239 // $ldapservers->SetValue($i,'server','sasl_authz_id_replacement',null);
240 # $ldapservers->SetValue($i,'server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i');
241 # $ldapservers->SetValue($i,'server','sasl_authz_id_replacement','$1');
243 /* SASL auth security props.
244 See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation.
246 // $ldapservers->SetValue($i,'server','sasl_props',null);
248 /* If the link between your web server and this LDAP server is slow, it is
249 recommended that you set 'low_bandwidth' to true. This will enable
250 phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */
251 // $ldapservers->SetValue($i,'server','low_bandwidth',false);
253 /* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5,
254 blowfish, crypt or leave blank for now default algorithm. */
255 // $ldapservers->SetValue($i,'appearance','password_hash','md5');
257 /* If you specified 'cookie' or 'session' as the auth_type above, you can
258 optionally specify here an attribute to use when logging in. If you enter
259 'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith)
260 and log in as that user.
261 Leave blank or specify 'dn' to use full DN for logging in. Note also that if
262 your LDAP server requires you to login to perform searches, you can enter the
263 DN to use when searching in 'login_dn' and 'login_pass' above. You may also
264 specify 'string', in which case you can provide a string to use for logging
265 users in. See 'login_string' directly below. */
266 // $ldapservers->SetValue($i,'login','attr','dn');
268 /* If you specified something different from 'dn', for example 'uid', as the
269 login_attr above, you can optionally specify here to fall back to
270 authentication with dn.
271 This is useful, when users should be able to log in with their uid, but
272 the ldap administrator wants to log in with his root-dn, that does not
273 necessarily have the uid attribute. */
274 // $ldapservers->SetValue($i,'login','fallback_dn',false);
276 /* If you specified 'cookie' or 'session' as the auth_type above, and you
277 specified 'string' for 'login_attr' above, you must provide a string here for
278 logging users in. If, for example, I have a lot of user entries with DNs like
279 "uid=dsmith,ou=People,dc=example,dc=com", then I can specify a string
280 "uid=<username>,ou=People,dc=example,dc=com" and my users can login with
281 their user names alone, ie: "dsmith" in this case. */
282 # $ldapservers->SetValue($i,'login','string','uid=<username>,ou=People,dc=example,dc=com');
284 /* If 'login_attr' is used above such that phpLDAPadmin will search for your DN
285 at login, you may restrict the search to a specific objectClass. EG, set this
286 to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */
287 // $ldapservers->SetValue($i,'login','class',null);
289 /* Specify true If you want phpLDAPadmin to not display or permit any
290 modification to the LDAP server. */
291 // $ldapservers->SetValue($i,'server','read_only',false);
293 /* Specify false if you do not want phpLDAPadmin to draw the 'Create new' links
294 in the tree viewer. */
295 // $ldapservers->SetValue($i,'appearance','show_create',true);
297 /* This feature allows phpLDAPadmin to automatically determine the next
298 available uidNumber for a new entry. */
299 // $ldapservers->SetValue($i,'auto_number','enable',true);
301 /* The mechanism to use when finding the next available uidNumber. Two possible
302 values: 'uidpool' or 'search'.
303 The 'uidpool' mechanism uses an existing uidPool entry in your LDAP server to
304 blindly lookup the next available uidNumber. The 'search' mechanism searches
305 for entries with a uidNumber value and finds the first available uidNumber
307 // $ldapservers->SetValue($i,'auto_number','mechanism','search');
309 /* The DN of the search base when the 'search' mechanism is used above. */
310 # $ldapservers->SetValue($i,'auto_number','search_base','ou=People,dc=example,dc=com');
312 /* The minimum number to use when searching for the next available UID number
313 (only when 'search' is used for auto_uid_number_mechanism' */
314 // $ldapservers->SetValue($i,'auto_number','min','1000');
316 /* The DN of the uidPool entry when 'uidpool' mechanism is used above. */
317 # $servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
319 /* If you set this, then phpldapadmin will bind to LDAP with this user ID when
320 searching for the uidnumber. The idea is, this user id would have full
321 (readonly) access to uidnumber in your ldap directory (the logged in user
322 may not), so that you can be guaranteed to get a unique uidnumber for your
324 // $ldapservers->SetValue($i,'auto_number','dn',null);
326 /* The password for the dn above. */
327 // $ldapservers->SetValue($i,'auto_number','pass',null);
329 /* Enable anonymous bind login. */
330 // $ldapservers->SetValue($i,'login','anon_bind',true);
332 /* Use customized page with prefix when available. */
333 # $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
335 /* If you set this, then phpldapadmin will bind to LDAP with this user when
336 testing for unique attributes (as set in unique_attrs array). If you want to
337 enforce unique attributes, than this id should have full (readonly) access
338 to the attributes in question (the logged in user may not have enough access)
340 // $ldapservers->SetValue($i,'unique_attrs','dn',null);
342 /* The password for the dn above */
343 // $ldapservers->SetValue($i,'unique_attrs','pass',null);
345 /* If you set this, then only these DNs are allowed to log in. This array can
346 contain individual users, groups or ldap search filter(s). Keep in mind that
347 the user has not authenticated yet, so this will be an anonymous search to
348 the LDAP server, so make your ACLs allow these searches to return results! */
349 # $ldapservers->SetValue($i,'login','allowed_dns',array(
350 # 'uid=stran,ou=People,dc=example,dc=com',
351 # '(&(gidNumber=811)(objectClass=groupOfNames))',
352 # '(|(uidNumber=200)(uidNumber=201))',
353 # 'cn=callcenter,ou=Group,dc=example,dc=com'));
355 /* Set this if you dont want this LDAP server to show in the tree */
356 // $ldapservers->SetValue($i,'appearance','visible',true);
358 /* This is the time out value in minutes for the server. After as many minutes
359 of inactivity you will be automatically logged out. If not set, the default
360 value will be ( session_cache_expire()-1 ) */
361 # $ldapservers->SetValue($i,'login','timeout',30);
363 /* Set this if you want phpldapadmin to perform rename operation on entry which
364 has children. Certain servers are known to allow it, certain are not */
365 // $ldapservers->SetValue($i,'server','branch_rename',false);
367 /**************************************************************************
368 * If you want to configure additional LDAP servers, do so below. *
369 * Remove the commented lines and use this section as a template for all *
370 * your other LDAP servers. *
371 **************************************************************************/
375 $ldapservers->SetValue($i,'server','name','LDAP Server');
376 $ldapservers->SetValue($i,'server','host','127.0.0.1');
377 $ldapservers->SetValue($i,'server','port','389');
378 $ldapservers->SetValue($i,'server','base',array(''));
379 $ldapservers->SetValue($i,'server','auth_type','cookie');
380 $ldapservers->SetValue($i,'login','dn','');
381 $ldapservers->SetValue($i,'login','pass','');
382 $ldapservers->SetValue($i,'server','tls',false);
383 $ldapservers->SetValue($i,'server','low_bandwidth',false);
384 $ldapservers->SetValue($i,'appearance','password_hash','md5');
385 $ldapservers->SetValue($i,'login','attr','dn');
386 $ldapservers->SetValue($i,'login','string',null);
387 $ldapservers->SetValue($i,'login','class',null);
388 $ldapservers->SetValue($i,'server','read_only',false);
389 $ldapservers->SetValue($i,'appearance','show_create',true);
390 $ldapservers->SetValue($i,'auto_number','enable',true);
391 $ldapservers->SetValue($i,'auto_number','mechanism','search');
392 $ldapservers->SetValue($i,'auto_number','search_base',null);
393 $ldapservers->SetValue($i,'auto_number','min','1000');
394 $ldapservers->SetValue($i,'auto_number','dn',null);
395 $ldapservers->SetValue($i,'auto_number','pass',null);
396 $ldapservers->SetValue($i,'login','anon_bind',true);
397 $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
398 $ldapservers->SetValue($i,'unique_attrs','dn',null);
399 $ldapservers->SetValue($i,'unique_attrs','pass',null);
402 $ldapservers->SetValue($i,'server','sasl_auth',true);
403 $ldapservers->SetValue($i,'server','sasl_mech','PLAIN');
404 $ldapservers->SetValue($i,'server','sasl_realm','EXAMPLE.COM');
405 $ldapservers->SetValue($i,'server','sasl_authz_id',null);
406 $ldapservers->SetValue($i,'server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i');
407 $ldapservers->SetValue($i,'server','sasl_authz_id_replacement','$1');
408 $ldapservers->SetValue($i,'server','sasl_props',null);
411 /*********************************************/
412 /* User-friendly attribute translation */
413 /*********************************************/
415 /* Use this array to map attribute names to user friendly names. For example, if
416 you don't want to see "facsimileTelephoneNumber" but rather "Fax". */
417 $friendly_attrs = array();
419 $friendly_attrs['facsimileTelephoneNumber'] = 'Fax';
420 $friendly_attrs['telephoneNumber'] = 'Phone';
421 $friendly_attrs['uid'] = 'User Name';
423 /*********************************************/
424 /* Support for attrs display order */
425 /*********************************************/
427 /* Use this array if you want to have your attributes displayed in a specific
428 order. You can use default attribute names or their fridenly names.
429 For example, "sn" will be displayed right after "givenName". All the other
430 attributes that are not specified in this array will be displayed after in
431 alphabetical order. */
432 # $attrs_display_order = array(
445 /*********************************************/
446 /* Hidden attributes */
447 /*********************************************/
449 /* You may want to hide certain attributes from being displayed in the editor
450 screen. Do this by adding the desired attributes to this list (and uncomment
451 it). This only affects the editor screen. Attributes will still be visible in
452 the schema browser and elsewhere. An example is provided below:
453 NOTE: The user must be able to read the hidden_except_dn entry to be
455 # $hidden_attrs = array( 'jpegPhoto', 'objectClass' );
456 # $hidden_except_dn = "cn=PLA UnHide,ou=Groups,c=AU";
458 /* Hidden attributes in read-only mode. If undefined, it will be equal to
460 # $hidden_attrs_ro = array(
461 # 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax',
462 # 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire');
465 /** Read-only attributes **/
468 /* You may want to phpLDAPadmin to display certain attributes as read only,
469 meaning that users will not be presented a form for modifying those
470 attributes, and they will not be allowed to be modified on the "back-end"
471 either. You may configure this list here:
472 NOTE: The user must be able to read the read_only_except_dn entry to be
474 # $read_only_attrs = array( 'objectClass' );
475 # $read_only_except_dn = "cn=PLA ReadWrite,ou=Groups,c=AU";
477 /* An example of how to specify multiple read-only attributes: */
478 # $read_only_attrs = array( 'jpegPhoto', 'objectClass', 'someAttribute' );
480 /*********************************************/
481 /* Unique attributes */
482 /*********************************************/
484 /* You may want phpLDAPadmin to enforce some attributes to have unique values
485 (ie: not belong to other entries in your tree. This (together with
486 unique_attrs['dn'] and unique_attrs['pass'] option will not let updates to
487 occur with other attributes have the same value.
488 NOTE: Currently the unique_attrs is NOT enforced when copying a dn. (Need to
489 present a user with the option of changing the unique attributes. */
490 # $unique_attrs = array('uid','uidNumber','mail');
492 /*********************************************/
493 /* Group attributes */
494 /*********************************************/
496 /* Add "modify group members" link to the attribute. */
497 // $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid')
499 /* Configure filter for member search. This only applies to "modify group members" feature */
500 // $config->custom->modify_member['filter'] = '(objectclass=Person)';
502 /* Attribute that is added to the group member attribute. */
503 // $config->custom->modify_member['attr'] = 'dn';
505 /*********************************************/
506 /* Predefined Queries (canned views) */
507 /*********************************************/
509 /* To make searching easier, you may setup predefined queries below: */
513 /* The name that will appear in the simple search form */
514 $queries[$q]['name'] = 'User List';
516 /* The base to search on */
517 $queries[$q]['base'] = 'dc=example,dc=com';
519 /* The search scope (sub, base, one) */
520 $queries[$q]['scope'] = 'sub';
522 /* The LDAP filter to use */
523 $queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))';
525 /* The attributes to return */
526 $queries[$q]['attributes'] = 'cn, uid, homeDirectory, telephonenumber, jpegphoto';
528 /* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */
530 $queries[$q]['name'] = 'Samba Users';
531 $queries[$q]['base'] = 'dc=example,dc=com';
532 $queries[$q]['scope'] = 'sub';
533 $queries[$q]['filter'] = '(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))';
534 $queries[$q]['attributes'] = 'uid, smbHome, uidNumber';
537 $queries[$q]['name'] = 'Samba Computers';
538 $queries[$q]['base'] = 'dc=example,dc=com';
539 $queries[$q]['scope'] = 'sub';
540 $queries[$q]['filter'] = '(&(objectClass=sambaAccount)(uid=*$))';
541 $queries[$q]['attributes'] = 'uid, homeDirectory';