<?php
-/**
- * Bacula® - The Network Backup Solution
- * Baculum - Bacula web interface
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
*
- * Copyright (C) 2013-2015 Marcin Haba
+ * Copyright (C) 2013-2016 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
- * The main author of Bacula is Kern Sibbald, with contributions from many
- * others, a complete list can be found in the file AUTHORS.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
*
* You may use this file and others of this release according to the
* license defined in the LICENSE file, which includes the Affero General
* Public License, v3.0 ("AGPLv3") and some additional permissions and
* terms pursuant to its AGPLv3 Section 7.
*
- * Bacula® is a registered trademark of Kern Sibbald.
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
*/
Prado::using('Application.Class.ConfigurationManager');
const SUDO = 'sudo';
- const BCONSOLE_COMMAND_PATTERN = "%s%s -c %s %s <<END_OF_DATA\n%s\nquit\n<<END_OF_DATA";
+ const BCONSOLE_COMMAND_PATTERN = "%s%s -c %s %s <<END_OF_DATA\n%s\nquit\nEND_OF_DATA";
const BCONSOLE_DIRECTORS_PATTERN = "%s%s -c %s -l";
}
}
$output = count($output) > 1 ? array_values($output) : array_shift($output);
- return (object)array('output' => $output, 'exitcode' => $exitcode);
+ return (object)array('output' => $output, 'exitcode' => (integer)$exitcode);
}
public function bconsoleCommand($director, array $command, $user = null) {
}
private function execCommand($director, array $command, $user) {
+ $cmd = '';
if(!is_null($director) && $this->isValidDirector($director) === false) {
$output = array(BconsoleError::MSG_ERROR_INVALID_DIRECTOR, '');
$exitcode = BconsoleError::ERROR_INVALID_DIRECTOR;
public function testBconsoleCommand(array $command, $bconsoleCmdPath, $bconsoleCfgPath, $useSudo) {
$this->setEnvironmentParams($bconsoleCmdPath, $bconsoleCfgPath, null, $useSudo);
$director = array_shift($this->getDirectors()->output);
- return $this->bconsoleCommand($director, $command);
+ $result = $this->bconsoleCommand($director, $command);
+ return $result;
}
}
-?>
\ No newline at end of file
+?>