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
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2015-10-01