projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Let say... start porting module/profile.php
[platal.git]
/
modules
/
xnetgrp
/
mail.inc.php
diff --git
a/modules/xnetgrp/mail.inc.php
b/modules/xnetgrp/mail.inc.php
index
6040e30
..
a998e99
100644
(file)
--- a/
modules/xnetgrp/mail.inc.php
+++ b/
modules/xnetgrp/mail.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
6
Polytechnique.org *
+ * Copyright (C) 2003-200
8
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-21,12
+21,12
@@
// {{{ get_all_redirects
// {{{ get_all_redirects
-function get_all_redirects($membres, $
exclude, $
mls, &$client)
+function get_all_redirects($membres, $mls, &$client)
{
global $globals;
{
global $globals;
-
+
$tos = array();
$tos = array();
-
+
if (!empty($membres)) {
$membres = array_map(create_function('$str', 'return "\"$str\"";'), $membres);
$membres = join(',', $membres);
if (!empty($membres)) {
$membres = array_map(create_function('$str', 'return "\"$str\"";'), $membres);
$membres = join(',', $membres);
@@
-76,13
+76,13
@@
function get_all_redirects($membres, $exclude, $mls, &$client)
// }}}
// {{{ _send_xnet_mail
// }}}
// {{{ _send_xnet_mail
-function _send_xnet_mail($user, $body, $mailer, $replyto = null)
+function _send_xnet_mail($user, $body, $
wiki, $
mailer, $replyto = null)
{
{
- $cher = isset($user['sexe']) ? ($user['sexe'] ? 'Ch
è
re' : 'Cher') : 'Cher(e)';
+ $cher = isset($user['sexe']) ? ($user['sexe'] ? 'Ch
è
re' : 'Cher') : 'Cher(e)';
$nom = isset($user['nom']) ? $user['nom'] : "";
$nom = isset($user['nom']) ? $user['nom'] : "";
- $pnom = isset($user['prenom']) ? $user['prenom'] : preg_replace('!@.*!', '', $user['email']);
+ $pnom = isset($user['prenom']) ? $user['prenom'] : preg_replace('!@.*!
u
', '', $user['email']);
$to = isset($user['prenom']) ? "\"{$user['prenom']} {$user['nom']}\" <{$user['email']}>" : $user['email'];
$to = isset($user['prenom']) ? "\"{$user['prenom']} {$user['nom']}\" <{$user['email']}>" : $user['email'];
-
+
$text = $body;
$text = preg_replace('!<cher>!i', $cher, $text);
$text = preg_replace('!<nom>!i', $nom, $text);
$text = $body;
$text = preg_replace('!<cher>!i', $cher, $text);
$text = preg_replace('!<nom>!i', $nom, $text);
@@
-92,14
+92,18
@@
function _send_xnet_mail($user, $body, $mailer, $replyto = null)
if ($replyto) {
$mailer->addHeader('Reply-To', $replyto);
}
if ($replyto) {
$mailer->addHeader('Reply-To', $replyto);
}
- $mailer->setTxtBody(wordwrap($text, 72));
+ if ($wiki) {
+ $mailer->setWikiBody($text);
+ } else {
+ $mailer->setTxtBody(wordwrap($text, 72));
+ }
$mailer->send();
}
// }}}
// {{{ send_xnet_mails
$mailer->send();
}
// }}}
// {{{ send_xnet_mails
-function send_xnet_mails($from, $sujet, $body, $
tos, $replyto = null, $attach
= null)
+function send_xnet_mails($from, $sujet, $body, $
wiki, $tos, $replyto = null, $upload = null, $name
= null)
{
global $globals;
$sent = array();
{
global $globals;
$sent = array();
@@
-107,20
+111,18
@@
function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null, $attach =
$mailer = new PlMailer();
$mailer->setSubject($sujet);
$mailer->setFrom($from);
$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) {
if ($sent[$user['email']]) continue;
}
foreach ($tos as $user) {
if ($sent[$user['email']]) continue;
- _send_xnet_mail($user, $body, $mailer, $replyto);
+ _send_xnet_mail($user, $body, $
wiki, $
mailer, $replyto);
$sent[$user['email']] = true;
}
}
// }}}
$sent[$user['email']] = true;
}
}
// }}}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker
enc=utf-8
:
?>
?>