先确定是否安装php-ldap:yum list|grep
php-ldap; yum install php-ldap
1、下载插件:http://www.mediawiki.org/wiki/Extension:LDAP_Authentication
2、解压到wiki\extensions 下
3、修改
wiki目录下的LocalSettings.php文件,添加下面到wiki/LocalSettings.php,
require_once(
"$IP/extensions/LdapAuthentication/LdapAuthentication.php" );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "pdc.cn" );
$wgLDAPServerNames = array( "pdc.cn" =>
"domain.pdc.cn" );
$wgLDAPSearchStrings = array( "pdc.cn" =>
"pdc\\USER-NAME" );
$wgLDAPEncryptionType = array( "pdc" => "clear"
);
$wgLDAPUseLocal = false;
$wgMinimalPasswordLength = 1;
$wgLDAPBaseDNs = array( "pdc.cn" => "dc=pdc,dc=cn"
);
$wgLDAPSearchAttributes = array( "pdc.cn" =>
"sAMAccountName" );
$wgLDAPRetrievePrefs = array( "pdc.cn" => "true"
);
$wgLDAPDebug = 3; //for debugging LDAP
$wgShowExceptionDetails = true; //for debugging MediaWiki
4、重启apache :service httpd restart
5、用windows域账号登录mediawiki
**
windows登录名有“.”,因此修改wiki/extensions/LdapAuthentication/LdapAuthentication.php
var $LDAPUsername;
var $winlname;//在上面一行下添加该行
$winlname =
str_replace('
','.',$username);;//在下面一行上添加该行
$this->userdn
= $this->getSearchString( $winlname
);//把括号内的值改成$winlname
参考:http://blog.technotesdesk.com/?p=643 |