Commit 83376d76 authored by 张育槟's avatar 张育槟

优化代码功能

parent 44d97fee
......@@ -146,17 +146,27 @@ class LdapController extends Controller
//登陆状态默认启用 544默认启用 66080密码永不过期
$user->setUserAccountControl(544);
//邮箱
$user->setAttribute('mail',$company_email);
if(!empty($company_email)) {
$user->setAttribute('mail', $company_email);
}
//联系方式
$user->setAttribute('telephoneNumber',$mobileNumber);
if(!empty($mobileNumber)) {
$user->setAttribute('telephoneNumber', $mobileNumber);
}
//姓
$user->setAttribute('sn',$first_name);
if(!empty($first_name)) {
$user->setAttribute('sn', $first_name);
}
//名
$user->setAttribute('givenName',$last_name);
if(!empty($last_name)) {
$user->setAttribute('givenName', $last_name);
}
//显示名称
$user->setAttribute('displayName',$value);
//登陆账号
$user->setAttribute('sAMAccountName',$account);
if(!empty($account)) {
$user->setAttribute('sAMAccountName', $account);
}
if($user->create()){
Log::info("{$value} created success....");
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment