CC-2558 : Delete all files from disk, only allow admins to delete.

This commit is contained in:
Naomi Aro 2011-07-19 11:00:32 +02:00
parent 28b71c61d6
commit ba0458c442
3 changed files with 4 additions and 1 deletions

View file

@ -151,6 +151,7 @@ class LibraryController extends Zend_Controller_Action
return; return;
} }
else { else {
$res = settype($res, "integer");
$data = array("filepath" => $file->getFilePath(), "delete" => $res); $data = array("filepath" => $file->getFilePath(), "delete" => $res);
RabbitMq::SendMessageToMediaMonitor("file_delete", $data); RabbitMq::SendMessageToMediaMonitor("file_delete", $data);
} }

View file

@ -318,6 +318,8 @@ class StoredFile {
Playlist::DeleteFileFromAllPlaylists($this->getId()); Playlist::DeleteFileFromAllPlaylists($this->getId());
$this->_file->delete(); $this->_file->delete();
return $res;
} }
/** /**

View file

@ -112,7 +112,7 @@ class AirtimeNotifier(Notifier):
self.logger.info("Adding file to ignore: %s ", filepath) self.logger.info("Adding file to ignore: %s ", filepath)
mm.add_filepath_to_ignore(filepath) mm.add_filepath_to_ignore(filepath)
if m['delete'] == "true": if m['delete']:
self.logger.info("Deleting file: %s ", filepath) self.logger.info("Deleting file: %s ", filepath)
os.unlink(filepath) os.unlink(filepath)