From 65b986ec0016bdb25059eb0c1288938bf2ad370d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 24 Oct 2011 08:59:14 +0200 Subject: [PATCH] Fix: avoid warning --- htdocs/core/class/ldap.class.php | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 29f1f1172f7..a8cf6927cef 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -1,8 +1,8 @@ - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2005-2006 Regis Houssin - * Copyright (C) 2006 Laurent Destailleur +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2006-2011 Laurent Destailleur * * 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 @@ -104,7 +104,7 @@ class Ldap /** * Constructor */ - function Ldap () + function __construct() { global $conf; @@ -1319,29 +1319,29 @@ class Ldap /** - * \brief Return available value of group GID - * \param - * \return int gid number + * Return available value of group GID + * @return int gid number */ - function getNextGroupGid() { + function getNextGroupGid() + { global $conf; + $search='('.$conf->global->LDAP_KEY_GROUPS.'=*)'; $result = $this->search($this->groups,$search); - if($result) { - $c = $result['count']; - $gids = array(); - for($i=0;$i<$c;$i++) + if($result) { - $gids[] = $result[$i]['gidnumber'][0]; - } - rsort($gids); - - - return $gids[0]+1; + $c = $result['count']; + $gids = array(); + for($i=0;$i<$c;$i++) + { + $gids[] = $result[$i]['gidnumber'][0]; + } + rsort($gids); + + return $gids[0]+1; } - return 0; - + return 0; } }