Extension:CompanyDirectory

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
OOjs UI icon advanced.svg
CompanyDirectory
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.

Usage[edit]

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 instructions[edit]

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

Installation[edit]

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

require_once("$IP/extensions/CompanyDirectory/CompanyDirectory.php");

Configuration parameters[edit]

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 Page[edit]

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

TODO[edit]

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

Special Thanks[edit]

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 rights[edit]

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