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 // Use the displayName in the tree view, when available.
120 $config->custom->appearance['tree_display_formats'] = array("%displayName", "%rdnValue");
122 /* If you want to choose the appearance of the tree, specify a class name which
123 inherits from the Tree class. */
124 // $config->custom->appearance['tree'] = "AJAXTree";
125 # $config->custom->appearance['tree'] = "HTMLTree";
127 /* If you want to customise the entry view/edition, specify your factory name which
128 inherits from the EntryFactory class.
129 The 'DefaultEntryFactory' draws all the attributes of an entry according this
130 config file and the ldap schema definition ; the 'TemplateEntryFactory' draws
131 an entry according to the template whose regexp matches with the dn. */
132 # $config->custom->appearance['entry_factory'] = "DefaultEntryFactory";
133 // $config->custom->appearance['entry_factory'] = "TemplateEntryFactory";
135 /* If you want to customise an attribute view/edition, specify your factory name which
136 inherits from the AttributeFactory class.
137 An AttributeFactory defines which class to use to represent a given attribute */
138 // $config->custom->appearance['attribute_factory'] = "AttributeFactory";
140 /* Configure what objects are shown in left hand tree */
141 // $config->custom->appearance['tree_filter'] = '(objectclass=*)';
143 /* The height and width of the tree. If these values are not set, then
144 no tree scroll bars are provided.
145 // $config->custom->appearance['tree_height'] = null;
146 # $config->custom->appearance['tree_height'] = 600;
147 // $config->custom->appearance['tree_width'] = null;
148 # $config->custom->appearance['tree_width'] = 250;
150 /*********************************************/
151 /* Define your LDAP servers in this section */
152 /*********************************************/
155 $ldapservers = new LDAPServers;
157 /* A convenient name that will appear in the tree viewer and throughout
158 phpLDAPadmin to identify this LDAP server to users. */
159 $ldapservers->SetValue($i,'server','name','My LDAP Server');
163 'ldaps://ldap.example.com/',
164 'ldapi://%2fusr%local%2fvar%2frun%2fldapi'
165 (Unix socket at /usr/local/var/run/ldap) */
166 $ldapservers->SetValue($i,'server','host','ldap.drsnuggles.stderr.nl');
168 /* The port your LDAP server listens on (no quotes). 389 is standard. */
169 // $ldapservers->SetValue($i,'server','port','389');
171 /* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin
172 auto-detect it for you. */
173 $ldapservers->SetValue($i,'server','base',array('dc=drsnuggles,dc=stderr,dc=nl'));
175 /* Four options for auth_type:
176 1. 'cookie': you will login via a web form, and a client-side cookie will
177 store your login dn and password.
178 2. 'session': same as cookie but your login dn and password are stored on the
179 web server in a persistent session variable.
180 3. 'http': same as session but your login dn and password are retrieved via
182 4. 'config': specify your login dn and password here in this config file. No
183 login will be required to use phpLDAPadmin for this server.
185 Choose wisely to protect your authentication information appropriately for
186 your situation. If you choose 'cookie', your cookie contents will be
187 encrypted using blowfish and the secret your specify above as
188 session['blowfish']. */
189 $ldapservers->SetValue($i,'server','auth_type','session');
191 /* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or
192 'cookie' or 'session' auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If
193 you specify a login_attr in conjunction with a cookie or session auth_type,
194 then you can also specify the login_dn/login_pass here for searching the
195 directory for users (ie, if your LDAP server does not allow anonymous binds. */
196 // $ldapservers->SetValue($i,'login','dn','');
197 $ldapservers->SetValue($i,'login','dn','cn=admin,dc=drsnuggles,dc=stderr,dc=nl');
199 /* Your LDAP password. If you specified an empty login_dn above, this MUST also
201 // $ldapservers->SetValue($i,'login','pass','');
202 $ldapservers->SetValue($i,'login','pass','');
204 // Make sure that uniqueNumber doesn't start counting at 1000. The uidNumbers
205 // will still work correctly, since they start counting at whatever minimal
206 // value is in the directory already.
207 $ldapservers->SetValue($i,'auto_number','min',0);
209 /* Use TLS (Transport Layer Security) to connect to the LDAP server. */
210 // $ldapservers->SetValue($i,'server','tls',false);
212 /************************************
213 * SASL Authentication *
214 ************************************/
216 /* Enable SASL authentication LDAP SASL authentication requires PHP 5.x
217 configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to
218 false), then all other sasl options are ignored. */
219 // $ldapservers->SetValue($i,'server','sasl_auth',false);
221 /* SASL auth mechanism */
222 // $ldapservers->SetValue($i,'server','sasl_mech','PLAIN');
224 /* SASL authentication realm name */
225 // $ldapservers->SetValue($i,'server','sasl_realm','');
226 # $ldapservers->SetValue($i,'server','sasl_realm',"example.com");
228 /* SASL authorization ID name
229 If this option is undefined, authorization id will be computed from bind DN,
230 using sasl_authz_id_regex and sasl_authz_id_replacement. */
231 // $ldapservers->SetValue($i,'server','sasl_authz_id', null);
233 /* SASL authorization id regex and replacement
234 When sasl_authz_id property is not set (default), phpLDAPAdmin will try to
235 figure out authorization id by itself from bind distinguished name (DN).
237 This procedure is done by calling preg_replace() php function in the
240 $authz_id = preg_replace($sasl_authz_id_regex,$sasl_authz_id_replacement,
243 For info about pcre regexes, see:
245 - http://www.php.net/preg_replace */
246 // $ldapservers->SetValue($i,'server','sasl_authz_id_regex',null);
247 // $ldapservers->SetValue($i,'server','sasl_authz_id_replacement',null);
248 # $ldapservers->SetValue($i,'server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i');
249 # $ldapservers->SetValue($i,'server','sasl_authz_id_replacement','$1');
251 /* SASL auth security props.
252 See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation.
254 // $ldapservers->SetValue($i,'server','sasl_props',null);
256 /* If the link between your web server and this LDAP server is slow, it is
257 recommended that you set 'low_bandwidth' to true. This will enable
258 phpLDAPadmin to forego some "fancy" features to conserve bandwidth. */
259 // $ldapservers->SetValue($i,'server','low_bandwidth',false);
261 /* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5,
262 blowfish, crypt or leave blank for now default algorithm. */
263 // $ldapservers->SetValue($i,'appearance','password_hash','md5');
265 /* If you specified 'cookie' or 'session' as the auth_type above, you can
266 optionally specify here an attribute to use when logging in. If you enter
267 'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith)
268 and log in as that user.
269 Leave blank or specify 'dn' to use full DN for logging in. Note also that if
270 your LDAP server requires you to login to perform searches, you can enter the
271 DN to use when searching in 'login_dn' and 'login_pass' above. You may also
272 specify 'string', in which case you can provide a string to use for logging
273 users in. See 'login_string' directly below. */
274 // $ldapservers->SetValue($i,'login','attr','dn');
276 /* If you specified something different from 'dn', for example 'uid', as the
277 login_attr above, you can optionally specify here to fall back to
278 authentication with dn.
279 This is useful, when users should be able to log in with their uid, but
280 the ldap administrator wants to log in with his root-dn, that does not
281 necessarily have the uid attribute. */
282 // $ldapservers->SetValue($i,'login','fallback_dn',false);
284 /* If you specified 'cookie' or 'session' as the auth_type above, and you
285 specified 'string' for 'login_attr' above, you must provide a string here for
286 logging users in. If, for example, I have a lot of user entries with DNs like
287 "uid=dsmith,ou=People,dc=example,dc=com", then I can specify a string
288 "uid=<username>,ou=People,dc=example,dc=com" and my users can login with
289 their user names alone, ie: "dsmith" in this case. */
290 # $ldapservers->SetValue($i,'login','string','uid=<username>,ou=People,dc=example,dc=com');
292 /* If 'login_attr' is used above such that phpLDAPadmin will search for your DN
293 at login, you may restrict the search to a specific objectClass. EG, set this
294 to 'posixAccount' or 'inetOrgPerson', depending upon your setup. */
295 // $ldapservers->SetValue($i,'login','class',null);
297 /* Specify true If you want phpLDAPadmin to not display or permit any
298 modification to the LDAP server. */
299 // $ldapservers->SetValue($i,'server','read_only',false);
301 /* Specify false if you do not want phpLDAPadmin to draw the 'Create new' links
302 in the tree viewer. */
303 // $ldapservers->SetValue($i,'appearance','show_create',true);
305 /* This feature allows phpLDAPadmin to automatically determine the next
306 available uidNumber for a new entry. */
307 // $ldapservers->SetValue($i,'auto_number','enable',true);
309 /* The mechanism to use when finding the next available uidNumber. Two possible
310 values: 'uidpool' or 'search'.
311 The 'uidpool' mechanism uses an existing uidPool entry in your LDAP server to
312 blindly lookup the next available uidNumber. The 'search' mechanism searches
313 for entries with a uidNumber value and finds the first available uidNumber
315 // $ldapservers->SetValue($i,'auto_number','mechanism','search');
317 /* The DN of the search base when the 'search' mechanism is used above. */
318 # $ldapservers->SetValue($i,'auto_number','search_base','ou=People,dc=example,dc=com');
320 /* The minimum number to use when searching for the next available UID number
321 (only when 'search' is used for auto_uid_number_mechanism' */
322 // $ldapservers->SetValue($i,'auto_number','min','1000');
324 /* The DN of the uidPool entry when 'uidpool' mechanism is used above. */
325 # $servers[$i]['auto_uid_number_uid_pool_dn'] = 'cn=uidPool,dc=example,dc=com';
327 /* If you set this, then phpldapadmin will bind to LDAP with this user ID when
328 searching for the uidnumber. The idea is, this user id would have full
329 (readonly) access to uidnumber in your ldap directory (the logged in user
330 may not), so that you can be guaranteed to get a unique uidnumber for your
332 // $ldapservers->SetValue($i,'auto_number','dn',null);
334 /* The password for the dn above. */
335 // $ldapservers->SetValue($i,'auto_number','pass',null);
337 /* Enable anonymous bind login. */
338 // $ldapservers->SetValue($i,'login','anon_bind',true);
340 /* Use customized page with prefix when available. */
341 # $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
343 /* If you set this, then phpldapadmin will bind to LDAP with this user when
344 testing for unique attributes (as set in unique_attrs array). If you want to
345 enforce unique attributes, than this id should have full (readonly) access
346 to the attributes in question (the logged in user may not have enough access)
348 // $ldapservers->SetValue($i,'unique_attrs','dn',null);
350 /* The password for the dn above */
351 // $ldapservers->SetValue($i,'unique_attrs','pass',null);
353 /* If you set this, then only these DNs are allowed to log in. This array can
354 contain individual users, groups or ldap search filter(s). Keep in mind that
355 the user has not authenticated yet, so this will be an anonymous search to
356 the LDAP server, so make your ACLs allow these searches to return results! */
357 # $ldapservers->SetValue($i,'login','allowed_dns',array(
358 # 'uid=stran,ou=People,dc=example,dc=com',
359 # '(&(gidNumber=811)(objectClass=groupOfNames))',
360 # '(|(uidNumber=200)(uidNumber=201))',
361 # 'cn=callcenter,ou=Group,dc=example,dc=com'));
363 /* Set this if you dont want this LDAP server to show in the tree */
364 // $ldapservers->SetValue($i,'appearance','visible',true);
366 /* This is the time out value in minutes for the server. After as many minutes
367 of inactivity you will be automatically logged out. If not set, the default
368 value will be ( session_cache_expire()-1 ) */
369 # $ldapservers->SetValue($i,'login','timeout',30);
371 /* Set this if you want phpldapadmin to perform rename operation on entry which
372 has children. Certain servers are known to allow it, certain are not */
373 // $ldapservers->SetValue($i,'server','branch_rename',false);
375 /**************************************************************************
376 * If you want to configure additional LDAP servers, do so below. *
377 * Remove the commented lines and use this section as a template for all *
378 * your other LDAP servers. *
379 **************************************************************************/
383 $ldapservers->SetValue($i,'server','name','LDAP Server');
384 $ldapservers->SetValue($i,'server','host','127.0.0.1');
385 $ldapservers->SetValue($i,'server','port','389');
386 $ldapservers->SetValue($i,'server','base',array(''));
387 $ldapservers->SetValue($i,'server','auth_type','cookie');
388 $ldapservers->SetValue($i,'login','dn','');
389 $ldapservers->SetValue($i,'login','pass','');
390 $ldapservers->SetValue($i,'server','tls',false);
391 $ldapservers->SetValue($i,'server','low_bandwidth',false);
392 $ldapservers->SetValue($i,'appearance','password_hash','md5');
393 $ldapservers->SetValue($i,'login','attr','dn');
394 $ldapservers->SetValue($i,'login','string',null);
395 $ldapservers->SetValue($i,'login','class',null);
396 $ldapservers->SetValue($i,'server','read_only',false);
397 $ldapservers->SetValue($i,'appearance','show_create',true);
398 $ldapservers->SetValue($i,'auto_number','enable',true);
399 $ldapservers->SetValue($i,'auto_number','mechanism','search');
400 $ldapservers->SetValue($i,'auto_number','search_base',null);
401 $ldapservers->SetValue($i,'auto_number','min','1000');
402 $ldapservers->SetValue($i,'auto_number','dn',null);
403 $ldapservers->SetValue($i,'auto_number','pass',null);
404 $ldapservers->SetValue($i,'login','anon_bind',true);
405 $ldapservers->SetValue($i,'custom','pages_prefix','custom_');
406 $ldapservers->SetValue($i,'unique_attrs','dn',null);
407 $ldapservers->SetValue($i,'unique_attrs','pass',null);
410 $ldapservers->SetValue($i,'server','sasl_auth',true);
411 $ldapservers->SetValue($i,'server','sasl_mech','PLAIN');
412 $ldapservers->SetValue($i,'server','sasl_realm','EXAMPLE.COM');
413 $ldapservers->SetValue($i,'server','sasl_authz_id',null);
414 $ldapservers->SetValue($i,'server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i');
415 $ldapservers->SetValue($i,'server','sasl_authz_id_replacement','$1');
416 $ldapservers->SetValue($i,'server','sasl_props',null);
419 /*********************************************/
420 /* User-friendly attribute translation */
421 /*********************************************/
423 /* Use this array to map attribute names to user friendly names. For example, if
424 you don't want to see "facsimileTelephoneNumber" but rather "Fax". */
425 $friendly_attrs = array();
427 $friendly_attrs['facsimileTelephoneNumber'] = 'Fax';
428 $friendly_attrs['telephoneNumber'] = 'Phone';
429 $friendly_attrs['uid'] = 'User Name';
431 /*********************************************/
432 /* Support for attrs display order */
433 /*********************************************/
435 /* Use this array if you want to have your attributes displayed in a specific
436 order. You can use default attribute names or their fridenly names.
437 For example, "sn" will be displayed right after "givenName". All the other
438 attributes that are not specified in this array will be displayed after in
439 alphabetical order. */
440 # $attrs_display_order = array(
453 /*********************************************/
454 /* Hidden attributes */
455 /*********************************************/
457 /* You may want to hide certain attributes from being displayed in the editor
458 screen. Do this by adding the desired attributes to this list (and uncomment
459 it). This only affects the editor screen. Attributes will still be visible in
460 the schema browser and elsewhere. An example is provided below:
461 NOTE: The user must be able to read the hidden_except_dn entry to be
463 # $hidden_attrs = array( 'jpegPhoto', 'objectClass' );
464 # $hidden_except_dn = "cn=PLA UnHide,ou=Groups,c=AU";
466 /* Hidden attributes in read-only mode. If undefined, it will be equal to
468 # $hidden_attrs_ro = array(
469 # 'objectClass','shadowWarning', 'shadowLastChange', 'shadowMax',
470 # 'shadowFlag', 'shadowInactive', 'shadowMin', 'shadowExpire');
473 /** Read-only attributes **/
476 /* You may want to phpLDAPadmin to display certain attributes as read only,
477 meaning that users will not be presented a form for modifying those
478 attributes, and they will not be allowed to be modified on the "back-end"
479 either. You may configure this list here:
480 NOTE: The user must be able to read the read_only_except_dn entry to be
482 # $read_only_attrs = array( 'objectClass' );
483 # $read_only_except_dn = "cn=PLA ReadWrite,ou=Groups,c=AU";
485 /* An example of how to specify multiple read-only attributes: */
486 # $read_only_attrs = array( 'jpegPhoto', 'objectClass', 'someAttribute' );
488 /*********************************************/
489 /* Unique attributes */
490 /*********************************************/
492 /* You may want phpLDAPadmin to enforce some attributes to have unique values
493 (ie: not belong to other entries in your tree. This (together with
494 unique_attrs['dn'] and unique_attrs['pass'] option will not let updates to
495 occur with other attributes have the same value.
496 NOTE: Currently the unique_attrs is NOT enforced when copying a dn. (Need to
497 present a user with the option of changing the unique attributes. */
498 # $unique_attrs = array('uid','uidNumber','mail');
500 /*********************************************/
501 /* Group attributes */
502 /*********************************************/
504 /* Add "modify group members" link to the attribute. */
505 // $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid')
507 /* Configure filter for member search. This only applies to "modify group members" feature */
508 // $config->custom->modify_member['filter'] = '(objectclass=Person)';
510 /* Attribute that is added to the group member attribute. */
511 // $config->custom->modify_member['attr'] = 'dn';
513 /*********************************************/
514 /* Predefined Queries (canned views) */
515 /*********************************************/
517 /* To make searching easier, you may setup predefined queries below: */
521 /* The name that will appear in the simple search form */
522 $queries[$q]['name'] = 'User List';
524 /* The base to search on */
525 $queries[$q]['base'] = 'dc=example,dc=com';
527 /* The search scope (sub, base, one) */
528 $queries[$q]['scope'] = 'sub';
530 /* The LDAP filter to use */
531 $queries[$q]['filter'] = '(&(objectClass=posixAccount)(uid=*))';
533 /* The attributes to return */
534 $queries[$q]['attributes'] = 'cn, uid, homeDirectory, telephonenumber, jpegphoto';
536 /* If you want to configure more pre-defined queries, copy and paste the above (including the "$q++;") */
538 $queries[$q]['name'] = 'Samba Users';
539 $queries[$q]['base'] = 'dc=example,dc=com';
540 $queries[$q]['scope'] = 'sub';
541 $queries[$q]['filter'] = '(&(|(objectClass=sambaAccount)(objectClass=sambaSamAccount))(objectClass=posixAccount)(!(uid=*$)))';
542 $queries[$q]['attributes'] = 'uid, smbHome, uidNumber';
545 $queries[$q]['name'] = 'Samba Computers';
546 $queries[$q]['base'] = 'dc=example,dc=com';
547 $queries[$q]['scope'] = 'sub';
548 $queries[$q]['filter'] = '(&(objectClass=sambaAccount)(uid=*$))';
549 $queries[$q]['attributes'] = 'uid, homeDirectory';