* 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
class PoolUpdate extends BaculumAPIServer {
public function set($id, $params) {
- $pool = $this->getModule('pool')->getPoolById($id);
- if(!is_null($pool)) {
- $poolUpdate = $this->getModule('bconsole')->bconsoleCommand($this->director, array('update', 'pool="' . $pool->name . '"'), $this->user);
- $this->output = $poolUpdate->output;
- $this->error = (integer)$poolUpdate->exitcode;
+ $poolid = intval($id);
+ $pool = $this->getModule('pool')->getPoolById($poolid);
+ if(is_object($pool)) {
+ $result = $this->getModule('bconsole')->bconsoleCommand(
+ $this->director,
+ array('update', 'pool="' . $pool->name . '"')
+ );
+ $this->output = $result->output;
+ $this->error = $result->exitcode;
} else {
$this->output = PoolError::MSG_ERROR_POOL_DOES_NOT_EXISTS;
$this->error = PoolError::ERROR_POOL_DOES_NOT_EXISTS;