Commit fa7429e0 authored by Franco Fichtner's avatar Franco Fichtner

ldap: fix access of non-array

parent b91de022
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com> Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com>
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
...@@ -113,13 +114,15 @@ if ($authcfg['type'] == 'ldap') { ...@@ -113,13 +114,15 @@ if ($authcfg['type'] == 'ldap') {
} }
} }
} else { } else {
// list all missing accounts if (is_array($result)) {
foreach ($result as $ldap_user ) { // list all missing accounts
if (!in_array($ldap_user['dn'], $confDNs)) { foreach ($result as $ldap_user ) {
$ldap_users[$ldap_user['name']] = $ldap_user['dn']; if (!in_array($ldap_user['dn'], $confDNs)) {
$ldap_users[$ldap_user['name']] = $ldap_user['dn'];
}
} }
ksort($ldap_users);
} }
ksort($ldap_users);
} }
} }
} }
......
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