[ Index ]
 

Code source de GeekLog 1.4.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/plugins/spamx/ -> SLVwhitelist.Admin.class.php (source)

   1  <?php
   2  
   3  /**
   4  * File: SLVwhitelist.Admin.class.php
   5  * This is the SLV Whitelist Module for the Geeklog Spam-X plugin
   6  *
   7  * Copyright (C) 2004-2006 by the following authors:
   8  * Author   Tom Willett     tomw AT pigstye DOT net
   9  *          Dirk Haun       dirk AT haun-online DOT de
  10  *
  11  * Licensed under GNU General Public License
  12  *
  13  * $Id: SLVwhitelist.Admin.class.php,v 1.1 2006/09/02 15:35:46 dhaun Exp $
  14  */
  15  
  16  if (strpos ($_SERVER['PHP_SELF'], 'SLVwhitelist.Admin.class.php') !== false) {
  17      die ('This file can not be used on its own!');
  18  }
  19  
  20  /**
  21  * SLV Whitelist Editor
  22  */
  23  
  24  require_once ($_CONF['path'] . 'plugins/spamx/BaseAdmin.class.php');
  25  
  26  class SLVwhitelist extends BaseAdmin {
  27      /**
  28       * Constructor
  29       */
  30      function display()
  31      {
  32          global $_CONF, $_TABLES, $LANG_SX00;
  33  
  34          $action = '';
  35          if (isset ($_GET['action'])) {
  36              $action = COM_applyFilter ($_GET['action']);
  37          } else if (isset ($_POST['paction'])) {
  38              $action = COM_applyFilter ($_POST['paction']);
  39          } 
  40  
  41          $entry = '';
  42          if (isset ($_GET['entry'])) {
  43              $entry = COM_stripslashes ($_GET['entry']);
  44          } else if (isset ($_POST['pentry'])) {
  45              $entry = COM_stripslashes ($_POST['pentry']);
  46          }
  47  
  48          if ($action == 'delete') {
  49              $entry = addslashes ($entry);
  50              $result = DB_query ("DELETE FROM {$_TABLES['spamx']} WHERE name = 'SLVwhitelist' AND value = '$entry'");
  51          } elseif ($action == $LANG_SX00['addentry']) {
  52              if (!empty ($entry)) {
  53                  $entry = addslashes ($entry);
  54                  $result = DB_query ("INSERT INTO {$_TABLES['spamx']} VALUES ('SLVwhitelist', '$entry')");
  55              }
  56          }
  57  
  58          $display = '<hr>' . LB . '<p><b>';
  59          $display .= $LANG_SX00['slvwhitelist'];
  60          $display .= '</b></p>' . LB . '<ul>' . LB;
  61          $result = DB_query ("SELECT value FROM {$_TABLES['spamx']} WHERE name = 'SLVwhitelist'");
  62          $nrows = DB_numRows ($result);
  63          for ($i = 0; $i < $nrows; $i++) {
  64              $A = DB_fetchArray ($result);
  65              $e = $A['value'];
  66              $display .= '<li><a href="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=SLVwhitelist&amp;action=delete&amp;entry=' . urlencode ($e) . '">' . htmlspecialchars ($e) . '</a></li>' . LB;
  67          }
  68          $display .= '</ul>' . LB . '<p>' . $LANG_SX00['e1'] . '</p>' . LB;
  69          $display .= '<p>' . $LANG_SX00['e2'] . '</p>' . LB;
  70          $display .= '<form method="POST" action="' . $_CONF['site_admin_url'] . '/plugins/spamx/index.php?command=SLVwhitelist">' . LB;
  71          $display .= '<input type="text" size ="30" name="pentry">&nbsp;&nbsp;&nbsp;';
  72          $display .= '<input type="submit" name="paction" value="' . $LANG_SX00['addentry'] . '">' . LB;
  73          $display .= '</form>' . LB;
  74  
  75          return $display;
  76      }
  77  
  78      function link()
  79      {
  80          return 'Edit SLV Whitelist';
  81      }
  82  }
  83  
  84  ?>


Généré le : Wed Nov 21 12:27:40 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics