Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-05-14 18:35:28 -04:00
commit 6f7efb14a4
2 changed files with 7 additions and 3 deletions

View file

@ -400,7 +400,6 @@ class Application_Model_Preference
public static function GetSystemInfo($returnArray=false, $p_testing=false)
{
exec('/usr/bin/airtime-check-system --no-color', $output);
$output = preg_replace('/\s+/', ' ', $output);
$systemInfoArray = array();
@ -409,9 +408,14 @@ class Application_Model_Preference
if(isset($info[1])){
$key = str_replace(' ', '_', trim($info[0]));
$key = strtoupper($key);
if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' ||
$key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' ||
$key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' ||
$key == 'PLAYOUT_ENGINE_CPU_PERC' ) {
$systemInfoArray[$key] = $info[1];
}
}
}
$outputArray = array();

View file

@ -34,7 +34,7 @@ class AirtimeCheck {
{
// Need to check that we are superuser before running this.
$euid = posix_geteuid();
$user = posix_getlogin();
$user = exec('whoami');
if($euid != 0 && $user != "www-data"){
echo "Must be root user.\n";
exit(1);