Merge branch 'saas-dev' into soundcloud

This commit is contained in:
Duncan Sommerville 2015-09-08 16:01:06 -04:00
commit f243014d9f
271 changed files with 123614 additions and 117677 deletions

View file

@ -64,6 +64,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('update-stream-setting-table' , 'json')
->addActionContext('update-replay-gain-value' , 'json')
->addActionContext('update-cue-values-by-silan' , 'json')
->addActionContext('get-usability-hint' , 'json')
->initContext();
}
@ -1466,5 +1467,13 @@ class ApiController extends Zend_Controller_Action
}
$this->_helper->json->sendJson(array(1));
}
public function getUsabilityHintAction()
{
$userPath = $this->_getParam("userPath");
$hint = Application_Common_UsabilityHints::getUsabilityHint($userPath);
$this->_helper->json->sendJson($hint);
}
}

View file

@ -21,6 +21,9 @@ class BillingController extends Zend_Controller_Action {
public function upgradeAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);
@ -28,21 +31,24 @@ class BillingController extends Zend_Controller_Action {
$request = $this->getRequest();
$form = new Application_Form_BillingUpgradeDowngrade();
if ($request->isPost()) {
$formData = $request->getPost();
if ($form->isValid($formData)) {
$credentials = Billing::getAPICredentials();
//Check if VAT should be applied or not to this invoice.
if (in_array("7", $formData["customfields"])) {
$apply_vat = Billing::checkIfVatShouldBeApplied($formData["customfields"]["7"], $formData["country"]);
} else {
$apply_vat = false;
}
$placeAnUpgradeOrder = true;
$currentPlanProduct = Billing::getClientCurrentAirtimeProduct();
$currentPlanProductId = $currentPlanProduct["pid"];
$currentPlanProductBillingCycle = strtolower($currentPlanProduct["billingcycle"]);
@ -51,33 +57,33 @@ class BillingController extends Zend_Controller_Action {
//and it freaks out and does the wrong thing if we do it via the API
//so we have to do avoid that.
if (($currentPlanProductId == $formData["newproductid"]) &&
($currentPlanProductBillingCycle == $formData["newproductbillingcycle"]))
{
($currentPlanProductBillingCycle == $formData["newproductbillingcycle"])
) {
$placeAnUpgradeOrder = false;
}
$postfields = array();
$postfields["username"] = $credentials["username"];
$postfields["password"] = md5($credentials["password"]);
$postfields["action"] = "upgradeproduct";
$postfields["clientid"] = Application_Model_Preference::GetClientId();
$postfields["serviceid"] = Billing::getClientInstanceId();
$postfields["type"] = "product";
$postfields["newproductid"] = $formData["newproductid"];
$postfields["newproductbillingcycle"] = $formData["newproductbillingcycle"];
$postfields["paymentmethod"] = $formData["paymentmethod"];
$postfields["responsetype"] = "json";
$upgrade_query_string = "";
foreach ($postfields AS $k=>$v) $upgrade_query_string .= "$k=".urlencode($v)."&";
foreach ($postfields AS $k => $v) $upgrade_query_string .= "$k=" . urlencode($v) . "&";
//update client info
$clientfields = array();
$clientfields["username"] = $credentials["username"];
$clientfields["password"] = md5($credentials["password"]);
$clientfields["action"] = "updateclient";
$clientfields["action"] = "updateclient";
$clientfields["clientid"] = Application_Model_Preference::GetClientId();
$clientfields["customfields"] = base64_encode(serialize($formData["customfields"]));
unset($formData["customfields"]);
@ -90,8 +96,8 @@ class BillingController extends Zend_Controller_Action {
unset($clientfields["password2verify"]);
unset($clientfields["submit"]);
$client_query_string = "";
foreach ($clientfields AS $k=>$v) $client_query_string .= "$k=".urlencode($v)."&";
foreach ($clientfields AS $k => $v) $client_query_string .= "$k=" . urlencode($v) . "&";
//Update the client details in WHMCS first
$result = Billing::makeRequest($credentials["url"], $client_query_string);
Logging::info($result);
@ -100,33 +106,39 @@ class BillingController extends Zend_Controller_Action {
$this->view->form = $form;
return;
}
//If there were no changes to the plan or billing cycle, we just redirect you to the
//invoices screen and show a message.
if (!$placeAnUpgradeOrder)
{
if (!$placeAnUpgradeOrder) {
$this->_redirect('billing/invoices?planupdated');
return;
}
//Then place an upgrade order in WHMCS
$result = Billing::makeRequest($credentials["url"], $upgrade_query_string);
if ($result["result"] == "error") {
Logging::info($_SERVER['HTTP_HOST']." - Account upgrade failed. - ".$result["message"]);
Logging::info($_SERVER['HTTP_HOST'] . " - Account upgrade failed. - " . $result["message"]);
$this->setErrorMessage();
$this->view->form = $form;
} else {
Logging::info($_SERVER['HTTP_HOST']. "Account plan upgrade request:");
Logging::info($_SERVER['HTTP_HOST'] . "Account plan upgrade request:");
Logging::info($result);
// Disable the view and the layout here, squashes an error.
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
if ($apply_vat) {
Billing::addVatToInvoice($result["invoiceid"]);
}
self::viewInvoice($result["invoiceid"]);
// there may not be an invoice created if the client is downgrading
if (!empty($result["invoiceid"])) {
self::viewInvoice($result["invoiceid"]);
} else {
$this->_redirect('billing/invoices?planupdated');
return;
}
}
} else {
$this->view->form = $form;
@ -207,6 +219,8 @@ class BillingController extends Zend_Controller_Action {
public function clientAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);
@ -257,6 +271,8 @@ class BillingController extends Zend_Controller_Action {
public function invoicesAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Billing');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/billing.css?'.$CC_CONFIG['airtime_version']);

View file

@ -108,11 +108,12 @@ class DashboardController extends Zend_Controller_Action
public function helpAction()
{
// action body
Zend_Layout::getMvcInstance()->assign('parent_page', 'Help');
}
public function aboutAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Help');
$this->view->airtime_version = Application_Model_Preference::GetAirtimeVersion();
}

View file

@ -8,8 +8,10 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
}
public function indexAction()
public function playerAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headLink()->appendStylesheet($baseUrl.'css/player-form.css?'.$CC_CONFIG['airtime_version']);
@ -27,6 +29,13 @@ class EmbeddableWidgetsController extends Zend_Controller_Action
1. Enable at least one MP3, AAC, or OGG stream under System -> Streams<br>
2. Enable the Public Airtime API under System -> Preferences");
}
}
public function scheduleAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Widgets');
$apiEnabled = Application_Model_Preference::GetAllow3rdPartyApi();
if (!$apiEnabled) {
$this->view->weekly_schedule_error_msg = _("To use the embeddable weekly schedule widget you must:<br><br>

View file

@ -16,8 +16,6 @@ class LibraryController extends Zend_Controller_Action
->addActionContext('delete-group', 'json')
->addActionContext('context-menu', 'json')
->addActionContext('get-file-metadata', 'html')
->addActionContext('upload-file-soundcloud', 'json')
->addActionContext('get-upload-to-soundcloud-status', 'json')
->addActionContext('set-num-entries', 'json')
->addActionContext('edit-file-md', 'json')
->initContext();
@ -25,95 +23,7 @@ class LibraryController extends Zend_Controller_Action
public function indexAction()
{
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$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/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_playlistbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$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']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/waveform.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/observer/observer.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/config.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/curves.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/fades.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/local_storage.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/controls.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playout.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track_render.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/track.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/time_scale.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/waveformplaylist/playlist.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
//arbitrary attributes need to be allowed to set an id for the templates.
$this->view->headScript()->setAllowArbitraryAttributes(true);
//$this->view->headScript()->appendScript(file_get_contents(APPLICATION_PATH.'/../public/js/waveformplaylist/templates/bottombar.tpl'),
// 'text/template', array('id' => 'tpl_playlist_cues', 'noescape' => true));
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try {
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
if (isset($obj_sess->id)) {
$objInfo = Application_Model_Library::getObjInfo($obj_sess->type);
$obj = new $objInfo['className']($obj_sess->id);
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if ($isAdminOrPM || $obj->getCreatorId() == $userInfo->id) {
$this->view->obj = $obj;
if ($obj_sess->type == "block") {
$form = new Application_Form_SmartBlockCriteria();
$form->startForm($obj_sess->id);
$this->view->form = $form;
}
}
$formatter = new LengthFormatter($obj->getLength());
$this->view->length = $formatter->format();
$this->view->type = $obj_sess->type;
}
//get user settings and determine if we need to hide
// or show the playlist editor
$showPlaylist = false;
$data = Application_Model_Preference::getLibraryScreenSettings();
if (!is_null($data)) {
if ($data["playlist"] == "true") {
$showPlaylist = true;
}
}
$this->view->showPlaylist = $showPlaylist;
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound($obj_sess->type);
} catch (Exception $e) {
$this->playlistNotFound($obj_sess->type);
Logging::info($e->getMessage());
//$this->playlistUnknownError($e);
}
$this->_redirect("showbuilder");
}
protected function playlistNotFound($p_type)
@ -219,6 +129,40 @@ class LibraryController extends Zend_Controller_Action
// is a cloud_file and handle it appropriately.
$url = $baseUrl."api/get-media/file/$id/download/true";
$menu["download"] = array("name" => _("Download"), "icon" => "download", "url" => $url);
// SOUNDCLOUD MENU OPTION
$ownerId = empty($obj) ? $file->getFileOwnerId() : $obj->getCreatorId();
if ($isAdminOrPM || $ownerId == $user->getId()) {
$soundcloudService = new SoundcloudService();
if ($type === "audioclip" && $soundcloudService->hasAccessToken()) {
//create a menu separator
$menu["sep1"] = "-----------";
//create a sub menu for Soundcloud actions.
$menu["soundcloud"] = array("name" => _(SOUNDCLOUD), "icon" => "soundcloud", "items" => array());
$serviceId = $soundcloudService->getServiceId($id);
if (!is_null($file) && $serviceId != 0) {
$menu["soundcloud"]["items"]["view"] = array("name" => _("View track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/view-on-sound-cloud/id/{$id}");
$menu["soundcloud"]["items"]["remove"] = array("name" => _("Remove track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/delete/id/{$id}");
} else {
// If a reference exists for this file ID, that means the user has uploaded the track
// but we haven't yet gotten a response from Celery, so disable the menu item
if ($soundcloudService->referenceExists($id)) {
$menu["soundcloud"]["items"]["upload"] = array(
"name" => _("Upload track"), "icon" => "soundcloud",
"url" => $baseUrl . "soundcloud/upload/id/{$id}", "disabled" => true
);
} else {
$menu["soundcloud"]["items"]["upload"] = array(
"name" => _("Upload track"), "icon" => "soundcloud",
"url" => $baseUrl . "soundcloud/upload/id/{$id}"
);
}
}
}
}
} elseif ($type === "playlist" || $type === "block") {
if ($type === 'playlist') {
$obj = new Application_Model_Playlist($id);
@ -265,40 +209,6 @@ class LibraryController extends Zend_Controller_Action
}
}
// SOUNDCLOUD MENU OPTION
$ownerId = empty($obj) ? $file->getFileOwnerId() : $obj->getCreatorId();
if ($isAdminOrPM || $ownerId == $user->getId()) {
$soundcloudService = new SoundcloudService();
if ($type === "audioclip" && $soundcloudService->hasAccessToken()) {
//create a menu separator
$menu["sep1"] = "-----------";
//create a sub menu for Soundcloud actions.
$menu["soundcloud"] = array("name" => _("Soundcloud"), "icon" => "soundcloud", "items" => array());
$serviceId = $soundcloudService->getServiceId($id);
if (!is_null($file) && $serviceId != 0) {
$menu["soundcloud"]["items"]["view"] = array("name" => _("View track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/view-on-sound-cloud/id/{$id}");
$menu["soundcloud"]["items"]["remove"] = array("name" => _("Remove track"), "icon" => "soundcloud", "url" => $baseUrl . "soundcloud/delete/id/{$id}");
} else {
// If a reference exists for this file ID, that means the user has uploaded the track
// but we haven't yet gotten a response from Celery, so disable the menu item
if ($soundcloudService->referenceExists($id)) {
$menu["soundcloud"]["items"]["upload"] = array(
"name" => _("Upload track"), "icon" => "soundcloud",
"url" => $baseUrl . "soundcloud/upload/id/{$id}", "disabled" => true
);
} else {
$menu["soundcloud"]["items"]["upload"] = array(
"name" => _("Upload track"), "icon" => "soundcloud",
"url" => $baseUrl . "soundcloud/upload/id/{$id}"
);
}
}
}
}
if (empty($menu)) {
$menu["noaction"] = array("name"=>_("No action available"));
}
@ -435,14 +345,17 @@ class LibraryController extends Zend_Controller_Action
$file_id = $this->_getParam('id', null);
$file = Application_Model_StoredFile::RecallById($file_id);
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
return;
}
$form = new Application_Form_EditAudioMD();
$form->startForm($file_id);
$form->populate($file->getDbColMetadata());
$this->view->permissionDenied = false;
if (!$isAdminOrPM && $file->getFileOwnerId() != $user->getId()) {
$form->makeReadOnly();
$form->removeActionButtons();
$this->view->permissionDenied = true;
}
if ($request->isPost()) {
$js = $this->_getParam('data');
@ -461,7 +374,10 @@ class LibraryController extends Zend_Controller_Action
}
$this->view->form = $form;
$this->view->dialog = $this->view->render('library/edit-file-md.phtml');
$this->view->id = $file_id;
$this->view->title = $file->getPropelOrm()->getDbTrackTitle();
$this->view->type = "md";
$this->view->html = $this->view->render('library/edit-file-md.phtml');
}
public function getFileMetadataAction()

View file

@ -17,8 +17,11 @@ class ListenerstatController extends Zend_Controller_Action
$request = $this->getRequest();
$baseUrl = Application_Common_OsPath::getBaseDir();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.crosshair.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/flot/jquery.flot.resize.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/listenerstat/listenerstat.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');

View file

@ -51,6 +51,15 @@ class LocaleController extends Zend_Controller_Action
//library/events/library_showbuilder.js
//already in library/events/library_playlistbuilder.js
"Please select a cursor position on timeline." => _("Please select a cursor position on timeline."),
"You haven't added any tracks" => _("You haven't added any tracks"),
"You haven't added any playlists" => _("You haven't added any playlists"),
"You haven't added any smart blocks" => _("You haven't added any smart blocks"),
"You haven't added any webstreams" => _("You haven't added any webstreams"),
"Learn about tracks" => _("Learn about tracks"),
"Learn about playlists" => _("Learn about playlists"),
"Learn about smart blocks" => _("Learn about smart blocks"),
"Learn about webstreams" => _("Learn about webstreams"),
"Click 'New' to create one." => _("Click 'New' to create one."),
//"Adding 1 Item" => _("Adding 1 Item"),
//"Adding %s Items" => _("Adding %s Items"),
//library/library.js
@ -62,7 +71,8 @@ class LocaleController extends Zend_Controller_Action
"Deselect all" => _("Deselect all"),
"Are you sure you want to delete the selected item(s)?" => _("Are you sure you want to delete the selected item(s)?"),
"Scheduled" => _("Scheduled"),
"Playlist" => _("Playlist / Block"),
"Tracks" => _("Tracks"),
"Playlist" => _("Playlist"),
"Title" => _("Title"),
"Creator" => _("Creator"),
"Album" => _("Album"),
@ -112,7 +122,7 @@ class LocaleController extends Zend_Controller_Action
//library/spl.js
"Open Media Builder" => _("Open Media Builder"),
"please put in a time '00:00:00 (.0)'" => _("please put in a time '00:00:00 (.0)'"),
"please put in a time in seconds '00 (.0)'" => _("please put in a time in seconds '00 (.0)'"),
"Please enter a valid time in seconds. Eg. 0.5'" => _("Please enter a valid time in seconds. Eg. 0.5"),
"Your browser does not support playing this file type: " => _("Your browser does not support playing this file type: "),
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
"Limit to: " => _("Limit to: "),
@ -171,8 +181,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"),
@ -233,10 +242,10 @@ class LocaleController extends Zend_Controller_Action
"Oct" => _("Oct"),
"Nov" => _("Nov"),
"Dec" => _("Dec"),
"today" => _("today"),
"day" => _("day"),
"week" => _("week"),
"month" => _("month"),
"Today" => _("Today"),
"Day" => _("Day"),
"Week" => _("Week"),
"Month" => _("Month"),
"Sunday" => _("Sunday"),
"Monday" => _("Monday"),
"Tuesday" => _("Tuesday"),
@ -264,6 +273,9 @@ class LocaleController extends Zend_Controller_Action
"Start" => _("Start"),
"End" => _("End"),
"Duration" => _("Duration"),
"Filtering out " => _("Filtering out "),
" of " => _(" of "),
" records" => _(" records"),
//already in library/library.js
//"Title" => _("Title"),
//"Creator" => _("Creator"),
@ -291,7 +303,7 @@ class LocaleController extends Zend_Controller_Action
//"Select" => _("Select"),
"Select all" => _("Select all"),
"Select none" => _("Select none"),
"Remove overbooked tracks" => _("Remove overbooked tracks"),
"Trim overbooked shows" => _("Trim overbooked shows"),
"Remove selected scheduled items" => _("Remove selected scheduled items"),
"Jump to the current playing track" => _("Jump to the current playing track"),
"Cancel current show" => _("Cancel current show"),
@ -391,7 +403,27 @@ class LocaleController extends Zend_Controller_Action
"No Show" => _("No Show"),
"All" => _("All"),
"Copied %s row%s to the clipboard" => _("Copied %s row%s to the clipboard"),
"%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished." => _("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished.")
"%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished." => _("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."),
"New Show" => _("New Show"),
"New Log Entry" => _("New Log Entry"),
//Datatables:
"No data available in table",
"Showing _START_ to _END_ of _TOTAL_ entries",
"Showing 0 to 0 of 0 entries",
"(filtered from _MAX_ total entries)",
"",
",",
"Show _MENU_",
"Loading...",
"Processing...",
"No matching records found",
"First",
"Last",
"Next",
"Previous",
": activate to sort column ascending",
": activate to sort column descending"
//End of datatables
);
$this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

View file

@ -28,7 +28,7 @@ class LoginController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$this->_redirect('Showbuilder');
$this->_redirect('showbuilder');
}
//uses separate layout without a navigation.
@ -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.
@ -78,7 +76,7 @@ class LoginController extends Zend_Controller_Action
//set the user locale in case user changed it in when logging in
Application_Model_Preference::SetUserLocale($locale);
$this->_redirect('Showbuilder');
$this->_redirect('showbuilder');
} else {
$email = $form->getValue('username');
$authAdapter = new WHMCS_Auth_Adapter("admin", $email, $password);
@ -89,7 +87,7 @@ class LoginController extends Zend_Controller_Action
//set the user locale in case user changed it in when logging in
Application_Model_Preference::SetUserLocale($locale);
$this->_redirect('Showbuilder');
$this->_redirect('showbuilder');
}
else {
$message = _("Wrong username or password provided. Please try again.");
@ -132,34 +130,32 @@ class LoginController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$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');
//uses separate layout without a navigation.
$this->_helper->layout->setLayout('login');
$form = new Application_Form_PasswordRestore();
$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();
$request = $this->getRequest();
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,12 +167,14 @@ 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;
}
$this->view->form = $form;
}
public function passwordRestoreAfterAction()

