CC-4854: Remove SaaS checking from codebase

-fixed
This commit is contained in:
Martin Konecny 2013-01-16 14:31:43 -05:00
parent 9d8c9149fd
commit 8b12f692cd
6 changed files with 19 additions and 113 deletions

View File

@ -134,16 +134,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) {
$view->headScript()->appendFile($baseUrl.'js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
}
if (Application_Model_Preference::GetPlanLevel() != "disabled"
&& !($_SERVER['REQUEST_URI'] == $baseUrl.'Dashboard/stream-player' ||
strncmp($_SERVER['REQUEST_URI'], $baseUrl.'audiopreview/audio-preview', strlen($baseUrl.'audiopreview/audio-preview'))==0)) {
$client_id = Application_Model_Preference::GetClientId();
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
$view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
}
}
protected function _initViewHelpers()

View File

@ -692,26 +692,24 @@ class ApiController extends Zend_Controller_Action
Application_Model_ServiceRegister::Register($component, $remoteAddr);
//send ip, subdomain
if (Application_Model_Preference::GetPlanLevel() != 'disabled'){
if ($component == "pypo"){
$split = explode('.', $_SERVER['SERVER_NAME']);
$subdomain = array();
foreach ($split as $value) {
if ($value == 'airtime') {
break;
} else {
$subdomain[] = $value;
}
if ($component == "pypo"){
$split = explode('.', $_SERVER['SERVER_NAME']);
$subdomain = array();
foreach ($split as $value) {
if ($value == 'airtime') {
break;
} else {
$subdomain[] = $value;
}
if (count($subdomain) > 0){
$subDomain = implode('.',$subdomain);
}
if (count($subdomain) > 0){
$subDomain = implode('.',$subdomain);
$md = array();
$md["sub_domain"] = $subDomain;
$md["pypo_ip"] = $remoteAddr;
$md = array();
$md["sub_domain"] = $subDomain;
$md["pypo_ip"] = $remoteAddr;
Application_Model_RabbitMq::SendMessageToHaproxyConfigDaemon($md);
}
Application_Model_RabbitMq::SendMessageToHaproxyConfigDaemon($md);
}
}
}

View File

@ -23,8 +23,6 @@ class PreferenceController extends Zend_Controller_Action
$CC_CONFIG = Config::getConfig();
$request = $this->getRequest();
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/preferences.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
@ -123,19 +121,7 @@ class PreferenceController extends Zend_Controller_Action
public function directoryConfigAction()
{
$CC_CONFIG = Config::getConfig();
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
$baseUrl = Application_Common_OsPath::getBaseDir();
$this->view->headScript()->appendFile($baseUrl.'js/serverbrowse/serverbrowser.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'js/airtime/preferences/musicdirs.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$watched_dirs_pref = new Application_Form_WatchedDirPreferences();
$this->view->form = $watched_dirs_pref;
}
}
public function streamSettingAction()

View File

@ -3,10 +3,6 @@
class Airtime_View_Helper_IsTrial extends Zend_View_Helper_Abstract{
public function isTrial(){
$plan = Application_Model_Preference::GetPlanLevel();
if($plan == 'trial'){
return true;
}else{
return false;
}
return $plan == 'trial';
}
}

View File

@ -12,46 +12,6 @@
class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{
public function versionNotify(){
if(Application_Model_Preference::GetPlanLevel() != 'disabled'){
return "";
}
// retrieve and validate current and latest versions,
$current = Application_Model_Preference::GetAirtimeVersion();
$latest = Application_Model_Preference::GetLatestVersion();
$link = Application_Model_Preference::GetLatestLink();
$currentExploded = explode('.', $current);
$latestExploded = explode('.', $latest);
if(count($currentExploded) != 3 || count($latestExploded) != 3) {
return "";
}
// Calculate the version difference;
// Example: if current = 1.9.5 and latest = 3.0.0, diff = 105
// Note: algorithm assumes the number after 1st dot never goes above 9
$versionDifference = (intval($latestExploded[0]) * 100 + intval($latestExploded[1]) *10 + intval($latestExploded[2]))
- (intval($currentExploded[0]) * 100 + intval($currentExploded[1] *10 + intval($currentExploded[2])));
// Pick icon based on distance this version is to the latest version available
if($versionDifference <= 0) {
// current version is up to date or newer
$class = "uptodate";
} else if($versionDifference < 20) {
// 2 or less major versions back
$class = "update";
} else if($versionDifference < 30) {
// 3 major versions back
$class = "update2";
} else {
// more than 3 major versions back
$class = "outdated";
}
$result = "<div id='version-diff' style='display:none'>" . $versionDifference . "</div>"
. "<div id='version-current' style='display:none'>" . $current . "</div>"
. "<div id='version-latest' style='display:none'>" . $latest . "</div>"
. "<div id='version-link' style='display:none'>" . $link . "</div>"
. "<div id='version-icon' class='" . $class . "'></div>";
return $result;
return "";
}
}

View File

@ -88,30 +88,6 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){
curl_close($ch);
}
// Get latest version from stat server and store to db
if(Application_Model_Preference::GetPlanLevel() == 'disabled'){
$url = 'http://stat.sourcefabric.org/airtime-stats/airtime_latest_version';
//$url = 'http://localhost:9999/index.php?p=airtime';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
if(curl_errno($ch)) {
echo "curl error: " . curl_error($ch) . "\n";
} else {
$resultArray = explode("\n", $result);
if (isset($resultArray[0])) {
Application_Model_Preference::SetLatestVersion($resultArray[0]);
}
if (isset($resultArray[1])) {
Application_Model_Preference::SetLatestLink($resultArray[1]);
}
}
curl_close($ch);
}
/**
* Ensures that the user is running this PHP script with root