diff options
author | MaZderMind | 2015-12-23 13:53:05 +0100 |
---|---|---|
committer | MaZderMind | 2015-12-23 13:53:05 +0100 |
commit | c1c54bd1295d9de8b3575cef25efa3dd5f6b0c85 (patch) | |
tree | e4ebf2870757064c6d4f3f8d8e32d583e3ba0c13 /model/Conference.php | |
parent | 2b671e30dadf312410be18f9eebe631bebc5846f (diff) |
show warning when running in preview mode
Diffstat (limited to '')
-rw-r--r-- | model/Conference.php | 12 |
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'); |