View file

@ -1,5 +1,6 @@
<?php
class PlaylistController extends Zend_Controller_Action
{
@ -29,6 +30,7 @@ class PlaylistController extends Zend_Controller_Action
->addActionContext('get-block-info', 'json')
->addActionContext('shuffle', 'json')
->addActionContext('empty-content', 'json')
->addActionContext('change-playlist', 'json')
->initContext();
//This controller writes to the session all over the place, so we're going to reopen it for writing here.
@ -41,6 +43,7 @@ class PlaylistController extends Zend_Controller_Action
$objInfo = Application_Model_Library::getObjInfo($p_type);
$obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
if (isset($obj_sess->id)) {
$obj = new $objInfo['className']($obj_sess->id);
@ -72,6 +75,16 @@ class PlaylistController extends Zend_Controller_Action
private function createFullResponse($obj = null, $isJson = false,
$formIsValid = false)
{
$user = Application_Model_User::getCurrentUser();
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if (!$isAdminOrPM && $obj->getCreatorId() != $user->getId()) {
$this->view->objType = $obj instanceof Application_Model_Block ? "block" : "playlist";
$this->view->obj = $obj;
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
return;
}
$isBlock = false;
$viewPath = 'playlist/playlist.phtml';
if ($obj instanceof Application_Model_Block) {
@ -89,6 +102,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->form = $form;
$this->view->obj = $obj;
$this->view->type = "sb";
$this->view->id = $obj->getId();
if ($isJson) {
@ -98,6 +112,7 @@ class PlaylistController extends Zend_Controller_Action
}
} else {
$this->view->obj = $obj;
$this->view->type = "pl";
$this->view->id = $obj->getId();
if ($isJson) {
return $this->view->html = $this->view->render($viewPath);
@ -187,6 +202,16 @@ class PlaylistController extends Zend_Controller_Action
$this->createFullResponse($obj);
}
public function changePlaylistAction() {
$this->view->layout()->disableLayout(); // Don't inject the standard Now Playing header.
$this->_helper->viewRenderer->setNoRender(true); // Don't use (phtml) templates
$id = $this->_getParam('id', null);
$type = $this->_getParam('type');
Application_Model_Library::changePlaylist($id, $type);
}
public function editAction()
{
$id = $this->_getParam('id', null);
@ -194,9 +219,9 @@ class PlaylistController extends Zend_Controller_Action
$objInfo = Application_Model_Library::getObjInfo($type);
Logging::info("editing {$type} {$id}");
if (!is_null($id)) {
Application_Model_Library::changePlaylist($id, $type);
}
// if (!is_null($id)) {
Application_Model_Library::changePlaylist($id, $type);
// }
try {
$obj = new $objInfo['className']($id);
@ -227,7 +252,7 @@ class PlaylistController extends Zend_Controller_Action
Logging::info("Currently active {$type} {$obj_sess->id}");
if (in_array($obj_sess->id, $ids)) {
Logging::info("Deleting currently active {$type}");
Application_Model_Library::changePlaylist(null, $type);
// Application_Model_Library::changePlaylist(null, $type);
} else {
Logging::info("Not deleting currently active {$type}");
$obj = new $objInfo['className']($obj_sess->id);
@ -519,7 +544,7 @@ class PlaylistController extends Zend_Controller_Action
$request = $this->getRequest();
$params = $request->getPost();
$result = array();
if ($params['type'] == 'block') {
try {
$bl = new Application_Model_Block($params['obj_id']);
@ -531,24 +556,34 @@ class PlaylistController extends Zend_Controller_Action
if ($form->isValid($params)) {
$this->setPlaylistNameDescAction();
$bl->saveSmartBlockCriteria($params['data']);
$this->createUpdateResponse($bl);
$this->view->result = 0;
/*
$result['html'] = $this->createFullResponse($bl, true, true);
$result['result'] = 0;
*/
} else {
$this->view->obj = $bl;
$this->view->id = $bl->getId();
$this->view->form = $form;
$this->view->unsavedName = $params['name'];
$this->view->unsavedDesc = $params['description'];
$viewPath = 'playlist/smart-block.phtml';
$result['html'] = $this->view->render($viewPath);
$result['result'] = 1;
$this->view->obj = $bl;
$this->view->id = $bl->getId();
$this->view->html = $this->view->render($viewPath);
$this->view->result = 1;
}
$this->view->name = $bl->getName();
$this->view->type = "sb";
$this->view->id = $bl->getId();
$this->view->modified = $bl->getLastModified("U");
} else if ($params['type'] == 'playlist') {
$this->setPlaylistNameDescAction();
$this->view->modified = $this->view->modified;
$this->view->name = $params['name'];
}
$result["modified"] = $this->view->modified;
$this->_helper->json->sendJson($result);
//$this->_helper->json->sendJson($result);
}
public function smartBlockGenerateAction()
@ -564,15 +599,14 @@ class PlaylistController extends Zend_Controller_Action
$form->startForm($params['obj_id']);
if ($form->isValid($params)) {
$result = $bl->generateSmartBlock($params['data']);
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
$this->view->result = $result['result'];
$this->createUpdateResponse($bl);
#$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true, true)));
} else {
$this->view->obj = $bl;
$this->view->id = $bl->getId();
$this->view->form = $form;
$viewPath = 'playlist/smart-block.phtml';
$result['html'] = $this->view->render($viewPath);
$result['result'] = 1;
$this->_helper->json->sendJson($result);
$this->createFullResponse($bl, false, true);
}
} catch (BlockNotFoundException $e) {
$this->playlistNotFound('block', true);
@ -589,12 +623,20 @@ class PlaylistController extends Zend_Controller_Action
try {
$bl = new Application_Model_Block($params['obj_id']);
$result = $bl->shuffleSmartBlock();
$this->view->result = $result["result"];
$this->createUpdateResponse($bl);
/*
if ($result['result'] == 0) {
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($bl, true)));
$this->_helper->json->sendJson(array(
"result"=>0,
"contents" => $bl->getContents());
///"html"=>$this->viwe));
} else {
$this->_helper->json->sendJson($result);
}
}*/
} catch (BlockNotFoundException $e) {
$this->playlistNotFound('block', true);
} catch (Exception $e) {
@ -609,12 +651,18 @@ class PlaylistController extends Zend_Controller_Action
try {
$pl = new Application_Model_Playlist($params['obj_id']);
$result = $pl->shuffle();
$this->view->result = $result["result"];
$this->createUpdateResponse($pl);
/*
if ($result['result'] == 0) {
$this->_helper->json->sendJson(array("result"=>0, "html"=>$this->createFullResponse($pl, true)));
$this->_helper->json->sendJson(array(
"result"=>0,
"contents" => $pl->getContents(),
"html"=>$this->createUpdateResponse($pl, true)));
} else {
$this->_helper->json->sendJson($result);
}
}*/
} catch (PlaylistNotFoundException $e) {
$this->playlistNotFound('block', true);
} catch (Exception $e) {

View file

@ -24,6 +24,8 @@ class PlayouthistoryController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
list($startsDT, $endsDT) = Application_Common_HTTPHelper::getStartEndFromRequest($this->getRequest());
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());

View file

@ -17,6 +17,8 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
{
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/template.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);
@ -31,6 +33,8 @@ class PlayouthistorytemplateController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Analytics');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/history_styles.css?'.$CC_CONFIG['airtime_version']);

View file

@ -22,9 +22,11 @@ class PluploadController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'js/plupload/jquery.plupload.queue.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/plupload.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/plupload/i18n/'.$locale.'.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/plupload.queue.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/addmedia.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
$this->view->quotaLimitReached = false;
if (Application_Model_Systemstatus::isDiskOverQuota()) {

View file

@ -23,6 +23,8 @@ class PreferenceController extends Zend_Controller_Action
{
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
$baseUrl = Application_Common_OsPath::getBaseDir();
@ -143,15 +145,14 @@ class PreferenceController extends Zend_Controller_Action
$request = $this->getRequest();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
session_start(); //Open session for writing.
// get current settings
$setting = Application_Model_StreamSetting::getStreamSetting();
$name_map = array(
'ogg' => 'Ogg Vorbis',
'fdkaac' => 'AAC+',
@ -160,55 +161,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 +206,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,13 +222,8 @@ 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"];
$changeRGmodifier = Application_Model_Preference::getReplayGainModifier() != $values["replayGainModifier"];
@ -294,34 +248,86 @@ class PreferenceController extends Zend_Controller_Action
}
Application_Model_RabbitMq::SendMessageToPypo("update_stream_setting", $data);
$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->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
$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,
));
} 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')));
}
}
// 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;
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,
));
} else {
$this->_helper->json->sendJson(array("valid" => "false", "html" => $this->view->render('preference/stream-setting.phtml')));
}
}
}
/**
* 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()

View file

@ -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)

View file

@ -94,10 +94,14 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$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.colReorder.min.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/libs/moment.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/libs/moment-timezone-with-data-2010-2020.min.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/utilities/utilities.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/buttons/buttons.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
@ -106,8 +110,9 @@ class ScheduleController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$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']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']);
//End Show builder JS/CSS requirements
$this->createShowFormAction(true);
@ -584,7 +589,20 @@ class ScheduleController extends Zend_Controller_Action
$forms = $this->createShowFormAction();
$this->view->addNewShow = true;
if ($data['add_show_start_now'] == "now") {
//have to use the timezone the user has entered in the form to check past/present
$showTimezone = new DateTimeZone($data["add_show_timezone"]);
$nowDateTime = new DateTime("now", $showTimezone);
//$showStartDateTime = new DateTime($start_time, $showTimezone);
//$showEndDateTime = new DateTime($end_time, $showTimezone);
$data['add_show_start_time'] = $nowDateTime->format("H:i");
$data['add_show_start_date'] = $nowDateTime->format("Y-m-d");
}
if ($service_showForm->validateShowForms($forms, $data)) {
// Get the show ID from the show service to pass as a parameter to the RESTful ShowImageController
$this->view->showId = $service_show->addUpdateShow($data);

View 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');
}
}

View file

@ -20,30 +20,25 @@ class ShowbuilderController extends Zend_Controller_Action
public function indexAction()
{
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$response = $this->getResponse();
//Enable AJAX requests from www.airtime.pro because the autologin during the seamless sign-up follows
//a redirect here.
CORSHelper::enableATProCrossOriginRequests($request, $response);
$baseUrl = Application_Common_OsPath::getBaseDir();
$userType = Application_Model_User::GetCurrentUser()->getType();
//$this->_helper->layout->setLayout("showbuilder");
$user = Application_Model_User::GetCurrentUser();
$userType = $user->getType();
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
$this->view->headScript()->appendScript(Application_Common_GoogleAnalytics::generateGoogleTagManagerDataLayerJavaScript());
$this->view->headLink()->appendStylesheet($baseUrl . 'css/redmond/jquery-ui-1.8.8.custom.css?' . $CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/contextmenu/jquery.contextMenu.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/js/jquery.dataTables.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.pluginAPI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.fnSetFilteringDelay.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/datatables/plugin/dataTables.ColVis.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
//$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.colReorder.min.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.FixedHeader.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/blockui/jquery.blockUI.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
@ -53,108 +48,32 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'css/media_library.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.contextMenu.css?'.$CC_CONFIG['airtime_version']);
$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']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/datatables/css/dataTables.colReorder.min.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$refer_sses = new Zend_Session_Namespace('referrer');
// PLUPLOAD
$this->view->headScript()->appendFile($baseUrl.'js/libs/dropzone.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
if ($request->isPost()) {
$form = new Application_Form_RegisterAirtime();
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$values = $request->getPost();
if ($values["Publicise"] != 1 && $form->isValid($values)) {
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
// MEDIA BUILDER
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/playlist/smart_blockbuilder.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
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"]);
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/dashboard.css?'.$CC_CONFIG['airtime_version']); // TODO
$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');
}
//determine whether to remove/hide/display the library.
$showLib = false;
if (!$user->isGuest()) {
$disableLib = false;
$data = Application_Model_Preference::getNowPlayingScreenSettings();
if (!is_null($data)) {
if ($data["library"] == "true") {
$showLib = true;
}
}
} else {
$disableLib = true;
}
$this->view->disableLib = $disableLib;
$this->view->showLib = $showLib;
//only include library things on the page if the user can see it.
if (!$disableLib) {
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/library.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/library/events/library_showbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$data = Application_Model_Preference::getCurrentLibraryTableSetting();
if (!is_null($data)) {
$libraryTable = json_encode($data);
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', JSON.stringify($libraryTable) );");
} else {
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', '' );");
}
}
$data = Application_Model_Preference::getTimelineDatatableSetting();
if (!is_null($data)) {
$timelineTable = json_encode($data);
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', JSON.stringify($timelineTable) );");
} else {
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-timeline', '' );");
}
$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->view->csrf = $csrf_element;
$request = $this->getRequest();
//populate date range form for show builder.
$now = time();
$from = $request->getParam("from", $now);
@ -170,20 +89,33 @@ class ShowbuilderController extends Zend_Controller_Action
$form = new Application_Form_ShowBuilder();
$form->populate(array(
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
$this->view->sb_form = $form;
}
$this->view->headScript()->appendFile($baseUrl.'js/timepicker/jquery.ui.timepicker.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/showbuilder/main_builder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
/** 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;
$this->view->headLink()->appendStylesheet($baseUrl.'css/jquery.ui.timepicker.css?'.$CC_CONFIG['airtime_version']);
$this->view->headLink()->appendStylesheet($baseUrl.'css/showbuilder.css?'.$CC_CONFIG['airtime_version']);
// 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()
@ -229,7 +161,7 @@ class ShowbuilderController extends Zend_Controller_Action
}
$displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
$start = $instance->getDbStarts(null);
$start->setTimezone($displayTimeZone);
$end = $instance->getDbEnds(null);
@ -243,9 +175,19 @@ class ShowbuilderController extends Zend_Controller_Action
$this->view->start = $start_time;
$this->view->end = $end_time;
$form = new Application_Form_ShowBuilder();
$form->populate(array(
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
$this->view->sb_form = $form;
$this->view->dialog = $this->view->render('showbuilder/builderDialog.phtml');
}
public function checkBuilderFeedAction()
{
$request = $this->getRequest();
@ -268,7 +210,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function builderFeedAction()
{
$current_time = time();
$request = $this->getRequest();
$show_filter = intval($request->getParam("showFilter", 0));
$show_instance_filter = intval($request->getParam("showInstanceFilter", 0));
@ -290,10 +232,10 @@ class ShowbuilderController extends Zend_Controller_Action
public function scheduleAddAction()
{
$request = $this->getRequest();
$mediaItems = $request->getParam("mediaIds", array());
$scheduledItems = $request->getParam("schedIds", array());
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "showbuilder/schedule-add";
@ -301,7 +243,7 @@ class ShowbuilderController extends Zend_Controller_Action
$log_vars["params"]["media_items"] = $mediaItems;
$log_vars["params"]["scheduled_items"] = $scheduledItems;
Logging::info($log_vars);
try {
$scheduler = new Application_Model_Scheduler();
$scheduler->scheduleAfter($scheduledItems, $mediaItems);
@ -318,7 +260,7 @@ class ShowbuilderController extends Zend_Controller_Action
{
$request = $this->getRequest();
$items = $request->getParam("items", array());
$log_vars = array();
$log_vars["url"] = $_SERVER['HTTP_HOST'];
$log_vars["action"] = "showbuilder/schedule-remove";
@ -368,8 +310,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function scheduleReorderAction()
{
throw new Exception("this controller is/was a no-op please fix your
code");
throw new Exception("this controller is/was a no-op please fix your code");
}
}

View file

@ -1,22 +0,0 @@
<?php
class SystemstatusController extends Zend_Controller_Action
{
public function init()
{
/* Disable this on Airtime pro since we're not using Media Monitor/Monit
$CC_CONFIG = Config::getConfig();
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/status/status.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
*/
}
public function indexAction()
{
$partitions = Application_Model_Systemstatus::GetDiskInfo();
$this->view->status = new StdClass;
$this->view->status->partitions = $partitions;
}
}

