2 /***************************************************************************
3 * Copyright (C) 2003-2007 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 require_once 'banana/banana.inc.php';
23 require_once 'banana/hooks.inc.php';
25 function hook_makeLink($params)
27 global $globals, $platal;
28 $base = $globals->baseurl
. $platal->ns
. '/lists/archives/' . MLBanana
::$listname;
29 return $base . hook_platalMessageLink($params);
32 class MLBanana
extends Banana
34 static public $listname;
35 static public $domain;
37 function __construct($params = null
)
39 Banana
::$spool_boxlist = false
;
40 Banana
::$msgedit_canattach = true
;
41 array_push(Banana
::$msgparse_headers, 'x-org-id', 'x-org-mail');
43 MLBanana
::$listname = $params['listname'];
44 MLBanana
::$domain = $params['domain'];
45 $params['group'] = $params['listname'] . '@' . $params['domain'];
46 parent
::__construct($params, 'MLArchive');
51 global $platal, $globals;
53 $nom = S
::v('prenom') . ' ' . S
::v('nom');
54 $mail = S
::v('bestalias') . '@' . $globals->mail
->domain
;
55 $sig = $nom . ' (' . S
::v('promo') . ')';
56 Banana
::$msgedit_headers['X-Org-Mail'] = S
::v('forlife') . '@' . $globals->mail
->domain
;
59 Banana
::$profile['headers']['From'] = utf8_encode("$nom <$mail>");
60 Banana
::$profile['headers']['Organization'] = 'Utilisateur de Polytechnique.org';
61 Banana
::$profile['signature'] = utf8_encode($sig);
64 Banana
::$page->killPage('forums');
65 Banana
::$page->killPage('subscribe');
72 require_once('banana/mbox.inc.php');
74 class BananaMLArchive
extends BananaMBox
76 public function name()
81 public function filename()
83 return MLBanana
::$domain . '_' . MLBanana
::$listname;
86 protected function getFileName($box)
89 $base = $globals->lists
->spool
;
90 $file = MLBanana
::$domain . $globals->lists
->vhost_sep
. MLBanana
::$listname . '.mbox';
91 return "$base/$file/$file";