22 include_once (
"FDL/Class.Doc.php");
23 include_once (
"FDL/Lib.Dir.php");
42 if (count($acls) > 0) {
44 foreach ($acls as $userid => $aclon) {
51 $before[$userid] = array(
55 $perm->UnsetControl();
57 foreach ($aclon as $k => $pos) {
58 if (intval($pos) > 0)
$perm->SetControlP($pos);
65 $after[$userid] = array(
72 $doc->recomputeProfiledDocument();
75 foreach ($acls as $userid => $aclon) {
79 $q->AddQuery(getsqlcond($tuid,
"id"));
80 $l =
$q->Query(0, 0,
"TABLE");
84 foreach ($l as $k => $v) {
85 $tuname[$v[
"id"]] = $v[
"firstname"] .
' ' . $v[
"lastname"];
90 $q->AddQuery(getsqlcond($tuid,
"num"));
91 $l =
$q->Query(0, 0,
"TABLE");
93 foreach ($l as $k => $v) {
94 $tuname[$v[
"num"]] = sprintf(_(
"attribute %s") , $v[
"id"]);
99 foreach (
$doc->dacls as $k => $v) {
100 $posacls[$k] = $v[
"pos"];
103 foreach ($before as $k => $v) {
109 foreach (
$doc->acls as $acl) {
110 $pos = $posacls[$acl];
112 $a0 = (
$a & (1 << $pos));
113 $b0 = ($b & (1 << $pos));
115 if ($a0) $tadd[] = $acl;
120 if (count($tadd) > 0) $tc[] = sprintf(_(
"Add acl %s for %s") , implode(
", ", $tadd) , $tuname[$k]);
121 if (count($tdel) > 0) $tc[] = sprintf(_(
"Delete acl %s for %s") , implode(
", ", $tdel) , $tuname[$k]);
124 if (count($tc) > 0)
$doc->addComment(sprintf(_(
"Change control :\n %s") , implode(
"\n", $tc)));