aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.php11
-rw-r--r--lib/helper.php8
2 files changed, 13 insertions, 6 deletions
diff --git a/config.php b/config.php
index 6faf9fb..91dbcb6 100644
--- a/config.php
+++ b/config.php
@@ -4,14 +4,15 @@ date_default_timezone_set('Europe/Berlin');
/**
* Während der Entwicklung wird die BASEURL automatisch erraten
* In Produktionssituationen sollte manuell eine konfiguriert werden um Überraschungen zu vermeiden
+ *
+ * Protokollfreie URLs (welche, die mit // beginnen), werden automatisch mit dem korrekten Protokoll ergänzt.
+ * In diesem Fall wird auch ein SSL-Umschalt-Button im Header angezeigt
*/
if($_SERVER['HTTP_HOST'] != 'localhost')
- $GLOBALS['CONFIG']['BASEURL'] = proto().'://streaming.media.ccc.de/';
+ $GLOBALS['CONFIG']['BASEURL'] = '//streaming.media.ccc.de/';
+
+$GLOBALS['CONFIG']['BASEURL'] = '//localhost/streaming-website/';
-/**
- * Beispielkonfiguration für Produktionssituationen
- */
-//$GLOBALS['CONFIG']['BASEURL'] = proto().'://streaming.media.ccc.de/';
$GLOBALS['CONFIG']['CONFERENCE'] = array(
/**
diff --git a/lib/helper.php b/lib/helper.php
index 4cf089f..711ac6a 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -13,7 +13,13 @@ function proto()
function baseurl()
{
if(isset($GLOBALS['CONFIG']['BASEURL']))
- return $GLOBALS['CONFIG']['BASEURL'];
+ {
+ $base = $GLOBALS['CONFIG']['BASEURL'];
+ if(startswith('//', $base))
+ $base = proto().':'.$base;
+
+ return $base;
+ }
$base = ssl() ? 'https://' : 'http://';
$base .= $_SERVER['HTTP_HOST'];