diff --git a/LICENSE_3RD_PARTY b/LICENSE_3RD_PARTY index 9bc1f8019..f935ac900 100644 --- a/LICENSE_3RD_PARTY +++ b/LICENSE_3RD_PARTY @@ -43,7 +43,7 @@ Linked code: * Phing - What is it: PHP project build system - Web site: http://phing.info/trac/ - - Note: Only used for database installation and development, not needed to run Airtime. + - Note: Only used for development, not needed to run Airtime. - License: LGPLv3 * PHP-AMQPLIB @@ -175,7 +175,7 @@ Non-linked code: - Web site: http://www.python.org/ - License: PSF License. See http://docs.python.org/license.html - * Liquidsoap (pre-release of 1.0) + * Liquidsoap 1.0.0 - Web site: http://savonet.sourceforge.net/ - License: GPLv2 diff --git a/airtime_mvc/application/configs/conf.php b/airtime_mvc/application/configs/conf.php index 10668cd68..3eb436520 100644 --- a/airtime_mvc/application/configs/conf.php +++ b/airtime_mvc/application/configs/conf.php @@ -81,5 +81,9 @@ class Config { $CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries']; $CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries']; + + if(isset($values['demo']['demo'])){ + $CC_CONFIG['demo'] = $values['demo']['demo']; + } } } diff --git a/airtime_mvc/application/controllers/LoginController.php b/airtime_mvc/application/controllers/LoginController.php index b3eddaeee..9618f9296 100644 --- a/airtime_mvc/application/controllers/LoginController.php +++ b/airtime_mvc/application/controllers/LoginController.php @@ -10,6 +10,8 @@ class LoginController extends Zend_Controller_Action public function indexAction() { + global $CC_CONFIG; + if(Zend_Auth::getInstance()->hasIdentity()) { $this->_redirect('Nowplaying'); @@ -80,11 +82,14 @@ class LoginController extends Zend_Controller_Action } } - $this->view->message = $message; - $this->view->error = $error; - $this->view->form = $form; - $this->view->airtimeVersion = Application_Model_Preference::GetAirtimeVersion(); - $this->view->airtimeCopyright = AIRTIME_COPYRIGHT_DATE; + $this->view->message = $message; + $this->view->error = $error; + $this->view->form = $form; + $this->view->airtimeVersion = Application_Model_Preference::GetAirtimeVersion(); + $this->view->airtimeCopyright = AIRTIME_COPYRIGHT_DATE; + if(isset($CC_CONFIG['demo'])){ + $this->view->demo = $CC_CONFIG['demo']; + } } public function logoutAction() diff --git a/airtime_mvc/application/forms/Login.php b/airtime_mvc/application/forms/Login.php index 52323a666..c288b8b37 100644 --- a/airtime_mvc/application/forms/Login.php +++ b/airtime_mvc/application/forms/Login.php @@ -5,6 +5,8 @@ class Application_Form_Login extends Zend_Form public function init() { + global $CC_CONFIG; + // Set the method for the display form to POST $this->setMethod('post'); @@ -13,17 +15,19 @@ class Application_Form_Login extends Zend_Form 'label' => 'Username:', 'class' => 'input_text', 'required' => true, + 'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'', 'filters' => array('StringTrim'), 'validators' => array( 'NotEmpty', ) )); - + // Add password element $this->addElement('password', 'password', array( 'label' => 'Password:', 'class' => 'input_text', 'required' => true, + 'value' => (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1)?'admin':'', 'filters' => array('StringTrim'), 'validators' => array( 'NotEmpty', diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index a5b17ffc1..31bd75d44 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -298,9 +298,11 @@ class Application_Model_Show { $showId = $this->getId(); $sql = "SELECT starts FROM cc_show_instances " - ."WHERE show_id = $showId AND rebroadcast = 1 " + ."WHERE instance_id = (SELECT id FROM cc_show_instances WHERE show_id = $showId ORDER BY starts LIMIT 1) AND rebroadcast = 1 " ."ORDER BY starts"; + Logging::log($sql); + $rebroadcasts = $CC_DBC->GetAll($sql); $rebroadcastsLocal = array(); @@ -415,8 +417,7 @@ class Application_Model_Show { public function deleteAllInstances(){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances" @@ -433,8 +434,7 @@ class Application_Model_Show { public function deleteAllRebroadcasts(){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances" @@ -457,8 +457,7 @@ class Application_Model_Show { public function removeAllInstancesFromDate($p_date=null){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); if(is_null($p_date)) { $date = new Application_Model_DateHelper; @@ -490,8 +489,7 @@ class Application_Model_Show { public function removeAllInstancesBeforeDate($p_date){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances " diff --git a/airtime_mvc/application/models/ShowInstance.php b/airtime_mvc/application/models/ShowInstance.php index 78baca4ae..de62f7c83 100644 --- a/airtime_mvc/application/models/ShowInstance.php +++ b/airtime_mvc/application/models/ShowInstance.php @@ -494,7 +494,12 @@ class Application_Model_ShowInstance { } } else { - $show->delete(); + if ($this->isRebroadcast()) { + $this->_showInstance->delete(); + } + else { + $show->delete(); + } } } diff --git a/airtime_mvc/application/views/scripts/login/index.phtml b/airtime_mvc/application/views/scripts/login/index.phtml index ea6c24e41..bde3fb9f9 100644 --- a/airtime_mvc/application/views/scripts/login/index.phtml +++ b/airtime_mvc/application/views/scripts/login/index.phtml @@ -2,6 +2,9 @@
Welcome to the online Airtime demo! You can log in using the username 'admin' and the password 'admin'.
+message; ?>
form; ?>