$to = Env::v('to');
$subj = Env::v('sujet');
$from = Env::v('from');
- $cc = Env::v('cc');
- $bcc = Env::v('bcc');
+ $cc = trim(Env::v('cc'));
+ $bcc = trim(Env::v('bcc'));
if (empty($to) && empty($cc) && empty($to2) && empty($bcc) && empty($cc2)) {
$page->trig("Indique au moins un destinataire.");
require_once dirname(__FILE__) . '/xnetgrp/mail.inc.php';
$tos = get_all_redirects($mbr, $mls, $mmlist);
- send_xnet_mails($from, $sujet, $body, $tos, Post::v('replyto'), $_FILES['uploaded']);
+ $upload = PlUpload::get($_FILES['uploaded'], S::v('forlife'), 'xnet.emails', true);
+ send_xnet_mails($from, $sujet, $body, $tos, Post::v('replyto'), $upload, @$_FILES['uploaded']['name']);
+ if ($upload) {
+ $upload->rm();
+ }
$page->kill("Mail envoyé !");
$page->assign('sent', true);
}
// }}}
// {{{ send_xnet_mails
-function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null, $attach = null)
+function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null, $upload = null, $name = null)
{
global $globals;
$sent = array();
$mailer = new PlMailer();
$mailer->setSubject($sujet);
$mailer->setFrom($from);
- if (is_uploaded_file($attach['tmp_name'])) {
- $mailer->addAttachment($attach['tmp_name'],
- $attach['type'],
- $attach['name']);
+ if ($upload && $upload->exists()) {
+ $mailer->addUploadAttachment($upload, $name);
}
foreach ($tos as $user) {
{include file=search/quick.form.tpl show_js=1}
+{if $smarty.session.perms->hasFlag('user')}
<h1>Voir le trombi d'une promotion</h1>
<div id="message" style="position:absolute;"></div><br />
<script type="text/javascript">
- {literal}
+ {liiteral}
function showPromo()
{
var value = document.getElementById('promo').value;
</script>
<form action="" method="post" onsubmit="return showPromo();">
-<table class="tinybicol" style="width: 30%; margin-right: auto; margin-left: auto">
+<table class="tinybicol" style="width: 35%; margin-right: auto; margin-left: auto">
<td class="titre">Promotion :</td>
<td>
<input type="text" name="promo" id="promo" size="4" value="" />
</table>
</form>
+{/if}
+
<h1>Comment faire une recherche ?</h1>
<h2>Nom, Prenom, Promo ...</h2>