18 include_once (
"Class.Group.php");
19 include_once (
"FDL/Class.Dir.php");
27 $wg =
new group(
"", 2);
29 function refreshGroups($groupIdList, $refresh =
false, &$currentPath = array() , &$groupDepth = array())
33 foreach ($groupIdList as $groupId) {
35 if (array_search($groupId, $currentPath)) {
36 error_log(__CLASS__ .
"::" . __FUNCTION__ .
" " . sprintf(
"Loop detected in group with id '%s' (path=[%s])", $groupId, join(
'-', $currentPath)));
40 $parentGroupIdList = $wg->getParentsGroupId($groupId);
42 array_push($currentPath, $groupId);
43 $groupDepth[$groupId] = max($groupDepth[$groupId], count($currentPath));
44 refreshGroups($parentGroupIdList, $refresh, $currentPath, $groupDepth);
45 array_pop($currentPath);
48 if (count($currentPath) <= 0) {
50 uasort($groupDepth, create_function(
'$a,$b',
'return ($a-$b);'));
51 foreach ($groupDepth as $group => $depth) {
61 foreach (
$t as $k => $v) {
62 if ($v == $vp) unset(
$t[$k]);
69 $g =
new User(
"", $gid);
73 if (
$doc->isAlive()) {
74 if ($_SERVER[
'HTTP_HOST'] ==
"") print sprintf(
"\trefreshing %s\n",
$doc->title);
76 if ($refresh)
$doc->refreshMembers();
77 $doc->SetGroupMail((
$doc->GetValue(
"US_IDDOMAIN") > 1));
79 $doc->specPostInsert();
80 $doc->setValue(
"grp_isrefreshed",
"1");
81 $doc->modify(
true, array(