From 767c42b43f62a2937e5d108ab33f2d907c690364 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 8 Jun 2006 22:04:44 +0000 Subject: [PATCH] accounts_ldap::_get_nextid was not returning a negative number for groups, which lead to accounts_ldap::save to return a positive account_id for groups, which messed up some stuff in setup ... --- phpgwapi/inc/class.accounts_ldap.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.accounts_ldap.inc.php b/phpgwapi/inc/class.accounts_ldap.inc.php index 8c7327d480..83a57e00aa 100644 --- a/phpgwapi/inc/class.accounts_ldap.inc.php +++ b/phpgwapi/inc/class.accounts_ldap.inc.php @@ -175,7 +175,7 @@ class accounts_backend } } } - if (!$data['account_id']) // new group + if (!$data['account_id']) // new account { if (!($data['account_id'] = $data_utf8['account_id'] = $this->_get_nextid($is_group ? 'g' : 'u'))) { @@ -214,7 +214,7 @@ class accounts_backend //echo "

ldap_".($old ? 'modify' : 'add')."(,$dn,".print_r($to_write,true).")

\n"; // modifying or adding the entry if ($old && !ldap_modify($this->ds,$dn,$to_write) || - !$old && !ldap_add($this->ds,$dn,$to_write)) + !$old && !@ldap_add($this->ds,$dn,$to_write)) { $err = true; if (!$old && $is_group) @@ -772,7 +772,7 @@ class accounts_backend * * @internal * @param $string $account_type='u' (optional, default to 'u') - * @return int/boolean interger account_id or false if none is free anymore + * @return int/boolean integer account_id (negative for groups) or false if none is free anymore */ function _get_nextid($account_type='u') { @@ -801,6 +801,6 @@ class accounts_backend { return False; } - return $account_id; + return $sign * $account_id; } }