定制 mccwebdev/bat008.yii2-ldap-nwu 二次开发

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

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

mccwebdev/bat008.yii2-ldap-nwu

Composer 安装命令:

composer require mccwebdev/bat008.yii2-ldap-nwu

包简介

Yii 2 Ldap Extension for Northwestern University

README 文档

README

Yii 2 Ldap Extension for Northwestern University

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mccwebdev/bat008.yii2-ldap-nwu "*"

or add

"mccwebdev/bat008.yii2-ldap-nwu": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, configure the component:

'ldap' => [
	'class' => '\mccwebdev\ldap\Ldap',
	'connectionHostname' => '========',
	'connectionPort' => '========',
	'serviceDistinguishedName' => '========',
	'servicePassword' => '========',
	'searchBaseDistinguishedName' => '========',
	'searchParameters' => [
		'uid' => 'username',
	],
	'requestedAttributes' => [
		'name' => [
			'id' => 'displayname',
			'type' => 'single',
		],
		'emailAddress' => [
			'id' => 'mail',
			'type' => 'single',
		],
		'schoolAffiliations' => [
			'id' => 'nuschoolaffiliations',
			'type' => 'multiple',
		],
	],
],

Finally, use the component wherever you need to find or authenticate an account.

$isUser = Yii::$app->ldap->findUser( );
$isAuthenticated = Yii::$app->ldap->authenticateUser( );

You can get any additional attributes that were added to the configuration as an array using the following method after finding or authenticating an account.

$userAttributes = Yii::$app->ldap->getUserAttributes( );

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-10-01