migrate mail.php
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 14 Jul 2006 20:41:29 +0000 (20:41 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 14 Jul 2006 20:41:29 +0000 (20:41 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@486 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs.net/groupe/mail.php [deleted file]
include/xnet/page.inc.php
modules/xnetgrp.php

diff --git a/htdocs.net/groupe/mail.php b/htdocs.net/groupe/mail.php
deleted file mode 100644 (file)
index f8c8c3d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-    require_once 'xnet.inc.php';
-    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);
-    }
-
-    $page->run();
-?>
index 1b79379..b9a3f6d 100644 (file)
@@ -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";
             }
index 3b0c455..e6df708 100644 (file)
@@ -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;