<?php
if (isset($_GET['action'])) //we have to show the input form
{
//We show only a form without any data, so no security checks are possible.
//First of all, put all the id_xxx=on into string for easier use
$ids = '';
while(list
($key,
$val)=
each($_GET))
if ($val ==
'on' &&
substr($key,
0,
3) ==
'id_')
//Perhaps it is usefull to use the same as in acls.php
?>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" style="padding-right: 20px">
<strong>Read ACL:</strong><br />
<textarea name="read_acl" rows="4" cols="20"></textarea>
<td>
<td valign="top" style="padding-right: 20px">
<strong>Write ACL:</strong><br />
<textarea name="write_acl" rows="4" cols="20"></textarea>
<td>
<td valign="top" style="padding-right: 20px">
<strong>Comments ACL:</strong><br />
<textarea name="comment_acl" rows="4" cols="20"></textarea>
<td>
</tr>
<tr>
<td colspan="3">
<br />
<input type="hidden" name="action" value="massacls"/>
<input type="hidden" name="ids" value="<?php echo $ids;?>"/>
<input type="submit" value="Store ACLs" style="width: 120px" accesskey="s" />
<input type="button" value="Cancel" onclick="history.back();" style="width: 120px" />
</td>
</tr>
<tr>
<td colspan="3">
<br /><h4>Syntax:</h4><br />
* = Everyone<br />
+ = Registered users<br />
Or enter individual user WikiNames, one per line<br />
--------------------------------------<br />
Note: Any of these items can be negated with a !<br />
!* = No one<br />
!+ = Anonymous users<br />
!JohnDoe = JohnDoe will be denied access.<br />
<br />
<em>Be aware that the ACLs are tested in the order specified.</em>
<br/ >So be sure to specify * on a separate line
<br /><b>after</b> negating any users--not before.
<br/ >Otherwise, the * everyone condition will always give access
<br/ >before the list of users that should not have access is tested.
<td>
</tr>
</table>
<?php
print($this->
FormClose());
}
else if (isset($_POST['action']) &&
$this->
IsAdmin($this->
GetUser())) // we have to do the acl change action
{
function mySaveACL($page, $tag, $acl, $acls)
{
$posted = $_POST[$acl.'_acl'];
//$default = $page->GetConfigValue('default_'.$acl.'_acl');
if ($posted != $acls[$acl.'_acl'])
{
//if ($posted == $default)
// $posted = '';
$page->SaveACL($tag, $acl, $page->TrimACLs($posted));
print ('<p>'.
$acl.
' ACL updated for <a href="'.
$page->
Href('',
$tag,
'').
'">'.
$tag.
'</a></p>');
}
}
foreach (explode('|',
$_POST['ids']) as $id)
if ($id != '')
{
$page = $this->LoadPageById($id);
$tag = $page['tag'];
$acls = $this->LoadAllACLs($tag,0);
mySaveACL($this, $tag, 'read', $acls);
mySaveACL($this, $tag, 'write', $acls);
mySaveACL($this, $tag, 'comment', $acls);
}
}
else
print ('<p>What are you doing here?</a></p>');
print ('<p><a href="'.
$this->
Href('',
'',
'').
'">Seiten - Administration</a></p>');
?>