aboutsummaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorMaZderMind2015-12-23 13:53:05 +0100
committerMaZderMind2015-12-23 13:53:05 +0100
commitc1c54bd1295d9de8b3575cef25efa3dd5f6b0c85 (patch)
treee4ebf2870757064c6d4f3f8d8e32d583e3ba0c13 /model
parent2b671e30dadf312410be18f9eebe631bebc5846f (diff)
show warning when running in preview mode
Diffstat (limited to 'model')
-rw-r--r--model/Conference.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/model/Conference.php b/model/Conference.php
index 701d7c7..8a8291b 100644
--- a/model/Conference.php
+++ b/model/Conference.php
@@ -6,16 +6,18 @@ class Conference extends ModelBase
return $this->get('CONFERENCE.TITLE', 'C3Voc Streaming');
}
+ public function isPreviewEnabled() {
+ return $this->has('PREVIEW_DOMAIN') && ($this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST']);
+ }
+
public function isClosed() {
return !$this->hasBegun() || $this->hasEnded();
}
public function hasBegun() {
// on the preview-domain all conferences are always open
- if($this->has('PREVIEW_DOMAIN') && $this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST'])
- {
+ if($this->isPreviewEnabled())
return true;
- }
if($this->has('CONFERENCE.CLOSED')) {
$closed = $this->get('CONFERENCE.CLOSED');
@@ -42,10 +44,8 @@ class Conference extends ModelBase
public function hasEnded() {
// on the preview-domain no conference ever ends
- if($this->has('PREVIEW_DOMAIN') && $this->get('PREVIEW_DOMAIN') == $_SERVER['HTTP_HOST'])
- {
+ if($this->isPreviewEnabled())
return false;
- }
if($this->has('CONFERENCE.CLOSED')) {
$closed = $this->get('CONFERENCE.CLOSED');