View file

@ -22,6 +22,9 @@ class UserController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
$baseUrl = Application_Common_OsPath::getBaseDir();
$js_files = array(
@ -121,6 +124,8 @@ class UserController extends Zend_Controller_Action
public function editUserAction()
{
Zend_Layout::getMvcInstance()->assign('parent_page', 'Settings');
session_start(); //Reopen session for writing.
$request = $this->getRequest();
$form = new Application_Form_EditUser();

View file

@ -14,7 +14,6 @@ class WebstreamController extends Zend_Controller_Action
public function newAction()
{
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
if (!$this->isAuthorized(-1)) {
// TODO: this header call does not actually print any error message
@ -56,7 +55,20 @@ class WebstreamController extends Zend_Controller_Action
if ($webstream) {
Application_Model_Library::changePlaylist($id, "stream");
}
$this->view->obj = new Application_Model_Webstream($webstream);
$obj = new Application_Model_Webstream($webstream);
$user = Application_Model_User::getCurrentUser();
$isAdminOrPM = $user->isUserType(array(UTYPE_SUPERADMIN, UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
if (!$isAdminOrPM && $webstream->getDbCreatorId() != $user->getId()) {
$this->view->objType = "webstream";
$this->view->obj = $obj;
$this->view->html = $this->view->render('playlist/permission-denied.phtml');
return;
}
$this->view->obj = $obj;
$this->view->action = "edit";
$this->view->html = $this->view->render('webstream/webstream.phtml');
}

View file

@ -22,7 +22,7 @@ class WhmcsLoginController extends Zend_Controller_Action
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
if (Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('Showbuilder');
$this->_redirect('showbuilder');
}
$authAdapter = new WHMCS_Auth_Adapter($username, $email, $password);
@ -58,7 +58,7 @@ class WhmcsLoginController extends Zend_Controller_Action
//$locale = $form->getValue('locale');
//Application_Model_Preference::SetUserLocale($locale);
$this->_redirect('Showbuilder');
$this->_redirect('showbuilder');
}
else {
echo("Sorry, that username or password was incorrect.");

View file

@ -82,7 +82,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
* @param string $module
* @return void
**/
public function setErrorPage($action, $controller = 'error', $module = null)
public function setErrorPage($action, $controller = 'error', $module = 'default')
{
$this->_errorPage = array('module' => $module,
'controller' => $controller,
@ -204,7 +204,8 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$resourceName,
$request->getActionName())) {
/** Redirect to access denied page */
$this->denyAccess();
$this->setErrorPage('error403');
$this->denyAccess(); /* This results in a 404! */
}
}
}