make group autocompletion work again

fixes #5
This commit is contained in:
Jan Dittberner 2007-11-23 18:48:56 +00:00
parent ef9a212ece
commit c0c7ce59ad

View file

@ -56,12 +56,13 @@ function getGroups($part) {
$last_string = trim(array_pop($array)); $last_string = trim(array_pop($array));
$retval = array(); $retval = array();
if ($last_string != '') { if ($last_string != '') {
$prefix = count($array) ? implode(",", $array) . ", ": '';
$groups = file($GLOBALS['davconfig']['group.file']); $groups = file($GLOBALS['davconfig']['group.file']);
foreach ($groups as $line) { foreach ($groups as $line) {
list($group, $users) = explode(":", $line); list($group, $users) = explode(":", $line);
$group = trim($group); $group = trim($group);
if (stripos($group, $last_string) === 0) { if (stripos($group, $last_string) === 0) {
array_push($retval, $group); $retval[$prefix . $group] = $group;
} }
} }
} }