mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Simplify accounts exist check, by checking for total of search > 1, fixes problems with not working limited search in ldap (still returning correct total)
This commit is contained in:
parent
51e32dd1f4
commit
21a9d24d3a
@ -1126,25 +1126,13 @@ class setup
|
|||||||
{
|
{
|
||||||
if (!$this->setup_account_object()) return false;
|
if (!$this->setup_account_object()) return false;
|
||||||
|
|
||||||
$accounts = $this->accounts->search(array(
|
$this->accounts->search(array(
|
||||||
'type' => 'accounts',
|
'type' => 'accounts',
|
||||||
'start' => 0,
|
'start' => 0,
|
||||||
'offset' => 2 // we only need to check 2 accounts, if we just check for not anonymous
|
'offset' => 2 // we only need to check 2 accounts, if we just check for not anonymous
|
||||||
));
|
));
|
||||||
|
|
||||||
if (!$accounts || !is_array($accounts) || !count($accounts))
|
return $this->accounts->total > 1;
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user