promo lists
authorx2000habouzit <x2000habouzit>
Sat, 25 Sep 2004 14:56:53 +0000 (14:56 +0000)
committerx2000habouzit <x2000habouzit>
Sat, 25 Sep 2004 14:56:53 +0000 (14:56 +0000)
htdocs/listes/index.php
templates/listes/index.tpl

index ad6f885..b459d0f 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.php,v 1.4 2004-09-23 15:40:45 x2000habouzit Exp $
+        $Id: index.php,v 1.5 2004-09-25 14:56:53 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -38,6 +38,12 @@ if(isset($_GET['add'])) {
     $client->subscribe('polytechnique.org',$_GET['add']);
     header('Location: index.php');
 }
+if(isset($_POST['promo_add'])) {
+    $promo = intval($_POST['promo_add']);
+    if($promo>=1900 and $promo<2100) {
+       $client->subscribe('polytechnique.org',"promo$promo");
+    }
+}
 
 $listes = $client->get_lists('polytechnique.org');
 $page->assign_by_ref('listes',$listes);
index e3751d4..0ccc616 100644 (file)
@@ -17,7 +17,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: index.tpl,v 1.6 2004-09-23 15:40:46 x2000habouzit Exp $
+        $Id: index.tpl,v 1.7 2004-09-25 14:56:53 x2000habouzit Exp $
  ***************************************************************************}
 
 <div class="rubrique">
@@ -64,7 +64,7 @@ Les listes de diffusion publiques sont visibles par tous les X inscrits 
 {include file='listes/listes.inc.tpl' min=0}
 
 <div class="rubrique">
-  Listes de diffusion privées
+  Listes de diffusion privées (et de promo)
 </div>
 
 <p>
@@ -73,6 +73,24 @@ Si tu te d
 
 {include file='listes/listes.inc.tpl' min=1}
 
+<br />
+
+<form method='post' action='{$smarty.server.REQUEST_URI}'>
+  <table class='tinybicol' cellspacing='0' cellpadding='2'>
+    <tr>
+      <th colspan='2'>Inscription à une liste de diffusion promo</th>
+    </tr>
+    <tr>
+      <td class='titre'>Promotion:</td>
+      <td>
+        <input type='text' size='4' maxlength='4' name='promo_add' />
+        &nbsp;
+        <input type='submit' value="m'inscrire" />
+      </td>
+    </tr>
+  </table>
+</form>
+
 {perms level=admin}
 <div class="rubrique">
   Listes d'administration