If banana port is 563, use ssl.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 13 Feb 2010 14:14:06 +0000 (15:14 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 13 Feb 2010 14:35:04 +0000 (15:35 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
bin/banana.feedgen.php
bin/banana.spoolgen.php
bin/cron/banana.feedgen.php
include/banana/forum.inc.php

index 6e25f22..873f1eb 100755 (executable)
@@ -9,12 +9,12 @@
  ********************************************************************************/
 
 require_once 'connect.db.inc.php';
-require_once dirname(__FILE__).'/../include/banana/ml.inc.php';
+require_once dirname(__FILE__).'/../include/banana/forum.inc.php';
 ini_set('memory_limit', '128M');
 
 Banana::$mbox_helper = $globals->banana->mbox_helper;
 Banana::$spool_root = $globals->banana->spool_root;
-Banana::$nntp_host = "news://{$globals->banana->web_user}:{$globals->banana->web_pass}@{$globals->banana->server}:{$globals->banana->port}/";
+Banana::$nntp_host =  ForumsBanana::buildURL()
 Banana::refreshAllFeeds(array('NNTP', 'MLArchive'));
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 4fbc479..ac18c35 100755 (executable)
@@ -9,12 +9,12 @@
  ********************************************************************************/
 
 require_once 'connect.db.inc.php';
-require_once dirname(__FILE__).'/../include/banana/ml.inc.php';
+require_once dirname(__FILE__).'/../include/banana/forum.inc.php';
 ini_set('memory_limit', '128M');
 
 Banana::$mbox_helper = $globals->banana->mbox_helper;
 Banana::$spool_root = $globals->banana->spool_root;
-Banana::$nntp_host = "news://{$globals->banana->web_user}:{$globals->banana->web_pass}@{$globals->banana->server}:{$globals->banana->port}/";
+Banana::$nntp_host = ForumsBanana::buildURL();
 Banana::createAllSpool(array('NNTP', 'MLArchive'));
 system("chown -R www-data:www-data /var/spool/banana");
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index e85766a..b4dae8b 100755 (executable)
@@ -9,12 +9,12 @@
  ********************************************************************************/
 
 require_once 'connect.db.inc.php';
-require_once dirname(__FILE__).'/../../include/banana/ml.inc.php';
+require_once dirname(__FILE__).'/../../include/banana/forum.inc.php';
 ini_set('memory_limit', '128M');
 
 Banana::$mbox_helper = $globals->banana->mbox_helper;
 Banana::$spool_root = $globals->banana->spool_root;
-Banana::$nntp_host = "news://{$globals->banana->web_user}:{$globals->banana->web_pass}@{$globals->banana->server}:{$globals->banana->port}/";
+Banana::$nntp_host = ForumsBanana::buildURL();
 Banana::refreshAllFeeds(array('NNTP'));
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 8baa6bb..d9822d5 100644 (file)
@@ -39,8 +39,7 @@ class ForumsBanana extends Banana
         Banana::$msgedit_canattach = false;
         Banana::$spool_root = $globals->banana->spool_root;
         array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
-        Banana::$nntp_host = 'news://web_' . $user->login()
-                           . ":{$globals->banana->password}@{$globals->banana->server}:{$globals->banana->port}/";
+        Banana::$nntp_host = self::buildURL($user->login());
         if (S::admin()) {
             Banana::$msgshow_mimeparts[] = 'source';
         }
@@ -54,6 +53,19 @@ class ForumsBanana extends Banana
         }
     }
 
+    public static function buildURL($login = null)
+    {
+        global $globals;
+        $scheme = ($globals->banana->port == 563) ? "nntps" : "news";
+        $user = $globals->banana->web_user;
+        if ($login != null) {
+            $user .= '_' . $login;
+        }
+        return $scheme . '://' . $user
+                       . ":{$globals->banana->password}@{$globals->banana->server}:{$globals->banana->port}/";
+
+    }
+
     private function fetchProfile()
     {
         // Get user profile from SQL