20 include_once (
"FDL/Class.Doc.php");
21 include_once (
"FDL/Lib.Dir.php");
44 if (count($acls) > 0) {
46 foreach ($acls as $userid => $aclon) {
55 $doc->removeControl($userid);
56 foreach ($aclon as $k => $aclName) {
58 $doc->addControl($userid, $aclName);
65 $doc->setViewProfil();
67 $doc->recomputeProfiledDocument();
72 foreach ($acls as $userid => $aclon) {
76 $q->AddQuery(getsqlcond($tuid,
"id"));
77 $l =
$q->Query(0, 0,
"TABLE");
81 foreach ($l as $k => $v) {
82 $tuname[$v[
"id"]] = $v[
"firstname"] .
' ' . $v[
"lastname"];
87 $q->AddQuery(getsqlcond($tuid,
"num"));
88 $l =
$q->Query(0, 0,
"TABLE");
90 foreach ($l as $k => $v) {
91 $tuname[$v[
"num"]] = sprintf(_(
"attribute %s") , $v[
"id"]);
96 foreach (
$doc->dacls as $k => $v) {
97 $posacls[$k] = $v[
"pos"];
100 foreach ($before as $uid => $acls) {
104 foreach ($acls as $aclName => $granted) {
105 if (($before[$uid][$aclName] ===
true) && ($after[$uid][$aclName] ===
false)) {
107 } elseif (($before[$uid][$aclName] ===
false) && ($after[$uid][$aclName] ===
true)) {
112 if (count($tadd) > 0) $tc[] = sprintf(_(
"Add acl %s for %s") , implode(
", ", $tadd) , $tuname[$uid]);
113 if (count($tdel) > 0) $tc[] = sprintf(_(
"Delete acl %s for %s") , implode(
", ", $tdel) , $tuname[$uid]);
115 if (count($tc) > 0)
$doc->addHistoryEntry(sprintf(_(
"Change control :\n %s") , implode(
"\n", $tc)));
117 redirect($action,
"FREEDOM", sprintf(
"FREEDOM_GACCESS&id=%s&allgreen=%s&group=%s",
$docid, $action->
getArgument(
"allgreen",
"N") , $action->
getArgument(
"group",
"N")));
123 $doc->userid = $userid;
125 foreach ($doc->acls as $aclName) {
127 else $grant[$aclName] = ($doc->
controlUp($uperm, $aclName) ==
'');
controlUp($uperm, $aclname)
exitError($texterr, $exit=true, $code="")
static getUperm($profid, $userid, $strict=false)
getUserAclNames(Doc &$doc, $userid)
freedom_modaccess(Action &$action)
controlExtId($docid, $aclname, $strict=false)
new_Doc($dbaccess, $id= '', $latest=false)
static getArgument($k, $def= '')
if($file) if($subject==""&&$file) if($subject=="") $err