Merge branch 'devel' into 2.3.x-saas

This commit is contained in:
Martin Konecny 2013-01-17 10:56:18 -05:00
commit 784cb390d3
11 changed files with 79 additions and 13 deletions

View file

@ -15,6 +15,7 @@ class PreferenceController extends Zend_Controller_Action
->addActionContext('change-stream-setting', 'json') ->addActionContext('change-stream-setting', 'json')
->addActionContext('get-liquidsoap-status', 'json') ->addActionContext('get-liquidsoap-status', 'json')
->addActionContext('set-source-connection-url', 'json') ->addActionContext('set-source-connection-url', 'json')
->addActionContext('get-admin-password-status', 'json')
->initContext(); ->initContext();
} }
@ -218,6 +219,16 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_StreamSetting::setStreamSetting($values); Application_Model_StreamSetting::setStreamSetting($values);
/* If the admin password values are empty then we should not
* set the pseudo password ('xxxxxx') on the front-end
*/
$s1_set_admin_pass = true;
$s2_set_admin_pass = true;
$s3_set_admin_pass = true;
if (empty($values["s1_data"]["admin_pass"])) $s1_set_admin_pass = false;
if (empty($values["s2_data"]["admin_pass"])) $s2_set_admin_pass = false;
if (empty($values["s3_data"]["admin_pass"])) $s3_set_admin_pass = false;
// this goes into cc_pref table // this goes into cc_pref table
Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']); Application_Model_Preference::SetStreamLabelFormat($values['streamFormat']);
Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]); Application_Model_Preference::SetLiveStreamMasterUsername($values["master_username"]);
@ -255,7 +266,13 @@ class PreferenceController extends Zend_Controller_Action
$this->view->form = $form; $this->view->form = $form;
$this->view->num_stream = $num_of_stream; $this->view->num_stream = $num_of_stream;
$this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>"; $this->view->statusMsg = "<div class='success'>"._("Stream Setting Updated.")."</div>";
die(json_encode(array("valid"=>"true", "html"=>$this->view->render('preference/stream-setting.phtml')))); die(json_encode(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,
)));
} else { } else {
$live_stream_subform->updateVariables(); $live_stream_subform->updateVariables();
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf(); $this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
@ -402,4 +419,17 @@ class PreferenceController extends Zend_Controller_Action
die(); die();
} }
public function getAdminPasswordStatusAction()
{
$out = array();
for ($i=1; $i<=3; $i++) {
if (Application_Model_StreamSetting::getAdminPass('s'.$i)=='') {
$out["s".$i] = false;
} else {
$out["s".$i] = true;
}
}
die(json_encode($out));
}
} }

View file

@ -203,7 +203,7 @@ class Application_Form_StreamSettingSubForm extends Zend_Form_SubForm
$adminUser->setAttrib('alt', 'regular_text'); $adminUser->setAttrib('alt', 'regular_text');
$this->addElement($adminUser); $this->addElement($adminUser);
$adminPass = new Zend_Form_Element_Text('admin_pass'); $adminPass = new Zend_Form_Element_Password('admin_pass');
$adminPass->setLabel(_("Admin Password")) $adminPass->setLabel(_("Admin Password"))
->setValue(Application_Model_StreamSetting::getAdminPass($prefix)) ->setValue(Application_Model_StreamSetting::getAdminPass($prefix))
->setValidators(array( ->setValidators(array(

View file

@ -220,7 +220,7 @@ class Application_Model_Preference
$fade = $out; $fade = $out;
} }
$fade = number_format($fade, 1); $fade = number_format($fade, 1, '.', '');
//fades need 2 leading zeros for DateTime conversion //fades need 2 leading zeros for DateTime conversion
$fade = str_pad($fade, 4, "0", STR_PAD_LEFT); $fade = str_pad($fade, 4, "0", STR_PAD_LEFT);
@ -457,7 +457,12 @@ class Application_Model_Preference
public static function GetUserTimezone($id) public static function GetUserTimezone($id)
{ {
return self::getValue("user_timezone", true); $timezone = self::getValue("user_timezone", true);
if (!$timezone) {
return self::GetDefaultTimezone();
} else {
return $timezone;
}
} }
public static function GetTimezone() public static function GetTimezone()
@ -484,7 +489,12 @@ class Application_Model_Preference
public static function GetUserLocale($id) public static function GetUserLocale($id)
{ {
return self::getValue("user_locale", true); $locale = self::getValue("user_locale", true);
if (!$locale) {
return self::GetDefaultLocale();
} else {
return $locale;
}
} }
public static function SetUserLocale($userId, $locale = null) public static function SetUserLocale($userId, $locale = null)

View file

@ -242,7 +242,14 @@ class Application_Model_StreamSetting
$v = $d['enable'] == 1 ? 'true' : 'false'; $v = $d['enable'] == 1 ? 'true' : 'false';
} }
$v = trim($v); $v = trim($v);
if ($k != 'admin_pass') {
self::saveStreamSetting($keyname, $v); self::saveStreamSetting($keyname, $v);
/* We use 'xxxxxx' as the admin password placeholder so we
* only want to save it when it is a different string
*/
} elseif ($v != 'xxxxxx') {
self::saveStreamSetting($keyname, $v);
}
} }
} }
} }

View file

@ -326,7 +326,6 @@ INSERT INTO cc_pref("keystr", "valstr") VALUES('locale', 'en_CA');
INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_CA'); INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_CA');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_US', 'English - US');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('fr_FR', 'Français'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('fr_FR', 'Français');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('de_DE', 'Deutsch');
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('it_IT', 'Italiano'); INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('it_IT', 'Italiano');

