From 1c06879ca5965c9b2eef31babc807dedc1f49b78 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 30 Jun 2009 22:17:33 +1000 Subject: [PATCH] Unreleased patch 0.9.7 --- lib/functions.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/functions.php b/lib/functions.php index 0442c53..c6ea9a4 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1,5 +1,5 @@ $attrs) { + $entry = array(); + switch ($type) { case 'uid' : if (isset($attrs['uidNumber'])) { @@ -799,6 +804,8 @@ function get_next_uid_number($ldapserver,$startbase='',$type='uid') { $entry['uniqnumber'] = $attrs['gidNumber']; } break; + default : + pla_error(sprintf('Unknown type [%s] in search',$type)); } $results[] = $entry; } @@ -807,7 +814,8 @@ function get_next_uid_number($ldapserver,$startbase='',$type='uid') { # construct a list of used numbers $autonum = array(); foreach ($results as $result) - $autonum[] = $result['uniqnumber']; + if (isset($result['uniqnumber'])) + $autonum[] = $result['uniqnumber']; $autonum = array_unique($autonum); if (count($autonum) == 0)