20110601 a phpldapadmin 12x configphp that works - plembo/onemoretech GitHub Wiki

title: A phpldapadmin 1.2.x config.php that works link: https://onemoretech.wordpress.com/2011/06/01/a-phpldapadmin-12x-configphp-that-works/ author: lembobro description: post_id: 33 created: 2011/06/01 01:26:27 created_gmt: 2011/06/01 01:26:27 comment_status: open post_name: a-phpldapadmin-12x-configphp-that-works status: publish post_type: post

A phpldapadmin 1.2.x config.php that works

So phpldpadmin has never been documented very well. In fact the wiki's description of the core config.php file is woefully out of date and worse than useless. Sadly, the mailing lists are not very active and don't receive many visits from the developers either. To make things worse, the config.php.example file included with the 1.2.x distributions will not work without editing. Unfortunately there is no up to date "M" to recommend people to "RTF". Some pointers to follow. Although the developers recommend going to the latest version, overall I'm pretty unhappy with the changes that were made to the UI defaults since 1.1.0.7 (e.g. the elimination of the "Simple" query form, and the new requirement that users select a template to view entries). As a result I would caution anyone planning an upgrade to 1.2.x to try learning how the app works and do some meaningful testing before rolling it out. I am still actively working to determine what customizations will be needed to restore the defaults my folks are used to, and coming up short so far (so much so that I'm also looking around for a replacement web-enabled LDAP browser like the experimental java Directory Editor that Sun bundled with JSDS 6.3 -- I'm even considering the current DSEE web console as an option). In fact there are two lines in that example configuration that, if left uncommented, will cause the application to abend. The offending lines you need to comment out in each LDAP server definition are:

$servers->setValue('login','class',null);
$servers->setValue('force_may','attrs',array('uidNumber','gidNumber','sambaSID'));

Following is a complete, working, example config.php. This configuration has been tested successfully with version 1.2.1.1 (the latest as of this posting).

<?php
/**NOTE**
**Makesurethat<?phpistheFIRSTlineofthisfile!
**IE:ThereshouldNOTbeanyblanklinesorspacesBEFOREcustomvariabletodoso.
*Forexample,thedefaultfordefiningthelanguageinconfig_default.php
*
*$this->default->appearance['language']=array(
*'desc'=>'Language',
*'default'=>'auto');
*
*tooverridethis,use$config->custom->appearance['language']='en_EN';
*
*ThisfileisalsousedtoconfigureyourLDAPserverconnections.
*
*YoumustspecifyatleastoneLDAPserverthere.Youmayadd
*asmanyasyoulike.Youcanalsospecifyyourlanguage,and
*manyotheroptions.
*
*NOTE:Commentedoutvaluesinthisfileprefixedby//,representthe
*defaultsthathavebeendefinedinconfig_default.php.
*Commentedoutvaluesprefixedby#,dontreflecttheirdefaultvalue,youcan
*checkconfig_default.phpifyouwanttoseewhatthedefaultis.
*
*DONTchangeconfig_default.php,youchangeswillbelostbythenextrelease
*ofPLA.Insteadchangethisfile-asitwillNOTbereplacedbyanew
*versionofphpLDAPadmin.
*/
	
/*********************************************
*Usefulimportantconfigurationoverrides*
*********************************************/
	
/*IfyouareaskedtoputPLAindebugmode,thisishowyoudoit:*/
#$config->custom->debug['level']=255;
#$config->custom->debug['syslog']=true;
#$config->custom->debug['file']='/tmp/pla_debug.log';
	
/*phpLDAPadmincanencryptthecontentofsensitivecookiesifyousetthis
toabigrandomstring.*/
//$config->custom->session['blowfish']=null;
	
/*Ifyourauth_typeishttp,youcanoverrideyourHTTPAuthenticationRealm.*/
//$config->custom->session['http_realm']=sprintf('%s%s',app_name(),'login');
	
/*Thelanguagesetting.Ifyousetthisto'auto',phpLDAPadminwillattempt
todetermineyourlanguageautomatically.Otherwise,availablelanaguages
are:'ct','de','en','es','fr','it','nl',and'ru'
Localizationisnotcompleteyet,butmoststringshavebeentranslated.
Pleasehelpbywritinglanguagefiles.Seelang/en.phpforanexample.*/
//$config->custom->appearance['language']='auto';
	
/*ThetemporarystoragedirectorywherewewillputjpegPhotodata
Thisdirectorymustbereadableandwritablebyyourwebserver.*/
//$config->custom->jpeg['tmpdir']='/tmp';//ExampleforUnixsystems
#$config->custom->jpeg['tmpdir']='c:\temp';//ExampleforWindowssystems
	
