fiamma06/yii2-adldap-module
最新稳定版本:1.0.1
Composer 安装命令:
composer require fiamma06/yii2-adldap-module
包简介
yii2 adldap extention (wrapper for adldap/adLDAP Module)
README 文档
README
Yii2 extension for adLDAP (https://packagist.org/packages/adldap/adldap)
Installation
Composer
The preferred way to install this extension is through Composer.
Either run
php composer.phar require edvlerblog/yii2-adldap-module "v1.0.1"
or add
"edvlerblog/yii2-adldap-module": "v1.0.1"
to the require section of your composer.json
Configuration
Add this code in your components section of the application configuration (eg. config/main.php):
'components' => [
.....
'ldap' => [
'class'=>'Edvlerblog\Ldap',
'options'=> [
'ad_port' => 389,
'domain_controllers' => array('AdServerName1','AdServerName2'),
'account_suffix' => '@test.lan',
'base_dn' => "DC=test,DC=lan",
// for basic functionality this could be a standard, non privileged domain user (required)
'admin_username' => 'ActiveDirectoryUser',
'admin_password' => 'StrongPassword'
]
]
...
]
Examples
To use the yii2-adldap-module you need only one line. You can use the yii2-adldap-module everywhere where \Yii::$app works (Controllers, Widgets,...).
Authenticate User:
$authUser = \Yii::$app->ldap->authenticate("username","password");
var_dump ($authUser);
Group membership of a User:
$groups = \Yii::$app->ldap->user()->groups("username");
var_dump($groups);
Get informations about a Group:
$groupinfo= \Yii::$app->ldap->group()->info("example_group");
var_dump($groupinfo);
....
DOCUMENTATION
yii2-adldap-module is only a wrapper class. Feel free to learn more about the underlying adLDAP.
You can find the website at https://github.com/adldap/adLDAP/ or the class documentation at
https://github.com/adldap/adLDAP/wiki/adLDAP-Developer-API-Reference
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-2.1
- 更新时间: 2015-07-22