| 1 | <?php |
| 2 | /******************************************************************************** |
| 3 | * spoolgen.php : spool generation |
| 4 | * -------------- |
| 5 | * |
| 6 | * This file is part of the banana distribution |
| 7 | * Copyright: See COPYING files that comes with this distribution |
| 8 | ********************************************************************************/ |
| 9 | |
| 10 | ini_set('max_execution_time','300'); |
| 11 | ini_set('include_path','.:..:../custom/banana:../../custom/banana:../public/include:../../public/include'); |
| 12 | |
| 13 | require_once("include/encoding.inc.php"); |
| 14 | require_once("include/config.inc.php"); |
| 15 | require_once("include/NetNNTP.inc.php"); |
| 16 | require_once("include/post.inc.php"); |
| 17 | require_once("include/groups.inc.php"); |
| 18 | require_once("include/spool.inc.php"); |
| 19 | require_once("include/password.inc.php"); |
| 20 | |
| 21 | |
| 22 | $nntp = new nntp($news['server']); |
| 23 | if (!$nntp) { |
| 24 | print "cannot connect to server\n"; |
| 25 | exit; |
| 26 | } |
| 27 | |
| 28 | if ($news['user']!="anonymous") { |
| 29 | $result = $nntp->authinfo($news["user"],$news["pass"]); |
| 30 | if (!$result) { |
| 31 | print "authentication error\n"; |
| 32 | exit; |
| 33 | } |
| 34 | } |
| 35 | unset($result); |
| 36 | |
| 37 | $groups = new groups($nntp,2); |
| 38 | $list = array_keys($groups->overview); |
| 39 | unset($groups); |
| 40 | foreach ($list as $g) { |
| 41 | print "Generating spool for $g : "; |
| 42 | $spool = new spool($nntp,$g); |
| 43 | print "done.\n"; |
| 44 | unset($spool); |
| 45 | } |
| 46 | $nntp->quit(); |
| 47 | ?> |