public function checkLiveStreamAuthAction() { $request = $this->getRequest(); $username = $request->getParam('username'); $password = $request->getParam('password'); $djtype = $request->getParam('djtype'); if ($djtype == 'master') { //check against master if ($username == Application_Model_Preference::GetLiveStreamMasterUsername() && $password == Application_Model_Preference::GetLiveStreamMasterPassword()) { $this->view->msg = true; } else { $this->view->msg = false; } } elseif ($djtype == "dj") { //check against show dj auth $showInfo = Application_Model_Show::getCurrentShow(); // there is current playing show if (isset($showInfo[0]['id'])) { $current_show_id = $showInfo[0]['id']; $CcShow = CcShowQuery::create()->findPK($current_show_id); // get custom pass info from the show $custom_user = $CcShow->getDbLiveStreamUser(); $custom_pass = $CcShow->getDbLiveStreamPass(); // get hosts ids $show = new Application_Model_Show($current_show_id); $hosts_ids = $show->getHostsIds(); // check against hosts auth if ($CcShow->getDbLiveStreamUsingAirtimeAuth()) { foreach ($hosts_ids as $host) { $h = new Application_Model_User($host['subjs_id']); if ($username == $h->getLogin() && md5($password) == $h->getPassword()) { $this->view->msg = true; return; } } } // check against custom auth if ($CcShow->getDbLiveStreamUsingCustomAuth()) { if ($username == $custom_user && $password == $custom_pass) { $this->view->msg = true; } else { $this->view->msg = false; } } else { $this->view->msg = false; } } else { // no show is currently playing $this->view->msg = false; } } }