MediaWiki extensions manual
OOjs UI icon advanced.svg
Release status: experimental
Implementation User interface, Special page
Description Creates a directory listing from LDAP
Author(s) (Cburton1talk)
Latest version 0.0.1 (2010-05-26)
MediaWiki 1.15+
License GPL
Download http://dl.dropbox.com/u/1628974/CompanyDirectory.zip
Translate the CompanyDirectory extension if it is available at translatewiki.net
Check usage and version matrix.

What can this extension do?Edit

This extension was created because we had a need to get an automatically generated list of employees to populate our Company Directory. Without wanting to have to mess with a lot of formatting and still have a nice table displayed, I put together this script to take care of it.


When installed, CompanyDirectory will show up under the Users heading on the Special Pages list. On this page you will find a wiki formatted table with all the information of the users from the user group you specify. Simply copy and paste this table into a page, and repeat this process when the directory has been updated.

Download instructionsEdit

The fileset is downloadable from here for now. I want to transfer the file to MediaWiki, but I guess you can't upload zips?


To install this extension, copy the CompanyDirectory folder to /extensions/ and add the following to LocalSettings.php :


Configuration parametersEdit

Edit CD_config.inc.php to fit your system and change the CSS options to get the table to fit your wiki's style. Here is a sample for the ficticious company PretendSite:

 * Define LDAP Settings
define('ACCT_SUFFIX', '@pretendsite.com');
define('LDAP_DOMAIN', 'dc01.pretendsite.com');
define('LDAP_BASEDN', 'DC=pretendsite,DC=com'); //Generally the same as ACCT_SUFFIX, just broken up
//Domain admin account for searching 
define('LDAP_USERNAME', 'ldapsearcher');
define('LDAP_PASSWD', 'searchpasswd');
define('LDAP_SSL', false);
define('LDAP_TLS', false); //Do not set TLS to true if SSL is true
define('LDAP_GROUP', 'All Users'); //Group to make list from

 * Define CSS attributes
define('HEADER_HEX', '#074f90');
define('HDRFONT_HEX', '#ffffff');
define('ODD_HEX', '#ffffff');
define('EVEN_HEX', '#efefef');
define('TBL_BORDER', '0px');
define('CELL_SPACING', '0px');
define('CELL_PADDING', '5px');

Example PageEdit

Click here to see a sample output and displayed table form that output.


  • Configuration options for fields output from active directory.
  • Automated display on page of choice instead of copy/paste.

Special ThanksEdit

The LDAP php class included with this extension was obtained from: http://adldap.sourceforge.net/ I have found this class to be incredibly helpful and have used it on many internal projects requiring LDAP interfacing. I modified this class file slightly to allow for a single config file for the extension.

User rightsEdit

This extension is set to be accessible only by admins from SpecialPages.