require_once ("/00_PHP/src/f/i/file2array.inc");
function wwwgroups2AssocArray ($groupfile) {
$y = array();
$arr = file2array ($groupfile);
foreach ($arr as $entry) {
$lineParse = split (":", $entry);
$groupName = $lineParse[0];
$members = split (" ", $lineParse[1]);
if (!isset ($y[$groupName])) $y[$groupName] = array();
$y[$groupName] = array_merge ($y[$groupName], $members);
}
// print_r ($y);
return ($y);
}
function stdgroups2AssocArray ($groupfile) {
print ("*** Not implemented");
exit (1);
}
function groups2AssocArray ($groupfile, $passwdfile) {
if ($passwdfile == "www") {
$y = wwwgroups2AssocArray ($groupfile);
}
else {
$y = stdgroups2AssocArray ($groupfile, $passwdfile);
}
return ($y);
}
?>