Subversion Repositories Applications.projet

Rev

Rev 416 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 416 Rev 421
1
<?php
1
<?php
2
/**
2
/**
3
 * @author        Raphaël Droz <raphael@tela-botanica.org>
3
 * @author        Raphaël Droz <raphael@tela-botanica.org>
4
 * @copyright     2013, Tela-Botanica
4
 * @copyright     2013, Tela-Botanica
5
 * @license GPL v3
5
 * @license GPL v3
6
 * @license CECILL v2
6
 * @license CECILL v2
7
 */
7
 */
8
 
8
 
9
// eg: php clical.php amorphophallus_et_araceae|html2text 
9
// eg: php clical.php amorphophallus_et_araceae|html2text 
10
if (PHP_SAPI !== 'cli') die;
10
if (PHP_SAPI !== 'cli') die;
11
 
11
 
12
// for standalone use
12
// for standalone use
13
// WARNING: this uses cache !
13
// WARNING: this uses cache !
14
// php-cli user could have != permission than a webserver
14
// php-cli user could have != permission than a webserver
15
// then cache file created could become inaccessible to webserver
15
// then cache file created could become inaccessible to webserver
16
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED);
16
error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE ^ E_DEPRECATED);
17
date_default_timezone_set('Europe/Paris');
17
date_default_timezone_set('Europe/Paris');
18
 
18
 
19
$path = '/home/vpopmail/domains';
19
$path = '/home/vpopmail/domains';
20
$domaine = 'tela-botanica.org';
20
$domaine = 'tela-botanica.org';
-
 
21
 
-
 
22
/*
-
 
23
  List (ezmlm_threads::listmessages()), /calendrier_messages.php, 
-
 
24
  Recent (ezmlm_listinfo::show_recentmsgs()), /derniers_messages.php?domaine=&liste=
-
 
25
  Month (ezmlm_listinfo::show_month(X)), /messages_mois.php?domaine=&liste=&actionargs[]=201306
-
 
26
  month/Thread (ezmlm_listinfo::show_month(X)), /messages_thread.php?domaine=&liste=&actionargs[]=201306
-
 
27
  XXX: Show (ezmlm_msgdisplay::display(X)), /message.php?domaine=&liste=&action=show_msg&actionargs[]=18&actionargs[]=09
-
 
28
 
21
 
29
  -p: path
-
 
30
  -d: domaine
-
 
31
  
-
 
32
*/
22
$liste = $argv[1];
33
$options = getopt("LRMTp:d:");
23
if(isset($argv[2])) $domaine = $argv[2];
34
if(isset($options['p'])) $path = $options['p'];
-
 
35
if(isset($options['d'])) $domaine = $options['d'];
24
if(isset($argv[3])) $path = $argv[3];
36
$liste = array_slice($argv, -1)[0];
25
 
37
 
26
if(!$liste || !$domaine || !$path) die;
38
if(!$liste || !$domaine || !$path) die;
27
 
39
 
28
include_once 'ezmlm-php-2.0/ezmlm.php' ;
40
include_once 'ezmlm-php-2.0/ezmlm.php' ;
29
 
41
 
30
// Parametrage de la liste
42
// Parametrage de la liste
-
 
43
if(array_key_exists('R', $options) || array_key_exists('M', $options)) {
-
 
44
    $info = new ezmlm_listinfo();   
-
 
45
} else { // cal & show threads
31
$info = new ezmlm_threads();
46
    $info = new ezmlm_threads();
-
 
47
}
-
 
48
 
-
 
49
 
32
if (!$info) die('Les fichiers de la liste ne sont pas visible sur le serveur');
50
if (!$info) die('Les fichiers de la liste ne sont pas visible sur le serveur');
33
 
51
 
34
$info->forcehref = $url;
52
$info->forcehref = $url;
35
$info->listdir = $path . '/' . $domaine . '/' . $liste ;
53
$info->listdir = $path . '/' . $domaine . '/' . $liste ;
36
$info->listname = $liste;
54
$info->listname = $liste;
37
$info->listdomain = $domaine ;
55
$info->listdomain = $domaine ;
-
 
56
 
38
 
57
if(array_key_exists('R', $options)) {
-
 
58
    echo $info->show_recentmsgs();
-
 
59
}
-
 
60
elseif(array_key_exists('M', $options)) {
-
 
61
    echo $info->show_month("201307");
-
 
62
}
-
 
63
elseif(array_key_exists('T', $options)) {
-
 
64
    $info->tempdir = '/tmp' ; echo $info->load("201306");
-
 
65
}
-
 
66
else {
-
 
67
    echo $info->listmessages(); // ezmlm_threads
39
echo $info->listmessages();
68
}