--- /dev/null
+<?php
+require 'xnet.inc.php';
+
+new_groupadmin_page('xnet/groupe/alias-create.tpl');
+$page->useMenu();
+$page->setType($globals->asso('cat'));
+
+$page->assign('asso', $globals->asso());
+
+if(Post::has('submit')) {
+ if (!Post::has('liste')) {
+ $page->kill('champs «addresse souhaitée» vide');
+ }
+ $liste = Post::get('liste');
+ if (!preg_match("/^[a-zA-Z0-9\-]*$/", $liste)) {
+ $page->kill('le nom de l\'alias ne doit contenir que des lettres, chiffres et tirets');
+ }
+
+ $new = $liste.'@'.$globals->asso('mail_domain');
+ $res = $globals->xdb->query('SELECT COUNT(*) FROM x4dat.virtual WHERE alias={?}', $new);
+ $n = $res->fetchOneCell();
+ if($n) {
+ $page->kill('cet alias est déjà pris');
+ }
+
+ $globals->xdb->query('INSERT INTO x4dat.virtual (alias,type) VALUES({?}, "user")', $new);
+ header("Location: alias-admin.php?liste=$new");
+}
+
+$page->run();
+
+?>
--- /dev/null
+{***************************************************************************
+ * 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 *
+ ***************************************************************************}
+
+<h1>Création d'un alias</h1>
+<p class='descr'>
+Les alias sont concus pour répondre aux problèmes suivants :
+</p>
+<ul class='descr'>
+ <li>
+ redirections pour les postes des gens au sein du groupe : par exemple il est pratique d'avoir un alias
+ president@..., ou bien tresorier@... qui pointent tout le temps vers la bonne personne du groupe.
+ Une sorte d'adresse de «redirection à vie».
+ </li>
+ <li>
+ listes de diffusions pour de petits nombres de personnes (bureau@ ...)
+ </li>
+ <li>
+ listes à vie courte (liste créée pour l'organisation d'un évenement ponctuel par exemple)
+ </li>
+ <li>
+ fédérer plusieurs listes/alias sous un même nom (ce que ne peuvent faire les listes de diffusion).
+ </li>
+</ul>
+
+<p class='descr'>
+Pour les autres besoins de communications (notament pour un grand nombre de personnes, et pour bénéficier des outils
+de modération), il est recommandé de créer <a href="listes-create.php">une liste de diffusion</a>.
+</p>
+<form action='{$smarty.server.PHP_SELF}' method='post'>
+ <table border='1'>
+ <tr>
+ <th colspan='2'>Caractéristiques de l'alias</th>
+ </tr>
+ <tr>
+ <td><strong>Addresse souhaitée :</strong></td>
+ <td>
+ <input type='text' name='liste' value='{$smarty.post.liste}' />@{$asso.mail_domain}
+ </td>
+ </tr>
+ </table>
+ <center><p><input name='submit' type='submit' value="Créer !" /></p></center>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2: *}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************}
-
{if $smarty.get.del_alias}
<p class="error">Est tu sur de supprimer l'alias {$smarty.get.del_alias} ?</p>
-<form action='<?php echo $_SERVER['PHP_SELF']; ?>' method="post">
+<form action='{$smarty.server.PHP_SELF}' method="post">
<div class="center">
<input type='submit' value="Oui, je suis sur" />
<input type='hidden' name='del_alias' value="{$smarty.get.del_alias}" />
{foreachelse}
<tr><td colspan='6'>Pas de listes pour ce groupe</td></tr>
{/foreach}
- {/if}
</table>
<p class="descr">
<p>Aucun alias pour ce groupe</p>
{/if}
+{/if}
+
{* vim:set et sw=2 sts=2 sws=2: *}