not used anymore
authorx2000habouzit <x2000habouzit>
Fri, 8 Oct 2004 11:30:46 +0000 (11:30 +0000)
committerx2000habouzit <x2000habouzit>
Fri, 8 Oct 2004 11:30:46 +0000 (11:30 +0000)
htdocs/admin/postfix_blacklist.php
templates/admin/postfix.common.tpl [deleted file]

index 7ce35b7..73e1816 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: postfix_blacklist.php,v 1.6 2004-09-02 23:33:56 x2000bedo Exp $
+        $Id: postfix_blacklist.php,v 1.7 2004-10-08 11:30:46 x2000habouzit Exp $
  ***************************************************************************/
 
-require("auto.prepend.inc.php");
-new_admin_page('admin/postfix.common.tpl');
+require('auto.prepend.inc.php');
+new_admin_table_editor('postfix_blacklist','email',true);
 
-if(isset($_REQUEST['nomligne'])) {
-    $nomligne = $_REQUEST['nomligne'];
+$editor->assign('title', 'Blacklist de postfix');
+$editor->hide_id();
 
-    if (!empty($_REQUEST['del'])) {
-        exec("/home/web/spam/effacerBlacklist $nomligne {$_SESSION['forlife']}");
-        $page->assign('erreur', "Action: DEL($nomligne)");
-    } else if (!empty($_REQUEST['add'])) {
-        exec("/home/web/spam/ajouterBlacklist ".$nomligne);
-        $page->assign('erreur', "Action: ADD($nomligne)");
-    }
-}
+$editor->describe('email','email',true);
+$editor->describe('reject_text','Texte de rejet',true);
 
-$blacklist = Array();
-$fd = @fopen ("/etc/postfix/spamaccess", "r");
-while ($fd && !feof ($fd)) {
-    $buffer = fgets($fd, 4096);
-    if ($buffer[0]!='#' && (strlen($buffer)>1)) { # FIXME $string[i] is deprecated
-        $blacklist[] = $buffer;
-    }
-}
-@fclose($fd);
-
-$page->assign_by_ref('list',$blacklist);
-$page->assign('title','Bannis de polytechnique.org');
-$page->assign('expl','Ne mettre dans les cases que des emails (aucun espace ni commentaire supplĂ©mentaire)');
-$page->run();
+$editor->run();
 ?>
diff --git a/templates/admin/postfix.common.tpl b/templates/admin/postfix.common.tpl
deleted file mode 100644 (file)
index 5a45b90..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-{***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************
-        $Id: postfix.common.tpl,v 1.7 2004-08-31 11:25:39 x2000habouzit Exp $
- ***************************************************************************}
-
-
-{dynamic}
-<p class="erreur">{$erreur}</p>
-
-<div class="rubrique">
-{$title}
-</div>
-
-<a href="{"admin/"|url}">page d'admin</a> |
-<a href="{"admin/postfix_blacklist.php"|url}">blacklist</a> |
-<a href="{"admin/postfix_perm.php"|url}">permissions</a> | 
-<a href="{"admin/postfix_retardes.php"|url}">mails retardĂ©s</a>
-
-<p>
-{$expl}
-</p>
-
-<form method="post" action="{$smarty.server.PHP_SELF}">
-  <div>
-    <input type="text" name="nomligne" size="64" />
-    <input type="submit" name="add" value="Add" />
-  </div>
-</form>
-
-{foreach item=line from=$list}
-<form method="post" action="{$smarty.server.PHP_SELF}">
-  <input type="text" name="nomligne" value="{$line}" size="100" />
-  <input type="submit" name="del" value="Del" />
-</form>
-{/foreach}
-{/dynamic}
-
-{* vim:set et sw=2 sts=2 sws=2: *}