Platform
3.1
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
modacl.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5
* @package FDL
6
*/
7
/**
8
* Generated Header (not documented yet)
9
*
10
* @author Anakeen 2000
11
* @version $Id: modacl.php,v 1.7 2005/06/28 08:37:46 eric Exp $
12
* @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13
* @package FDL
14
* @subpackage
15
*/
16
/**
17
*/
18
// ---------------------------------------------------------------
19
// $Id: modacl.php,v 1.7 2005/06/28 08:37:46 eric Exp $
20
// $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Fdl/modacl.php,v $
21
// ---------------------------------------------------------------
22
include_once (
"FDL/Class.Doc.php"
);
23
// -----------------------------------
24
function
modacl
(&
$action
)
25
{
26
// -----------------------------------
27
// get all parameters
28
$userid =
GetHttpVars
(
"userid"
);
29
30
$aclp =
GetHttpVars
(
"aclup"
);
// ACL + (more access)
31
$acln =
GetHttpVars
(
"aclun"
);
// ACL - (less access)
32
$docid
=
GetHttpVars
(
"docid"
);
// oid for controlled object
33
$dbaccess
=
$action
->GetParam(
"FREEDOM_DB"
);
34
35
$doc
=
new_Doc
(
$dbaccess
,
$docid
);
36
// test if current user can modify ACL
37
$err
=
$doc
->Control(
"modifyacl"
);
38
if
(
$err
!=
""
)
$action
->exitError(
$err
);
39
40
$perm
=
new
DocPerm
(
$dbaccess
, array(
41
$docid
,
42
$userid
43
));
44
45
$perm
->UnSetControl();
46
47
if
(is_array($aclp)) {
48
while
(list($k, $v) = each($aclp)) {
49
$perm
->SetControlP($v);
50
}
51
}
52
if
(is_array($acln)) {
53
while
(list($k, $v) = each($acln)) {
54
$perm
->SetControlN($v);
55
}
56
}
57
58
if
(
$perm
->isAffected())
$perm
->modify();
59
else
$perm
->Add();
60
61
RedirectSender
(
$action
);
62
}
63
?>
← centre documentaire
© anakeen
- published under
CC License
-
Dynacase