Merge pull request #8 from kyed/patch-1
Update login-ldap.php (fix: array_shift expected parameter to be array, null given)
This commit is contained in:
@@ -181,11 +181,16 @@ class LoginLDAPPlugin extends Plugin
|
|||||||
|
|
||||||
foreach ($groups as $group) {
|
foreach ($groups as $group) {
|
||||||
$attributes = $group->getAttributes();
|
$attributes = $group->getAttributes();
|
||||||
$user_group = array_shift($attributes[$group_indentifier]);
|
|
||||||
$user_groups[] = $user_group;
|
// make sure we have an array to read
|
||||||
|
if ( !empty($attributes) && !empty($attributes[$group_indentifier]) && is_array($attributes[$group_indentifier]) )
|
||||||
|
{
|
||||||
|
$user_group = array_shift($attributes[$group_indentifier]);
|
||||||
|
$user_groups[] = $user_group;
|
||||||
|
|
||||||
if ($this->config->get('plugins.login-ldap.store_ldap_data', false)) {
|
if ($this->config->get('plugins.login-ldap.store_ldap_data', false)) {
|
||||||
$userdata['ldap']['groups'][] = $user_group;
|
$userdata['ldap']['groups'][] = $user_group;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user