From 479d278731a6c8a4e5f6dc87194c851ed270906c Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Fri, 14 Jul 2006 20:41:29 +0000 Subject: [PATCH] migrate mail.php git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@486 839d8a87-29fc-0310-9880-83ba4fa771e5 --- htdocs.net/groupe/mail.php | 24 ------------------------ include/xnet/page.inc.php | 2 +- modules/xnetgrp.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 25 deletions(-) delete mode 100644 htdocs.net/groupe/mail.php diff --git a/htdocs.net/groupe/mail.php b/htdocs.net/groupe/mail.php deleted file mode 100644 index f8c8c3d..0000000 --- a/htdocs.net/groupe/mail.php +++ /dev/null @@ -1,24 +0,0 @@ -asso('mail_domain')); - $page->assign('listes', $client->get_lists()); - - if (Post::has('send')) { - $from = Post::get('from'); - $sujet = Post::get('sujet'); - $body = Post::get('body'); - - $mls = array_keys(Env::getMixed('ml', array())); - - require_once 'xnet/mail.inc.php'; - $tos = get_all_redirects(Post::has('membres'), $mls, $client); - send_xnet_mails($from, $sujet, $body, $tos, Post::get('replyto')); - $page->kill("Mail envoyé !"); - $page->assign('sent', true); - } - - $page->run(); -?> diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 1b79379..b9a3f6d 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -96,7 +96,7 @@ class XnetPage extends PlatalPage if ($globals->wiki->wikidir && $globals->xnet->wiki) $sub['wiki'] = "$dim/Accueil"; if ($globals->asso('mail_domain')) { - $sub['envoyer un mail'] = "$dim/mail.php"; + $sub['envoyer un mail'] = "$dim/mail"; $sub['créer une liste'] = "$dim/listes-create.php"; $sub['créer un alias'] = "$dim/alias-create.php"; } diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 3b0c455..e6df708 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -28,6 +28,7 @@ class XnetGrpModule extends PLModule 'grp/asso.php' => $this->make_hook('index', AUTH_PUBLIC), 'grp/logo' => $this->make_hook('logo', AUTH_PUBLIC), 'grp/edit' => $this->make_hook('edit', AUTH_MDP), + 'grp/mail' => $this->make_hook('mail', AUTH_MDP), 'grp/annuaire' => $this->make_hook('annuaire', AUTH_MDP), ); } @@ -139,6 +140,33 @@ class XnetGrpModule extends PLModule } } + function handler_mail(&$page) + { + global $globals; + + require_once 'lists.inc.php'; + + new_groupadmin_page('xnet/groupe/mail.tpl'); + $client =& lists_xmlrpc(Session::getInt('uid'), + Session::get('password'), + $globals->asso('mail_domain')); + $page->assign('listes', $client->get_lists()); + + if (Post::has('send')) { + $from = Post::get('from'); + $sujet = Post::get('sujet'); + $body = Post::get('body'); + + $mls = array_keys(Env::getMixed('ml', array())); + + require_once 'xnet/mail.inc.php'; + $tos = get_all_redirects(Post::has('membres'), $mls, $client); + send_xnet_mails($from, $sujet, $body, $tos, Post::get('replyto')); + $page->kill("Mail envoyé !"); + $page->assign('sent', true); + } + } + function handler_annuaire(&$page) { global $globals; -- 2.1.4