* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
* @return none
*/
private function put() {
- $id = $this->Request->contains('id') ? $this->Request['id'] : null;
+ $id = $this->Request->contains('id') ? intval($this->Request['id']) : 0;
/**
* Check if it is possible to read PUT method data.
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
private $jobids;
private $path;
- public function set($id, $params) {
- // TODO: Remove when finished support for old API
- $misc = $this->getModule('misc');
- $this->jobids = property_exists($params, 'jobids') && $misc->isValidIdsList($params->jobids) ? $params->jobids : null;
- $this->path = property_exists($params, 'path') && $misc->isValidPath($params->path) ? $params->path : null;
- $this->get();
- }
-
public function get() {
$misc = $this->getModule('misc');
$limit = $this->Request->contains('limit') ? intval($this->Request['limit']) : 0;
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
private $jobids;
private $path;
- public function set($id, $params) {
- // TODO: Remove when finished support for old API
- $misc = $this->getModule('misc');
- $this->jobids = property_exists($params, 'jobids') && $misc->isValidIdsList($params->jobids) ? $params->jobids : null;
- $this->path = property_exists($params, 'path') && $misc->isValidPath($params->path) ? $params->path : null;
- $this->get();
- }
-
public function get() {
$misc = $this->getModule('misc');
$limit = $this->Request->contains('limit') ? intval($this->Request['limit']) : 0;
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
class JobCancel extends BaculumAPIServer {
public function set($id, $params) {
- $jobid = intval($id);
- $job = $this->getModule('job')->getJobById($jobid);
+ $job = $this->getModule('job')->getJobById($id);
if (is_object($job)) {
$cancel = $this->getModule('bconsole')->bconsoleCommand(
$this->director,
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
class PoolUpdate extends BaculumAPIServer {
public function set($id, $params) {
- $poolid = intval($id);
$result = $this->getModule('bconsole')->bconsoleCommand(
$this->director,
array('.pool')
);
if ($result->exitcode === 0) {
array_shift($result->output);
- $pool = $this->getModule('pool')->getPoolById($poolid);
+ $pool = $this->getModule('pool')->getPoolById($id);
if (is_object($pool) && in_array($pool->name, $result->output)) {
$result = $this->getModule('bconsole')->bconsoleCommand(
$this->director,
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2018 Kern Sibbald
+ * Copyright (C) 2013-2019 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
class PoolUpdateVolumes extends BaculumAPIServer {
public function set($id, $params) {
- $poolid = intval($id);
$result = $this->getModule('bconsole')->bconsoleCommand(
$this->director,
array('.pool')
);
if ($result->exitcode === 0) {
array_shift($result->output);
- $pool = $this->getModule('pool')->getPoolById($poolid);
+ $pool = $this->getModule('pool')->getPoolById($id);
if (is_object($pool) && in_array($pool->name, $result->output)) {
$voldata = $this->getModule('volume')->getVolumeByPoolId($pool->poolid);
if(is_object($voldata)) {