定制 mediawiki/ldap-provider 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mediawiki/ldap-provider

最新稳定版本:3.1.0

Composer 安装命令:

composer require mediawiki/ldap-provider

包简介

Provides a mechanism for MediaWiki to retrieve information using the LDAP protocol

README 文档

README

Table of Contents

Extension:LDAPProvider

This extension provides a common infrastructure to connect to a LDAP resource and run queries against it.

Installation

This extension can be installed by creating a composer.local.json file in your MediaWiki's installation directory containing the following (or merging this into your current composer.local.json):

{
	"require": {
		"mediawiki/ldap-provider": "dev-master"
	},
	"config": {
		"prefer": "source"
	}
}

Note that "prefer": "source" causes composer to use a clone of the git repository if it can.

Configuration

In the simplest case where you have a single LDAP server to query, you need to simply specify your LDAP server and the json file. By default LDAPProvider looks for this file in /etc/mediawiki/ldapprovider.json. If LDAProvider is installed, but cannot find it configuration file, it will fail with an error message.

LDAPProvider contains a sample configuration file that points to the Forum Systems online ldap test server in the included ldapprovider.json. This file and the server (if it is accessible on your network) will allow you to test the extension without affecting production systems or configuring your own LDAP server.

The contents of ldapprovider.json demonstrates a minimal configuration:

{
	"LDAP Demo": {
		"connection": {
				"server": "10.5.5.1",
				"user": "cn=read-only-admin,dc=example,dc=com",
				"pass": "password",
				"basedn": "dc=example,dc=com",
				"searchstring": "uid=USER-NAME,dc=example,dc=com"
		}
	}

Other configurations are possible.

If you just want to try out the sample configuration, adding the following to your LocalSettings.php should be all that is needed:

$LDAPProviderDomainConfigs = "$IP/extensions/LDAPProvider/ldapprovider.json";

Alternative configuration via PHP

In LocalSettings.php add

$LDAPProviderDomainConfigProvider = function( $ldapConfig ) {
	return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( [
		//Domain name
		'LDAP' => [
			'connection' => [
					'server' => '10.5.5.1',
					'user' => 'cn=read-only-admin,dc=example,dc=com',
					'pass' => 'password',
					'basedn' => 'dc=example,dc=com',
					'searchstring' => 'uid=USER-NAME,dc=example,dc=com'
				]
			]
	] );
};

Testing

Tests are provided. These can be run using the following in your MediaWiki's installation directory:

$ ./tests/phpunit/phpunit.php extensions/LDAPProvider

统计信息

  • 总下载量: 2.8k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 16
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2017-10-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固