backport
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Mon, 23 May 2005 11:33:18 +0000 (11:33 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:29:01 +0000 (23:29 +0200)
Patches applied:

 * opensource@polytechnique.org--2005/platal--release--0.9.6--patch-16
   fix x.net Mail lists

git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-651

htdocs.net/groupe/listes-admin.php
htdocs.net/groupe/listes-archives.php
htdocs.net/groupe/listes-moderate.php
htdocs/listes/admin.php
htdocs/listes/archives.php
htdocs/listes/moderate.php

index bfd9196..c63934d 100644 (file)
@@ -21,7 +21,8 @@
 
 require_once 'xnet.inc.php';
 if (!Env::has('liste')) header('Location: listes.php');
-$liste = strtolower(Env::get('liste'));
+$liste  = strtolower(Env::get('liste'));
+$domain = $globals->asso('mail_domain');
 
 new_group_page('listes/admin.tpl');
 
index 61597ed..2bc1a40 100644 (file)
@@ -21,7 +21,8 @@
 
 require_once 'xnet.inc.php';
 if (!Env::has('liste')) header('Location: listes.php');
-$liste = strtolower(Env::get('liste'));
+$liste  = strtolower(Env::get('liste'));
+$domain = $globals->asso('mail_domain');
 
 new_group_page('listes/archives.tpl');
 
index 44a660e..286aca0 100644 (file)
@@ -21,7 +21,8 @@
 
 require_once 'xnet.inc.php';
 if (!Env::has('liste')) header('Location: listes.php');
-$liste = strtolower(Env::get('liste'));
+$liste  = strtolower(Env::get('liste'));
+$domain = $globals->asso('mail_domain');
 
 if (preg_match("!(?:[a-z0-9]+\\.)?{".$globals->asso('mail_domain')."}_(.*)!", $liste, $matches)) {
     header("Location: {$_SERVER['PHP_SELF']}?liste={$matches[1]}");
index 59d7814..514bbc5 100644 (file)
@@ -22,7 +22,8 @@
 if (!$page) {
     require_once("xorg.inc.php");
     if (!Env::has('liste')) header('Location: index.php');
-    $liste = strtolower(Env::get('liste'));
+    $liste  = strtolower(Env::get('liste'));
+    $domain = $globals->mail->domain;
 
     new_skinned_page('listes/admin.tpl', AUTH_MDP);
     require_once('lists.inc.php');
@@ -45,7 +46,7 @@ if (Env::has('add_member')) {
 }
 
 if (Env::has('del_member')) {
-    $client->mass_unsubscribe($liste, Array(Env::get('del_member').'@'.$globals->mail->domain));
+    $client->mass_unsubscribe($liste, Array(Env::get('del_member').'@'.$domain));
     header("Location: {$_SERVER['PHP_SELF']}?liste=$liste");
 }
 
@@ -61,7 +62,7 @@ if (Env::has('add_owner')) {
 }
 
 if (Env::has('del_owner')) {
-    $client->del_owner($liste, Env::get('del_owner').'@'.$globals->mail->domain);
+    $client->del_owner($liste, Env::get('del_owner').'@'.$domain);
     header("Location: {$_SERVER['PHP_SELF']}?liste=$liste");
 }
 
index f163945..68169ed 100644 (file)
@@ -23,6 +23,7 @@ if (!$page) {
     require_once("xorg.inc.php");
     if (!Env::has('liste')) header('Location: index.php');
     $liste = strtolower(Env::get('liste'));
+    $domain = $globals->mail->domain;
 
     new_skinned_page('listes/archives.tpl', AUTH_COOKIE);
     require_once('lists.inc.php');
@@ -40,11 +41,11 @@ if (list($det) = $client->get_members($liste)) {
         if(strstr('/', $file)!==false || !preg_match(',^\d+/\d+$,', $rep)) {
             $page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
         } else { 
-            $page->assign('archives', $globals->lists->spool."/{$globals->mail->domain}{$globals->lists->vhost_sep}$liste/$rep/$file");
+            $page->assign('archives', $globals->lists->spool."/{$domain}{$globals->lists->vhost_sep}$liste/$rep/$file");
         }
     } else {
         $archs = Array();
-        foreach (glob($globals->lists->spool."/{$globals->mail->domain}{$globals->lists->vhost_sep}$liste/*/*") as $rep) {
+        foreach (glob($globals->lists->spool."/{$domain}{$globals->lists->vhost_sep}$liste/*/*") as $rep) {
             if (preg_match(",/(\d*)/(\d*)$,", $rep, $matches)) {
                 $archs[intval($matches[1])][intval($matches[2])] = true;
             }
index a2609b9..cda7d4f 100644 (file)
@@ -23,8 +23,9 @@ if (!$page) {
     require_once("xorg.inc.php");
     if (!Env::has('liste')) header('Location: index.php');
     $liste = strtolower(Env::get('liste'));
+    $domain = $globals->mail->domain;
 
-    if (preg_match("!(?:[a-z0-9]+\\.)?{$globals->mail->domain}_(.*)!", $liste, $matches)) {
+    if (preg_match("!(?:[a-z0-9]+\\.)?{$domain}_(.*)!", $liste, $matches)) {
         header("Location: {$_SERVER['PHP_SELF']}?liste={$matches[1]}");
     }
 
@@ -79,9 +80,9 @@ if(Env::has('mid')) {
                 .$append;
         require_once('diogenes/diogenes.hermes.inc.php');
         $mailer = new HermesMailer();
-        $mailer->addTo("$liste-owner@{$globals->mail->domain}");
-        $mailer->setFrom("$liste-bounces@{$globals->mail->domain}");
-        $mailer->addHeader('Reply-To', "$liste-owner@{$globals->mail->domain}");
+        $mailer->addTo("$liste-owner@{$domain}");
+        $mailer->setFrom("$liste-bounces@{$domain}");
+        $mailer->addHeader('Reply-To', "$liste-owner@{$domain}");
         $mailer->setSubject($subject);
         $mailer->setTxtBody(wordwrap($texte,72));
         $mailer->send();
@@ -90,7 +91,7 @@ if(Env::has('mid')) {
 
     if(Get::has('mid') && is_array($mail)) {
        $msg = file_get_contents('/etc/mailman/fr/refuse.txt');
-       $msg = str_replace("%(adminaddr)s","$liste-owner@{$globals->mail->domain}", $msg);
+       $msg = str_replace("%(adminaddr)s","$liste-owner@{$domain}", $msg);
        $msg = str_replace("%(request)s","<< SUJET DU MAIL >>", $msg);
        $msg = str_replace("%(reason)s","<< TON EXPLICATION >>", $msg);
        $msg = str_replace("%(listname)s","$liste", $msg);