From 45319df1e1765047535c950a525c76fbeda48df0 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 28 Oct 2007 18:55:08 +0100 Subject: [PATCH] Accept a default value for baseurl Signed-off-by: Florent Bruneau --- bin/connect.db.inc.php | 1 - configs/platal.ini | 1 + include/banana/hooks.inc.php | 2 +- include/globals.inc.php.in | 4 +++- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/connect.db.inc.php b/bin/connect.db.inc.php index 1cade25..3e61ba1 100644 --- a/bin/connect.db.inc.php +++ b/bin/connect.db.inc.php @@ -26,6 +26,5 @@ require_once('xorg.misc.inc.php'); require_once 'xdb.php'; -$globals->baseurl = "https://www.polytechnique.org"; // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?> diff --git a/configs/platal.ini b/configs/platal.ini index 545ac84..fe98ecb 100644 --- a/configs/platal.ini +++ b/configs/platal.ini @@ -2,6 +2,7 @@ locale = "fr_FR.UTF-8" timezone = "Europe/Paris" secure_domain = "" +baseurl = "https://www.example.org/" skin = "default" register_skin = "register" diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index 7a6367e..ed55ec0 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -150,7 +150,7 @@ function hook_makeLink($params) $base .= '/' . $params['group']; } else if (Banana::$protocole->name() == 'NNTP' && $xnet) { if ($feed) { - return 'http://www.polytechnique.org/banana' . hook_platalRSS(@$params['group']); + return $globals->baseurl . '/banana' . hook_platalRSS(@$params['group']); } $base = $globals->baseurl . '/' . $platal->ns . 'forum'; } else if (Banana::$protocole->name() == 'MLArchives') { diff --git a/include/globals.inc.php.in b/include/globals.inc.php.in index 9bb1b54..37a8cfe 100644 --- a/include/globals.inc.php.in +++ b/include/globals.inc.php.in @@ -53,7 +53,9 @@ class PlatalGlobals $this->session = $sess; $base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://'; - $this->baseurl = @trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/'); + if (isset($_SERVER) && isset($_SERVER['SERVER_NAME'])) { + $this->baseurl = @trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/'); + } $this->spoolroot = dirname(dirname(__FILE__)); $this->read_config(); -- 2.1.4