From: x2000habouzit Date: Tue, 31 Aug 2004 08:57:24 +0000 (+0000) Subject: various bugfixes, closes FS#18 X-Git-Tag: xorg/old~1666 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=782e0b6dae047d0d87115c03ade45a53fb50b0b6;p=platal.git various bugfixes, closes FS#18 --- diff --git a/htdocs/sendmail.php b/htdocs/sendmail.php index 68778f4..f14f1d2 100644 --- a/htdocs/sendmail.php +++ b/htdocs/sendmail.php @@ -2,6 +2,7 @@ require("auto.prepend.inc.php"); new_skinned_page('sendmail.tpl',AUTH_MDP,true); + // action si on recoit un formulaire if (isset($_REQUEST['submit']) and $_REQUEST['submit'] == 'Envoyer' and isset($_REQUEST['to']) and isset($_REQUEST['sujet']) @@ -9,18 +10,19 @@ if (isset($_REQUEST['submit']) and $_REQUEST['submit'] == 'Envoyer' and isset($_REQUEST['bcc'])) { $autre_to = (isset($_REQUEST['contacts']) ? join(', ',$_REQUEST['contacts']) : ''); + if (get_magic_quotes_gpc()) { + $_REQUEST['contenu'] = str_replace(' ', '', stripslashes($_REQUEST['contenu'])); + $_REQUEST['to'] = stripslashes($_REQUEST['to']); + $_REQUEST['sujet'] = stripslashes($_REQUEST['sujet']); + $_REQUEST['from'] = stripslashes($_REQUEST['from']); + $_REQUEST['cc'] = stripslashes($_REQUEST['cc']); + $_REQUEST['bcc'] = stripslashes($_REQUEST['bcc']); + $autre_to = stripslashes($autre_to); + } + if ($_REQUEST['to'] == '' and $_REQUEST['cc'] == '' and $autre_to == '') { - echo "

\n Indique au moins un destinataire.\n

\n"; + $page->assign('error',"Indique au moins un destinataire."); } else { - if (get_magic_quotes_gpc()) { - $_REQUEST['contenu'] = str_replace(' ', '', stripslashes($_REQUEST['contenu'])); - $_REQUEST['to'] = stripslashes($_REQUEST['to']); - $_REQUEST['sujet'] = stripslashes($_REQUEST['sujet']); - $_REQUEST['from'] = stripslashes($_REQUEST['from']); - $_REQUEST['cc'] = stripslashes($_REQUEST['cc']); - $_REQUEST['bcc'] = stripslashes($_REQUEST['bcc']); - $autre_to = stripslashes($autre_to); - } require("diogenes.mailer.inc.php"); $FROM = "From: {$_REQUEST['from']}"; //$_REQUEST['contenu'] = chunk_split($_REQUEST['contenu'], 76, "\n"); // pas bon, ne tient pas compte des mots diff --git a/templates/sendmail.tpl b/templates/sendmail.tpl index 41cde5a..f71e126 100644 --- a/templates/sendmail.tpl +++ b/templates/sendmail.tpl @@ -1,8 +1,8 @@ -{* $Id: sendmail.tpl,v 1.7 2004-08-29 16:20:42 x2000habouzit Exp $ *} +{* $Id: sendmail.tpl,v 1.8 2004-08-31 08:57:24 x2000habouzit Exp $ *} {dynamic} -{$error} +

{$error}

Envoyer un mail @@ -21,7 +21,19 @@ -
+ + + @@ -52,7 +64,7 @@ @@ -79,9 +91,9 @@ {/if} {if $key is odd} @@ -113,8 +125,7 @@
en-têtes
copie cachée : - +
- {$contact.prenom} {$contact.nom} (X{$contact.promo}) + {$contact.prenom} {$contact.nom} (X{$contact.promo})