ridiculous f**c**ng bugfix
[banana.git] / scripts / spoolgen.php
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("include/encoding.inc.php");
14 require("include/config.inc.php");
15 require("include/NetNNTP.inc.php");
16 include("include/post.inc.php");
17 include("include/groups.inc.php");
18 require("include/spool.inc.php");
19 require("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 ?>