Fix: avoid warning

This commit is contained in:
Regis Houssin 2011-10-24 08:59:14 +02:00
parent 2b8332eb2d
commit 65b986ec00

View File

@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -104,7 +104,7 @@ class Ldap
/** /**
* Constructor * Constructor
*/ */
function Ldap () function __construct()
{ {
global $conf; global $conf;
@ -1319,29 +1319,29 @@ class Ldap
/** /**
* \brief Return available value of group GID * Return available value of group GID
* \param * @return int gid number
* \return int gid number
*/ */
function getNextGroupGid() { function getNextGroupGid()
{
global $conf; global $conf;
$search='('.$conf->global->LDAP_KEY_GROUPS.'=*)'; $search='('.$conf->global->LDAP_KEY_GROUPS.'=*)';
$result = $this->search($this->groups,$search); $result = $this->search($this->groups,$search);
if($result) { if($result)
$c = $result['count'];
$gids = array();
for($i=0;$i<$c;$i++)
{ {
$gids[] = $result[$i]['gidnumber'][0]; $c = $result['count'];
} $gids = array();
rsort($gids); for($i=0;$i<$c;$i++)
{
$gids[] = $result[$i]['gidnumber'][0];
}
rsort($gids);
return $gids[0]+1;
return $gids[0]+1;
} }
return 0; return 0;
} }
} }