433 |
ddelon |
1 |
<div class="page">
|
|
|
2 |
<?php
|
|
|
3 |
|
|
|
4 |
if ($this->UserIsOwner())
|
|
|
5 |
{
|
|
|
6 |
if ($_POST)
|
|
|
7 |
{
|
|
|
8 |
// store lists
|
|
|
9 |
$this->SaveAcl($this->GetPageTag(), "read", $_POST["read_acl"]);
|
|
|
10 |
$this->SaveAcl($this->GetPageTag(), "write", $_POST["write_acl"]);
|
|
|
11 |
$this->SaveAcl($this->GetPageTag(), "comment", $_POST["comment_acl"]);
|
|
|
12 |
$message = "Mise à jour des droits d\'accés";//$message = "Access control lists updated";
|
|
|
13 |
|
|
|
14 |
// change owner?
|
|
|
15 |
if ($newowner = $_POST["newowner"])
|
|
|
16 |
{
|
|
|
17 |
$this->SetPageOwner($this->GetPageTag(), $newowner);
|
|
|
18 |
$message .= " et changement du propriétaire. Nouveau propriétaire : ".$newowner;//$message .= " and gave ownership to ".$newowner;
|
|
|
19 |
}
|
|
|
20 |
|
|
|
21 |
// redirect back to page
|
|
|
22 |
$this->SetMessage($message."!");
|
|
|
23 |
$this->Redirect($this->Href());
|
|
|
24 |
}
|
|
|
25 |
else
|
|
|
26 |
{
|
|
|
27 |
// load acls
|
|
|
28 |
$readACL = $this->LoadAcl($this->GetPageTag(), "read");
|
|
|
29 |
$writeACL = $this->LoadAcl($this->GetPageTag(), "write");
|
|
|
30 |
$commentACL = $this->LoadAcl($this->GetPageTag(), "comment");
|
|
|
31 |
|
|
|
32 |
// show form
|
|
|
33 |
?>
|
|
|
34 |
<h3>Liste des droits d'accés de la page <?php echo $this->ComposeLinkToPage($this->GetPageTag()) ?></h3><!-- Access Control Lists for-->
|
|
|
35 |
<br />
|
|
|
36 |
|
|
|
37 |
<?php echo $this->FormOpen("acls") ?>
|
|
|
38 |
<table border="0" cellspacing="0" cellpadding="0">
|
|
|
39 |
<tr>
|
|
|
40 |
<td valign="top" style="padding-right: 20px">
|
|
|
41 |
<b>Droits de lecture :</b><br /><!-- Read ACL:-->
|
|
|
42 |
<textarea name="read_acl" rows="4" cols="20"><?php echo $readACL["list"] ?></textarea>
|
|
|
43 |
<td>
|
|
|
44 |
<td valign="top" style="padding-right: 20px">
|
|
|
45 |
<b>Droits d'écriture :</b><br /><!-- Write ACL:-->
|
|
|
46 |
<textarea name="write_acl" rows="4" cols="20"><?php echo $writeACL["list"] ?></textarea>
|
|
|
47 |
<td>
|
|
|
48 |
<td valign="top" style="padding-right: 20px">
|
|
|
49 |
<b>Droits des commentaires :</b><br /><!-- Comments ACL:-->
|
|
|
50 |
<textarea name="comment_acl" rows="4" cols="20"><?php echo $commentACL["list"] ?></textarea>
|
|
|
51 |
<td>
|
|
|
52 |
</tr>
|
|
|
53 |
<tr>
|
|
|
54 |
<td colspan="3">
|
|
|
55 |
<b>Changer le propriétaire :</b><br /><!-- Set Owner:-->
|
|
|
56 |
<select name="newowner">
|
|
|
57 |
<option value="">Ne rien modifier</option><!-- Don't change-->
|
|
|
58 |
<option value=""></option>
|
|
|
59 |
<?php
|
|
|
60 |
if ($users = $this->LoadUsers())
|
|
|
61 |
{
|
|
|
62 |
foreach($users as $user)
|
|
|
63 |
{
|
|
|
64 |
print("<option value=\"".htmlentities($user["name"])."\">".$user["name"]."</option>\n");
|
|
|
65 |
}
|
|
|
66 |
}
|
|
|
67 |
?>
|
|
|
68 |
</select>
|
|
|
69 |
<td>
|
|
|
70 |
</tr>
|
|
|
71 |
<tr>
|
|
|
72 |
<td colspan="3">
|
|
|
73 |
<br />
|
|
|
74 |
<input type="submit" value="Enregistrer" style="width: 120px" accesskey="s"><!-- Store ACLs-->
|
|
|
75 |
<input type="button" value="Annuler" onClick="history.back();" style="width: 120px"><!-- Cancel -->
|
|
|
76 |
</td>
|
|
|
77 |
</tr>
|
|
|
78 |
</table>
|
|
|
79 |
<?php
|
|
|
80 |
print($this->FormClose());
|
|
|
81 |
}
|
|
|
82 |
}
|
|
|
83 |
else
|
|
|
84 |
{
|
|
|
85 |
print("<i>Vous n'êtes pas le propriétaire de cette page.</i>");
|
|
|
86 |
//print("<i>You're not the owner of this page.</i>");
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
?>
|
|
|
90 |
</div>
|