X-Git-Url: https://git.sur5r.net/?p=bacula%2Fbacula;a=blobdiff_plain;f=gui%2Fbaculum%2Fprotected%2FAPI%2FPages%2FAPI%2FStorageRelease.php;h=c975e9b7e806a7fb6f0ff34d4b449371a6798c22;hp=5e61e5a076419577eb5609b958b03d8d121589da;hb=2e793c9b32d91e8a44344ac7bd40d82b3769340c;hpb=e26b9d05c8c05fccef0d89c50759d4df75fbd359 diff --git a/gui/baculum/protected/API/Pages/API/StorageRelease.php b/gui/baculum/protected/API/Pages/API/StorageRelease.php index 5e61e5a076..c975e9b7e8 100644 --- a/gui/baculum/protected/API/Pages/API/StorageRelease.php +++ b/gui/baculum/protected/API/Pages/API/StorageRelease.php @@ -3,7 +3,7 @@ * Bacula(R) - The Network Backup Solution * Baculum - Bacula web interface * - * Copyright (C) 2013-2016 Kern Sibbald + * Copyright (C) 2013-2017 Kern Sibbald * * The main author of Baculum is Marcin Haba. * The original author of Bacula is Kern Sibbald, with contributions @@ -22,14 +22,16 @@ class StorageRelease extends BaculumAPIServer { public function get() { - $storageid = intval($this->Request['id']); - $drive = intval($this->Request['drive']); - + $storageid = $this->Request->contains('id') ? intval($this->Request['id']) : 0; + $drive = $this->Request->contains('drive') ? intval($this->Request['drive']) : 0; $storage = $this->getModule('storage')->getStorageById($storageid); - if(!is_null($storage)) { - $storageRelease = $this->getModule('bconsole')->bconsoleCommand($this->director, array('release', 'storage="' . $storage->name . '"', 'drive="' . $drive . '"'), $this->user); - $this->output = $storageRelease->output; - $this->error = (integer)$storageRelease->exitcode; + if (is_object($storage)) { + $result = $this->getModule('bconsole')->bconsoleCommand( + $this->director, + array('release', 'storage="' . $storage->name . '"', 'drive="' . $drive . '"') + ); + $this->output = $result->output; + $this->error = $result->exitcode; } else { $this->output = StorageError::MSG_ERROR_STORAGE_DOES_NOT_EXISTS; $this->error = StorageError::ERROR_STORAGE_DOES_NOT_EXISTS;