[ Index ]
 

Code source de WikiNi 0.4.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/handlers/page/ -> acls.php (source)

   1  <?php
   2  /*
   3  acls.php
   4  Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
   5  Copyright 2002, 2003 David DELON
   6  Copyright 2002, 2003 Charles NEPOTE
   7  Copyright  2003  Eric FELDSTEIN
   8  Copyright  2003  Jean-Pascal MILCENT
   9  All rights reserved.
  10  Redistribution and use in source and binary forms, with or without
  11  modification, are permitted provided that the following conditions
  12  are met:
  13  1. Redistributions of source code must retain the above copyright
  14  notice, this list of conditions and the following disclaimer.
  15  2. Redistributions in binary form must reproduce the above copyright
  16  notice, this list of conditions and the following disclaimer in the
  17  documentation and/or other materials provided with the distribution.
  18  3. The name of the author may not be used to endorse or promote products
  19  derived from this software without specific prior written permission.
  20  
  21  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  22  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  23  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  24  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  25  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  26  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  30  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32  //vérification de sécurité
  33  if (!eregi("wakka.php", $_SERVER['PHP_SELF'])) {
  34      die ("acc&egrave;s direct interdit");
  35  }
  36  echo $this->Header();
  37  ?>
  38  <div class="page">
  39  <?php
  40  
  41  if ($this->UserIsOwner())
  42  {
  43      if ($_POST)
  44      {
  45          // store lists
  46          $this->SaveAcl($this->GetPageTag(), "read", $_POST["read_acl"]);
  47          $this->SaveAcl($this->GetPageTag(), "write", $_POST["write_acl"]);
  48          $this->SaveAcl($this->GetPageTag(), "comment", $_POST["comment_acl"]);
  49          $message = "Droits d\'acc&egrave;s mis &agrave; jour ";//$message = "Access control lists updated";
  50          
  51          // change owner?
  52          if ($newowner = $_POST["newowner"])
  53          {
  54              $this->SetPageOwner($this->GetPageTag(), $newowner);
  55              $message .= " et changement du propri&eacute;taire. Nouveau propri&eacute;taire : ".$newowner;//$message .= " and gave ownership to ".$newowner;
  56          }
  57  
  58          // redirect back to page
  59          $this->SetMessage($message."!");
  60          $this->Redirect($this->Href());
  61      }
  62      else
  63      {
  64          // load acls
  65          $readACL = $this->LoadAcl($this->GetPageTag(), "read");
  66          $writeACL = $this->LoadAcl($this->GetPageTag(), "write");
  67          $commentACL = $this->LoadAcl($this->GetPageTag(), "comment");
  68  
  69          // show form
  70          ?>
  71          <h3>Liste des droits d'acc&egrave;s de la page  <?php echo  $this->ComposeLinkToPage($this->GetPageTag()) ?></h3><!-- Access Control Lists for-->
  72          <br />
  73          
  74          <?php echo  $this->FormOpen("acls") ?>
  75          <table border="0" cellspacing="0" cellpadding="0">
  76              <tr>
  77                  <td valign="top" style="padding-right: 20px">
  78                      <b>Droits de lecture :</b><br /><!-- Read ACL:-->
  79                      <textarea name="read_acl" rows="4" cols="20"><?php echo  $readACL["list"] ?></textarea>
  80                  </td>
  81                  <td valign="top" style="padding-right: 20px">
  82                      <b>Droits d'&eacute;criture :</b><br /><!-- Write ACL:-->
  83                      <textarea name="write_acl" rows="4" cols="20"><?php echo  $writeACL["list"] ?></textarea>
  84                  </td>
  85                  <td valign="top" style="padding-right: 20px">
  86                      <b>Droits des commentaires :</b><br /><!-- Comments ACL:-->
  87                      <textarea name="comment_acl" rows="4" cols="20"><?php echo  $commentACL["list"] ?></textarea>
  88                  </td>
  89              </tr>
  90              <tr>
  91                  <td colspan="3">
  92                      <b>Changer le propri&eacute;taire :</b><br /><!-- Set Owner:-->
  93                      <select name="newowner">
  94                          <option value="">Ne rien modifier</option><!-- Don't change-->
  95                          <option value="">&nbsp;</option>
  96                          <?php
  97                          if ($users = $this->LoadUsers())
  98                          {
  99                              foreach($users as $user)
 100                              {
 101                                  echo "<option value=\"",htmlentities($user["name"]),"\">",$user["name"],"</option>\n";
 102                              }
 103                          }
 104                          ?>
 105                      </select>
 106                  </td>
 107              </tr>
 108              <tr>
 109                  <td colspan="3">
 110                      <br />
 111                      <input type="submit" value="Enregistrer" style="width: 120px" accesskey="s" /><!-- Store ACLs-->
 112                      <input type="button" value="Annuler" onclick="history.back();" style="width: 120px" /><!-- Cancel -->
 113                  </td>
 114              </tr>
 115          </table>
 116          <?php
 117          echo$this->FormClose();
 118      }
 119  }
 120  else
 121  {
 122      echo"<i>Vous n'&ecirc;tes pas le propri&eacute;taire de cette page.</i>";
 123      //echo"<i>You're not the owner of this page.</i>";
 124  }
 125  
 126  ?>
 127  </div>
 128  <?php echo $this->Footer(); ?>


Généré le : Mon Nov 26 12:05:46 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics