From 21a9d24d3a0d73cb503074d0cb0e99a451e0fbba Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 29 Jan 2016 10:52:52 +0000 Subject: [PATCH] Simplify accounts exist check, by checking for total of search > 1, fixes problems with not working limited search in ldap (still returning correct total) --- setup/inc/class.setup.inc.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/setup/inc/class.setup.inc.php b/setup/inc/class.setup.inc.php index cf0437b47a..37073e1615 100644 --- a/setup/inc/class.setup.inc.php +++ b/setup/inc/class.setup.inc.php @@ -1126,25 +1126,13 @@ class setup { if (!$this->setup_account_object()) return false; - $accounts = $this->accounts->search(array( + $this->accounts->search(array( 'type' => 'accounts', 'start' => 0, 'offset' => 2 // we only need to check 2 accounts, if we just check for not anonymous )); - if (!$accounts || !is_array($accounts) || !count($accounts)) - { - return false; - } - foreach($accounts as $account) - { - if ($account['account_lid'] != 'anonymous') - { - // we might add further checks, eg. if the account really has admin rights here - return true; - } - } - return false; + return $this->accounts->total > 1; } /**