}
return $tool_type;
}
-
- // REMOVE ???
- public function testConfigDir($path) {
- $valid = is_writable($path);
- return $valid;
- }
}
function overwrite_directives_callback($directive_name, $directive_value) {
$directive = '';
+++ /dev/null
-<?php
-/*
- * Bacula(R) - The Network Backup Solution
- * Baculum - Bacula web interface
- *
- * Copyright (C) 2013-2016 Kern Sibbald
- *
- * The main author of Baculum is Marcin Haba.
- * 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.
- *
- * This notice must be preserved when any source code is
- * conveyed and/or propagated.
- *
- * Bacula(R) is a registered trademark of Kern Sibbald.
- */
-
-class ConfigDirTest extends BaculumAPIServer {
-
- public function set($id, $params) {
- $config_dir = property_exists($params, 'path') ? $params->path : '';
- $result = $this->getModule('bacula_config')->testConfigDir($config_dir);
- if ($result === true) {
- $this->output = BaculaConfigError::MSG_ERROR_NO_ERRORS;
- $this->error = BaculaConfigError::ERROR_NO_ERRORS;
- } else {
- $this->output = BaculaConfigError::MSG_ERROR_CONFIG_DIR_NOT_WRITABLE;
- $this->error = BaculaConfigError::ERROR_CONFIG_DIR_NOT_WRITABLE;
- }
- }
-}
+++ /dev/null
-<?php
-/*
- * Bacula(R) - The Network Backup Solution
- * Baculum - Bacula web interface
- *
- * Copyright (C) 2013-2016 Kern Sibbald
- *
- * The main author of Baculum is Marcin Haba.
- * 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.
- *
- * This notice must be preserved when any source code is
- * conveyed and/or propagated.
- *
- * Bacula(R) is a registered trademark of Kern Sibbald.
- */
-
-class JSONToolsTest extends BaculumAPIServer {
-
- public function set($id, $params) {
- $type = property_exists($params, 'type') ? $params->type : '';
- $path = property_exists($params, 'path') ? $params->path : '';
- $cfg = property_exists($params, 'cfg') ? $params->cfg : '';
- $use_sudo = property_exists($params, 'use_sudo') ? $params->use_sudo : false;
- $result = $this->getModule('json_tools')->testJSONTool($type, $path, $cfg, $use_sudo);
- if ($result === true) {
- $this->output = JSONToolsError::MSG_ERROR_NO_ERRORS;
- $this->error = JSONToolsError::ERROR_NO_ERRORS;
- } else {
- $this->output = JSONToolsError::MSG_ERROR_JSON_TOOLS_CONNECTION_PROBLEM;
- $this->error = JSONToolsError::ERROR_JSON_TOOLS_CONNECTION_PROBLEM;
- }
- }
-}
-?>
+++ /dev/null
-<?php
-/*
- * Bacula(R) - The Network Backup Solution
- * Baculum - Bacula web interface
- *
- * Copyright (C) 2013-2016 Kern Sibbald
- *
- * The main author of Baculum is Marcin Haba.
- * 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.
- *
- * This notice must be preserved when any source code is
- * conveyed and/or propagated.
- *
- * Bacula(R) is a registered trademark of Kern Sibbald.
- */
-
-class VolumesPools extends BaculumAPIServer {
- public function get() {
- $limit = intval($this->Request['limit']);
- $volumes = $this->getModule('volume')->getVolumes($limit, true);
- $this->output = $volumes;
- $this->error = VolumeError::ERROR_NO_ERRORS;
- }
-}
-?>
<url ServiceParameter="API.FileSet" pattern="api/filesets/{id}/" parameters.id="\d+" />
<url ServiceParameter="API.FileSetsInfo" pattern="api/filesets/info/" />
<!-- Bacula config module endpoints -->
- <url ServiceParameter="API.JSONToolsTest" pattern="api/config/tools/test/" />
- <url ServiceParameter="API.ConfigDirTest" pattern="api/config/directory/test/" />
<url ServiceParameter="API.Config" pattern="api/config/" />
<url ServiceParameter="API.Config" pattern="api/config/{component_type}/" parameters.component_type="[a-z]+" />
<url ServiceParameter="API.Config" pattern="api/config/{component_type}/{resource_type}/" parameters.component_type="[a-z]+" parameters.resource_type="[a-zA-Z]+" />