* 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 PoolShow extends BaculumAPIServer {
public function get() {
- $poolid = intval($this->Request['id']);
+ $poolid = $this->Request->contains('id') ? intval($this->Request['id']) : 0;
$pool = $this->getModule('pool')->getPoolById($poolid);
- if(!is_null($pool)) {
- $poolShow = $this->getModule('bconsole')->bconsoleCommand($this->director, array('show', 'pool="' . $pool->name . '"'), $this->user);
- $this->output = $poolShow->output;
- $this->error = (integer)$poolShow->exitcode;
+ if (is_object($pool)) {
+ $result = $this->getModule('bconsole')->bconsoleCommand(
+ $this->director,
+ array('show', '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;
}
}
-?>
\ No newline at end of file
+?>