Merge branch '2.4.x' of dev.sourcefabric.org:airtime into 2.4.x
This commit is contained in:
commit
61427647d6
|
@ -1361,7 +1361,12 @@ SQL;
|
||||||
"is" => _("is"),
|
"is" => _("is"),
|
||||||
"is not" => _("is not"),
|
"is not" => _("is not"),
|
||||||
"starts with" => _("starts with"),
|
"starts with" => _("starts with"),
|
||||||
"ends with" => _("ends with")
|
"ends with" => _("ends with"),
|
||||||
|
"is" => _("is"),
|
||||||
|
"is not" => _("is not"),
|
||||||
|
"is greater than" => _("is greater than"),
|
||||||
|
"is less than" => _("is less than"),
|
||||||
|
"is in the range" => _("is in the range")
|
||||||
);
|
);
|
||||||
|
|
||||||
// Load criteria from db
|
// Load criteria from db
|
||||||
|
@ -1375,7 +1380,10 @@ SQL;
|
||||||
$extra = $crit->getDbExtra();
|
$extra = $crit->getDbExtra();
|
||||||
|
|
||||||
if ($criteria == "limit") {
|
if ($criteria == "limit") {
|
||||||
$storedCrit["limit"] = array("value"=>$value, "modifier"=>_($modifier));
|
$storedCrit["limit"] = array(
|
||||||
|
"value"=>$value,
|
||||||
|
"modifier"=>$modifier,
|
||||||
|
"display_modifier"=>_($modifier));
|
||||||
} else if($criteria == "repeat_tracks") {
|
} else if($criteria == "repeat_tracks") {
|
||||||
$storedCrit["repeat_tracks"] = array("value"=>$value);
|
$storedCrit["repeat_tracks"] = array("value"=>$value);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -593,7 +593,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
"</li>";
|
"</li>";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"</span></li>";
|
$html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.display_modifier+"</span></li>";
|
||||||
}
|
}
|
||||||
$pl.find("#block_"+id+"_info").html($html).show();
|
$pl.find("#block_"+id+"_info").html($html).show();
|
||||||
mod.enableUI();
|
mod.enableUI();
|
||||||
|
|
|
@ -1,4 +1,17 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Ensures that the user is running this PHP script with root
|
||||||
|
* permissions. If not running with root permissions, causes the
|
||||||
|
* script to exit.
|
||||||
|
*/
|
||||||
|
function exitIfNotRoot()
|
||||||
|
{
|
||||||
|
// Need to check that we are superuser before running this.
|
||||||
|
if(posix_geteuid() != 0){
|
||||||
|
echo "Must be root user.\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exitIfNotRoot();
|
exitIfNotRoot();
|
||||||
|
|
||||||
|
@ -9,54 +22,19 @@ $CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
|
||||||
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
|
require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
|
||||||
$CC_CONFIG = Config::getConfig();
|
$CC_CONFIG = Config::getConfig();
|
||||||
|
|
||||||
/*
|
|
||||||
// Name of the web server user
|
|
||||||
$CC_CONFIG['webServerUser'] = $values['general']['web_server_user'];
|
|
||||||
$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
|
|
||||||
$CC_CONFIG['rabbitmq'] = $values['rabbitmq'];
|
|
||||||
|
|
||||||
//$CC_CONFIG['baseUrl'] = $values['general']['base_url'];
|
|
||||||
//$CC_CONFIG['basePort'] = $values['general']['base_port'];
|
|
||||||
|
|
||||||
// Database config
|
|
||||||
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
|
|
||||||
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
|
|
||||||
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
|
|
||||||
$CC_CONFIG['dsn']['phptype'] = 'pgsql';
|
|
||||||
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
|
|
||||||
|
|
||||||
$CC_CONFIG['apiKey'] = array($values['general']['api_key']);
|
|
||||||
|
|
||||||
$CC_CONFIG['soundcloud-connection-retries'] = $values['soundcloud']['connection_retries'];
|
|
||||||
$CC_CONFIG['soundcloud-connection-wait'] = $values['soundcloud']['time_between_retries'];
|
|
||||||
*/
|
|
||||||
require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php');
|
require_once($CC_CONFIG['phpDir'].'/application/configs/constants.php');
|
||||||
//require_once($CC_CONFIG['phpDir'].'/application/configs/conf.php');
|
require_once($CC_CONFIG['phpDir'].'/application/logging/Logging.php');
|
||||||
|
|
||||||
//$CC_CONFIG['phpDir'] = $values['general']['airtime_dir'];
|
Logging::setLogPath("/var/log/airtime/zendphp.log");
|
||||||
|
|
||||||
// Ensure library/ is on include_path
|
// Ensure library/ is on include_path
|
||||||
set_include_path(implode(PATH_SEPARATOR, array(
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
get_include_path(),
|
get_include_path(),
|
||||||
realpath($CC_CONFIG['phpDir'] . '/library')
|
realpath($CC_CONFIG['phpDir'] . '/library'),
|
||||||
|
realpath($CC_CONFIG['phpDir']),
|
||||||
|
realpath($CC_CONFIG['phpDir'].'/application/models'),
|
||||||
)));
|
)));
|
||||||
|
|
||||||
function my_autoload($classname){
|
|
||||||
$CC_CONFIG = Config::getConfig();
|
|
||||||
$info = explode('_', $classname);
|
|
||||||
if (isset($info[1]) && isset($info[2])) {
|
|
||||||
$filename = $info[2].".php";
|
|
||||||
if ($info[1] == "Model") {
|
|
||||||
$folderName = "models";
|
|
||||||
} else if ($info[1] == "Common") {
|
|
||||||
$folderName = "common";
|
|
||||||
}
|
|
||||||
require_once($CC_CONFIG['phpDir'].'/application/'.$folderName.'/'.$filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
spl_autoload_register('my_autoload');
|
|
||||||
|
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
Propel::init($CC_CONFIG['phpDir']."/application/configs/airtime-conf-production.php");
|
Propel::init($CC_CONFIG['phpDir']."/application/configs/airtime-conf-production.php");
|
||||||
|
|
||||||
|
@ -67,6 +45,22 @@ if (file_exists('/usr/share/php/libzend-framework-php')){
|
||||||
|
|
||||||
require_once('Zend/Loader/Autoloader.php');
|
require_once('Zend/Loader/Autoloader.php');
|
||||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||||
|
$autoloader->registerNamespace('Application_');
|
||||||
|
|
||||||
|
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
|
||||||
|
'basePath' => $CC_CONFIG['phpDir'].'/'.'application',
|
||||||
|
'namespace' => 'Application',
|
||||||
|
'resourceTypes' => array(
|
||||||
|
'model' => array(
|
||||||
|
'path' => 'models/',
|
||||||
|
'namespace' => 'Model',
|
||||||
|
),
|
||||||
|
'common' => array(
|
||||||
|
'path' => 'common/',
|
||||||
|
'namespace' => 'Common',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
|
||||||
$infoArray = Application_Model_Preference::GetSystemInfo(true);
|
$infoArray = Application_Model_Preference::GetSystemInfo(true);
|
||||||
|
|
||||||
|
@ -88,6 +82,7 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Get latest version from stat server and store to db
|
// Get latest version from stat server and store to db
|
||||||
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||||
$url = 'http://stat.sourcefabric.org/airtime-stats/airtime_latest_version';
|
$url = 'http://stat.sourcefabric.org/airtime-stats/airtime_latest_version';
|
||||||
|
@ -113,16 +108,3 @@ if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures that the user is running this PHP script with root
|
|
||||||
* permissions. If not running with root permissions, causes the
|
|
||||||
* script to exit.
|
|
||||||
*/
|
|
||||||
function exitIfNotRoot()
|
|
||||||
{
|
|
||||||
// Need to check that we are superuser before running this.
|
|
||||||
if(posix_geteuid() != 0){
|
|
||||||
echo "Must be root user.\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue