Merge branch 'saas-dev' into saas
Conflicts: airtime_mvc/application/common/FileDataHelper.php
This commit is contained in:
commit
75914b791c
40 changed files with 615 additions and 603 deletions
|
@ -10,6 +10,7 @@ class FileDataHelper {
|
|||
"audio/mp3" => "mp3",
|
||||
"audio/mpeg" => "mp3",
|
||||
"audio/mpeg3" => "mp3",
|
||||
"audio/x-aac" => "aac",
|
||||
"audio/aac" => "aac",
|
||||
"audio/aacp" => "aac",
|
||||
"audio/mp4" => "m4a",
|
||||
|
|
|
@ -11,6 +11,7 @@ class ProvisioningHelper
|
|||
private $dbuser, $dbpass, $dbname, $dbhost, $dbowner, $apikey;
|
||||
private $instanceId;
|
||||
private $stationName, $description;
|
||||
private $defaultIcecastPassword;
|
||||
|
||||
public function __construct($apikey)
|
||||
{
|
||||
|
@ -122,6 +123,9 @@ class ProvisioningHelper
|
|||
if (isset($_POST['description'])) {
|
||||
$this->description = $_POST['description'];
|
||||
}
|
||||
if (isset($_POST['icecast_pass'])) {
|
||||
$this->defaultIcecastPassword = $_POST['icecast_pass'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -212,6 +216,9 @@ class ProvisioningHelper
|
|||
if ($this->description) {
|
||||
Application_Model_Preference::SetStationDescription($this->description);
|
||||
}
|
||||
if (isset($this->defaultIcecastPassword)) {
|
||||
Application_Model_Preference::setDefaultIcecastPassword($this->defaultIcecastPassword);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,7 +40,8 @@ $ccAcl->add(new Zend_Acl_Resource('library'))
|
|||
->add(new Zend_Acl_Resource('provisioning'))
|
||||
->add(new Zend_Acl_Resource('player'))
|
||||
->add(new Zend_Acl_Resource('soundcloud'))
|
||||
->add(new Zend_Acl_Resource('embeddablewidgets'));
|
||||
->add(new Zend_Acl_Resource('embeddablewidgets'))
|
||||
->add(new Zend_Acl_Resource('setup'));
|
||||
|
||||
/** Creating permissions */
|
||||
$ccAcl->allow('G', 'index')
|
||||
|
@ -60,6 +61,7 @@ $ccAcl->allow('G', 'index')
|
|||
->allow('G', 'downgrade')
|
||||
->allow('G', 'rest:show-image', 'get')
|
||||
->allow('G', 'rest:media', 'get')
|
||||
->allow('G', 'setup')
|
||||
->allow('H', 'soundcloud')
|
||||
->allow('H', 'rest:show-image')
|
||||
->allow('H', 'rest:media')
|
||||
|
|
|
@ -9,6 +9,7 @@ define('COMPANY_NAME' , 'Sourcefabric');
|
|||
define('COMPANY_SUFFIX' , 'z.ú.');
|
||||
define('COMPANY_SITE' , 'Sourcefabric.org');
|
||||
define('COMPANY_SITE_URL' , 'http://sourcefabric.org/');
|
||||
define('SUPPORT_EMAIL_ADDRESS', "help@sourcefabric.org");
|
||||
|
||||
define('HELP_URL' , 'http://help.sourcefabric.org/');
|
||||
define('FAQ_URL' , 'https://sourcefabricberlin.zendesk.com/hc/en-us/sections/200994309-Airtime-FAQ');
|
||||
|
@ -17,6 +18,7 @@ define('TERMS_AND_CONDITIONS_URL' , 'http://www.sourcefabric.org/en/about/poli
|
|||
define('PRIVACY_POLICY_URL' , 'http://www.sourcefabric.org/en/about/policy/');
|
||||
define('USER_MANUAL_URL' , 'http://sourcefabric.booktype.pro/airtime-pro-for-broadcasters');
|
||||
define('AIRTIME_TRANSIFEX_URL' , 'https://www.transifex.com/projects/p/airtime/');
|
||||
define('WHMCS_PASSWORD_RESET_URL' , 'https://account.sourcefabric.com/pwreset.php');
|
||||
|
||||
define('LICENSE_VERSION' , 'GNU AGPL v.3');
|
||||
define('LICENSE_URL' , 'http://www.gnu.org/licenses/agpl-3.0-standalone.html');
|
||||
|
@ -32,6 +34,8 @@ define('DEFAULT_LOGO_PLACEHOLDER', 1);
|
|||
define('DEFAULT_LOGO_FILE', 'images/airtime_logo.png');
|
||||
define('DEFAULT_TIMESTAMP_FORMAT', 'Y-m-d H:i:s');
|
||||
define('DEFAULT_MICROTIME_FORMAT', 'Y-m-d H:i:s.u');
|
||||
define('DEFAULT_ICECAST_PORT', 8000);
|
||||
define('DEFAULT_ICECAST_PASS', 'hackme');
|
||||
|
||||
// Metadata Keys for files
|
||||
define('MDATA_KEY_FILEPATH' , 'filepath');
|
||||
|
|
|
@ -171,8 +171,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Check this box to automatically switch on Master/Show source upon source connection." => _("Check this box to automatically switch on Master/Show source upon source connection."),
|
||||
"If your Icecast server expects a username of 'source', this field can be left blank." => _("If your Icecast server expects a username of 'source', this field can be left blank."),
|
||||
"If your live streaming client does not ask for a username, this field should be 'source'." => _("If your live streaming client does not ask for a username, this field should be 'source'."),
|
||||
"If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."
|
||||
=> _("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."),
|
||||
"WARNING: This will restart your stream and may cause a short dropout for your listeners!" => _("WARNING: This will restart your stream and may cause a short dropout for your listeners!"),
|
||||
"This is the admin username and password for Icecast/SHOUTcast to get listener statistics." => _("This is the admin username and password for Icecast/SHOUTcast to get listener statistics."),
|
||||
//preferences/support-setting.js
|
||||
"Image must be one of jpg, jpeg, png, or gif" => _("Image must be one of jpg, jpeg, png, or gif"),
|
||||
|
|
|
@ -38,11 +38,9 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/login.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$form = new Application_Form_Login();
|
||||
|
||||
$message = _("Please enter your user name and password");
|
||||
$message = _("Please enter your username and password.");
|
||||
|
||||
if ($request->isPost()) {
|
||||
// if the post contains recaptcha field, which means form had recaptcha field.
|
||||
|
@ -133,33 +131,31 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/login/password-restore.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl . 'js/airtime/login/password-restore.js?' . $CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$stationLocale = Application_Model_Preference::GetDefaultLocale();
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', $stationLocale));
|
||||
|
||||
if (!Application_Model_Preference::GetEnableSystemEmail()) {
|
||||
$this->_redirect('login');
|
||||
} else {
|
||||
//uses separate layout without a navigation.
|
||||
$this->_helper->layout->setLayout('login');
|
||||
|
||||
$form = new Application_Form_PasswordRestore();
|
||||
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost() && $form->isValid($request->getPost())) {
|
||||
if (is_null($form->username->getValue()) || $form->username->getValue() == '') {
|
||||
$user = CcSubjsQuery::create()
|
||||
->filterByDbEmail($form->email->getValue())
|
||||
->findOne();
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($request->getPost())) {
|
||||
$query = CcSubjsQuery::create();
|
||||
if (empty($form->username->getValue())) {
|
||||
$query->filterByDbEmail($form->email->getValue());
|
||||
} else if (empty($form->email->getValue())) {
|
||||
$query->filterByDbLogin($form->username->getValue());
|
||||
} else {
|
||||
$user = CcSubjsQuery::create()
|
||||
->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue())
|
||||
->findOne();
|
||||
$query->filterByDbEmail($form->email->getValue())
|
||||
->filterByDbLogin($form->username->getValue());
|
||||
}
|
||||
$user = $query->findOne();
|
||||
|
||||
if (!empty($user)) {
|
||||
$auth = new Application_Model_Auth();
|
||||
|
@ -171,13 +167,15 @@ class LoginController extends Zend_Controller_Action
|
|||
$form->email->addError($this->view->translate(_("Email could not be sent. Check your mail server settings and ensure it has been configured properly.")));
|
||||
}
|
||||
} else {
|
||||
$form->email->addError($this->view->translate(_("Given email not found.")));
|
||||
$form->email->addError($this->view->translate(sprintf(_pro("That username or email address could not be found. If you are the station owner, you should <a href=\"%s\">reset your here</a>."), WHMCS_PASSWORD_RESET_URL)));
|
||||
}
|
||||
} else { //Form is not valid
|
||||
$form->email->addError($this->view->translate(_("There was a problem with the username or email address you entered.")));
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->form = $form;
|
||||
}
|
||||
}
|
||||
|
||||
public function passwordRestoreAfterAction()
|
||||
{
|
||||
|
|
|
@ -149,9 +149,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
session_start(); //Open session for writing.
|
||||
|
||||
// get current settings
|
||||
$setting = Application_Model_StreamSetting::getStreamSetting();
|
||||
|
||||
$name_map = array(
|
||||
'ogg' => 'Ogg Vorbis',
|
||||
'fdkaac' => 'AAC+',
|
||||
|
@ -160,55 +157,14 @@ class PreferenceController extends Zend_Controller_Action
|
|||
'mp3' => 'MP3',
|
||||
);
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
foreach ($temp_types as $type) {
|
||||
$type = strtolower(trim($type));
|
||||
if (isset($name_map[$type])) {
|
||||
$name = $name_map[$type];
|
||||
} else {
|
||||
$name = $type;
|
||||
}
|
||||
$stream_types[$type] = $name;
|
||||
}
|
||||
|
||||
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
|
||||
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
|
||||
$stream_bitrates = array();
|
||||
foreach ($temp_bitrate as $type) {
|
||||
if (intval($type) <= $max_bitrate) {
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
|
||||
}
|
||||
}
|
||||
|
||||
$num_of_stream = intval(Application_Model_Preference::GetNumOfStreams());
|
||||
$form = new Application_Form_StreamSetting();
|
||||
|
||||
// $form->addElement('hash', 'csrf', array(
|
||||
// 'salt' => 'unique'
|
||||
// ));
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
|
||||
$form->addElement($csrf_element);
|
||||
|
||||
$form->setSetting($setting);
|
||||
$form->startFrom();
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
$subform->setPrefix($i);
|
||||
$subform->setSetting($setting);
|
||||
$subform->setStreamTypes($stream_types);
|
||||
$subform->setStreamBitrates($stream_bitrates);
|
||||
$subform->startForm();
|
||||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
}
|
||||
if ($request->isPost()) {
|
||||
$params = $request->getPost();
|
||||
/* Parse through post data and put in format
|
||||
|
@ -246,7 +202,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$values["s3_data"] = $s3_data;
|
||||
$values["s4_data"] = $s4_data;
|
||||
|
||||
$error = false;
|
||||
if ($form->isValid($values)) {
|
||||
|
||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||
|
@ -263,12 +218,7 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$s4_set_admin_pass = !empty($values["s4_data"]["admin_pass"]);
|
||||
|
||||
// this goes into cc_pref table
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
$this->setStreamPreferences($values);
|
||||
|
||||
// compare new values with current value
|
||||
$changeRGenabled = Application_Model_Preference::GetEnableReplayGain() != $values["enableReplayGain"];
|
||||
|
@ -294,34 +244,86 @@ class PreferenceController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
|
||||
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||
}
|
||||
}
|
||||
|
||||
// get predefined type and bitrate from pref table
|
||||
$temp_types = Application_Model_Preference::GetStreamType();
|
||||
$stream_types = array();
|
||||
foreach ($temp_types as $type) {
|
||||
$type = strtolower(trim($type));
|
||||
if (isset($name_map[$type])) {
|
||||
$name = $name_map[$type];
|
||||
} else {
|
||||
$name = $type;
|
||||
}
|
||||
$stream_types[$type] = $name;
|
||||
}
|
||||
|
||||
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
|
||||
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
|
||||
$stream_bitrates = array();
|
||||
foreach ($temp_bitrate as $type) {
|
||||
if (intval($type) <= $max_bitrate) {
|
||||
$stream_bitrates[trim($type)] = strtoupper(trim($type))." kbit/s";
|
||||
}
|
||||
}
|
||||
|
||||
// get current settings
|
||||
$setting = Application_Model_StreamSetting::getStreamSetting();
|
||||
|
||||
$form->setSetting($setting);
|
||||
$form->startFrom();
|
||||
|
||||
$live_stream_subform = new Application_Form_LiveStreamingPreferences();
|
||||
$form->addSubForm($live_stream_subform, "live_stream_subform");
|
||||
|
||||
for ($i=1; $i<=$num_of_stream; $i++) {
|
||||
$subform = new Application_Form_StreamSettingSubForm();
|
||||
$subform->setPrefix($i);
|
||||
$subform->setSetting($setting);
|
||||
$subform->setStreamTypes($stream_types);
|
||||
$subform->setStreamBitrates($stream_bitrates);
|
||||
$subform->startForm();
|
||||
$subform->toggleState();
|
||||
$form->addSubForm($subform, "s".$i."_subform");
|
||||
}
|
||||
|
||||
$live_stream_subform->updateVariables();
|
||||
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
|
||||
if ($request->isPost()) {
|
||||
if ($form->isValid($values)) {
|
||||
$this->_helper->json->sendJson(array(
|
||||
"valid"=>"true",
|
||||
"html"=>$this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass"=>$s1_set_admin_pass,
|
||||
"s2_set_admin_pass"=>$s2_set_admin_pass,
|
||||
"s3_set_admin_pass"=>$s3_set_admin_pass,
|
||||
"s4_set_admin_pass"=>$s4_set_admin_pass,
|
||||
"valid" => "true",
|
||||
"html" => $this->view->render('preference/stream-setting.phtml'),
|
||||
"s1_set_admin_pass" => $s1_set_admin_pass,
|
||||
"s2_set_admin_pass" => $s2_set_admin_pass,
|
||||
"s3_set_admin_pass" => $s3_set_admin_pass,
|
||||
"s4_set_admin_pass" => $s4_set_admin_pass,
|
||||
));
|
||||
} else {
|
||||
$live_stream_subform->updateVariables();
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->_helper->json->sendJson(array("valid"=>"false", "html"=>$this->view->render('preference/stream-setting.phtml')));
|
||||
$this->_helper->json->sendJson(array("valid" => "false", "html" => $this->view->render('preference/stream-setting.phtml')));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$live_stream_subform->updateVariables();
|
||||
|
||||
$this->view->num_stream = $num_of_stream;
|
||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||
$this->view->form = $form;
|
||||
/**
|
||||
* Set stream settings preferences
|
||||
*
|
||||
* @param array $values stream setting preference values
|
||||
*/
|
||||
private function setStreamPreferences($values) {
|
||||
Application_Model_Preference::setUsingCustomStreamSettings($values['customStreamSettings']);
|
||||
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
|
||||
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
|
||||
Application_Model_Preference::SetLiveStreamMasterPassword($values["master_password"]);
|
||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
}
|
||||
|
||||
public function serverBrowseAction()
|
||||
|
|
|
@ -41,6 +41,9 @@ class ProvisioningController extends Zend_Controller_Action
|
|||
if (isset($_POST['provisioning_status'])) {
|
||||
Application_Model_Preference::setProvisioningStatus($_POST['provisioning_status']);
|
||||
}
|
||||
if (isset($_POST['icecast_pass'])) {
|
||||
Application_Model_Preference::setDefaultIcecastPassword($_POST['icecast_pass']);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->getResponse()
|
||||
->setHttpResponseCode(400)
|
||||
|
|
43
airtime_mvc/application/controllers/SetupController.php
Normal file
43
airtime_mvc/application/controllers/SetupController.php
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/** This class displays the Language and Timezone setup popup dialog that you see on first run. */
|
||||
|
||||
class SetupController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
||||
$ajaxContext->addActionContext('setup-language-timezone', 'json');
|
||||
}
|
||||
|
||||
public function setupLanguageTimezoneAction()
|
||||
{
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$form = new Application_Form_SetupLanguageTimezone();
|
||||
|
||||
if ($request->isPost()) {
|
||||
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$currentUserId = $currentUser->getDbId();
|
||||
|
||||
Application_Model_Preference::SetUserTimezone($formData["setup_timezone"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultTimezone($formData["setup_timezone"]);
|
||||
|
||||
Application_Model_Preference::SetUserLocale($formData["setup_language"], $currentUserId);
|
||||
Application_Model_Preference::SetDefaultLocale($formData["setup_language"]);
|
||||
|
||||
Application_Model_Preference::setLangTimezoneSetupComplete(true);
|
||||
|
||||
$this->_redirect('/Showbuilder');
|
||||
}
|
||||
}
|
||||
$this->_redirect('/Showbuilder');
|
||||
}
|
||||
|
||||
}
|
|
@ -45,6 +45,7 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
//$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColReorder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.FixedColumns.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.columnFilter.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/js-timezone-detect/jstz-1.0.4.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
@ -55,66 +56,8 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColVis.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
|
||||
|
||||
$refer_sses = new Zend_Session_Namespace('referrer');
|
||||
|
||||
if ($request->isPost()) {
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
|
||||
$values = $request->getPost();
|
||||
if ($values["Publicise"] != 1 && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
session_start(); //open session for writing again
|
||||
// unset referrer
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
} elseif ($values["Publicise"] == '1' && $form->isValid($values)) {
|
||||
Application_Model_Preference::SetHeadTitle($values["stnName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
|
||||
$form->Logo->receive();
|
||||
$imagePath = $form->Logo->getFileName();
|
||||
|
||||
Application_Model_Preference::SetStationCountry($values["Country"]);
|
||||
Application_Model_Preference::SetStationCity($values["City"]);
|
||||
Application_Model_Preference::SetStationDescription($values["Description"]);
|
||||
Application_Model_Preference::SetStationLogo($imagePath);
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
session_start(); //open session for writing again
|
||||
// unset referrer
|
||||
Zend_Session::namespaceUnset('referrer');
|
||||
} else {
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
//popup if previous page was login
|
||||
if ($refer_sses->referrer == 'login' && Application_Model_Preference::ShouldShowPopUp()
|
||||
&& !Application_Model_Preference::GetSupportFeedback() && $user->isAdmin()){
|
||||
|
||||
$form = new Application_Form_RegisterAirtime();
|
||||
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
if ($logo) {
|
||||
$this->view->logoImg = $logo;
|
||||
}
|
||||
$this->view->dialog = $form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/register.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
//Show the timezone and language setup popup, if needed.
|
||||
$this->checkAndShowSetupPopup($request);
|
||||
|
||||
//determine whether to remove/hide/display the library.
|
||||
$showLib = false;
|
||||
|
@ -186,6 +129,26 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
|
||||
}
|
||||
|
||||
/** Check if we need to show the timezone/language setup popup and display it. (eg. on first run) */
|
||||
public function checkAndShowSetupPopup($request)
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
$setupComplete = Application_Model_Preference::getLangTimezoneSetupComplete();
|
||||
$previousPage = $request->getHeader('Referer');
|
||||
$userService = new Application_Service_UserService();
|
||||
$currentUser = $userService->getCurrentUser();
|
||||
$previousPageWasLoginScreen = strpos(strtolower($previousPage), 'login') !== false;
|
||||
|
||||
// If current user is Super Admin, and they came from the login page,
|
||||
// and they have not seen the setup popup before
|
||||
if ($currentUser->isSuperAdmin() && $previousPageWasLoginScreen && empty($setupComplete)) {
|
||||
$lang_tz_popup_form = new Application_Form_SetupLanguageTimezone();
|
||||
$this->view->lang_tz_popup_form = $lang_tz_popup_form;
|
||||
$this->view->headScript()->appendFile($baseUrl.'js/airtime/nowplaying/lang-timezone-setup.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
}
|
||||
}
|
||||
|
||||
public function contextMenuAction()
|
||||
{
|
||||
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
<?php
|
||||
require_once 'customvalidators/ConditionalNotEmpty.php';
|
||||
|
||||
class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_email_server.phtml'))
|
||||
));
|
||||
|
||||
// Enable system emails
|
||||
$this->addElement('checkbox', 'enableSystemEmail', array(
|
||||
'label' => _('Enable System Emails (Password Reset)'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetEnableSystemEmail(),
|
||||
'decorators' => array(
|
||||
'ViewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'systemEmail', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _("Reset Password 'From' Email"),
|
||||
'value' => Application_Model_Preference::GetSystemEmail(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper')
|
||||
));
|
||||
|
||||
$this->addElement('checkbox', 'configureMailServer', array(
|
||||
'label' => _('Configure Mail Server'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetMailServerConfigured(),
|
||||
'decorators' => array (
|
||||
'viewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('checkbox', 'msRequiresAuth', array(
|
||||
'label' => _('Requires Authentication'),
|
||||
'required' => false,
|
||||
'value' => Application_Model_Preference::GetMailServerRequiresAuth(),
|
||||
'decorators' => array(
|
||||
'viewHelper'
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'mailServer', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Mail Server'),
|
||||
'value' => Application_Model_Preference::GetMailServer(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1'
|
||||
))
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('text', 'email', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Email Address'),
|
||||
'value' => Application_Model_Preference::GetMailServerEmailAddress(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1',
|
||||
'msRequiresAuth' => '1'
|
||||
))
|
||||
)
|
||||
));
|
||||
|
||||
$this->addElement('password', 'ms_password', array(
|
||||
'class' => 'input_text',
|
||||
'label' => _('Password'),
|
||||
'value' => Application_Model_Preference::GetMailServerPassword(),
|
||||
'readonly' => true,
|
||||
'decorators' => array('viewHelper'),
|
||||
'allowEmpty' => false,
|
||||
'validators' => array(
|
||||
new ConditionalNotEmpty(array(
|
||||
'configureMailServer' => '1',
|
||||
'msRequiresAuth' => '1'
|
||||
))
|
||||
),
|
||||
'renderPassword' => true
|
||||
));
|
||||
|
||||
$port = new Zend_Form_Element_Text('port');
|
||||
$port->class = 'input_text';
|
||||
$port->setRequired(false)
|
||||
->setValue(Application_Model_Preference::GetMailServerPort())
|
||||
->setLabel(_('Port'))
|
||||
->setAttrib('readonly', true)
|
||||
->setDecorators(array('viewHelper'));
|
||||
|
||||
$this->addElement($port);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -7,7 +7,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultTransitionFade();
|
||||
|
||||
|
@ -103,7 +102,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$this->addElement($showSourceMount);
|
||||
|
||||
// demo only code
|
||||
if (!$isStreamConfigable) {
|
||||
if ($isDemo) {
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if ($element->getType() != 'Zend_Form_Element_Hidden') {
|
||||
|
|
|
@ -40,7 +40,7 @@ class Application_Form_PasswordChange extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Get new password'),
|
||||
'label' => _('Save'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
|
|
@ -11,7 +11,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('text', 'email', array(
|
||||
'label' => _('E-mail'),
|
||||
'label' => _('Email'),
|
||||
'required' => true,
|
||||
'filters' => array(
|
||||
'stringTrim',
|
||||
|
@ -33,7 +33,7 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
));
|
||||
|
||||
$this->addElement('submit', 'submit', array(
|
||||
'label' => _('Restore password'),
|
||||
'label' => _('Reset password'),
|
||||
'ignore' => true,
|
||||
'class' => 'ui-button ui-widget ui-state-default ui-button-text-only center',
|
||||
'decorators' => array(
|
||||
|
@ -41,12 +41,14 @@ class Application_Form_PasswordRestore extends Zend_Form
|
|||
)
|
||||
));
|
||||
|
||||
/*
|
||||
$cancel = new Zend_Form_Element_Button("cancel");
|
||||
$cancel->class = 'ui-button ui-widget ui-state-default ui-button-text-only center';
|
||||
$cancel->setLabel(_("Cancel"))
|
||||
$cancel->setLabel(_("Back"))
|
||||
->setIgnore(True)
|
||||
->setAttrib('onclick', 'redirectToLogin();')
|
||||
->setAttrib('onclick', 'window.location = ' . Zend_Controller_Front::getInstance()->getBaseUrl('login'))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($cancel);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
28
airtime_mvc/application/forms/SetupLanguageTimezone.php
Normal file
28
airtime_mvc/application/forms/SetupLanguageTimezone.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
class Application_Form_SetupLanguageTimezone extends Zend_Form_SubForm
|
||||
{
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/setup-lang-timezone.phtml'))));
|
||||
|
||||
$csrf_namespace = new Zend_Session_Namespace('csrf_namespace');
|
||||
$csrf_element = new Zend_Form_Element_Hidden('csrf');
|
||||
$csrf_element->setValue($csrf_namespace->authtoken)->setRequired('true')->removeDecorator('HtmlTag')->removeDecorator('Label');
|
||||
$this->addElement($csrf_element);
|
||||
|
||||
$language = new Zend_Form_Element_Select('setup_language');
|
||||
$language->setLabel(_("Station Language"));
|
||||
$language->setMultiOptions(Application_Model_Locale::getLocales());
|
||||
$this->addElement($language);
|
||||
|
||||
$timezone = new Zend_Form_Element_Select('setup_timezone');
|
||||
$timezone->setLabel(_("Station Timezone"));
|
||||
$timezone->setMultiOptions(Application_Common_Timezone::getTimezones());
|
||||
$this->addElement($timezone);
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,10 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
|
||||
public function startFrom()
|
||||
{
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'preference/stream-setting.phtml'))
|
||||
));
|
||||
|
||||
$setting = $this->setting;
|
||||
|
||||
$icecast_vorbis_metadata = new Zend_Form_Element_Checkbox('icecast_vorbis_metadata');
|
||||
|
@ -55,6 +59,13 @@ class Application_Form_StreamSetting extends Zend_Form
|
|||
->setAttribs(array('style' => "border: 0; color: #f6931f; font-weight: bold;"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($replay_gain);
|
||||
|
||||
$custom = Application_Model_Preference::getUsingCustomStreamSettings();
|
||||
$customSettings = new Zend_Form_Element_Radio('customStreamSettings');
|
||||
$customSettings->setLabel(_('Streaming Server:'));
|
||||
$customSettings->setMultiOptions(array(_("Airtime Pro Streaming"), _("Custom / 3rd Party Streaming")));
|
||||
$customSettings->setValue(!empty($custom) ? $custom : 0);
|
||||
$this->addElement($customSettings);
|
||||
}
|
||||
|
||||
public function isValid($data)
|
||||
|
|
|
@ -6,6 +6,8 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
private $stream_types;
|
||||
private $stream_bitrates;
|
||||
|
||||
static $customizable;
|
||||
|
||||
public function init()
|
||||
{
|
||||
|
||||
|
@ -39,54 +41,49 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$stream_types = $this->stream_types;
|
||||
$stream_bitrates = $this->stream_bitrates;
|
||||
|
||||
$streamDefaults = Application_Model_StreamSetting::getDefaults($prefix);
|
||||
// If we're not using custom stream settings, use the defaults
|
||||
$useDefaults = !Application_Model_Preference::getUsingCustomStreamSettings();
|
||||
|
||||
$this->setIsArray(true);
|
||||
$this->setElementsBelongTo($prefix."_data");
|
||||
|
||||
$disable_all = Application_Model_Preference::GetEnableStreamConf() == "false";
|
||||
|
||||
$enable = new Zend_Form_Element_Checkbox('enable');
|
||||
$enable->setLabel(_('Enabled:'))
|
||||
->setValue($setting[$prefix.'_enable'] == 'true' ? 1 : 0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$enable->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($enable);
|
||||
static::$customizable[] = $enable->getName();
|
||||
|
||||
$mobile = new Zend_Form_Element_Checkbox('mobile');
|
||||
$mobile->setLabel(_('Mobile:'));
|
||||
$mobile->setValue($setting[$prefix.'_mobile']);
|
||||
$mobile->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($mobile);
|
||||
static::$customizable[] = $mobile->getName();
|
||||
|
||||
$type = new Zend_Form_Element_Select('type');
|
||||
$type->setLabel(_("Stream Type:"))
|
||||
->setMultiOptions($stream_types)
|
||||
->setValue(isset($setting[$prefix.'_type'])?$setting[$prefix.'_type']:0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$type->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($type);
|
||||
static::$customizable[] = $type->getName();
|
||||
|
||||
$bitrate = new Zend_Form_Element_Select('bitrate');
|
||||
$bitrate->setLabel(_("Bit Rate:"))
|
||||
->setMultiOptions($stream_bitrates)
|
||||
->setValue(isset($setting[$prefix.'_bitrate'])?$setting[$prefix.'_bitrate']:0)
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$bitrate->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($bitrate);
|
||||
static::$customizable[] = $bitrate->getName();
|
||||
|
||||
$output = new Zend_Form_Element_Select('output');
|
||||
$output->setLabel(_("Service Type:"))
|
||||
->setMultiOptions(array("icecast"=>"Icecast", "shoutcast"=>"SHOUTcast"))
|
||||
->setValue(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast")
|
||||
->setValue($useDefaults ? $streamDefaults['output'] :
|
||||
(isset($setting[$prefix.'_output'])?$setting[$prefix.'_output']:"icecast"))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$output->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($output);
|
||||
|
||||
$channels = new Zend_Form_Element_Select('channels');
|
||||
|
@ -94,43 +91,35 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setMultiOptions(array("mono"=>_("1 - Mono"), "stereo"=>_("2 - Stereo")))
|
||||
->setValue(isset($setting[$prefix.'_channels']) ? $setting[$prefix.'_channels'] : "stereo")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$channels->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($channels);
|
||||
static::$customizable[] = $channels->getName();
|
||||
|
||||
$host = new Zend_Form_Element_Text('host');
|
||||
$host->setLabel(_("Server"))
|
||||
->setValue(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['host'] :
|
||||
(isset($setting[$prefix.'_host'])?$setting[$prefix.'_host']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[0-9a-zA-Z-_.]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$host->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$host->setAttrib('alt', 'domain');
|
||||
$this->addElement($host);
|
||||
|
||||
$port = new Zend_Form_Element_Text('port');
|
||||
$port->setLabel(_("Port"))
|
||||
->setValue(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['port'] :
|
||||
(isset($setting[$prefix.'_port'])?$setting[$prefix.'_port']:""))
|
||||
->setValidators(array(new Zend_Validate_Between(array('min'=>0, 'max'=>99999))))
|
||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>_('Only numbers are allowed.'))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$port->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($port);
|
||||
|
||||
$pass = new Zend_Form_Element_Text('pass');
|
||||
$pass->setLabel(_("Password"))
|
||||
->setValue(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['pass'] :
|
||||
(isset($setting[$prefix.'_pass'])?$setting[$prefix.'_pass']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$pass->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$pass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($pass);
|
||||
|
||||
|
@ -138,9 +127,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$genre->setLabel(_("Genre"))
|
||||
->setValue(isset($setting[$prefix.'_genre'])?$setting[$prefix.'_genre']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$genre->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($genre);
|
||||
|
||||
$url = new Zend_Form_Element_Text('url');
|
||||
|
@ -149,9 +135,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[0-9a-zA-Z\-_.:\/]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$url->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$url->setAttrib('alt', 'url');
|
||||
$this->addElement($url);
|
||||
|
||||
|
@ -159,41 +142,31 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
$name->setLabel(_("Name"))
|
||||
->setValue(isset($setting[$prefix.'_name'])?$setting[$prefix.'_name']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$name->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($name);
|
||||
|
||||
$description = new Zend_Form_Element_Text('description');
|
||||
$description->setLabel(_("Description"))
|
||||
->setValue(isset($setting[$prefix.'_description'])?$setting[$prefix.'_description']:"")
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$description->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$this->addElement($description);
|
||||
|
||||
$mount = new Zend_Form_Element_Text('mount');
|
||||
$mount->setLabel(_("Mount Point"))
|
||||
->setValue(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['mount'] :
|
||||
(isset($setting[$prefix.'_mount'])?$setting[$prefix.'_mount']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$mount->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$mount->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($mount);
|
||||
|
||||
$user = new Zend_Form_Element_Text('user');
|
||||
$user->setLabel(_("Username"))
|
||||
->setValue(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:"")
|
||||
->setValue($useDefaults ? $streamDefaults['user'] :
|
||||
(isset($setting[$prefix.'_user'])?$setting[$prefix.'_user']:""))
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$user->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$user->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($user);
|
||||
|
||||
|
@ -203,9 +176,6 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$adminUser->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$adminUser->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminUser);
|
||||
|
||||
|
@ -215,16 +185,16 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => _('Invalid character entered')))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
if ($disable_all) {
|
||||
$adminPass->setAttrib("disabled", "disabled");
|
||||
}
|
||||
$adminPass->setAttrib('alt', 'regular_text');
|
||||
$this->addElement($adminPass);
|
||||
|
||||
$liquidsopa_error_msg = '<div class="stream-status status-info"><h3>'._('Getting information from the server...').'</h3></div>';
|
||||
$liquidsoap_error_msg = '<div class="stream-status status-info"><h3>'._('Getting information from the server...').'</h3></div>';
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml', "stream_number"=>$stream_number, "enabled"=>$enable->getValue(), "liquidsoap_error_msg"=>$liquidsopa_error_msg))
|
||||
array('ViewScript', array('viewScript' => 'form/stream-setting-form.phtml',
|
||||
"stream_number"=>$stream_number,
|
||||
"enabled"=>$enable->getValue(),
|
||||
"liquidsoap_error_msg"=>$liquidsoap_error_msg))
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -232,7 +202,10 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
{
|
||||
$f_data = $data['s'.$this->prefix."_data"];
|
||||
$isValid = parent::isValid($f_data);
|
||||
if ($f_data['enable'] == 1) {
|
||||
// XXX: A couple of ugly workarounds here, but I guess that's what you get when you
|
||||
// combine an already-complex POST and GET into a single action...
|
||||
if (Application_Model_Preference::getUsingCustomStreamSettings() && $f_data) {
|
||||
if ($f_data['enable'] == 1 && isset($f_data["host"])) {
|
||||
if ($f_data['host'] == '') {
|
||||
$element = $this->getElement("host");
|
||||
$element->addError(_("Server cannot be empty."));
|
||||
|
@ -251,7 +224,20 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
||||
public function toggleState() {
|
||||
$elements = $this->getElements();
|
||||
foreach ($elements as $element) {
|
||||
if (Application_Model_Preference::getUsingCustomStreamSettings()) {
|
||||
$element->setAttrib('disabled', null);
|
||||
} else if (!(in_array($element->getName(), static::$customizable)
|
||||
|| $element->getType() == 'Zend_Form_Element_Hidden')) {
|
||||
$element->setAttrib('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,13 +30,13 @@ class Application_Model_Auth
|
|||
$e_link_port = $_SERVER['SERVER_PORT'];
|
||||
$e_link_path = $view->url(array('user_id' => $user->getDbId(), 'token' => $token), 'password-change');
|
||||
|
||||
$message = sprintf(_("Hi %s, \n\nClick this link to reset your password: "), $user->getDbLogin());
|
||||
$message = sprintf(_("Hi %s, \n\nPlease click this link to reset your password: "), $user->getDbLogin());
|
||||
$message .= "{$e_link_protocol}://{$e_link_base}:{$e_link_port}{$e_link_path}";
|
||||
$message .= sprintf(_pro("\n\nIf you have any problems, please contact our support team: %s"), SUPPORT_EMAIL_ADDRESS);
|
||||
$message .= sprintf(_pro("\n\nThank you,\nThe %s Team"), SAAS_PRODUCT_BRANDING_NAME);
|
||||
|
||||
$str = sprintf(_('%s Password Reset'), PRODUCT_NAME);
|
||||
$success = Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
|
||||
return $success;
|
||||
$str = sprintf(_('%s Password Reset'), SAAS_PRODUCT_BRANDING_NAME);
|
||||
return Application_Model_Email::send($str, $message, $user->getDbEmail());
|
||||
}
|
||||
|
||||
public function invalidateTokens($user, $action)
|
||||
|
|
|
@ -2,75 +2,20 @@
|
|||
|
||||
class Application_Model_Email
|
||||
{
|
||||
|
||||
/**
|
||||
* Send email
|
||||
*
|
||||
* @param string $subject
|
||||
* @param string $message
|
||||
* @param mixed $tos
|
||||
* @return void
|
||||
* @param mixed $to
|
||||
* @return boolean
|
||||
*/
|
||||
public static function send($subject, $message, $tos, $from = null)
|
||||
{
|
||||
$mailServerConfigured = Application_Model_Preference::GetMailServerConfigured() == true ? true : false;
|
||||
$mailServerRequiresAuth = Application_Model_Preference::GetMailServerRequiresAuth() == true ? true : false;
|
||||
$success = true;
|
||||
public static function send($subject, $message, $to) {
|
||||
|
||||
if ($mailServerConfigured) {
|
||||
$mailServer = Application_Model_Preference::GetMailServer();
|
||||
$mailServerPort = Application_Model_Preference::GetMailServerPort();
|
||||
if (!empty($mailServerPort)) {
|
||||
$port = $mailServerPort;
|
||||
}
|
||||
|
||||
if ($mailServerRequiresAuth) {
|
||||
$username = Application_Model_Preference::GetMailServerEmailAddress();
|
||||
$password = Application_Model_Preference::GetMailServerPassword();
|
||||
|
||||
$config = array(
|
||||
'auth' => 'login',
|
||||
'ssl' => 'ssl',
|
||||
'username' => $username,
|
||||
'password' => $password
|
||||
);
|
||||
} else {
|
||||
$config = array(
|
||||
'ssl' => 'tls'
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($port)) {
|
||||
$config['port'] = $port;
|
||||
}
|
||||
|
||||
$transport = new Zend_Mail_Transport_Smtp($mailServer, $config);
|
||||
}
|
||||
|
||||
$mail = new Zend_Mail('utf-8');
|
||||
$mail->setSubject($subject);
|
||||
$mail->setBodyText($message);
|
||||
|
||||
foreach ((array) $tos as $to) {
|
||||
$mail->addTo($to);
|
||||
}
|
||||
|
||||
if ($mailServerConfigured) {
|
||||
$mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetMailServerEmailAddress());
|
||||
try {
|
||||
$mail->send($transport);
|
||||
} catch (Exception $e) {
|
||||
$success = false;
|
||||
}
|
||||
} else {
|
||||
$mail->setFrom(isset($from) ? $from : Application_Model_Preference::GetSystemEmail());
|
||||
try {
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $success;
|
||||
$headers = sprintf('From: %s <noreply@account.sourcefabric.com>', SAAS_PRODUCT_BRANDING_NAME);
|
||||
return mail($to, $subject, $message, $headers);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1096,6 +1096,13 @@ class Application_Model_Preference
|
|||
|
||||
public static function GetSourceSwitchStatus($sourcename)
|
||||
{
|
||||
// Scheduled play switch should always be "on".
|
||||
// Even though we've hidden this element in the dashboard we should
|
||||
// always make sure it's on or else a station's stream could go offline.
|
||||
if ($sourcename == "scheduled_play") {
|
||||
return "on";
|
||||
}
|
||||
|
||||
$value = self::getValue($sourcename."_switch");
|
||||
return ($value == null || $value == "off") ? 'off' : 'on';
|
||||
}
|
||||
|
@ -1161,87 +1168,6 @@ class Application_Model_Preference
|
|||
{
|
||||
return self::getValue("auto_switch");
|
||||
}
|
||||
|
||||
public static function SetEnableSystemEmail($upload)
|
||||
{
|
||||
self::setValue("enable_system_email", $upload);
|
||||
}
|
||||
|
||||
public static function GetEnableSystemEmail()
|
||||
{
|
||||
$v = self::getValue("enable_system_email");
|
||||
return ($v === "") ? 0 : $v;
|
||||
}
|
||||
|
||||
public static function SetSystemEmail($value)
|
||||
{
|
||||
self::setValue("system_email", $value, false);
|
||||
}
|
||||
|
||||
public static function GetSystemEmail()
|
||||
{
|
||||
return self::getValue("system_email");
|
||||
}
|
||||
|
||||
public static function SetMailServerConfigured($value)
|
||||
{
|
||||
self::setValue("mail_server_configured", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerConfigured()
|
||||
{
|
||||
return self::getValue("mail_server_configured");
|
||||
}
|
||||
|
||||
public static function SetMailServer($value)
|
||||
{
|
||||
self::setValue("mail_server", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServer()
|
||||
{
|
||||
return self::getValue("mail_server");
|
||||
}
|
||||
|
||||
public static function SetMailServerEmailAddress($value)
|
||||
{
|
||||
self::setValue("mail_server_email_address", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerEmailAddress()
|
||||
{
|
||||
return self::getValue("mail_server_email_address");
|
||||
}
|
||||
|
||||
public static function SetMailServerPassword($value)
|
||||
{
|
||||
self::setValue("mail_server_password", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPassword()
|
||||
{
|
||||
return self::getValue("mail_server_password");
|
||||
}
|
||||
|
||||
public static function SetMailServerPort($value)
|
||||
{
|
||||
self::setValue("mail_server_port", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerPort()
|
||||
{
|
||||
return self::getValue("mail_server_port");
|
||||
}
|
||||
|
||||
public static function SetMailServerRequiresAuth($value)
|
||||
{
|
||||
self::setValue("mail_server_requires_auth", $value, false);
|
||||
}
|
||||
|
||||
public static function GetMailServerRequiresAuth()
|
||||
{
|
||||
return self::getValue("mail_server_requires_auth");
|
||||
}
|
||||
/* User specific preferences end */
|
||||
|
||||
public static function ShouldShowPopUp()
|
||||
|
@ -1512,6 +1438,29 @@ class Application_Model_Preference
|
|||
self::setValue("task_manager_lock", $value);
|
||||
}
|
||||
|
||||
// SAAS-876 - Toggle indicating whether user is using custom stream settings
|
||||
|
||||
public static function getUsingCustomStreamSettings() {
|
||||
$val = self::getValue("using_custom_stream_settings");
|
||||
return empty($val) ? false : $val;
|
||||
}
|
||||
|
||||
public static function setUsingCustomStreamSettings($value) {
|
||||
self::setValue("using_custom_stream_settings", $value);
|
||||
}
|
||||
|
||||
// SAAS-876 - Store the default Icecast password to restore when switching
|
||||
// back to Airtime Pro streaming settings
|
||||
|
||||
public static function getDefaultIcecastPassword() {
|
||||
$val = self::getValue("default_icecast_password");
|
||||
return empty($val) ? DEFAULT_ICECAST_PASS : $val;
|
||||
}
|
||||
|
||||
public static function setDefaultIcecastPassword($value) {
|
||||
self::setValue("default_icecast_password", $value);
|
||||
}
|
||||
|
||||
public static function getRadioPageDisplayLoginButton()
|
||||
{
|
||||
return self::getValue("radio_page_display_login_button");
|
||||
|
@ -1521,4 +1470,14 @@ class Application_Model_Preference
|
|||
{
|
||||
self::setValue("radio_page_display_login_button", $value);
|
||||
}
|
||||
|
||||
public static function getLangTimezoneSetupComplete()
|
||||
{
|
||||
return self::getValue("lang_tz_setup_complete");
|
||||
}
|
||||
|
||||
public static function setLangTimezoneSetupComplete($value)
|
||||
{
|
||||
self::setValue("lang_tz_setup_complete", $value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,6 +246,10 @@ class Application_Model_StreamSetting
|
|||
} elseif (is_array($d)) {
|
||||
$temp = explode('_', $key);
|
||||
$prefix = $temp[0];
|
||||
// SAAS-876 - If we're using Airtime Pro streaming, set the stream to use the default settings
|
||||
if (!Application_Model_Preference::getUsingCustomStreamSettings()) {
|
||||
$d = array_merge($d, static::getDefaults($prefix));
|
||||
}
|
||||
foreach ($d as $k => $v) {
|
||||
$keyname = $prefix . "_" . $k;
|
||||
if ($k == 'enable') {
|
||||
|
@ -265,8 +269,28 @@ class Application_Model_StreamSetting
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SAAS-876 - Get the default stream settings values for Airtime Pro streaming
|
||||
*
|
||||
* @param int $prefix
|
||||
*
|
||||
* @return array array of default stream setting values
|
||||
*/
|
||||
public static function getDefaults($prefix) {
|
||||
$config = Config::getConfig();
|
||||
return array(
|
||||
'host' => $config['stationId'] . ".out.airtime.pro",
|
||||
'port' => DEFAULT_ICECAST_PORT,
|
||||
'output' => 'icecast',
|
||||
'user' => $config['stationId'],
|
||||
'pass' => Application_Model_Preference::getDefaultIcecastPassword(),
|
||||
// Kind of ugly... convert prefix int to ascii char
|
||||
'mount' => $config['stationId'] . '_' . chr($prefix[1] + 96),
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets indivisual stream setting.
|
||||
* Sets individual stream setting.
|
||||
*
|
||||
* $data - data array. $data is [].
|
||||
* TODO: Make this SQL a prepared statement!
|
||||
|
|
|
@ -18,6 +18,11 @@ class CcSubjs extends BaseCcSubjs {
|
|||
return $this->type === UTYPE_SUPERADMIN || $this->type === UTYPE_ADMIN || $this->type === UTYPE_PROGRAM_MANAGER;
|
||||
}
|
||||
|
||||
public function isSuperAdmin()
|
||||
{
|
||||
return $this->type === UTYPE_SUPERADMIN;
|
||||
}
|
||||
|
||||
public function isHostOfShow($showId)
|
||||
{
|
||||
return CcShowHostsQuery::create()
|
||||
|
|
|
@ -30,17 +30,15 @@
|
|||
|
||||
<?php echo $this->element->getElement('csrf') ?>
|
||||
|
||||
<?php if (Application_Model_Preference::GetEnableSystemEmail()): ?>
|
||||
<dt id="reset-label" class="hidden"> </dt>
|
||||
<dd id="reset-element" class="text-right">
|
||||
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Reset password") ?></a>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
<?php echo $this->element->getElement('captcha') ?>
|
||||
<dt id="submit-label"> </dt>
|
||||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dt id="reset-label" class="hidden"> </dt>
|
||||
<dd id="reset-element" class="text-right">
|
||||
<a href="<?php echo $this->baseUrl('login/password-restore'); ?>" class="link reset"><?php echo _("Forgot your password?") ?></a>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<fieldset>
|
||||
<legend>Station Owners</legend>
|
||||
<p>
|
||||
<?php echo(sprintf(_pro("If you are the primary owner of this station, <a href=\"%s\">please reset your password here</a>."), WHMCS_PASSWORD_RESET_URL)); ?>
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>DJs, Program Managers, and Others</legend>
|
||||
<form enctype="application/x-www-form-urlencoded" method="post" action="">
|
||||
<dl class="zend_form">
|
||||
|
||||
<p>Please enter both your username and email address.</p>
|
||||
<dt id="username-label">
|
||||
<label for="username" class="required">
|
||||
<?php echo $this->element->getElement('username')->getLabel() ?>
|
||||
|
@ -8,6 +19,7 @@
|
|||
<dd id="username-element">
|
||||
<?php echo $this->element->getElement('username') ?>
|
||||
</dd>
|
||||
</dt>
|
||||
|
||||
<dt id="email-label">
|
||||
<label for="email" class="required">
|
||||
|
@ -17,9 +29,9 @@
|
|||
<dd id="email-element">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
</dd>
|
||||
<?php if($this->element->getElement('email')->hasErrors()): ?>
|
||||
<?php if ($this->element->getElement('email')->hasErrors()): ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<?php foreach ($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
@ -29,8 +41,14 @@
|
|||
<dd id="submit-element">
|
||||
<?php echo $this->element->getElement('submit') ?>
|
||||
</dd>
|
||||
|
||||
<dd id="cancel-element">
|
||||
<?php echo $this->element->getElement('cancel') ?>
|
||||
|
||||
<a href="<?php echo($this->baseUrl('login')); ?>">
|
||||
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</form>
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<div id="lang-timezone-popup" class="dialogPopup register-dialog" title="<?php echo sprintf(_("Welcome to %s!"), SAAS_PRODUCT_BRANDING_NAME); ?>" style="display: none;">
|
||||
<form id="lang-timezone-form" method="post" action="/setup/setup-language-timezone">
|
||||
<fieldset>
|
||||
<dl class="zend_form">
|
||||
<?php echo $this->element->getElement('csrf') ?>
|
||||
|
||||
<?php echo $this->element->getElement('setup_language')->render(); ?>
|
||||
|
||||
<?php echo $this->element->getElement('setup_timezone')->render(); ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<p style="margin-bottom: 0px; text-align: center;">You can change these later in your preferences and user settings.</p>
|
||||
|
||||
</form>
|
||||
</div>
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
$s_name = "s".$this->stream_number;
|
||||
?>
|
||||
<h3 class="collapsible-header <?php echo $this->stream_number == '1'?"closed":""?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number?></h3>
|
||||
<h3 class="collapsible-header <?php echo $this->enabled == 0?"closed":""?>"><span class="arrow-icon"></span><?php echo _("Stream "); ?><?php echo $this->stream_number?></h3>
|
||||
<div class="stream-setting-content" <?php echo $this->enabled == 0?'style="display: none;':''?> id="<?php echo $s_name?>-config">
|
||||
<fieldset class="padded">
|
||||
<dl class="zend_form clearfix">
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Email sent") ?></h2>
|
||||
<h2><?php echo _("Email Sent!") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light"><?php echo _("An email has been sent") ?></p>
|
||||
<p><a class="link" href="<?php echo $this->baseUrl('login'); ?>"><?php echo _("Back to login screen") ?></a></p>
|
||||
<p class="light"><?php echo _("A password reset link has been sent to your email address. Please check your email and follow the instructions inside to reset your password. If you don't see the email, please check your spam folder!") ?></p>
|
||||
<br>
|
||||
<dl class="zend-form">
|
||||
<dd id="cancel-element">
|
||||
<a href="<?php echo($this->baseUrl('login')); ?>">
|
||||
<button name="cancel" type="button" class="ui-button ui-widget ui-state-default ui-button-text-only center"><?php echo(_("Back")); ?></button>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
<div class="login_box">
|
||||
<div class="logobox"> </div>
|
||||
<h2><?php echo _("Reset password") ?></h2>
|
||||
<h2><?php echo _("Password Reset") ?></h2>
|
||||
|
||||
<div id="login" class="login-content clearfix">
|
||||
<p class="light">
|
||||
<?php echo _("Please enter your account e-mail address. You will receive a link to create a new password via e-mail.")?>
|
||||
</p>
|
||||
<?php echo $this->form; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
<div class="source-info-block">
|
||||
<h3><?php echo _("Source Streams") ?></h3>
|
||||
<ul>
|
||||
<ul style="padding-top: 10px;">
|
||||
<li>
|
||||
<div id="master_dj_div" class="source-label">
|
||||
<a id="master_dj" class="source-kick-button" onclick="kickSource(this)"></a>
|
||||
|
@ -41,12 +41,6 @@
|
|||
<a href="#" id="live_dj" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->live_dj_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
<li>
|
||||
<div id="scheduled_play_div" class="source-label"><?php echo " "._("Scheduled Play") ?></div>
|
||||
<div class="line-to-switch"></div>
|
||||
<a href="#" id="scheduled_play" class="source-switch-button" onclick="setSwitchListener(this);"><span><?php echo $this->scheduled_play_switch?></span></a>
|
||||
<div class="line-to-on-air"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="on-air-block">
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
|
||||
<h2 <?php if($this->enable_stream_conf == "true"){?>style="float:left"<?php }?>><?php echo _("Stream Settings") ?></h2>
|
||||
<h2 style="float:left"><?php echo _("Stream Settings") ?></h2>
|
||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||
<?php if($this->enable_stream_conf == "true"){?>
|
||||
<form method="post" id="stream_form" enctype="application/x-www-form-urlencoded">
|
||||
<button name="stream_save" id="stream_save" type="button" class="btn btn-small right-floated"><?php echo _("Save") ?></button>
|
||||
<button name="stream_save" id="stream_save_top" type="button" class="btn btn-small right-floated"><?php echo _("Save") ?></button>
|
||||
<?php echo $this->form->getElement('csrf') ?>
|
||||
<div style="clear:both"></div>
|
||||
<?php }?>
|
||||
<?php echo $this->statusMsg;?>
|
||||
<div style="float: left; margin-right: 10px; width: 490px; overflow: auto;">
|
||||
<fieldset class="padded stream-setting-global">
|
||||
|
@ -39,6 +37,7 @@
|
|||
<dd id="vorbisMetadata-element">
|
||||
<?php echo $this->form->getElement('icecast_vorbis_metadata') ?>
|
||||
</dd>
|
||||
|
||||
<dt id="streamFormat-label">
|
||||
<label class="optional"><?php echo $this->form->getElement('streamFormat')->getLabel() ?></label>
|
||||
</dt>
|
||||
|
@ -106,15 +105,15 @@
|
|||
<fieldset class="padded">
|
||||
<legend><?php echo _("Output Stream Settings") ?></legend>
|
||||
<?php
|
||||
// TODO: replace this with something that looks good
|
||||
echo $this->form->getElement('customStreamSettings')->render();
|
||||
for($i=1;$i<=$this->num_stream;$i++){
|
||||
echo $this->form->getSubform("s".$i."_subform");
|
||||
}
|
||||
?>
|
||||
</fieldset>
|
||||
<?php if($this->enable_stream_conf == "true"){?>
|
||||
<br />
|
||||
<button name="stream_save" id="stream_save" type="button" class="btn btn-small right-floated"><?php echo _("Save") ?></button>
|
||||
<?php }?>
|
||||
<button name="stream_save" id="stream_save_bottom" type="button" class="btn btn-small right-floated"><?php echo _("Save") ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -20,5 +20,4 @@
|
|||
<table id="show_builder_table" cellpadding="0" cellspacing="0" class="datatable"></table>
|
||||
</div>
|
||||
|
||||
|
||||
<?php echo $this->dialog ?>
|
||||
<?php echo $this->lang_tz_popup_form; ?>
|
||||
|
|
|
@ -21,6 +21,19 @@ html, body {
|
|||
text-align:center;
|
||||
}
|
||||
|
||||
#login-page fieldset
|
||||
{
|
||||
padding: 10px;
|
||||
border: 1px solid #555;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#login-page legend {
|
||||
font-weight: bold;
|
||||
color: #919191;
|
||||
}
|
||||
|
||||
|
||||
h2 {
|
||||
color: #000000;
|
||||
font-size: 2.1em;
|
||||
|
@ -1070,7 +1083,7 @@ input[type="checkbox"] {
|
|||
margin:0;
|
||||
padding:8px 0 16px 0;
|
||||
font-size:12px;
|
||||
color:#717171;
|
||||
color: #919191;
|
||||
text-align:left;
|
||||
}
|
||||
.logobox {
|
||||
|
@ -1195,13 +1208,17 @@ input[type="checkbox"] {
|
|||
.login-content .text-right, .text-right {
|
||||
text-align:right;
|
||||
}
|
||||
.login-content .link {
|
||||
.login-content a {
|
||||
color:#FF5D1A;
|
||||
text-decoration:none;
|
||||
}
|
||||
.login-content .link:hover {
|
||||
}
|
||||
.login-content a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
}
|
||||
|
||||
.login-content .errors a {
|
||||
color: #ff1c13;
|
||||
}
|
||||
|
||||
/*---//////////////////// END LOGIN ////////////////////---*/
|
||||
|
||||
|
@ -1888,6 +1905,7 @@ span.errors.sp-errors{
|
|||
margin:8px 0 0 0;
|
||||
cursor:pointer;
|
||||
position:relative;
|
||||
clear: both;
|
||||
}
|
||||
.collapsible-content {
|
||||
margin-top:-1px;
|
||||
|
@ -2234,6 +2252,10 @@ span.errors.sp-errors{
|
|||
width: 1100px;
|
||||
}
|
||||
|
||||
#stream_save_bottom {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.preferences .padded {
|
||||
margin-top: 5px; /* Firefox needs this */
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ $(document).ready(function() {
|
|||
unique_names : 'true',
|
||||
multiple_queues : 'true',
|
||||
filters : [
|
||||
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,wav,m4a,mp4,opus"}
|
||||
{title: "Audio Files", extensions: "ogg,mp3,oga,flac,wav,m4a,mp4,opus,aac,oga,mp1,mp2,wma,au"}
|
||||
],
|
||||
multipart_params : {
|
||||
"csrf_token" : $("#csrf").attr('value'),
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
function redirectToLogin(){
|
||||
window.location = baseUrl+"Login"
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
var dialog = $("#lang-timezone-popup");
|
||||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
width: 500,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
position:['center','center'],
|
||||
buttons: [
|
||||
{
|
||||
id: "setup-later",
|
||||
text: $.i18n._("Not Now"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "help_airtime",
|
||||
text: $.i18n._("OK"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
$("#lang-timezone-form").submit();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
var language = window.navigator.userLanguage || window.navigator.language;
|
||||
if (language === undefined) {
|
||||
language = "en_CA";
|
||||
}
|
||||
language = language.replace("-", "_");
|
||||
$("#setup_language").val(language);
|
||||
|
||||
var timezone = jstz.determine();
|
||||
var timezone_name = timezone.name();
|
||||
if (timezone_name === undefined) {
|
||||
timezone_name = "America/Toronto";
|
||||
}
|
||||
$("#setup_timezone").val(timezone_name);
|
||||
|
||||
dialog.dialog('open');
|
||||
});
|
|
@ -28,7 +28,7 @@ function rebuildStreamURL(ele){
|
|||
}else{
|
||||
streamurl = "http://"+host+":"+port+"/"
|
||||
}
|
||||
div.find("#stream_url").text(streamurl)
|
||||
div.find("#stream_url").html('<a href="' + streamurl + '" target="_blank">' + streamurl + '</a>')
|
||||
}
|
||||
function restrictOggBitrate(ele, on){
|
||||
var div = ele.closest("div")
|
||||
|
@ -468,19 +468,30 @@ $(document).ready(function() {
|
|||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
getAdminPasswordStatus();
|
||||
var s = $("[name^='customStreamSettings']:checked");
|
||||
|
||||
$('#stream_save').live('click', function(){
|
||||
var confirm_pypo_restart_text = sprintf($.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If %s is recording, and if the change causes a playout engine restart, the recording will be interrupted."), PRODUCT_NAME);
|
||||
$("[id^='stream_save'], [name^='customStreamSettings']").live('click', function() {
|
||||
var e = $(this);
|
||||
if (e[0] == s[0]) { return; }
|
||||
var confirm_pypo_restart_text = $.i18n._("WARNING: This will restart your stream and may cause a short dropout for your listeners!");
|
||||
if (confirm(confirm_pypo_restart_text)) {
|
||||
var data = $('#stream_form').serialize();
|
||||
var url = baseUrl+'Preference/stream-setting';
|
||||
|
||||
$.post(url, {format:"json", data: data}, function(json){
|
||||
$('#content').empty().append(json.html);
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass, json.s4_set_admin_pass);
|
||||
window.location.reload();
|
||||
//$('#content').empty().append(json.html);
|
||||
//setupEventListeners();
|
||||
//setSliderForReplayGain();
|
||||
//setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass, json.s4_set_admin_pass);
|
||||
});
|
||||
} else {
|
||||
if (e.prop('checked')) {
|
||||
if (e[0] != s[0]) {
|
||||
e.prop('checked', false);
|
||||
s.prop('checked', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
2
airtime_mvc/public/js/js-timezone-detect/jstz-1.0.4.min.js
vendored
Normal file
2
airtime_mvc/public/js/js-timezone-detect/jstz-1.0.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
17
python_apps/pypo/pypo/mime.types
Normal file
17
python_apps/pypo/pypo/mime.types
Normal file
|
@ -0,0 +1,17 @@
|
|||
audio/ogg ogg
|
||||
application/ogg ogg
|
||||
audio/vorbis ogg
|
||||
audio/mp3 mp3
|
||||
audio/mpeg mp3
|
||||
audio/mpeg3 mp3
|
||||
audio/x-aac aac
|
||||
audio/aac aac
|
||||
audio/aacp aac
|
||||
audio/mp4 mp4
|
||||
audio/x-flac flac
|
||||
audio/wav wav
|
||||
audio/x-wav wav
|
||||
audio/mp2 mp2
|
||||
audio/mp1 mp1
|
||||
audio/x-ms-wma wma
|
||||
audio/basic au
|
|
@ -12,7 +12,7 @@ import signal
|
|||
from datetime import datetime
|
||||
import traceback
|
||||
import pure
|
||||
|
||||
import mimetypes
|
||||
from Queue import Empty
|
||||
from threading import Thread, Timer
|
||||
from subprocess import Popen, PIPE
|
||||
|
@ -377,6 +377,21 @@ class PypoFetch(Thread):
|
|||
start = datetime.strptime(media_item['start'], "%Y-%m-%d-%H-%M-%S")
|
||||
end = datetime.strptime(media_item['end'], "%Y-%m-%d-%H-%M-%S")
|
||||
|
||||
root, ext = os.path.splitext(media_item['uri'])
|
||||
mime = media_item['metadata']['mime']
|
||||
mimetypes.init()
|
||||
mime_ext = mimetypes.guess_extension(mime, strict=False)
|
||||
|
||||
if mime_ext is None:
|
||||
mimes = mimetypes.read_mime_types("%s/mime.types" % os.path.dirname(os.path.realpath(__file__)))
|
||||
for k, v in mimes.iteritems():
|
||||
if v == mime:
|
||||
mime_ext = k
|
||||
|
||||
if mime_ext is not None and mime_ext != ext:
|
||||
self.logger.info("Invalid extension %s for file %s, changing to %s" % (ext, root, mime_ext))
|
||||
media_item['uri'] = root + mime_ext
|
||||
|
||||
length1 = pure.date_interval_to_seconds(end - start)
|
||||
length2 = media_item['cue_out'] - media_item['cue_in']
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ setup(name='airtime-playout',
|
|||
license='AGPLv3',
|
||||
packages=['pypo', 'pypo.media', 'pypo.media.update',
|
||||
'liquidsoap', 'liquidsoap.library'],
|
||||
package_data={'': ['*.liq', '*.cfg']},
|
||||
package_data={'': ['*.liq', '*.cfg', '*.types']},
|
||||
scripts=[
|
||||
'bin/airtime-playout',
|
||||
'bin/airtime-liquidsoap',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue