postfix new things
authorx2000habouzit <x2000habouzit>
Fri, 8 Oct 2004 12:04:04 +0000 (12:04 +0000)
committerx2000habouzit <x2000habouzit>
Fri, 8 Oct 2004 12:04:04 +0000 (12:04 +0000)
htdocs/admin/postfix_delayed.php [new file with mode: 0644]
htdocs/admin/postfix_whitelist.php [new file with mode: 0644]
templates/admin/index.tpl
templates/admin/postfix_delayed.tpl [new file with mode: 0644]

diff --git a/htdocs/admin/postfix_delayed.php b/htdocs/admin/postfix_delayed.php
new file mode 100644 (file)
index 0000000..b715fcb
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/***************************************************************************
+ *  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_delayed.php,v 1.1 2004-10-08 12:04:04 x2000habouzit Exp $
+ ***************************************************************************/
+
+require('auto.prepend.inc.php');
+new_admin_page('admin/postfix_delayed.tpl');
+
+
+if (isset($_REQUEST["del"])) {
+    mysql_query("UPDATE postfix_mailseen SET release = 'del' WHERE crc = '".$_REQUEST["crc"]."'");
+    $page->assign('res', $_REQUEST["crc"]." verra tous ses mails supprimés !");
+} else if (isset($_REQUEST["ok"])) {
+    mysql_query("UPDATE postfix_mailseen SET release = 'ok' WHERE crc = '".$_REQUEST["crc"]."'");
+    $page->assign('res', $_REQUEST["crc"]." a le droit de passer !");
+}
+
+$sql = "SELECT  crc, nb, update_time, create_time,
+               FIND_IN_SET('del', release) AS del,
+               FIND_IN_SET('ok', release) AS ok
+         FROM  postfix_mailseen
+        WHERE  nb >= 30
+      ORDER BY  release != ''";
+
+$page->mysql_assign($sql,'mails');
+
+$page->run();
+?>
diff --git a/htdocs/admin/postfix_whitelist.php b/htdocs/admin/postfix_whitelist.php
new file mode 100644 (file)
index 0000000..8c8373c
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+/***************************************************************************
+ *  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_whitelist.php,v 1.1 2004-10-08 12:04:04 x2000habouzit Exp $
+ ***************************************************************************/
+
+require('auto.prepend.inc.php');
+new_admin_table_editor('postfix_whitelist','email',true);
+
+$editor->assign('title', 'Whitelist de postfix');
+$editor->hide_id();
+
+$editor->describe('email','email',true);
+
+$editor->run();
+?>
index 683947b..08d9f4c 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.tpl,v 1.7 2004-09-25 16:30:26 x2000habouzit Exp $
+        $Id: index.tpl,v 1.8 2004-10-08 12:04:05 x2000habouzit Exp $
  ***************************************************************************}
 
 
@@ -28,8 +28,8 @@
   <tr class="impair"><td>
       <strong>Postfix : </strong>
       <a href="postfix_blacklist.php">Blacklist</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="postfix_perm.php">Permissions</a> &nbsp;&nbsp;|&nbsp;&nbsp;
-      <a href="postfix_retardes.php">Retards</a>
+      <a href="postfix_whitelist.php">Whitelist masspam</a> &nbsp;&nbsp;|&nbsp;&nbsp;
+      <a href="postfix_delayed.php">Retardés par masspam</a>
   </td></tr>
   <tr class="pair"><td>
       <strong>Statistiques : </strong>
diff --git a/templates/admin/postfix_delayed.tpl b/templates/admin/postfix_delayed.tpl
new file mode 100644 (file)
index 0000000..cdc832e
--- /dev/null
@@ -0,0 +1,57 @@
+{***************************************************************************
+ *  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_delayed.tpl,v 1.1 2004-10-08 12:04:05 x2000habouzit Exp $
+ ***************************************************************************}
+
+
+<p class='erreur'>{$res}</p>
+<div class="rubrique">
+  Mails en attente de décision
+</div>
+
+<table class="bicol" cellpadding='0' cellspacing='0'>
+  <tr>
+    <th>Checksum</th>
+    <th>Nb mails reçus</th>
+    <th>Dernier reçu</th>
+    <th>Premier reçu</th>
+    <th>Etat</th>
+    <th>Actions</th>
+  </tr>
+  {foreach from=$mails item=m}
+  <tr class="{cycle values="impair,pair"}">
+    <td>{$m.crc}</td>
+    <td><strong>{$m.nb}</strong></td>
+    <td>{$m.update_time}</td>
+    <td>{$m.creation_time}</td>
+    <td><strong>{if $m.del}Poubelle{elseif $m.ok}Autorisé{else}En attente{/if}</strong></td>
+    <td>
+      <form method="post">
+        <input type="hidden" name="crc" value="{$m.crc}" />
+        <input type="submit" name="ok"  value="Laisser passer" />
+        <input type="submit" name="del" value="Effacer les mails" />
+      </form>
+    </td>
+  </tr>
+  {/foreach}
+</table>
+
+{* vim:set et sw=2 sts=2 sws=2: *}