X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fbanana.inc.php.in;h=df1768b4a5399edeef608ae4664319febdf048b0;hb=b052aab700be8ff1e786df137be250bc4f51b4c5;hp=0b3c77c74519af10c2e16af065fa04937c3d442c;hpb=e95f5b5e073c84491d915f4788c0a501e5419a1b;p=banana.git diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 0b3c77c..df1768b 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -45,6 +45,7 @@ class Banana static public $msgshow_mimeparts = array('multipart/report', 'multipart/mixed', 'text/html', 'text/plain', 'text/enriched', 'text', 'message'); static public $msgshow_xface = true; static public $msgshow_wrap = 78; + static public $msgshow_externalimages = false; static public $msgshow_withthread = true; /** Match an url @@ -444,6 +445,49 @@ class Banana } /**************************************************************************/ + /* Spoolgen functions */ + /**************************************************************************/ + + private function checkErrors() + { + if (Banana::$protocole->lastErrno()) { + echo "\nL'erreur suivante s'est produite : " + . Banana::$protocole->lastErrno() . " " + . Banana::$protocole->lastError() . "\n"; + return false; + } + return true; + } + + static public function createAllSpool(array $protos) + { + foreach ($protos as $proto) { + $banana = new Banana(array(), $proto); + + if (!$banana->checkErrors()) { + continue; + } + $groups = Banana::$protocole->getBoxList(); + if (!$banana->checkErrors()) { + continue; + } + + print "** $proto **\n"; + foreach (array_keys($groups) as $g) { + print "Generating spool for $g : "; + Banana::$group = $g; + $spool = $banana->loadSpool($g); + if (!$banana->checkErrors()) { + break; + } + print "done.\n"; + unset($spool); + } + print "\n"; + } + } + + /**************************************************************************/ /* Private functions */ /**************************************************************************/ @@ -455,6 +499,10 @@ class Banana if ($group == @$_SESSION['banana_group'] && isset($_SESSION['banana_spool'])) { Banana::$spool = unserialize($_SESSION['banana_spool']); $clean = @(Banana::$profile['lastnews'] != $_SESSION['banana_lastnews']); + } else { + unset($_SESSION['banana_message']); + unset($_SESSION['banana_artid']); + unset($_SESSION['banana_showhdr']); } BananaSpool::getSpool($group, Banana::$profile['lastnews'], Banana::$profile['autoup'] || $clean); $_SESSION['banana_group'] = $group;