"DELETE FROM groupex.membres WHERE uid={?} AND asso_id={?}",
$user['uid'], $globals->asso('id'));
+ $mailer = new PlMailer('xnetgrp/unsubscription-notif.mail.tpl');
+ $res = XDB::iterRow("SELECT a.alias, u.prenom, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom
+ FROM groupex.membres AS m
+ INNER JOIN aliases AS a ON (m.uid = a.id AND FIND_IN_SET('bestalias', a.flags))
+ INNER JOIn auth_user_md5 AS u ON (u.user_id = a.id)
+ WHERE m.asso_id = {?} AND m.perms = 'admin'",
+ $globals->asso('id'));
+ while (list($alias, $prenom, $nom) = $res->next()) {
+ $mailer->addTo("\"$prenom $nom\" <$alias@{$globals->mail->domain}>");
+ }
+ $mailer->assign('group', $globals->asso('nom'));
+ $mailer->assign('prenom', $user['prenom']);
+ $mailer->assign('nom', $user['nom']);
+ $mailer->assign('mail', $user['email2']);
+ $mailer->assign('selfdone', $user['uid'] == S::i('uid'));
+ $mailer->send();
+
$user_same_email = get_infos($user['email']);
$domain = $globals->asso('mail_domain');
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2008 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 *}
+{* *}
+{**************************************************************************}
+
+{config_load file="mails.conf" section="xnet_unsubscription"}
+{if $mail_part eq 'head'}
+{from full=#from#}
+{subject text="[`$group`] Désinscription de `$prenom` `$nom`"}
+{elseif $mail_part eq 'wiki'}
+Chers animateurs du groupe {$group},
+
+{if $selfdone}
+{$prenom} {$nom} ({$mail}) vient de se désinscrire du groupe.
+{else}
+{$prenom} {$nom} ({$mail}) vient d'être désinscrit du groupe par {$smarty.session.prenom} {$smarty.session.nom}.
+{/if}
+
+Cordialement,\\
+L'Equipe de Polytechnique.org
+{/if}
+{* vim:set et sw=2 sts=2 sws=2: *}