/*Setthisto(bool)trueifyoudoNOTwantarandomsaltusedwhen
callingcrypt().Instead,usethefirsttwolettersoftheuser's
password.Thisisinsecurebutunfortunatelyneededforsomeolder
environments.*/
#$config->custom->password['no_random_crypt_salt']=true;
	
/*PHPscripttimeoutcontrol.Ifphprunslongerthanthismanysecondsthen
PHPwillstopwithanMaximumExecutiontimeerror.Increasethisvaluefrom
thedefaultifqueriestoyourLDAPserverareslow.Thedefaultiseither
30secondsorthesettingofmax_exection_timeifthisisnull.*/
//$config->custom->session['timelimit']=30;
	
/*Ourlocaltimezone
Thisistomakesurethatwhenweaskthesystemforthecurrenttime,we
gettherightlocaltime.Ifthisisnotset,alltime()calculationswill
assumeUTCifyouhavenotsetPHPdate.timezone.*/
//$config->custom->appearance['timezone']=null;
#$config->custom->appearance['timezone']='Australia/Melbourne';
	
/*********************************************
*Commands*
*********************************************/
	
/*Commandavailability;ifyoudon'tauthorizeacommandthecommand
linkswillnotbeshownandthecommandactionwillnotbepermitted.
Forbettersecurity,setalsoACLinyourldapdirectory.*/
/*
$config->custom->commands['cmd']=array(
	'entry_internal_attributes_show'=>true,
	'entry_refresh'=>true,
	'oslinks'=>true,
	'switch_template'=>true
);
	
$config->custom->commands['script']=array(
	'add_attr_form'=>true,
	'add_oclass_form'=>true,
	'add_value_form'=>true,
	'collapse'=>true,
	'compare'=>true,
	'compare_form'=>true,
	'copy'=>true,
	'copy_form'=>true,
	'create'=>true,
	'create_confirm'=>true,
	'delete'=>true,
	'delete_attr'=>true,
	'delete_form'=>true,
	'draw_tree_node'=>true,
	'expand'=>true,
	'export'=>true,
	'export_form'=>true,
	'import'=>true,
	'import_form'=>true,
	'login'=>true,
	'logout'=>true,
	'login_form'=>true,
	'mass_delete'=>true,
	'mass_edit'=>true,
	'mass_update'=>true,
	'modify_member_form'=>true,
	'monitor'=>true,
	'purge_cache'=>true,
	'query_engine'=>true,
	'rename'=>true,
	'rename_form'=>true,
	'rdelete'=>true,
	'refresh'=>true,
	'schema'=>true,
	'server_info'=>true,
	'show_cache'=>true,
	'template_engine'=>true,
	'update_confirm'=>true,
	'update'=>true
);
*/
	
/*********************************************
*Appearance*
*********************************************/
	
/*Ifyouwanttochoosetheappearanceofthetree,specifyaclassnamewhich
inheritsfromtheTreeclass.*/
//$config->custom->appearance['tree']='AJAXTree';
#$config->custom->appearance['tree']='HTMLTree';
	
/*Justshowyourcustomtemplates.*/
//$config->custom->appearance['custom_templates_only']=false;
	
/*Disablethedefaulttemplate.*/
//$config->custom->appearance['disable_default_template']=false;
	
/*HidethewarningsforinvalidobjectClasses/attributesintemplates.*/
//$config->custom->appearance['hide_template_warning']=false;
	
/*Configurewhatobjectsareshowninlefthandtree*/
//$config->custom->appearance['tree_filter']='(objectclass=*)';
	
/*Theheightandwidthofthetree.Ifthesevaluesarenotset,then
notreescrollbarsareprovided.*/
//$config->custom->appearance['tree_height']=null;
#$config->custom->appearance['tree_height']=600;
//$config->custom->appearance['tree_width']=null;
#$config->custom->appearance['tree_width']=250;
	
/*Confirmcreateandupdateoperations,allowingyoutoreviewthechanges
andoptionallyskipattributesduringthecreate/updateoperation.*/
//$config->custom->confirm['create']=true;
//$config->custom->confirm['update']=true;
	
/*Confirmcopyoperations,andtreatthemlikecreateoperations.Thisallows
youtoedittheattributes(thuschanginganythatmightconflictwith
uniqueness)beforecreatingthenewentry.*/
//$config->custom->confirm['copy']=true;
	
/*********************************************
*User-friendlyattributetranslation*
*********************************************/
	
/*Usethisarraytomapattributenamestouserfriendlynames.Forexample,if
youdon'twanttosee"facsimileTelephoneNumber"butrather"Fax".*/

Copyright 2004-2019 Phil Lembo