Some improvements for banana 'stand-alone'
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Wed, 16 May 2007 12:01:43 +0000 (12:01 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:43 +0000 (00:35 +0100)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@256 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
banana/page.inc.php
examples/index.php

index 546df27..5a514bc 100644 (file)
@@ -26,6 +26,7 @@ class Banana
                                     'autoup' => 1);
     static public $boxpattern;
     static public $withtabs = true;
+    static public $baseurl   = null;
     static public $mimeparts = array();
 
 ### Spool ###
index 0fa2273..78036a8 100644 (file)
@@ -230,7 +230,7 @@ class BananaPage extends Smarty
             return $res;
         }   
         $proto = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
-        $host  = $_SERVER['HTTP_HOST'];
+        $host  = Banana::$baseurl ? Banana::$baseurl : $_SERVER['SERVER_NAME'];
         $file  = $_SERVER['PHP_SELF'];
     
         if (count($params) != 0) {
index f4e71b4..37e2ee1 100644 (file)
@@ -17,6 +17,7 @@ Banana::$spool_root  = dirname(__FILE__) . '/spool'; // where to store cache fil
 Banana::$debug_nntp   = false; // if true, show the NNTP backtrace
 Banana::$debug_smarty = false; // if true, shos php-error in page generation
 Banana::$feed_active  = true;  // Activate RSS feed
+Banana::$feed_updateOnDemand = true; // Update the feed cache when it is acceeded
 
 // Implement a Banana which stores subscription list in a cookie
 class MyBanana extends Banana
@@ -29,7 +30,9 @@ class MyBanana extends Banana
     }
 }
 
-if (!isset($_SESSION['banana_email']) || isset($_POST['change_login']) || isset($_POST['valid_change'])) {
+// Minimalist login
+if ((@$_GET['action'] == 'rss2') && 
+    (!isset($_SESSION['banana_email']) || isset($_POST['change_login']) || isset($_POST['valid_change']))) {
     if (isset($_COOKIE['banana_login']) && !isset($_POST['change_login']) && !isset($_POST['valid_change'])) {
         $_SESSION['banana_email'] = $_COOKIE['banana_email'];
     } elseif (isset($_POST['valid_change'])) {