From 42a5df0b57bd60fd369efbd77e670e2bc394af74 Mon Sep 17 00:00:00 2001 From: martin Date: Fri, 22 Apr 2011 01:04:16 -0400 Subject: [PATCH 1/2] -changed version string to 1.8.1 --- VERSION | 2 +- airtime_mvc/application/configs/conf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index be6fbdd24..fb73d6432 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ PRODUCT_ID=Airtime -PRODUCT_RELEASE=1.8.0 +PRODUCT_RELEASE=1.8.1 diff --git a/airtime_mvc/application/configs/conf.php b/airtime_mvc/application/configs/conf.php index 0c7c39d33..3f6426e69 100644 --- a/airtime_mvc/application/configs/conf.php +++ b/airtime_mvc/application/configs/conf.php @@ -6,7 +6,7 @@ * /etc/airtime/recorder.cfg */ -define('AIRTIME_VERSION', '1.8.0'); +define('AIRTIME_VERSION', '1.8.1'); define('AIRTIME_COPYRIGHT_DATE', '2010-2011'); define('AIRTIME_REST_VERSION', '1.1'); From 219598ac062a89a6365fc4d8f65d9a945ff10968 Mon Sep 17 00:00:00 2001 From: Paul Baranowski Date: Mon, 25 Apr 2011 18:34:03 -0400 Subject: [PATCH 2/2] CC-2225 airtime-clean-storage doesnt work Forced the user to run the script as superuser. --- airtime_mvc/application/models/StoredFile.php | 10 +++++----- utils/airtime-clean-storage.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 01e0b8f00..99bccfb5e 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -1174,10 +1174,7 @@ class StoredFile { return TRUE; } else { - return PEAR::raiseError( - "StoredFile::deleteFile: unlink failed ({$this->filepath})", - GBERR_FILEIO - ); + return PEAR::raiseError("StoredFile::deleteFile: unlink failed ({$this->filepath})"); } } else { @@ -1237,7 +1234,10 @@ class StoredFile { $files = StoredFile::getAll(); foreach ($files as $file) { $media = StoredFile::Recall($file["id"]); - $media->delete(); + $result = $media->delete(); + if (PEAR::isError($result)) { + return $result; + } } } diff --git a/utils/airtime-clean-storage.php b/utils/airtime-clean-storage.php index f91d697ef..53aefdc49 100644 --- a/utils/airtime-clean-storage.php +++ b/utils/airtime-clean-storage.php @@ -59,7 +59,10 @@ function airtime_empty_db($db) Playlist::deleteAll(); echo " * Clearing files table...".PHP_EOL; - StoredFile::deleteAll(); + $result = StoredFile::deleteAll(); + if (PEAR::isError($result)) { + echo $result->getMessage().PHP_EOL; + } } @@ -88,6 +91,12 @@ if (isset($opts->h)) { exit; } +// Need to check that we are superuser before running this. +if (exec("whoami") != "root") { + echo PHP_EOL."You must be root to use this script.".PHP_EOL.PHP_EOL; + exit(1); +} + $CC_DBC = DB::connect($CC_CONFIG['dsn'], TRUE); $CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);