From: Pierre Habouzit (MadCoder Date: Thu, 21 Apr 2005 13:57:37 +0000 (+0000) Subject: alias-create + fixes X-Git-Tag: xorg/old~183 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7fb8cbfe29ab435a193b75e8ddb827335ee9fa48;p=platal.git alias-create + fixes git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-579 --- diff --git a/htdocs.net/groupe/alias-create.php b/htdocs.net/groupe/alias-create.php new file mode 100644 index 0000000..f76b572 --- /dev/null +++ b/htdocs.net/groupe/alias-create.php @@ -0,0 +1,32 @@ +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(); + +?> diff --git a/templates/xnet/groupe/alias-create.tpl b/templates/xnet/groupe/alias-create.tpl new file mode 100644 index 0000000..782ca14 --- /dev/null +++ b/templates/xnet/groupe/alias-create.tpl @@ -0,0 +1,61 @@ +{*************************************************************************** + * 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 * + ***************************************************************************} + +

Création d'un alias

+

+Les alias sont concus pour répondre aux problèmes suivants : +

+ + +

+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 une liste de diffusion. +

+
+ + + + + + + + +
Caractéristiques de l'alias
Addresse souhaitée : + @{$asso.mail_domain} +
+

+
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/listes.tpl b/templates/xnet/groupe/listes.tpl index 3f96996..1c0773a 100644 --- a/templates/xnet/groupe/listes.tpl +++ b/templates/xnet/groupe/listes.tpl @@ -18,11 +18,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************} - {if $smarty.get.del_alias}

Est tu sur de supprimer l'alias {$smarty.get.del_alias} ?

-
' method="post"> +
@@ -82,7 +81,6 @@ croix verte te permet de t'inscrire, apr {foreachelse} Pas de listes pour ce groupe {/foreach} - {/if}

@@ -109,4 +107,6 @@ t'emp

Aucun alias pour ce groupe

{/if} +{/if} + {* vim:set et sw=2 sts=2 sws=2: *}