forked from extern/egroupware
fix for bug #240: PHP Warning at accountsel popup if search has no result (accounts in ldap)
This commit is contained in:
parent
ec313158ee
commit
a6131d726e
@ -621,6 +621,7 @@ class accounts_backend
|
||||
{
|
||||
$query = ldap::quote(strtolower($param['query']));
|
||||
|
||||
$accounts = array();
|
||||
if($param['type'] != 'groups')
|
||||
{
|
||||
$filter = "(&(objectclass=posixaccount)";
|
||||
@ -727,20 +728,13 @@ class accounts_backend
|
||||
}
|
||||
//echo "<p>accounts_backend::search() found $this->total: ".microtime()."</p>\n";
|
||||
// return only the wanted accounts
|
||||
if (is_array($sortedAccounts))
|
||||
reset($sortedAccounts);
|
||||
if(is_numeric($start) && is_numeric($offset))
|
||||
{
|
||||
reset($sortedAccounts);
|
||||
if(is_numeric($start) && is_numeric($offset))
|
||||
{
|
||||
$account_search[$serial]['total'] = $this->total;
|
||||
return $account_search[$serial]['data'] = array_slice($sortedAccounts, $start, $offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $sortedAccounts;
|
||||
}
|
||||
$account_search[$serial]['total'] = $this->total;
|
||||
return $account_search[$serial]['data'] = array_slice($sortedAccounts, $start, $offset);
|
||||
}
|
||||
return False;
|
||||
return $sortedAccounts;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user