| Line 17... |
Line 17... |
| 17 |
// | |
|
17 |
// | |
|
| 18 |
// | You should have received a copy of the GNU General Public |
|
18 |
// | You should have received a copy of the GNU General Public |
|
| 19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
| 20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
| 22 |
// CVS : $Id: ezmlm-parser.php,v 1.5 2008-11-19 09:28:46 aperonnet Exp $
|
22 |
// CVS : $Id: ezmlm-parser.php,v 1.3 2007/04/19 15:34:35 neiluj Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
* Application projet
|
24 |
* Application projet
|
| 25 |
*
|
25 |
*
|
| 26 |
* classe ezmlm_parser pour lire les fichiers d index de ezmlm-idx
|
26 |
* classe ezmlm_parser pour lire les fichiers d index de ezmlm-idx
|
| 27 |
*
|
27 |
*
|
| 28 |
*@package projet
|
28 |
*@package projet
|
| 29 |
//Auteur original : ?? recupere dans ezmlm-php
|
29 |
//Auteur original : ?? recupere dans ezmlm-php
|
| 30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
| 31 |
*@copyright Tela-Botanica 2000-2004
|
31 |
*@copyright Tela-Botanica 2000-2004
|
| 32 |
*@version $Revision: 1.5 $
|
32 |
*@version $Revision: 1.3 $
|
| 33 |
// +------------------------------------------------------------------------------------------------------+
|
33 |
// +------------------------------------------------------------------------------------------------------+
|
| 34 |
*/
|
34 |
*/
|
| Line 35... |
Line 35... |
| 35 |
|
35 |
|
| 36 |
|
36 |
|
| 37 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 38... |
Line 38... |
| 38 |
// | ENTETE du PROGRAMME |
|
38 |
// | ENTETE du PROGRAMME |
|
| 39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 40... |
Line 40... |
| 40 |
|
40 |
|
| 41 |
// $Id: ezmlm-parser.php,v 1.5 2008-11-19 09:28:46 aperonnet Exp $
|
41 |
// $Id: ezmlm-parser.php,v 1.3 2007/04/19 15:34:35 neiluj Exp $
|
| 42 |
//
|
42 |
//
|
| Line 85... |
Line 85... |
| 85 |
function recent_msgs($show = 20, $month = "") {
|
85 |
function recent_msgs($show = 20, $month = "") {
|
| Line 86... |
Line 86... |
| 86 |
|
86 |
|
| Line 87... |
Line 87... |
| 87 |
$repertoire_archive = opendir($this->listdir . "/archive/");
|
87 |
$repertoire_archive = opendir($this->listdir . "/archive/");
|
| - |
|
88 |
|
| - |
|
89 |
$repertoire_message = array() ;
|
| - |
|
90 |
$dernier_repertoire = 0 ;
|
| - |
|
91 |
while (false !== ($item = readdir($repertoire_archive))) {
|
| 88 |
|
92 |
// $item contient les noms des repertoires
|
| 89 |
$repertoire_message = array() ;
|
93 |
// on ne garde que ceux qui sont des chiffres
|
| - |
|
94 |
|
| 90 |
|
95 |
if (preg_match('/[0-9]+/', $item)) {
|
| 91 |
$numArchive = $this->getNumArchive();
|
96 |
// on ouvre le fichier d index de chaque repertoire
|
| - |
|
97 |
if ((int) $item > $dernier_repertoire) $dernier_repertoire = (int) $item;
|
| - |
|
98 |
|
| 92 |
$dernier_repertoire = floor($numArchive / 100);
|
99 |
}
|
| 93 |
|
100 |
}
|
| 94 |
$tableau_message = array() ;
|
101 |
$tableau_message = array() ;
|
| 95 |
$compteur_message = 0 ;
|
102 |
$compteur_message = 0 ;
|
| 96 |
$fichier_index = fopen ($this->listdir.'/archive/'.$dernier_repertoire.'/index', 'r') ;
|
103 |
$fichier_index = fopen ($this->listdir.'/archive/'.$dernier_repertoire.'/index', 'r') ;
|
| Line 167... |
Line 174... |
| 167 |
while (!feof($fd)) { $data .= fgets($fd,4096); }
|
174 |
while (!feof($fd)) { $data .= fgets($fd,4096); }
|
| 168 |
fclose($fd);
|
175 |
fclose($fd);
|
| 169 |
return $this->parse($data,$simple);
|
176 |
return $this->parse($data,$simple);
|
| 170 |
}
|
177 |
}
|
| Line 171... |
Line 178... |
| 171 |
|
178 |
|
| 172 |
// parse_file_headers - ouvre un fichier et analyse les entête
|
179 |
// parse_file_headers - ouvre un fichier et analyse les ent�tes
|
| 173 |
function parse_file_headers($file,$simple = FALSE) {
|
180 |
function parse_file_headers($file,$simple = FALSE) {
|
| 174 |
if (!is_file($file)) {
|
181 |
if (!is_file($file)) {
|
| 175 |
if (is_file($this->listdir . "/" . $file)) { $file = $this->listdir . "/" . $file; }
|
182 |
if (is_file($this->listdir . "/" . $file)) { $file = $this->listdir . "/" . $file; }
|
| 176 |
else if (is_file($this->listdir . "/archive/" . $file)) { $file = $this->listdir . "/archive/" . $file; }
|
183 |
else if (is_file($this->listdir . "/archive/" . $file)) { $file = $this->listdir . "/archive/" . $file; }
|
| Line 241... |
Line 248... |
| 241 |
//echo htmlspecialchars($this->headers['from'])."<br />" ;
|
248 |
//echo htmlspecialchars($this->headers['from'])."<br />" ;
|
| 242 |
$last = strtolower($hdr[0]);
|
249 |
$last = strtolower($hdr[0]);
|
| 243 |
}
|
250 |
}
|
| 244 |
}
|
251 |
}
|
| 245 |
// ajout alex
|
252 |
// ajout alex
|
| 246 |
// pour supprimer le problème des ISO...
|
253 |
// pour supprimer le probl�me des ISO...
|
| 247 |
// a déplacer ailleur, et appelé avant affichage
|
254 |
// a d�placer ailleur, et appel� avant affichage
|
| Line 248... |
Line 255... |
| 248 |
|
255 |
|
| 249 |
if (preg_match ('/windows-[0-9][0-9][0-9][0-9]/', $this->headers['subject'], $nombre)) {
|
256 |
if (preg_match ('/windows-[0-9][0-9][0-9][0-9]/', $this->headers['subject'], $nombre)) {
|
| 250 |
$reg_exp = $nombre[0] ;
|
257 |
$reg_exp = $nombre[0] ;
|
| 251 |
} else {
|
258 |
} else {
|
| Line 351... |
Line 358... |
| 351 |
// After the parts are broken up they are then turned into parser objects and the
|
358 |
// After the parts are broken up they are then turned into parser objects and the
|
| 352 |
// resulting array of parts is set to $this->parts;
|
359 |
// resulting array of parts is set to $this->parts;
|
| 353 |
function _get_parts($data,$boundary) {
|
360 |
function _get_parts($data,$boundary) {
|
| 354 |
$inpart = -1;
|
361 |
$inpart = -1;
|
| 355 |
$lines = preg_split('/\n/', $data);
|
362 |
$lines = preg_split('/\n/', $data);
|
| 356 |
// La première partie contient l'avertissement pour les client mail ne supportant pas
|
363 |
// La premi�re partie contient l'avertissement pour les client mail ne supportant pas
|
| 357 |
// multipart, elle est stocké dans parts[-1]
|
364 |
// multipart, elle est stock� dans parts[-1]
|
| 358 |
while(list($key,$val) = each($lines)) {
|
365 |
while(list($key,$val) = each($lines)) {
|
| 359 |
if ($val == "--" . $boundary) { $inpart++; continue; } // start of a part
|
366 |
if ($val == "--" . $boundary) { $inpart++; continue; } // start of a part
|
| 360 |
else if ($val == "--" . $boundary . "--") { break; } // the end of the last part
|
367 |
else if ($val == "--" . $boundary . "--") { break; } // the end of the last part
|
| 361 |
else { $parts[$inpart] .= $val . "\n"; }
|
368 |
else { $parts[$inpart] .= $val . "\n"; }
|
| 362 |
}
|
369 |
}
|
| Line 363... |
Line 370... |
| 363 |
|
370 |
|
| 364 |
for ($i = 0; $i < count($parts) - 1; $i++) { // On saute la première partie
|
371 |
for ($i = 0; $i < count($parts) - 1; $i++) { // On saute la premi�re partie
|
| 365 |
$part[$i] = new ezmlm_parser();
|
372 |
$part[$i] = new ezmlm_parser();
|
| 366 |
$part[$i]->parse($parts[$i]);
|
373 |
$part[$i]->parse($parts[$i]);
|
| 367 |
$this->parts[$i] = $part[$i];
|
374 |
$this->parts[$i] = $part[$i];
|
| 368 |
//echo $this->parts[$i]."<br>" ;
|
375 |
//echo $this->parts[$i]."<br>" ;
|