mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-24 20:01:36 +02:00
use in_array() instead of class function; formatting
This commit is contained in:
parent
611c40af04
commit
ddfa5d9d4b
@ -192,7 +192,7 @@
|
||||
for($i=0;$i<count($members);$i++)
|
||||
{
|
||||
$currname = $this->id2name($members[$i]['account_id']);
|
||||
if (!$this->isin_array($currname,$entry['memberuid']))
|
||||
if(!@in_array($currname,$entry['memberuid']))
|
||||
{
|
||||
$entry['memberuid'][] = $currname;
|
||||
}
|
||||
@ -236,7 +236,7 @@
|
||||
for($i=0;$i<count($members);$i++)
|
||||
{
|
||||
$currname = $this->id2name($members[$i]['account_id']);
|
||||
if (!$this->isin_array($currname,$entry['memberuid']))
|
||||
if(!@in_array($currname,$entry['memberuid']))
|
||||
{
|
||||
$entry['memberuid'][] = $currname;
|
||||
}
|
||||
@ -287,16 +287,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
function isin_array($needle,$haystack='')
|
||||
{
|
||||
if(gettype($haystack) != 'array')
|
||||
{
|
||||
return False;
|
||||
}
|
||||
for($i=0;$i<count($haystack) && $haystack[$i] !=$needle;$i++);
|
||||
return ($i!=count($haystack));
|
||||
}
|
||||
|
||||
function delete($accountid = '')
|
||||
{
|
||||
$account_id = get_account_id($accountid);
|
||||
@ -352,7 +342,10 @@
|
||||
$test = @$allVals['uid'][0];
|
||||
if(!$GLOBALS['phpgw_info']['server']['global_denied_users'][$test] && $allVals['uid'][0])
|
||||
{
|
||||
if(!$query || strpos(' '.$allVals['cn'][0],$query) || strpos(' '.$allVals['givenname'][0],$query) || strpos(' '.$allVals['sn'][0],$query))
|
||||
if(!$query ||
|
||||
strpos(' ' . $allVals['cn'][0],$query) ||
|
||||
strpos(' ' . $allVals['givenname'][0],$query) ||
|
||||
strpos(' ' . $allVals['sn'][0],$query))
|
||||
{
|
||||
$accounts[] = Array(
|
||||
'account_id' => $allVals['uidnumber'][0],
|
||||
@ -376,7 +369,10 @@
|
||||
$test = $allVals['cn'][0];
|
||||
if(!$GLOBALS['phpgw_info']['server']['global_denied_groups'][$test] && $allVals['cn'][0])
|
||||
{
|
||||
if(!$query || strpos(' '.$allVals['cn'][0],$query) || strpos(' '.$allVals['givenname'][0],$query) || strpos(' '.$allVals['sn'][0],$query))
|
||||
if(!$query ||
|
||||
strpos(' ' . $allVals['cn'][0],$query) ||
|
||||
strpos(' ' . $allVals['givenname'][0],$query) ||
|
||||
strpos(' ' . $allVals['sn'][0],$query))
|
||||
{
|
||||
$accounts[] = Array(
|
||||
'account_id' => $allVals['gidnumber'][0],
|
||||
@ -497,7 +493,7 @@
|
||||
|
||||
/*
|
||||
* returns nonzero if $account exists in LDAP: 0: nowhere 1: user accounts, 2: group accounts, 3: both
|
||||
* $account can be an account_id (LDAP: uidnumber) or an account_lid (LDAP: uid) (is determinded by gettype($account) == 'integer')
|
||||
* $account can be an account_id (LDAP: uidnumber) or an account_lid (LDAP: uid) (is determinded by is_int($account))
|
||||
*/
|
||||
function exists($account)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user