mirror of
https://github.com/humhub/humhub.git
synced 2025-01-29 20:38:26 +01:00
Added ldap module to tests
This commit is contained in:
parent
fa2191e9d7
commit
64695d63a2
@ -199,7 +199,7 @@ class LdapController extends \yii\console\Controller
|
||||
$authClient = $newAuthClient->getAuthClientInstance($userEntry);
|
||||
$attributes = $authClient->getUserAttributes();
|
||||
|
||||
if (isset($attributes['id'])) {
|
||||
if (!isset($attributes['id'])) {
|
||||
print "Skipped - No ID for: " . $attributes['dn'] . "\n";
|
||||
continue;
|
||||
}
|
||||
@ -207,7 +207,7 @@ class LdapController extends \yii\console\Controller
|
||||
// Fix empty 'authclient_id' by e-mail
|
||||
if (isset($attributes['email'])) {
|
||||
$user = User::find()->where(['email' => $attributes['email']])->andWhere(['IS', 'authclient_id', new Expression('NULL')])->one();
|
||||
if ($user !== null) {
|
||||
if ($user !== null && User::findOne(['authclient_id' => $attributes['id']]) === null) {
|
||||
$user->updateAttributes(['authclient_id' => $attributes['id']]);
|
||||
$d++;
|
||||
}
|
||||
@ -216,7 +216,7 @@ class LdapController extends \yii\console\Controller
|
||||
// Fix empty 'authclient_id' by username
|
||||
if (isset($attributes['username'])) {
|
||||
$user = User::find()->where(['username' => $attributes['username']])->andWhere(['IS', 'authclient_id', new Expression('NULL')])->one();
|
||||
if ($user !== null) {
|
||||
if ($user !== null && User::findOne(['authclient_id' => $attributes['id']]) === null) {
|
||||
$user->updateAttributes(['authclient_id' => $attributes['id']]);
|
||||
$d++;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ class ModuleAutoLoaderTest extends Unit
|
||||
'tour',
|
||||
'ui',
|
||||
'user',
|
||||
'ldap',
|
||||
];
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user