Rev 2 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php/*acls.phpCopyright (c) 2002, Hendrik Mans <hendrik@mans.de>Copyright 2002, 2003 David DELONCopyright 2002, 2003 Charles NEPOTECopyright 2003 Eric FELDSTEINCopyright 2003 Jean-Pascal MILCENTAll rights reserved.Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:1. Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.3. The name of the author may not be used to endorse or promote productsderived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIESOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUTNOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OFTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*///vérification de sécuritéif (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {die ("accès direct interdit");}echo $this->Header();?><div class="page"><?phpif ($this->UserIsOwner()){if ($_POST){// store lists$this->SaveAcl($this->GetPageTag(), "read", $_POST["read_acl"]);$this->SaveAcl($this->GetPageTag(), "write", $_POST["write_acl"]);$this->SaveAcl($this->GetPageTag(), "comment", $_POST["comment_acl"]);$message = "Droits d\'accès mis à jour ";//$message = "Access control lists updated";// change owner?if ($newowner = $_POST["newowner"]){$this->SetPageOwner($this->GetPageTag(), $newowner);$message .= " et changement du propriétaire. Nouveau propriétaire : ".$newowner;//$message .= " and gave ownership to ".$newowner;}// redirect back to page$this->SetMessage($message."!");$this->Redirect($this->Href());}else{// load acls$readACL = $this->LoadAcl($this->GetPageTag(), "read");$writeACL = $this->LoadAcl($this->GetPageTag(), "write");$commentACL = $this->LoadAcl($this->GetPageTag(), "comment");// show form?><h3>Liste des droits d'accès de la page <?php echo $this->ComposeLinkToPage($this->GetPageTag()) ?></h3><!-- Access Control Lists for--><br /><?php echo $this->FormOpen("acls") ?><table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" style="padding-right: 20px"><b>Droits de lecture :</b><br /><!-- Read ACL:--><textarea name="read_acl" rows="4" cols="20"><?php echo $readACL["list"] ?></textarea></td><td valign="top" style="padding-right: 20px"><b>Droits d'écriture :</b><br /><!-- Write ACL:--><textarea name="write_acl" rows="4" cols="20"><?php echo $writeACL["list"] ?></textarea></td><td valign="top" style="padding-right: 20px"><b>Droits des commentaires :</b><br /><!-- Comments ACL:--><textarea name="comment_acl" rows="4" cols="20"><?php echo $commentACL["list"] ?></textarea></td></tr><tr><td colspan="3"><b>Changer le propriétaire :</b><br /><!-- Set Owner:--><select name="newowner"><option value="">Ne rien modifier</option><!-- Don't change--><option value=""></option><?phpif ($users = $this->LoadUsers()){foreach($users as $user){echo "<option value=\"",htmlentities($user["name"]),"\">",$user["name"],"</option>\n";}}?></select></td></tr><tr><td colspan="3"><br /><input type="submit" value="Enregistrer" style="width: 120px" accesskey="s" /><!-- Store ACLs--><input type="button" value="Annuler" onclick="history.back();" style="width: 120px" /><!-- Cancel --></td></tr></table><?phpecho$this->FormClose();}}else{echo"<i>Vous n'êtes pas le propriétaire de cette page.</i>";//echo"<i>You're not the owner of this page.</i>";}?></div><?php echo $this->Footer(); ?>