diff options
author | MaZderMind | 2016-12-18 13:34:57 +0100 |
---|---|---|
committer | MaZderMind | 2016-12-18 13:34:57 +0100 |
commit | a12d86ec058bc89e6feeda6ec8cfce691269b0a9 (patch) | |
tree | 6be1f764a8addd025eb774bcd2039788a4b1873f /model/Feedback.php | |
parent | 521f0e2e1c94538fdce65a021144180f368364d9 (diff) | |
parent | efd0b59f8ed363e12211894d8892e4d18b198c04 (diff) |
Merge branch 'master' into events/33c3
Diffstat (limited to 'model/Feedback.php')
-rw-r--r-- | model/Feedback.php | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/model/Feedback.php b/model/Feedback.php index 578650a..9475fe8 100644 --- a/model/Feedback.php +++ b/model/Feedback.php @@ -1,12 +1,16 @@ <?php -class Feedback extends ModelBase +class Feedback { - public function isEnabled() { - return $this->has('FEEDBACK'); + private $conference; + + public function __construct(Conference $conference) + { + $this->conference = $conference; } - public function getUrl() { - return 'feedback/'; + + public function getConference() { + return $this->conference; } public function validate($info) @@ -23,7 +27,7 @@ class Feedback extends ModelBase public function store($info) { - $db = new PDO($this->get('FEEDBACK.DSN')); + $db = new PDO($this->getConference()->get('FEEDBACK.DSN')); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stm = $db->prepare(' @@ -50,8 +54,8 @@ class Feedback extends ModelBase { return isset($_SERVER['PHP_AUTH_USER']) && - $_SERVER['PHP_AUTH_USER'] == $this->get('FEEDBACK.USERNAME') && - $_SERVER['PHP_AUTH_PW'] == $this->get('FEEDBACK.PASSWORD'); + $_SERVER['PHP_AUTH_USER'] == $this->getConference()->get('FEEDBACK.USERNAME') && + $_SERVER['PHP_AUTH_PW'] == $this->getConference()->get('FEEDBACK.PASSWORD'); } public function requestLogin() @@ -64,7 +68,7 @@ class Feedback extends ModelBase public function read($from, $to) { - $db = new PDO($this->get('FEEDBACK.DSN')); + $db = new PDO($this->getConference()->get('FEEDBACK.DSN')); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stm = $db->prepare(' |