View file

@ -2660,7 +2660,7 @@ msgstr "show does not exist"
#: airtime_mvc/application/controllers/ListenerstatController.php:56 #: airtime_mvc/application/controllers/ListenerstatController.php:56
msgid "Please make sure admin user/password is correct on System->Streams page." msgid "Please make sure admin user/password is correct on System->Streams page."
msgstr "" msgstr "Please make sure Admin User and Admin Password for the streaming server are present and correct under Stream -> Additional Options on the System -> Streams page."
#: airtime_mvc/application/controllers/ApiController.php:57 #: airtime_mvc/application/controllers/ApiController.php:57
#: airtime_mvc/application/controllers/ApiController.php:84 #: airtime_mvc/application/controllers/ApiController.php:84

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Airtime 2.3\n" "Project-Id-Version: Airtime 2.3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-15 10:36-0500\n" "POT-Creation-Date: 2013-01-15 10:36-0500\n"
"PO-Revision-Date: 2013-01-15 14:37-0500\n" "PO-Revision-Date: 2013-01-16 16:32-0500\n"
"Last-Translator: Cliff Wang <cliff.wang@sourcefabric.org>\n" "Last-Translator: Cliff Wang <cliff.wang@sourcefabric.org>\n"
"Language-Team: Chinese Localization <contact@sourcefabric.org>\n" "Language-Team: Chinese Localization <contact@sourcefabric.org>\n"
"Language: \n" "Language: \n"
@ -434,7 +434,7 @@ msgstr "编曲"
#: airtime_mvc/application/controllers/LocaleController.php:77 #: airtime_mvc/application/controllers/LocaleController.php:77
#: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:10 #: airtime_mvc/application/views/scripts/schedule/show-content-dialog.phtml:10
msgid "Genre" msgid "Genre"
msgstr "类型" msgstr "风格"
#: airtime_mvc/application/models/Block.php:1219 #: airtime_mvc/application/models/Block.php:1219
#: airtime_mvc/application/forms/SmartBlockCriteria.php:51 #: airtime_mvc/application/forms/SmartBlockCriteria.php:51
@ -1951,7 +1951,7 @@ msgstr "文件的状态不可知。这可能是由于文件位于远程存储位
#: airtime_mvc/application/controllers/LocaleController.php:125 #: airtime_mvc/application/controllers/LocaleController.php:125
#, php-format #, php-format
msgid "Listener Count on %s: %s" msgid "Listener Count on %s: %s"
msgstr "听众计%s%s" msgstr "听众计%s%s"
#: airtime_mvc/application/controllers/LocaleController.php:127 #: airtime_mvc/application/controllers/LocaleController.php:127
msgid "Remind me in 1 week" msgid "Remind me in 1 week"
@ -2845,7 +2845,7 @@ msgstr "无效的表格内容。"
#: airtime_mvc/application/views/scripts/listenerstat/index.phtml:2 #: airtime_mvc/application/views/scripts/listenerstat/index.phtml:2
msgid "Listener Count Over Time" msgid "Listener Count Over Time"
msgstr "听众收听时间" msgstr "听众统计报告"
#: airtime_mvc/application/views/scripts/partialviews/header.phtml:3 #: airtime_mvc/application/views/scripts/partialviews/header.phtml:3
msgid "Previous:" msgid "Previous:"

View file

@ -412,9 +412,28 @@ function setSliderForReplayGain(){
$( "#replayGainModifier" ).val( $( "#slider-range-max" ).slider( "value" ) ); $( "#replayGainModifier" ).val( $( "#slider-range-max" ).slider( "value" ) );
} }
function setPseudoAdminPassword(s1, s2, s3) {
if (s1) {
$('#s1_data-admin_pass').val('xxxxxx');
}
if (s2) {
$('#s2_data-admin_pass').val('xxxxxx');
}
if (s3) {
$('#s3_data-admin_pass').val('xxxxxx');
}
}
function getAdminPasswordStatus() {
$.ajax({ url: baseUrl+'Preference/get-admin-password-status/format/json', dataType:"json", success:function(data){
setPseudoAdminPassword(data.s1, data.s2, data.s3);
}});
}
$(document).ready(function() { $(document).ready(function() {
setupEventListeners(); setupEventListeners();
setSliderForReplayGain(); setSliderForReplayGain();
getAdminPasswordStatus();
$('#stream_save').live('click', function(){ $('#stream_save').live('click', function(){
var confirm_pypo_restart_text = $.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 Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted."); var confirm_pypo_restart_text = $.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 Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
@ -427,6 +446,7 @@ $(document).ready(function() {
$('#content').empty().append(json.html); $('#content').empty().append(json.html);
setupEventListeners(); setupEventListeners();
setSliderForReplayGain(); setSliderForReplayGain();
setPseudoAdminPassword(json.s1_set_admin_pass, json.s2_set_admin_pass, json.s3_set_admin_pass);
}); });
} }
}); });

View file

@ -11,7 +11,7 @@ dist=`lsb_release -is`
echo "Generating locales" echo "Generating locales"
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
if [ "$dist" = "Debian" ]; then if [ "$dist" = "Debian" ]; then
grep -q "$i" /etc/locale.gen grep -qi "^$i" /etc/locale.gen
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "$i.UTF-8 UTF-8" >> /etc/locale.gen echo "$i.UTF-8 UTF-8" >> /etc/locale.gen
fi fi