configcachedir = $(datadir)/runtime
samplesdir = $(examples)/$(SAMPLETYPE)
-webdatadirsrc = $(datadir)/$(webdir)/Class \
+webdatadirsrc = $(datadir)/$(webdir)/Modules \
$(datadir)/$(webdir)/Config \
$(datadir)/$(webdir)/JavaScript \
$(datadir)/$(webdir)/Data \
$(datadir)/$(webdir)/Pages \
$(datadir)/$(webdir)/Portlets
-apidatadirsrc = $(datadir)/$(apidir)/Class \
+apidatadirsrc = $(datadir)/$(apidir)/Modules \
$(datadir)/$(apidir)/Config \
$(datadir)/$(apidir)/Layouts \
$(datadir)/$(apidir)/Logs \
$(datadir)/$(apidir)/Pages \
$(datadir)/$(apidir)/Portlets
-commondatadirsrc = $(datadir)/$(commondir)/Class \
+commondatadirsrc = $(datadir)/$(commondir)/Modules \
$(datadir)/$(commondir)/JavaScript \
$(datadir)/$(commondir)/Pages \
$(datadir)/$(commondir)/Portlets
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.Common.Class.Params');
+
+use Prado\Web\UI\TTemplateControl;
/**
* Main layout.
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/datatables.net-responsive-dt/css/responsive.dataTables.min.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/datatables.net-buttons-dt/css/buttons.dataTables.min.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../../themes/Baculum-v2/css/baculum.css %> />
- <com:Application.Common.Portlets.TableDefaults />
+ <com:Baculum.Common.Portlets.TableDefaults />
<!-- Top container -->
<div class="w3-bar w3-top w3-black w3-large" style="z-index: 4">
<button type="button" class="w3-bar-item w3-button w3-hover-none w3-hover-text-light-grey" onclick="W3SideBar.open();"><i class="fa fa-bars"></i> Â Menu</button>
<img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/logo.png" alt="" />
</span>
</div>
- <com:Application.API.Portlets.APISideBar />
+ <com:Baculum.API.Portlets.APISideBar />
<div class="w3-main page_main_el" id="page_main" style="margin-left: 250px; margin-top: 43px;">
<com:TContentPlaceHolder ID="Main" />
<footer class="w3-container w3-right-align w3-small"><%[ Version: ]%> <%=Params::BACULUM_VERSION%></footer>
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Prado\Web\UI\TTemplateControl;
+
/**
* Wizard layout.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
/**
* Manage API configuration.
/**
* API config file path
*/
- const CONFIG_FILE_PATH = 'Application.API.Config.api';
+ const CONFIG_FILE_PATH = 'Baculum.API.Config.api';
/**
* API config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.API.Class.APIConfig');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.Database');
-Prado::using('System.Data.ActiveRecord.TActiveRecord');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Errors\DatabaseError;
+use PDO;
+use Prado\Data\ActiveRecord\TActiveRecord;
+use Prado\Data\TDbConnection;
/**
* Base API database module.
* @param array database parameters from api config
* @param bool force connection try (used when db_params are not saved yet)
* @return object TDbConnection instance or null if errors occured during connecting
- * @throws BCatalogExcemption if cataloga access is not supported
+ * @throws BCatalogException if cataloga access is not supported
*/
public static function getAPIDbConnection(array $db_params, $force = false) {
$db_connection = null;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.TModule');
+namespace Baculum\API\Modules;
+
+use Prado\TModule;
/**
* Abstract API module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
+use Prado\Prado;
+
/**
* API Server layer.
* Introduces main method inherited by particular API server versions.
* Set API server instance.
*
* @param BaculumAPIServer $obj server object
- * @return none
*/
public function setServerObj($obj) {
$this->server = $obj;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIServer');
-Prado::using('Application.API.Class.APIInterfaces');
+namespace Baculum\API\Modules;
+
+use stdClass;
/**
* API Server version 1.
/**
* Support for API GET method request.
*
- * @return none;
*/
public function get() {
$this->getServerObj()->get();
/**
* Support for API PUT method request.
*
- * @return none
*/
public function put() {
$id = $this->Request->contains('id') ? intval($this->Request['id']) : 0;
/**
* Support for API POST method request.
*
- * @return none
*/
public function post() {
$params = new StdClass;
/**
* Support for API DELETE method request.
*
- * @return none
*/
public function delete() {
$id = null;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIServer');
-Prado::using('Application.API.Class.APIInterfaces');
+namespace Baculum\API\Modules;
+
+use stdClass;
/**
* API Server version 2.
/**
* Support for API GET method request.
*
- * @return none;
*/
public function get() {
$this->getServerObj()->get();
/**
* Support for API PUT method request.
*
- * @return none
*/
public function put() {
$id = $this->Request->contains('id') ? intval($this->Request['id']) : 0;
/**
* Support for API POST method request.
*
- * @return none
*/
public function post() {
$inputstr = file_get_contents("php://input");
/**
* Support for API DELETE method request.
*
- * @return none
*/
public function delete() {
$id = null;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TUrlMapping');
+use Baculum\Common\Modules\BaculumUrlMapping;
+use Prado\Web\TUrlMappingPattern;
/**
* Extension default URL mapper for API.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BException');
+namespace Baculum\API\Modules;
-/**
- * API exceptions.
- *
- * @author Marcin Haba <marcin.haba@bacula.pl>
- * @category Exception
- * @package Baculum API
- */
-class BAPIException extends BException {
-}
+use Baculum\Common\Modules\BException;
-class BCatalogException extends BAPIException {
-}
-
-class BConsoleException extends BAPIException {
-}
-
-class BConfigException extends BAPIException {
+class BAPIException extends BException {
}
-?>
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\API\Modules;
+
+class BCatalogException extends BAPIException {
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\API\Modules;
+
+class BConfigException extends BAPIException {
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\API\Modules;
+
+class BConsoleException extends BAPIException {
+}
+
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
/**
* Bacula LStat value support.
*
*/
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules;
/**
* Tools used to show list files command output.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
/**
* BVFS module class.
* It provides tools to work with BVFS outputs.
);
}
}
- usort($elements, 'sortFilesListByName');
+ usort($elements, ['BVFS', 'sortFilesListByName']);
return $elements;
}
return $elements;
}
-}
-
-/*
- * Small sorting callback function to sort files and directories by name.
- * Function keeps '.' and '..' names always in the beginning of array.
- * Used to sort files and directories from Bvfs.
- */
-function sortFilesListByName($a, $b) {
- $firstLeft = substr($a['name'], 0, 1);
- $firstRight = substr($b['name'], 0, 1);
- if ($firstLeft == '.' && $firstRight != '.') {
- return -1;
- } else if ($firstRight == '.' && $firstLeft != '.') {
- return 1;
+ /*
+ * Small sorting callback function to sort files and directories by name.
+ * Function keeps '.' and '..' names always in the beginning of array.
+ * Used to sort files and directories from Bvfs.
+ */
+ public static function sortFilesListByName($a, $b) {
+ $firstLeft = substr($a['name'], 0, 1);
+ $firstRight = substr($b['name'], 0, 1);
+ if ($firstLeft == '.' && $firstRight != '.') {
+ return -1;
+ } else if ($firstRight == '.' && $firstLeft != '.') {
+ return 1;
+ }
+ return strcmp($a['name'], $b['name']);
}
- return strcmp($a['name'], $b['name']);
-}
-?>
+}
\ No newline at end of file
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\ConfigFileModule;
/**
* Manage Bacula configuration.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.APIConfig');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\Errors\BaculaConfigError;
+use Baculum\Common\Modules\Errors\JSONToolsError;
+use Baculum\Common\Modules\Params;
/**
* Read/write Bacula configuration.
);
}
$overwrite_directive = array_map(
- 'overwrite_directives_callback',
+ ['BaculaSetting', 'overwrite_directives_callback'],
array_keys($directive_value[$i]),
$values
);
}
return $tool_type;
}
-}
-function overwrite_directives_callback($directive_name, $directive_value) {
- $directive = '';
- $overwrite_directives = array(
- 'Level',
- 'Pool',
- 'Storage',
- 'Messages',
- 'FullPool',
- 'DifferentialPool',
- 'IncrementalPool',
- 'Accurate',
- 'Priority',
- 'SpoolData',
- 'MaxRunSchedTime',
- 'NextPool',
- 'MaxConnectTime'
- );
- if (in_array($directive_name, $overwrite_directives)) {
- $directive = "{$directive_name}={$directive_value}";
+
+ public static function overwrite_directives_callback($directive_name, $directive_value) {
+ $directive = '';
+ $overwrite_directives = array(
+ 'Level',
+ 'Pool',
+ 'Storage',
+ 'Messages',
+ 'FullPool',
+ 'DifferentialPool',
+ 'IncrementalPool',
+ 'Accurate',
+ 'Priority',
+ 'SpoolData',
+ 'MaxRunSchedTime',
+ 'NextPool',
+ 'MaxConnectTime'
+ );
+ if (in_array($directive_name, $overwrite_directives)) {
+ $directive = "{$directive_name}={$directive_value}";
+ }
+ return $directive;
}
- return $directive;
}
?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
session_start();
-Prado::using('Application.API.Pages.Requirements');
-Prado::using('Application.Common.Class.BaculumPage');
-Prado::using('Application.API.Class.APIConfig');
+use Baculum\Common\Modules\BaculumPage;
/**
* Main API pages class.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TPage');
-Prado::using('System.Exceptions.TException');
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.Common.Class.OAuth2');
-Prado::using('Application.Common.Class.Logging');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.APIDbModule');
-Prado::using('Application.API.Class.Bconsole');
-Prado::using('Application.API.Class.OAuth2.TokenRecord');
-Prado::using('Application.API.Class.APIServer');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Errors\AuthenticationError;
+use Baculum\Common\Modules\Errors\AuthorizationError;
+use Baculum\Common\Modules\Errors\GenericError;
+use Prado\Web\UI\TPage;
+use Prado\Exceptions\TException;
+use Baculum\Common\Modules\OAuth2;
+use Baculum\Common\Modules\Logging;
+use Baculum\API\Modules\OAuth2\TokenRecord;
/**
* Abstract module from which inherits each of API module.
*
* @access public
* @param mixed $params onInit action params
- * @return none
*/
public function onInit($params) {
parent::onInit($params);
* Run requested resource.
* It sets output and error values.
*
- * @return none
*/
private function runResource() {
$version = APIServer::getVersion();
break;
}
}
- } catch(Prado\Exceptions\TException $e) {
+ } catch(TException $e) {
$this->getModule('logging')->log(
__FUNCTION__,
"Method: {$_SERVER['REQUEST_METHOD']} $e",
* Initialize auth parameters.
*
* @param array $auth token params stored in TokenRecord session
- * @return none
*/
private function initAuthParams(array $auth) {
// if client has own bconsole config, assign it here
*
* @access public
* @param mixed $params onInit action params
- * @return none
*/
public function onLoad($params) {
parent::onLoad($params);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BasicUserConfig');
+namespace Baculum\API\Modules;
+
+use Prado\Prado;
+use Baculum\Common\Modules\BasicUserConfig;
/**
* Manage HTTP Basic auth method users.
/**
* Users login and password file for HTTP Basic auth.
*/
- const USERS_FILE_NAME = 'Application.API.Config.baculum';
+ const USERS_FILE_NAME = 'Baculum.API.Config.baculum';
const USERS_FILE_EXTENSION = '.users';
public function getConfigPath() {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\ConfigFileModule;
/**
* Manage Basic user configuration.
/**
* Basic user config file path
*/
- const CONFIG_FILE_PATH = 'Application.API.Config.basic';
+ const CONFIG_FILE_PATH = 'Baculum.API.Config.basic';
/**
* Basic user config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\Errors\BconsoleError;
+use Prado\Prado;
/**
* Execute bconsole module.
}
private function prepareOutputFile() {
- $dir = Prado::getPathOfNamespace('Application.API.Config');
+ $dir = Prado::getPathOfNamespace('Baculum.API.Config');
$fname = tempnam($dir, self::OUTPUT_FILE_PREFIX);
return $fname;
}
public static function readOutputFile($out_id) {
$output = array();
- $dir = Prado::getPathOfNamespace('Application.API.Config');
+ $dir = Prado::getPathOfNamespace('Baculum.API.Config');
if (preg_match('/^[a-z0-9]+$/i', $out_id) === 1) {
$file = $dir . '/' . self::OUTPUT_FILE_PREFIX . $out_id;
if (file_exists($file)) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.API.Class.DeviceConfig');
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\Errors\DeviceError;
+use Prado\Prado;
+use stdClass;
/**
* Execute changer command module.
* @return string|boolean new temporary filename (with path), or false on failure.
*/
private function prepareOutputFile() {
- $dir = Prado::getPathOfNamespace('Application.API.Config');
+ $dir = Prado::getPathOfNamespace('Baculum.API.Config');
$fname = tempnam($dir, self::OUTPUT_FILE_PREFIX);
return $fname;
}
*/
public static function readOutputFile($out_id) {
$output = [];
- $dir = Prado::getPathOfNamespace('Application.API.Config');
+ $dir = Prado::getPathOfNamespace('Baculum.API.Config');
if (preg_match('/^[a-z0-9]+$/i', $out_id) === 1) {
$file = $dir . '/' . self::OUTPUT_FILE_PREFIX . $out_id;
if (file_exists($file)) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.ClientRecord');
+namespace Baculum\API\Modules;
+
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* Client manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Client active record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.Common.Class.Errors');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\Errors\ActionsError;
/**
* Module responsible for executing action commands.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules;
/**
* Base abstract class to inherit commonly used method
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
/**
* Get console output page.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
+namespace Baculum\API\Modules;
/**
* Get console output for 'show' type commands.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.APIDbModule');
+
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\Errors\DatabaseError;
+use Prado\Data\TDbConnection;
+use Prado\Exceptions\TDbException;
/**
* Database module.
$connection->setActive(true);
$tables_format = $this->getTablesFormat($connection);
$is_connection = (is_numeric($tables_format) === true && $tables_format > 0);
- } catch (Prado\Exceptions\TDbException $e) {
+ } catch (TDbException $e) {
throw new BCatalogException(
DatabaseError::MSG_ERROR_DB_CONNECTION_PROBLEM . ' ' . $e->getErrorMessage(),
DatabaseError::ERROR_DB_CONNECTION_PROBLEM
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
/**
* Manage devices configuration.
/**
* Device config file path
*/
- const CONFIG_FILE_PATH = 'Application.API.Config.devices';
+ const CONFIG_FILE_PATH = 'Baculum.API.Config.devices';
/**
* Device config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.FileSetRecord');
+namespace Baculum\API\Modules;
+
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* FileSet manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* FileSet record module.
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2021 Kern Sibbald
+ * Copyright (C) 2013-2022 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\API\Modules;
+
/**
* API interfaces.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.Common.Class.Errors');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Errors\JSONToolsError;
+use Baculum\Common\Modules\Logging;
/**
* Bacula JSON tools manager.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.JobRecord');
-Prado::using('Application.API.Class.Database');
+namespace Baculum\API\Modules;
+
+use PDO;
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* Job manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Job record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.LogRecord');
+namespace Baculum\API\Modules;
/**
* Log manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Log record module.
*/
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules;
/**
* Ls command module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.OAuth2.AuthIdRecord');
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules\OAuth2;
+
+use Baculum\API\Modules\APIModule;
/**
* Manager for authorization identifiers (authorization codes).
* Delete expired authorization identifiers from database.
*
* @access public
- * @return none
*/
public function deleteExpiredAuthIds() {
$current_time = time();
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.SessionRecord');
+namespace Baculum\API\Modules\OAuth2;
+
+use Prado\Prado;
+use Baculum\Common\Modules\ISessionItem;
+use Baculum\Common\Modules\SessionRecord;
/**
* Get/set OAuth2 auth identifier.
* @category Authorization
* @package Baculum API
*/
-class AuthIdRecord extends SessionRecord implements SessionItem {
+class AuthIdRecord extends SessionRecord implements ISessionItem {
public $auth_id;
public $client_id;
}
public static function getSessionFile() {
- return Prado::getPathOfNamespace('Application.API.Config.session', '.dump');
+ return Prado::getPathOfNamespace('Baculum.API.Config.session', '.dump');
}
}
?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.OAuth2');
+namespace Baculum\API\Modules\OAuth2;
+
+use Baculum\Common\Modules\OAuth2;
/**
* Baculum API specific module with generic methods to support OAuth2.
* @param string $error_name error name
* @param string $error_description human-readable error description
* @param string $error_uri page location where client is able to get help for returned error
- * @return none
*/
public function authorizationError($header, $error_name, $error_description = null, $error_uri = null, $state = null) {
$error = array('error' => $error_name);
* @access public
* @param string $redirect_uri uniform resource identifier (URI)
* @param array $params GET parameters for redirect_uri contained in associative array
- * @return none
*/
public function authorizationRedirect($redirect_uri, $params = array()) {
header(parent::HEADER_HTTP_FOUND);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\API\Modules\OAuth2;
+
+use Baculum\Common\Modules\Logging;
+use Baculum\Common\Modules\ConfigFileModule;
/**
* Manage OAuth2 client configuration.
/**
* OAuth2 client config file path
*/
- const CONFIG_FILE_PATH = 'Application.API.Config.oauth2';
+ const CONFIG_FILE_PATH = 'Baculum.API.Config.oauth2';
/**
* OAuth2 client config file format
*
* @param array reference $config config to set added options.
* @param mixed $section determines if passed all config or only section
- * @return none
*/
private function setAddedOptions(&$config, $section = null) {
foreach ($this->added_options as $added_opt => $defval) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.OAuth2.TokenRecord');
-Prado::using('Application.API.Class.APIModule');
+namespace Baculum\API\Modules\OAuth2;
+
+use Baculum\API\Modules\APIModule;
/**
* Manager for tokens.
* Delete expired tokens from database.
*
* @access public
- * @return none
*/
public function deleteExpiredTokens() {
$current_time = time();
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.SessionRecord');
+namespace Baculum\API\Modules\OAuth2;
+
+use Prado\Prado;
+use Baculum\Common\Modules\ISessionItem;
+use Baculum\Common\Modules\SessionRecord;
/**
* Module to store tokens as session record.
* @category Authorization
* @package Baculum
*/
-class TokenRecord extends SessionRecord implements SessionItem {
+class TokenRecord extends SessionRecord implements ISessionItem {
public $access_token;
public $refresh_token;
}
public static function getSessionFile() {
- return Prado::getPathOfNamespace('Application.API.Config.session', '.dump');
+ return Prado::getPathOfNamespace('Baculum.API.Config.session', '.dump');
}
}
?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TUrlMapping');
+use Baculum\Common\Modules\BaculumUrlMapping;
+use Prado\Web\TUrlMappingPattern;
/**
* Extension default URL mapper for OAuth2.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TUrlMapping');
+use Baculum\Common\Modules\BaculumUrlMapping;
+use Prado\Web\TUrlMappingPattern;
/**
* Extension default URL mapper for Panel.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.PoolRecord');
-Prado::using('Application.API.Class.Database');
+namespace Baculum\API\Modules;
+
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* Pool manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Pool record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ComponentStatusModule');
+namespace Baculum\API\Modules;
+
+use Baculum\Common\Modules\Errors\GenericError;
/**
* Module used to get and parse client status output.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
-Prado::using('Application.API.Class.ComponentStatusModule');
+namespace Baculum\API\Modules;
/**
* Module used to parse and prepare director status output.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ComponentStatusModule');
+namespace Baculum\API\Modules;
/**
* Module used to get and parse storage status output.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.StorageRecord');
+namespace Baculum\API\Modules;
+
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* Storage manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Storage record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.VersionRecord');
+namespace Baculum\API\Modules;
+
+use Prado\Data\ActiveRecord\TActiveRecordCriteria;
/**
* Version manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Version record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIModule');
-Prado::using('Application.API.Class.VolumeRecord');
-Prado::using('Application.API.Class.Database');
+namespace Baculum\API\Modules;
/**
* Volume manager module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
+namespace Baculum\API\Modules;
/**
* Volume record module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIConfig');
-
+use Baculum\API\Modules\APIConfig;
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ActionsError;
+
/**
* API actions support.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Pages.OAuth2.Authorize');
+use Baculum\API\Pages\OAuth2\Authorize;
?>
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BVFSError;
+
/**
* BVFS cleanup.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+
/**
* BVFS clear cache.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BVFSError;
+
/**
* BVFS get jobids to do restore.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\BVFSError;
+
/**
* BVFS list directories.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\BVFSError;
/**
* BVFS list files.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BVFSError;
+
/**
* BVFS restore.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BVFSError;
+
/**
* BVFS update.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\BVFSError;
/**
* BVFS versions.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BasicUserError;
+
/**
* Basic user endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+
/**
* Basic users endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\DatabaseError;
+
/**
* Catalog test.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ChangerCommand');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\ChangerCommand;
+use Baculum\Common\Modules\Errors\DeviceError;
/**
* Load a given slot to autochanger drive.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\DeviceError;
+
/**
* Which slot is loaded in autochanger drive.
*
$drive = $this->Request->contains('drive') && $misc->isValidName($this->Request['drive']) ? $this->Request['drive'] : null;
if (is_null($drive)) {
- $this->output = ChangerCommandError::MSG_ERROR_CHANGER_COMMAND_AUTOCHANGER_DRIVE_DOES_NOT_EXIST;
- $this->error = ChangerCommandError::ERROR_CHANGER_COMMAND_AUTOCHANGER_DRIVE_DOES_NOT_EXIST;
+ $this->output = DeviceError::MSG_ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST
+ $this->error = DeviceError::ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST
return;
}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ChangerCommand');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\ChangerCommand;
+use Baculum\Common\Modules\Errors\DeviceError;
/**
* Unload a given slot from autochanger drive.
$slot = $this->Request->contains('slot') && $misc->isValidInteger($this->Request['slot']) ? intval($this->Request['slot']) : null;
if (is_null($drive)) {
- $this->output = ChangerCommandError::MSG_ERROR_CHANGER_COMMAND_AUTOCHANGER_DRIVE_DOES_NOT_EXIST;
- $this->error = ChangerCommandError::ERROR_CHANGER_COMMAND_AUTOCHANGER_DRIVE_DOES_NOT_EXIST;
+ $this->output = DeviceError::MSG_ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST;
+ $this->error = DeviceError::ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST
return;
}
if (is_null($slot)) {
- $this->output = ChangerCommandError::MSG_ERROR_CHANGER_COMMAND_WRONG_SLOT_NUMBER;
- $this->error = ChangerCommandError::ERROR_CHANGER_COMMAND_WRONG_SLOT_NUMBER;
+ $this->output = DeviceError::MSG_ERROR_DEVICE_WRONG_SLOT_NUMBER;
+ $this->error = DeviceError::ERROR_DEVICE_WRONG_SLOT_NUMBER;
return;
}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\DeviceError;
+
/**
* List autochanger volume names (requires barcode reader).
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\DeviceError;
+
/**
* Autochanger list all slots.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+
/**
* How many slots has autochanger.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ChangerCommand');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\ChangerCommand;
+use Baculum\Common\Modules\Errors\DeviceError;
/**
* Transfer autochanger tape from slot to slot.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+
/**
* Client endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+use Baculum\Common\Modules\Errors\GenericError;
+
/**
* Client bandwidth limit endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+use Baculum\Common\Modules\Errors\GenericError;
+
/**
* Client list directories.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\ClientError;
/**
* Client show command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\ClientError;
+use Baculum\Common\Modules\Errors\GenericError;
/**
* Client status.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+
/**
* Clients endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\ClientError;
/**
* Clients show command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\GenericError;
/**
* Component status module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BaculaConfigError;
/**
* Config endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+
/**
* Console command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Database size endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\BconsoleError;
/**
* Director show command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\BconsoleError;
+use Baculum\Common\Modules\Errors\GenericError;
/**
* Director status command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BconsoleError;
+
/**
* Directors endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\FileSetError;
+
/**
* FileSet endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BconsoleError;
+
/**
* FileSet resource names endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\FileSetError;
+
/**
* FileSets endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\GenericError;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job bandwidth limit endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Cancel job endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.API.Class.Bconsole');
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\JobError;
+use Baculum\Common\Modules\Errors\VolumeError;
/**
* Estimate job endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job files endpoint.
* It finds job by file criteria.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\APIServer;
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\GenericError;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* List files from 'list files jobid=xx' bconsole command.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job log endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\BconsoleError;
+
/**
* Job resource names endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job run endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\JobError;
/**
* Job show endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Job totals endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Jobs endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Jobs for client endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Jobs on volume endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+use Baculum\Common\Modules\Errors\FileSetError;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Recent jobs endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\JobError;
/**
* Show jobs command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\GenericError;
+
/**
* Console messages.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\OAuth2Error;
+
/**
* OAuth2 client endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\ClientError;
+
/**
* OAuth2 clients endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+
/**
* Pool endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\PoolError;
/**
* Show pool command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+
/**
* Update pool command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+
/**
* Update pool volumes command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+
/**
* Pools endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\PoolError;
/**
* Show pools command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Pages.OAuth2.RequestToken');
+use Baculum\API\Pages\OAuth2\RequestToken;
?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.APIDbModule');
-
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+
/**
* Run restore command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\PoolError;
/**
* Status schedune endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+
/**
* Schedules command endpoint
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\StorageError;
+use Baculum\Common\Modules\Errors\VolumeError;
/**
* Update slots command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Storage endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.API.Class.Bconsole');
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\StorageError;
/**
* Mount storage command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Mount storage command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.API.Class.Bconsole');
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\StorageError;
/**
* Release storage command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Release storage command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\StorageError;
/**
* Show storage command endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\Common\Modules\Errors\GenericError;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Storage status command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
-
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Storage umount command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Storage umount command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\StorageError;
+
/**
* Storages endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.ConsoleOutputPage');
-Prado::using('Application.API.Class.ConsoleOutputShowPage');
+use Baculum\API\Modules\ConsoleOutputPage;
+use Baculum\API\Modules\ConsoleOutputShowPage;
+use Baculum\Common\Modules\Errors\StorageError;
/**
* Show storages command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Volume endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\PoolError;
+use Baculum\Common\Modules\Errors\StorageError;
+use Baculum\Common\Modules\Errors\VolumeError;
/**
* Label volume endpoint.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.Bconsole');
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\API\Modules\Bconsole;
+use Baculum\Common\Modules\Errors\PoolError;
+use Baculum\Common\Modules\Errors\StorageError;
+use Baculum\Common\Modules\Errors\VolumeError;
/**
* Label barcodes command endpoint.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Volume prune command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Volume purge command endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Volumes endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\PoolError;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Volumes in pool endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\JobError;
+use Baculum\Common\Modules\Errors\VolumeError;
+
/**
* Required volumes endpoint.
*
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+use Baculum\API\Modules\BaculumAPIServer;
+use Baculum\Common\Modules\Errors\GenericError;
+
/**
* Welcome endpoint.
*
<configuration>
<paths>
- <using namespace="Application.API.Class.BaculumAPIServer" />
+ <using namespace="Baculum.API.Modules.BaculumAPIServer" />
</paths>
<modules>
<!-- OAuth2 - only to be compatible with old OAuth2 endpoints -->
<!-- Remove it in the future but keep oauth2_token (it is used in this service to remove old tokens) -->
- <module id="oauth2" class="Application.API.Class.OAuth2.BaculumOAuth2" />
- <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
- <module id="oauth2_authid" class="Application.API.Class.OAuth2.AuthIdManager" />
- <module id="oauth2_token" class="Application.API.Class.OAuth2.TokenManager" />
+ <module id="oauth2" class="Baculum\API\Modules\OAuth2\BaculumOAuth2" />
+ <module id="oauth2_config" class="Baculum\API\Modules\OAuth2\OAuth2Config" />
+ <module id="oauth2_authid" class="Baculum\API\Modules\OAuth2\AuthIdManager" />
+ <module id="oauth2_token" class="Baculum\API\Modules\OAuth2\TokenManager" />
<!-- Basic user config -->
- <module id="basic_apiuser" class="Application.API.Class.BasicAPIUserConfig" />
- <module id="basic_config" class="Application.API.Class.BasicConfig" />
+ <module id="basic_apiuser" class="Baculum\API\Modules\BasicAPIUserConfig" />
+ <module id="basic_config" class="Baculum\API\Modules\BasicConfig" />
<!-- API Server modules -->
- <module id="api_server_v1" class="Application.API.Class.APIServerV1" />
- <module id="api_server_v2" class="Application.API.Class.APIServerV2" />
+ <module id="api_server_v1" class="Baculum\API\Modules\APIServerV1" />
+ <module id="api_server_v2" class="Baculum\API\Modules\APIServerV2" />
<!-- database modules -->
- <module id="db" class="Application.API.Class.Database" />
- <module id="client" class="Application.API.Class.ClientManager" />
- <module id="fileset" class="Application.API.Class.FileSetManager" />
- <module id="job" class="Application.API.Class.JobManager" />
- <module id="joblog" class="Application.API.Class.LogManager" />
- <module id="pool" class="Application.API.Class.PoolManager" />
- <module id="storage" class="Application.API.Class.StorageManager" />
- <module id="version" class="Application.API.Class.VersionManager" />
- <module id="volume" class="Application.API.Class.VolumeManager" />
+ <module id="db" class="Baculum\API\Modules\Database" />
+ <module id="client" class="Baculum\API\Modules\ClientManager" />
+ <module id="fileset" class="Baculum\API\Modules\FileSetManager" />
+ <module id="job" class="Baculum\API\Modules\JobManager" />
+ <module id="joblog" class="Baculum\API\Modules\LogManager" />
+ <module id="pool" class="Baculum\API\Modules\PoolManager" />
+ <module id="storage" class="Baculum\API\Modules\StorageManager" />
+ <module id="version" class="Baculum\API\Modules\VersionManager" />
+ <module id="volume" class="Baculum\API\Modules\VolumeManager" />
<!-- tools modules -->
- <module id="bconsole" class="Application.API.Class.Bconsole" />
- <module id="json_tools" class="Application.API.Class.JSONTools" />
- <module id="bvfs" class="Application.API.Class.BVFS" />
- <module id="blstat" class="Application.API.Class.BLStat" />
+ <module id="bconsole" class="Baculum\API\Modules\Bconsole" />
+ <module id="json_tools" class="Baculum\API\Modules\JSONTools" />
+ <module id="bvfs" class="Baculum\API\Modules\BVFS" />
+ <module id="blstat" class="Baculum\API\Modules\BLStat" />
<!-- config modules -->
- <module id="api_config" class="Application.API.Class.APIConfig" />
- <module id="bacula_config" class="Application.API.Class.BaculaConfig" />
- <module id="bacula_setting" class="Application.API.Class.BaculaSetting" />
- <module id="device_config" class="Application.API.Class.DeviceConfig" />
+ <module id="api_config" class="Baculum\API\Modules\APIConfig" />
+ <module id="bacula_config" class="Baculum\API\Modules\BaculaConfig" />
+ <module id="bacula_setting" class="Baculum\API\Modules\BaculaSetting" />
+ <module id="device_config" class="Baculum\API\Modules\DeviceConfig" />
<!-- logging modules -->
- <module id="log" class="System.Util.TLogRouter">
- <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Application.API.Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
+ <module id="log" class="System\Util\TLogRouter">
+ <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Baculum\API\Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
</module>
<!-- component status modules -->
- <module id="status_dir" class="Application.API.Class.StatusDirector" />
- <module id="status_sd" class="Application.API.Class.StatusStorage" />
- <module id="status_fd" class="Application.API.Class.StatusClient" />
+ <module id="status_dir" class="Baculum\API\Modules\StatusDirector" />
+ <module id="status_sd" class="Baculum\API\Modules\StatusStorage" />
+ <module id="status_fd" class="Baculum\API\Modules\StatusClient" />
<!-- component actions modules -->
- <module id="comp_actions" class="Application.API.Class.ComponentActions" />
+ <module id="comp_actions" class="Baculum\API\Modules\ComponentActions" />
<!-- bconsole command modules -->
- <module id="ls" class="Application.API.Class.Ls" />
- <module id="list" class="Application.API.Class.BList" />
+ <module id="ls" class="Baculum\API\Modules\Ls" />
+ <module id="list" class="Baculum\API\Modules\BList" />
<!-- changer command modules -->
- <module id="changer_command" class="Application.API.Class.ChangerCommand" />
+ <module id="changer_command" class="Baculum\API\Modules\ChangerCommand" />
</modules>
</configuration>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BaculumAPIPage;
/**
* OAuth2 authorization server.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BaculumAPIPage;
/**
* OAuth2 authorization server - request token part.
<configuration>
<paths>
- <using namespace="Application.API.Class.BaculumAPIServer" />
+ <using namespace="Baculum\API\Modules\BaculumAPIServer" />
</paths>
<modules>
<!-- auth modules -->
- <module id="oauth2" class="Application.API.Class.OAuth2.BaculumOAuth2" />
- <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
- <module id="oauth2_authid" class="Application.API.Class.OAuth2.AuthIdManager" />
- <module id="oauth2_token" class="Application.API.Class.OAuth2.TokenManager" />
+ <module id="oauth2" class="Baculum\API\Modules\OAuth2\BaculumOAuth2" />
+ <module id="oauth2_config" class="Baculum\API\Modules\OAuth2\OAuth2Config" />
+ <module id="oauth2_authid" class="Baculum\API\Modules\OAuth2\AuthIdManager" />
+ <module id="oauth2_token" class="Baculum\API\Modules\OAuth2\TokenManager" />
<!-- config modules -->
- <module id="api_config" class="Application.API.Class.APIConfig" />
+ <module id="api_config" class="Baculum\API\Modules\APIConfig" />
</modules>
</configuration>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BaculumAPIPage;
/**
* API Basic users page.
-<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<header class="w3-container w3-block">
<h5>
<h2><%[ Add user ]%></h2>
</header>
<div class="w3-container w3-margin-left w3-margin-right w3-text-teal">
- <com:Application.Common.Portlets.NewAuthClient
+ <com:Baculum.Common.Portlets.NewAuthClient
ID="NewBasicClient"
Mode="add"
AuthType="basic"
<h2><%[ Edit user ]%></h2>
</header>
<div class="w3-container w3-margin-left w3-margin-right w3-text-teal">
- <com:Application.Common.Portlets.NewAuthClient
+ <com:Baculum.Common.Portlets.NewAuthClient
ID="EditBasicClient"
Mode="edit"
AuthType="basic"
-<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<header class="w3-container w3-block">
<h5>
</tfoot>
</table>
</div>
- <com:Application.API.Portlets.SudoConfig ID="SudoConfig" />
+ <com:Baculum.API.Portlets.SudoConfig ID="SudoConfig" />
<script>
var oAutochangerList = {
ids: {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.DeviceConfig');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BConfigException;
+use Baculum\API\Modules\DeviceConfig;
+use Baculum\API\Modules\BaculumAPIPage;
/**
* API devices page.
-<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<div class="w3-container">
<h3><%[ Welcome on the Baculum API default page ]%></h3>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.JuiControls.TJuiProgressbar');
-Prado::using('System.Web.UI.ActiveControls.TActiveDataGrid');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BaculumAPIPage;
/**
* API main page.
-<%@ MasterClass="Application.API.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:TWizard ID="InstallWizard"
CssClass="wizard"
</fieldset>
</com:TWizardStep>
</com:TWizard>
- <com:Application.API.Portlets.SudoConfig ID="SudoConfig" />
+ <com:Baculum.API.Portlets.SudoConfig ID="SudoConfig" />
<script type="text/javascript">
var bjsontools_fields = {
General: {
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveCustomValidator');
-Prado::using('Application.Common.Class.OAuth2');
-Prado::using('Application.API.Class.APIConfig');
-Prado::using('Application.API.Class.BAPIException');
-Prado::using('Application.API.Class.BaculumAPIPage');
-Prado::using('Application.API.Class.Database');
-Prado::using('Application.API.Class.BasicAPIUserConfig');
+use Baculum\API\Modules\APIConfig;
+use Baculum\API\Modules\BAPIException;
+use Baculum\API\Modules\BaculumAPIPage;
+use Baculum\API\Modules\Database;
/**
* API install wizard.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.API.Class.BaculumAPIPage');
+use Baculum\API\Modules\BaculumAPIPage;
/**
* API OAuth2 clients page.
-<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<header class="w3-container w3-block">
<h5>
<h2><%[ Add client ]%></h2>
</header>
<div class="w3-container w3-margin-left w3-margin-right w3-text-teal">
- <com:Application.Common.Portlets.NewAuthClient
+ <com:Baculum.Common.Portlets.NewAuthClient
ID="NewOAuth2Client"
Mode="add"
AuthType="oauth2"
<h2><%[ Edit client ]%></h2>
</header>
<div class="w3-container w3-margin-left w3-margin-right w3-text-teal">
- <com:Application.Common.Portlets.NewAuthClient
+ <com:Baculum.Common.Portlets.NewAuthClient
ID="EditOAuth2Client"
Mode="edit"
AuthType="oauth2"
-<%@ MasterClass="Application.API.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum.API.Layouts.Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<header class="w3-container w3-block">
<h5>
</div>
</div>
</div>
- <com:Application.API.Portlets.SudoConfig ID="SudoConfig" />
+ <com:Baculum.API.Portlets.SudoConfig ID="SudoConfig" />
<script>
var bin_fields = {
bconsole: [
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.AuthBasic');
-Prado::using('Application.Common.Class.AuthOAuth2');
-Prado::using('Application.API.Class.BaculumAPIPage');
-Prado::using('Application.API.Class.BAPIException');
+use Baculum\API\Modules\Database;
+use Baculum\Common\Modules\AuthBasic;
+use Baculum\Common\Modules\AuthOAuth2;
+use Baculum\API\Modules\BaculumAPIPage;
+use Baculum\API\Modules\BAPIException;
/**
* API settings page.
</paths>
<modules>
<!-- database modules -->
- <module id="db" class="Application.API.Class.Database" />
+ <module id="db" class="Baculum\API\Modules\Database" />
<!-- tools modules -->
- <module id="bconsole" class="Application.API.Class.Bconsole" />
- <module id="json_tools" class="Application.API.Class.JSONTools" />
+ <module id="bconsole" class="Baculum\API\Modules\Bconsole" />
+ <module id="json_tools" class="Baculum\API\Modules\JSONTools" />
<!-- config modules -->
- <module id="api_config" class="Application.API.Class.APIConfig" />
- <module id="device_config" class="Application.API.Class.DeviceConfig" />
- <module id="bacula_setting" class="Application.API.Class.BaculaSetting" />
+ <module id="api_config" class="Baculum\API\Modules\APIConfig" />
+ <module id="device_config" class="Baculum\API\Modules\DeviceConfig" />
+ <module id="bacula_setting" class="Baculum\API\Modules\BaculaSetting" />
<!-- internalization modules -->
<module id="globalization" class="TGlobalization">
- <translation type="gettext" source="Application.API.Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
+ <translation type="gettext" source="Baculum\API\Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
</module>
<!-- logging modules -->
- <module id="log" class="System.Util.TLogRouter">
- <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Application.API.Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
+ <module id="log" class="System\Util\TLogRouter">
+ <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Baculum\API\Logs" LogFile="baculum-api.log" MaxFileSize="1000" MaxLogFiles="5" />
</module>
<!-- auth modules -->
- <module id="basic_apiuser" class="Application.API.Class.BasicAPIUserConfig" />
- <module id="basic_config" class="Application.API.Class.BasicConfig" />
- <module id="oauth2_config" class="Application.API.Class.OAuth2.OAuth2Config" />
+ <module id="basic_apiuser" class="Baculum\API\Modules\BasicAPIUserConfig" />
+ <module id="basic_config" class="Baculum\API\Modules\BasicConfig" />
+ <module id="oauth2_config" class="Baculum\API\Modules\OAuth2\OAuth2Config" />
<!-- component actions modules -->
- <module id="comp_actions" class="Application.API.Class.ComponentActions" />
+ <module id="comp_actions" class="Baculum\API\Modules\ComponentActions" />
<!-- changer command modules -->
- <module id="changer_command" class="Application.API.Class.ChangerCommand" />
+ <module id="changer_command" class="Baculum\API\Modules\ChangerCommand" />
</modules>
</configuration>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.GeneralRequirements');
+namespace Baculum\API\Pages;
+
+use Baculum\Common\Modules\GeneralRequirements;
/**
* API part requirements class.
/**
* Validate all API environment depenencies.
*
- * @return none
*/
public function validateEnvironment() {
parent::validateExtensions($this->req_exts);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Common.Portlets.PortletTemplate');
+use Baculum\Common\Portlets\PortletTemplate;
/**
* Main side-bar control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.JuiControls.TJuiDialog');
-Prado::using('Application.Common.Portlets.PortletTemplate');
+use Baculum\Common\Portlets\PortletTemplate;
/**
* Sudo config control.
+++ /dev/null
-<?php
-/*
- * Bacula(R) - The Network Backup Solution
- * Baculum - Bacula web interface
- *
- * Copyright (C) 2013-2021 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.
- */
-
-/**
- * Error classes.
- *
- * @author Marcin Haba <marcin.haba@bacula.pl>
- * @category Errors
- * @package Baculum Common
- */
-class GenericError {
- const ERROR_NO_ERRORS = 0;
- const ERROR_INVALID_COMMAND = 1;
- const ERROR_INTERNAL_ERROR = 1000;
- const ERROR_INVALID_PATH = 8;
- const ERROR_WRONG_EXITCODE = 9;
-
- const MSG_ERROR_NO_ERRORS = '';
- const MSG_ERROR_INVALID_COMMAND = 'Invalid command.';
- const MSG_ERROR_INTERNAL_ERROR = 'Internal error.';
- const MSG_ERROR_INVALID_PATH = 'Invalid path.';
- const MSG_ERROR_WRONG_EXITCODE = 'Wrong exitcode.';
-}
-
-class DatabaseError extends GenericError {
- const ERROR_DB_CONNECTION_PROBLEM = 2;
- const ERROR_DATABASE_ACCESS_NOT_SUPPORTED = 3;
-
- const MSG_ERROR_DB_CONNECTION_PROBLEM = 'Problem with connection to database.';
- const MSG_ERROR_DATABASE_ACCESS_NOT_SUPPORTED = 'Database access is not supported by this API instance.';
-}
-
-class BconsoleError extends GenericError {
-
- const ERROR_BCONSOLE_CONNECTION_PROBLEM = 4;
- const ERROR_INVALID_DIRECTOR = 5;
- const ERROR_BCONSOLE_DISABLED = 11;
-
- const MSG_ERROR_BCONSOLE_CONNECTION_PROBLEM = 'Problem with connection to bconsole.';
- const MSG_ERROR_INVALID_DIRECTOR = 'Invalid director.';
- const MSG_ERROR_BCONSOLE_DISABLED = 'Bconsole support is disabled.';
-}
-
-class AuthenticationError extends GenericError {
-
- const ERROR_AUTHENTICATION_TO_API_PROBLEM = 6;
-
- const MSG_ERROR_AUTHENTICATION_TO_API_PROBLEM = 'Problem with authentication to Baculum API.';
-}
-
-class AuthorizationError extends GenericError {
-
- const ERROR_ACCESS_ATTEMPT_TO_NOT_ALLOWED_RESOURCE = 7;
-
- const MSG_ERROR_ACCESS_ATTEMPT_TO_NOT_ALLOWED_RESOURCE = 'Access attempt to not allowed resource. Permission denied.';
-}
-
-class ClientError extends GenericError {
- const ERROR_CLIENT_DOES_NOT_EXISTS = 10;
-
- const MSG_ERROR_CLIENT_DOES_NOT_EXISTS = 'Client does not exist.';
-}
-
-class StorageError extends GenericError {
- const ERROR_STORAGE_DOES_NOT_EXISTS = 20;
-
- const MSG_ERROR_STORAGE_DOES_NOT_EXISTS = 'Storage does not exist.';
-}
-
-class VolumeError extends GenericError {
- const ERROR_VOLUME_DOES_NOT_EXISTS = 30;
- const ERROR_INVALID_VOLUME = 31;
- const ERROR_INVALID_SLOT = 32;
- const ERROR_VOLUME_ALREADY_EXISTS = 33;
-
- const MSG_ERROR_VOLUME_DOES_NOT_EXISTS = 'Volume does not exist.';
- const MSG_ERROR_INVALID_VOLUME = 'Invalid volume.';
- const MSG_ERROR_INVALID_SLOT = 'Invalid slot.';
- const MSG_ERROR_VOLUME_ALREADY_EXISTS = 'Volume already exists.';
-}
-
-class PoolError extends GenericError {
- const ERROR_POOL_DOES_NOT_EXISTS = 40;
- const ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE = 41;
-
- const MSG_ERROR_POOL_DOES_NOT_EXISTS = 'Pool does not exist.';
- const MSG_ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE= 'Pool with inputted poolid does not contain any volume to update.';
-}
-
-class JobError extends GenericError {
- const ERROR_JOB_DOES_NOT_EXISTS = 50;
- const ERROR_INVALID_JOBLEVEL = 51;
- const ERROR_FILESET_DOES_NOT_EXISTS = 52;
- const ERROR_CLIENT_DOES_NOT_EXISTS = 53;
- const ERROR_STORAGE_DOES_NOT_EXISTS = 54;
- const ERROR_POOL_DOES_NOT_EXISTS = 55;
- const ERROR_INVALID_RPATH = 56;
- const ERROR_INVALID_WHERE_OPTION = 57;
- const ERROR_INVALID_REPLACE_OPTION = 58;
- const ERROR_INVALID_FILENAME = 59;
-
- const MSG_ERROR_JOB_DOES_NOT_EXISTS = 'Job does not exist.';
- const MSG_ERROR_INVALID_JOBLEVEL = 'Inputted job level is invalid.';
- const MSG_ERROR_FILESET_DOES_NOT_EXISTS = 'FileSet resource does not exist.';
- const MSG_ERROR_CLIENT_DOES_NOT_EXISTS = 'Client does not exist.';
- const MSG_ERROR_STORAGE_DOES_NOT_EXISTS = 'Storage does not exist.';
- const MSG_ERROR_POOL_DOES_NOT_EXISTS = 'Pool does not exist.';
- const MSG_ERROR_INVALID_RPATH = 'Inputted rpath for restore is invalid. Proper format is b2[0-9]+.';
- const MSG_ERROR_INVALID_WHERE_OPTION = 'Inputted "where" option is invalid.';
- const MSG_ERROR_INVALID_REPLACE_OPTION = 'Inputted "replace" option is invalid.';
- const MSG_ERROR_INVALID_FILENAME = 'Inputted "filename" option is invalid.';
-}
-
-class FileSetError extends GenericError {
- const ERROR_FILESET_DOES_NOT_EXISTS = 60;
-
- const MSG_ERROR_FILESET_DOES_NOT_EXISTS = 'FileSet does not exist.';
-}
-
-class BVFSError extends GenericError {
- const ERROR_INVALID_RPATH = 71;
- const ERROR_INVALID_RESTORE_PATH = 72;
- const ERROR_INVALID_JOBID_LIST = 73;
- const ERROR_INVALID_FILEID_LIST = 74;
- const ERROR_INVALID_FILEINDEX_LIST = 75;
- const ERROR_INVALID_DIRID_LIST = 76;
- const ERROR_INVALID_CLIENT = 77;
- const ERROR_INVALID_JOBID = 78;
-
- const MSG_ERROR_INVALID_RPATH = 'Inputted path for restore is invalid. Proper format is b2[0-9]+.';
- const MSG_ERROR_INVALID_RESTORE_PATH = 'Inputted BVFS path param is invalid.';
- const MSG_ERROR_INVALID_JOBID_LIST = 'Invalid jobid list.';
- const MSG_ERROR_INVALID_FILEID_LIST = 'Invalid fileid list.';
- const MSG_ERROR_INVALID_FILEINDEX_LIST = 'Invalid file index list.';
- const MSG_ERROR_INVALID_DIRID_LIST = 'Invalid dirid list.';
- const MSG_ERROR_INVALID_CLIENT = 'Invalid client name.';
- const MSG_ERROR_INVALID_JOBID = 'Invalid jobid.';
-}
-
-class JSONToolsError extends GenericError {
-
- const ERROR_JSON_TOOLS_DISABLED = 80;
- const ERROR_JSON_TOOLS_CONNECTION_PROBLEM = 81;
- const ERROR_JSON_TOOLS_WRONG_EXITCODE = 82;
- const ERROR_JSON_TOOLS_UNABLE_TO_PARSE_OUTPUT = 83;
- const ERROR_JSON_TOOL_NOT_CONFIGURED = 84;
-
- const MSG_ERROR_JSON_TOOLS_DISABLED = 'JSON tools support is disabled.';
- const MSG_ERROR_JSON_TOOLS_CONNECTION_PROBLEM = 'Problem with connection to a JSON tool.';
- const MSG_ERROR_JSON_TOOLS_WRONG_EXITCODE = 'JSON tool returned wrong exitcode.';
- const MSG_ERROR_JSON_TOOLS_UNABLE_TO_PARSE_OUTPUT = 'JSON tool output was unable to parse.';
- const MSG_ERROR_JSON_TOOL_NOT_CONFIGURED = 'JSON tool not configured.';
-}
-
-class BaculaConfigError extends GenericError {
-
- const ERROR_CONFIG_DIR_NOT_WRITABLE = 90;
- const ERROR_UNEXPECTED_BACULA_CONFIG_VALUE = 91;
- const ERROR_CONFIG_NO_JSONTOOL_READY = 92;
- const ERROR_WRITE_TO_CONFIG_ERROR = 93;
- const ERROR_CONFIG_VALIDATION_ERROR = 94;
-
- const MSG_ERROR_CONFIG_DIR_NOT_WRITABLE = 'Config directory is not writable.';
- const MSG_ERROR_UNEXPECTED_BACULA_CONFIG_VALUE = 'Unexpected Bacula config value.';
- const MSG_ERROR_CONFIG_NO_JSONTOOL_READY = 'No JSON tool ready.';
- const MSG_ERROR_WRITE_TO_CONFIG_ERROR = 'Write to config file error.';
- const MSG_ERROR_CONFIG_VALIDATION_ERROR = 'Config validation error.';
-}
-
-class ConnectionError extends GenericError {
-
- const ERROR_CONNECTION_TO_HOST_PROBLEM = 100;
-
- const MSG_ERROR_CONNECTION_TO_HOST_PROBLEM = 'Problem with connection to remote host.';
-}
-
-class ActionsError extends GenericError {
-
- const ERROR_ACTIONS_ACTION_DOES_NOT_EXIST = 110;
- const ERROR_ACTIONS_DISABLED = 111;
- const ERROR_ACTIONS_WRONG_EXITCODE = 112;
- const ERROR_ACTIONS_NOT_CONFIGURED = 113;
-
- const MSG_ERROR_ACTIONS_ACTION_DOES_NOT_EXIST = 'Action does not exist.';
- const MSG_ERROR_ACTIONS_DISABLED = 'Actions support is disabled.';
- const MSG_ERROR_ACTIONS_WRONG_EXITCODE = 'Action command returned wrong exitcode.';
- const MSG_ERROR_ACTIONS_NOT_CONFIGURED = 'Action is not configured.';
-}
-
-class OAuth2Error extends GenericError {
-
- const ERROR_OAUTH2_CLIENT_DOES_NOT_EXIST = 120;
- const ERROR_OAUTH2_CLIENT_ALREADY_EXISTS = 121;
- const ERROR_OAUTH2_CLIENT_INVALID_CLIENT_ID = 122;
- const ERROR_OAUTH2_CLIENT_INVALID_CLIENT_SECRET = 123;
- const ERROR_OAUTH2_CLIENT_INVALID_REDIRECT_URI = 124;
- const ERROR_OAUTH2_CLIENT_INVALID_SCOPE = 125;
- const ERROR_OAUTH2_CLIENT_INVALID_BCONSOLE_CFG_PATH = 126;
- const ERROR_OAUTH2_CLIENT_INVALID_NAME = 127;
- const ERROR_OAUTH2_CLIENT_INVALID_CONSOLE = 128;
- const ERROR_OAUTH2_CLIENT_INVALID_DIRECTOR = 129;
-
- const MSG_ERROR_OAUTH2_CLIENT_DOES_NOT_EXIST = 'OAuth2 client does not exist.';
- const MSG_ERROR_OAUTH2_CLIENT_ALREADY_EXISTS = 'OAuth2 client already exists.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_CLIENT_ID = 'Invalid OAuth2 client ID.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_CLIENT_SECRET = 'Invalid OAuth2 client secret.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_REDIRECT_URI = 'Invalid OAuth2 redirect URI.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_SCOPE = 'Invalid OAuth2 scope.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_BCONSOLE_CFG_PATH = 'Invalid Bconsole config path.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_NAME = 'Invalid OAuth2 client name.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_CONSOLE = 'Invalid Console name.';
- const MSG_ERROR_OAUTH2_CLIENT_INVALID_DIRECTOR = 'Invalid Director name.';
-}
-class DeviceError extends GenericError {
-
- const ERROR_DEVICE_DEVICE_CONFIG_DOES_NOT_EXIST = 130;
- const ERROR_DEVICE_INVALID_COMMAND = 131;
- const ERROR_DEVICE_AUTOCHANGER_DOES_NOT_EXIST = 132;
- const ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST = 133;
- const ERROR_DEVICE_WRONG_SLOT_NUMBER = 134;
- const ERROR_DEVICE_DRIVE_DOES_NOT_BELONG_TO_AUTOCHANGER = 135;
-
- const MSG_ERROR_DEVICE_DEVICE_CONFIG_DOES_NOT_EXIST = 'Device config does not exist.';
- const MSG_ERROR_DEVICE_INVALID_COMMAND = 'Invalid changer command.';
- const MSG_ERROR_DEVICE_AUTOCHANGER_DOES_NOT_EXIST = 'Autochanger does not exist.';
- const MSG_ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST = 'Autochanger drive does not exist.';
- const MSG_ERROR_DEVICE_WRONG_SLOT_NUMBER = 'Wrong slot number.';
- const MSG_ERROR_DEVICE_DRIVE_DOES_NOT_BELONG_TO_AUTOCHANGER = 'Drive does not belong to selected autochanger.';
-}
-
-class BasicUserError extends GenericError {
-
- const ERROR_BASIC_USER_DOES_NOT_EXIST = 140;
- const ERROR_BASIC_USER_ALREADY_EXISTS = 141;
- const ERROR_BASIC_USER_INVALID_USERNAME = 142;
- const ERROR_BASIC_USER_INVALID_BCONSOLE_CFG_PATH = 143;
- const ERROR_BASIC_USER_INVALID_CONSOLE = 144;
- const ERROR_BASIC_USER_INVALID_DIRECTOR = 145;
- const ERROR_BASIC_USER_INVALID_PASSWORD= 146;
-
- const MSG_ERROR_BASIC_USER_DOES_NOT_EXIST = 'Basic user does not exist.';
- const MSG_ERROR_BASIC_USER_ALREADY_EXISTS = 'Basic user already exists.';
- const MSG_ERROR_BASIC_USER_INVALID_USERNAME = 'Invalid basic user username';
- const MSG_ERROR_BASIC_USER_INVALID_BCONSOLE_CFG_PATH = 'Invalid bconsole config path.';
- const MSG_ERROR_BASIC_USER_INVALID_CONSOLE = 'Invalid Console name.';
- const MSG_ERROR_BASIC_USER_INVALID_DIRECTOR = 'Invalid Director name.';
- const MSG_ERROR_BASIC_USER_INVALID_PASSWORD = 'Invalid password.';
-}
-?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic APR1-MD5 hashing function module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
+
+use Prado\Web\THttpRequest;
/**
* Abstraction that defines common methods to inheirt by auth modules.
* Descendant classes can implement auth module interface.
- * @see Application.Common.Class.Interfaces.AuthModule
+ * @see Baculum\Common\Modules\IAuthModule
*
* @author Marcin Haba <marcin.haba@bacula.pl>
* @category Module
* Public constructor.
*
* @param THttpRequest $request HTTP request object.
- * @return none
*/
public function initialize(THttpRequest $request) {
self::$req = $request;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.AuthBase');
-Prado::using('Application.Common.Class.Interfaces');
+namespace Baculum\Common\Modules;
/**
* Basic authentication auth module.
* @category Module
* @package Baculum Common
*/
-class AuthBasic extends AuthBase implements AuthModule {
+class AuthBasic extends AuthBase implements IAuthModule {
/**
* Generic name (used e.g. in config files).
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.AuthBase');
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.OAuth2');
+namespace Baculum\Common\Modules;
/**
* OAuth2 authorization auth module.
* @category Module
* @package Baculum Common
*/
-class AuthOAuth2 extends AuthBase implements AuthModule {
+class AuthOAuth2 extends AuthBase implements IAuthModule {
/**
* Generic name (used e.g. in config files).
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TAssetManager');
+namespace Baculum\Common\Modules;
+
+use Prado\Exceptions\TInvalidDataValueException;
+use Prado\Web\TAssetManager;
/**
* Baculum asset manager.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.WebControls.TClientScript');
-Prado::using('Application.Common.Class.Params');
+namespace Baculum\Common\Modules;
+
+use Prado\Web\UI\WebControls\TClientScript;
/**
* Baculum client script class.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic BCrypt hashing function module
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-use Prado\Exceptions;
+namespace Baculum\Common\Modules;
+
+use \Prado\Exceptions\TException;
/**
* Main common Baculum exceptions class.
* @category Exception
* @package Baculum Common
*/
-class BException extends \Prado\Exceptions\TException {
+class BException extends TException {
private $error_code;
private $error_message;
$this->getErrorMessage()
);
}
-}
-
-class AuthException extends BException {
-}
-?>
+}
\ No newline at end of file
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.WebControls.TStyleSheet');
-Prado::using('Application.Common.Class.Params');
+namespace Baculum\Common\Modules;
+
+use Prado\Web\UI\WebControls\TStyleSheet;
/**
* Baculum loading stylesheel class.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TPage');
-Prado::using('Application.Common.Class.BClientScript');
-Prado::using('Application.Common.Class.Params');
+namespace Baculum\Common\Modules;
+
+use Prado\Web\UI\TPage;
/**
* Base pages module.
* @access public
* @param string $page_name page name to redirect
* @param array $params HTTP GET method parameters in associative array
- * @return none
*/
public function goToPage($page_name, $params = null) {
$url = $this->Service->constructUrl($page_name, $params, false);
*
* @access public
* @param array $params HTTP GET method parameters in associative array
- * @return none
*/
public function goToDefaultPage($params = null) {
$this->goToPage($this->Service->DefaultPage, $params);
* http://localhost:9095/baculum/
*
* @access private
- * @return none
*/
private function setURLPrefixForSubdir() {
$full_document_root = preg_replace('#(\/)$#', '', $this->getFullDocumentRoot());
if (!is_dir($css_dir)) {
return;
}
- $files = new FilesystemIterator($css_dir);
+ $files = new \FilesystemIterator($css_dir);
foreach ($files as $file) {
$filename = $file->getFilename();
if (!is_file($css_dir . $filename)) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TUrlMapping');
+namespace Baculum\Common\Modules;
+
+use Prado\Exceptions\THttpException;
+use Prado\Prado;
+use Prado\Web\TUrlMapping;
/**
* Baculum URL mapping class.
private $services = array(
'web' => array(
- 'url_manager' => 'Application.Web.Class.WebUrlMapping',
+ 'url_manager' => 'Baculum.Web.Modules.WebUrlMapping',
'url_pattern' => '!^(/index\.php)?/web([/,].*)?$!',
- 'endpoints' => 'Application.Web.endpoints'
+ 'endpoints' => 'Baculum.Web.endpoints'
),
'api' => array(
- 'url_manager' => 'Application.API.Class.APIUrlMapping',
+ 'url_manager' => 'Baculum.API.Modules.APIUrlMapping',
'url_pattern' => '!^(/index\.php)?/api([/,].*)?$!',
- 'endpoints' => 'Application.API.Pages.API.endpoints'
+ 'endpoints' => 'Baculum.API.Pages.API.endpoints'
),
'oauth' => array(
- 'url_manager' => 'Application.API.Class.OAuthUrlMapping',
+ 'url_manager' => 'Baculum.API.Modules.OAuthUrlMapping',
'url_pattern' => '!^(/index\.php)?/oauth([/,].*)?$!',
- 'endpoints' => 'Application.API.Pages.OAuth2.endpoints'
+ 'endpoints' => 'Baculum.API.Pages.OAuth2.endpoints'
),
'panel' => array(
- 'url_manager' => 'Application.API.Class.PanelUrlMapping',
+ 'url_manager' => 'Baculum.API.Modules.PanelUrlMapping',
'url_pattern' => '!^(/index\.php)?/panel([/,].*)?$!',
- 'endpoints' => 'Application.API.Pages.Panel.endpoints'
+ 'endpoints' => 'Baculum.API.Pages.Panel.endpoints'
)
);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Manage basic auth method users.
* Set config file path.
*
* @param string $path path to config file
- * @return none
*/
public function setConfigPath($path) {
$this->config_path = $path;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.TModule');
+namespace Baculum\Common\Modules;
+
+use Prado\TModule;
/**
* Abstract common module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Module to read/write Bacula-style config.
* @category Module
* @package Baculum Common
*/
-class ConfigBacula extends CommonModule implements ConfigFormat {
+class ConfigBacula extends CommonModule implements IConfigFormat {
/**
* Whitespace character used as indent.
*
* @access public
* @param string $source config file path
- * @return none
*/
public function read($source) {
// reading Bacula config files is done by Bacula JSON tools.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
+
+use Prado\Prado;
/**
* Generic config file module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Module to read/write INI-style config.
* @category Module
* @package Baculum Common
*/
-class ConfigIni extends CommonModule implements ConfigFormat {
+class ConfigIni extends CommonModule implements IConfigFormat {
/**
* Write config data to file in INI format.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
+
+use ReflectionClass;
/**
* Cryptographic tools.
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Actions error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class ActionsError extends GenericError {
+
+ const ERROR_ACTIONS_ACTION_DOES_NOT_EXIST = 110;
+ const ERROR_ACTIONS_DISABLED = 111;
+ const ERROR_ACTIONS_WRONG_EXITCODE = 112;
+ const ERROR_ACTIONS_NOT_CONFIGURED = 113;
+
+ const MSG_ERROR_ACTIONS_ACTION_DOES_NOT_EXIST = 'Action does not exist.';
+ const MSG_ERROR_ACTIONS_DISABLED = 'Actions support is disabled.';
+ const MSG_ERROR_ACTIONS_WRONG_EXITCODE = 'Action command returned wrong exitcode.';
+ const MSG_ERROR_ACTIONS_NOT_CONFIGURED = 'Action is not configured.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Authentication error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class AuthenticationError extends GenericError {
+
+ const ERROR_AUTHENTICATION_TO_API_PROBLEM = 6;
+
+ const MSG_ERROR_AUTHENTICATION_TO_API_PROBLEM = 'Problem with authentication to Baculum API.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Authorization error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class AuthorizationError extends GenericError {
+
+ const ERROR_ACCESS_ATTEMPT_TO_NOT_ALLOWED_RESOURCE = 7;
+
+ const MSG_ERROR_ACCESS_ATTEMPT_TO_NOT_ALLOWED_RESOURCE = 'Access attempt to not allowed resource. Permission denied.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * BVFS error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class BVFSError extends GenericError {
+ const ERROR_INVALID_RPATH = 71;
+ const ERROR_INVALID_RESTORE_PATH = 72;
+ const ERROR_INVALID_JOBID_LIST = 73;
+ const ERROR_INVALID_FILEID_LIST = 74;
+ const ERROR_INVALID_FILEINDEX_LIST = 75;
+ const ERROR_INVALID_DIRID_LIST = 76;
+ const ERROR_INVALID_CLIENT = 77;
+ const ERROR_INVALID_JOBID = 78;
+
+ const MSG_ERROR_INVALID_RPATH = 'Inputted path for restore is invalid. Proper format is b2[0-9]+.';
+ const MSG_ERROR_INVALID_RESTORE_PATH = 'Inputted BVFS path param is invalid.';
+ const MSG_ERROR_INVALID_JOBID_LIST = 'Invalid jobid list.';
+ const MSG_ERROR_INVALID_FILEID_LIST = 'Invalid fileid list.';
+ const MSG_ERROR_INVALID_FILEINDEX_LIST = 'Invalid file index list.';
+ const MSG_ERROR_INVALID_DIRID_LIST = 'Invalid dirid list.';
+ const MSG_ERROR_INVALID_CLIENT = 'Invalid client name.';
+ const MSG_ERROR_INVALID_JOBID = 'Invalid jobid.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Bacula config error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class BaculaConfigError extends GenericError {
+
+ const ERROR_CONFIG_DIR_NOT_WRITABLE = 90;
+ const ERROR_UNEXPECTED_BACULA_CONFIG_VALUE = 91;
+ const ERROR_CONFIG_NO_JSONTOOL_READY = 92;
+ const ERROR_WRITE_TO_CONFIG_ERROR = 93;
+ const ERROR_CONFIG_VALIDATION_ERROR = 94;
+
+ const MSG_ERROR_CONFIG_DIR_NOT_WRITABLE = 'Config directory is not writable.';
+ const MSG_ERROR_UNEXPECTED_BACULA_CONFIG_VALUE = 'Unexpected Bacula config value.';
+ const MSG_ERROR_CONFIG_NO_JSONTOOL_READY = 'No JSON tool ready.';
+ const MSG_ERROR_WRITE_TO_CONFIG_ERROR = 'Write to config file error.';
+ const MSG_ERROR_CONFIG_VALIDATION_ERROR = 'Config validation error.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Basic user error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class BasicUserError extends GenericError {
+
+ const ERROR_BASIC_USER_DOES_NOT_EXIST = 140;
+ const ERROR_BASIC_USER_ALREADY_EXISTS = 141;
+ const ERROR_BASIC_USER_INVALID_USERNAME = 142;
+ const ERROR_BASIC_USER_INVALID_BCONSOLE_CFG_PATH = 143;
+ const ERROR_BASIC_USER_INVALID_CONSOLE = 144;
+ const ERROR_BASIC_USER_INVALID_DIRECTOR = 145;
+ const ERROR_BASIC_USER_INVALID_PASSWORD= 146;
+
+ const MSG_ERROR_BASIC_USER_DOES_NOT_EXIST = 'Basic user does not exist.';
+ const MSG_ERROR_BASIC_USER_ALREADY_EXISTS = 'Basic user already exists.';
+ const MSG_ERROR_BASIC_USER_INVALID_USERNAME = 'Invalid basic user username';
+ const MSG_ERROR_BASIC_USER_INVALID_BCONSOLE_CFG_PATH = 'Invalid bconsole config path.';
+ const MSG_ERROR_BASIC_USER_INVALID_CONSOLE = 'Invalid Console name.';
+ const MSG_ERROR_BASIC_USER_INVALID_DIRECTOR = 'Invalid Director name.';
+ const MSG_ERROR_BASIC_USER_INVALID_PASSWORD = 'Invalid password.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Bconsole error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class BconsoleError extends GenericError {
+
+ const ERROR_BCONSOLE_CONNECTION_PROBLEM = 4;
+ const ERROR_INVALID_DIRECTOR = 5;
+ const ERROR_BCONSOLE_DISABLED = 11;
+
+ const MSG_ERROR_BCONSOLE_CONNECTION_PROBLEM = 'Problem with connection to bconsole.';
+ const MSG_ERROR_INVALID_DIRECTOR = 'Invalid director.';
+ const MSG_ERROR_BCONSOLE_DISABLED = 'Bconsole support is disabled.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Client error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class ClientError extends GenericError {
+ const ERROR_CLIENT_DOES_NOT_EXISTS = 10;
+
+ const MSG_ERROR_CLIENT_DOES_NOT_EXISTS = 'Client does not exist.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Connection error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class ConnectionError extends GenericError {
+
+ const ERROR_CONNECTION_TO_HOST_PROBLEM = 100;
+
+ const MSG_ERROR_CONNECTION_TO_HOST_PROBLEM = 'Problem with connection to remote host.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Database error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class DatabaseError extends GenericError {
+ const ERROR_DB_CONNECTION_PROBLEM = 2;
+ const ERROR_DATABASE_ACCESS_NOT_SUPPORTED = 3;
+
+ const MSG_ERROR_DB_CONNECTION_PROBLEM = 'Problem with connection to database.';
+ const MSG_ERROR_DATABASE_ACCESS_NOT_SUPPORTED = 'Database access is not supported by this API instance.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Device error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class DeviceError extends GenericError {
+
+ const ERROR_DEVICE_DEVICE_CONFIG_DOES_NOT_EXIST = 130;
+ const ERROR_DEVICE_INVALID_COMMAND = 131;
+ const ERROR_DEVICE_AUTOCHANGER_DOES_NOT_EXIST = 132;
+ const ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST = 133;
+ const ERROR_DEVICE_WRONG_SLOT_NUMBER = 134;
+ const ERROR_DEVICE_DRIVE_DOES_NOT_BELONG_TO_AUTOCHANGER = 135;
+
+ const MSG_ERROR_DEVICE_DEVICE_CONFIG_DOES_NOT_EXIST = 'Device config does not exist.';
+ const MSG_ERROR_DEVICE_INVALID_COMMAND = 'Invalid changer command.';
+ const MSG_ERROR_DEVICE_AUTOCHANGER_DOES_NOT_EXIST = 'Autochanger does not exist.';
+ const MSG_ERROR_DEVICE_AUTOCHANGER_DRIVE_DOES_NOT_EXIST = 'Autochanger drive does not exist.';
+ const MSG_ERROR_DEVICE_WRONG_SLOT_NUMBER = 'Wrong slot number.';
+ const MSG_ERROR_DEVICE_DRIVE_DOES_NOT_BELONG_TO_AUTOCHANGER = 'Drive does not belong to selected autochanger.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * FileSet error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class FileSetError extends GenericError {
+ const ERROR_FILESET_DOES_NOT_EXISTS = 60;
+
+ const MSG_ERROR_FILESET_DOES_NOT_EXISTS = 'FileSet does not exist.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Generic error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class GenericError {
+ const ERROR_NO_ERRORS = 0;
+ const ERROR_INVALID_COMMAND = 1;
+ const ERROR_INTERNAL_ERROR = 1000;
+ const ERROR_INVALID_PATH = 8;
+ const ERROR_WRONG_EXITCODE = 9;
+
+ const MSG_ERROR_NO_ERRORS = '';
+ const MSG_ERROR_INVALID_COMMAND = 'Invalid command.';
+ const MSG_ERROR_INTERNAL_ERROR = 'Internal error.';
+ const MSG_ERROR_INVALID_PATH = 'Invalid path.';
+ const MSG_ERROR_WRONG_EXITCODE = 'Wrong exitcode.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * JSON tools error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class JSONToolsError extends GenericError {
+
+ const ERROR_JSON_TOOLS_DISABLED = 80;
+ const ERROR_JSON_TOOLS_CONNECTION_PROBLEM = 81;
+ const ERROR_JSON_TOOLS_WRONG_EXITCODE = 82;
+ const ERROR_JSON_TOOLS_UNABLE_TO_PARSE_OUTPUT = 83;
+ const ERROR_JSON_TOOL_NOT_CONFIGURED = 84;
+
+ const MSG_ERROR_JSON_TOOLS_DISABLED = 'JSON tools support is disabled.';
+ const MSG_ERROR_JSON_TOOLS_CONNECTION_PROBLEM = 'Problem with connection to a JSON tool.';
+ const MSG_ERROR_JSON_TOOLS_WRONG_EXITCODE = 'JSON tool returned wrong exitcode.';
+ const MSG_ERROR_JSON_TOOLS_UNABLE_TO_PARSE_OUTPUT = 'JSON tool output was unable to parse.';
+ const MSG_ERROR_JSON_TOOL_NOT_CONFIGURED = 'JSON tool not configured.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Job error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class JobError extends GenericError {
+ const ERROR_JOB_DOES_NOT_EXISTS = 50;
+ const ERROR_INVALID_JOBLEVEL = 51;
+ const ERROR_FILESET_DOES_NOT_EXISTS = 52;
+ const ERROR_CLIENT_DOES_NOT_EXISTS = 53;
+ const ERROR_STORAGE_DOES_NOT_EXISTS = 54;
+ const ERROR_POOL_DOES_NOT_EXISTS = 55;
+ const ERROR_INVALID_RPATH = 56;
+ const ERROR_INVALID_WHERE_OPTION = 57;
+ const ERROR_INVALID_REPLACE_OPTION = 58;
+ const ERROR_INVALID_FILENAME = 59;
+
+ const MSG_ERROR_JOB_DOES_NOT_EXISTS = 'Job does not exist.';
+ const MSG_ERROR_INVALID_JOBLEVEL = 'Inputted job level is invalid.';
+ const MSG_ERROR_FILESET_DOES_NOT_EXISTS = 'FileSet resource does not exist.';
+ const MSG_ERROR_CLIENT_DOES_NOT_EXISTS = 'Client does not exist.';
+ const MSG_ERROR_STORAGE_DOES_NOT_EXISTS = 'Storage does not exist.';
+ const MSG_ERROR_POOL_DOES_NOT_EXISTS = 'Pool does not exist.';
+ const MSG_ERROR_INVALID_RPATH = 'Inputted rpath for restore is invalid. Proper format is b2[0-9]+.';
+ const MSG_ERROR_INVALID_WHERE_OPTION = 'Inputted "where" option is invalid.';
+ const MSG_ERROR_INVALID_REPLACE_OPTION = 'Inputted "replace" option is invalid.';
+ const MSG_ERROR_INVALID_FILENAME = 'Inputted "filename" option is invalid.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * OAuth2 error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class OAuth2Error extends GenericError {
+
+ const ERROR_OAUTH2_CLIENT_DOES_NOT_EXIST = 120;
+ const ERROR_OAUTH2_CLIENT_ALREADY_EXISTS = 121;
+ const ERROR_OAUTH2_CLIENT_INVALID_CLIENT_ID = 122;
+ const ERROR_OAUTH2_CLIENT_INVALID_CLIENT_SECRET = 123;
+ const ERROR_OAUTH2_CLIENT_INVALID_REDIRECT_URI = 124;
+ const ERROR_OAUTH2_CLIENT_INVALID_SCOPE = 125;
+ const ERROR_OAUTH2_CLIENT_INVALID_BCONSOLE_CFG_PATH = 126;
+ const ERROR_OAUTH2_CLIENT_INVALID_NAME = 127;
+ const ERROR_OAUTH2_CLIENT_INVALID_CONSOLE = 128;
+ const ERROR_OAUTH2_CLIENT_INVALID_DIRECTOR = 129;
+
+ const MSG_ERROR_OAUTH2_CLIENT_DOES_NOT_EXIST = 'OAuth2 client does not exist.';
+ const MSG_ERROR_OAUTH2_CLIENT_ALREADY_EXISTS = 'OAuth2 client already exists.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_CLIENT_ID = 'Invalid OAuth2 client ID.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_CLIENT_SECRET = 'Invalid OAuth2 client secret.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_REDIRECT_URI = 'Invalid OAuth2 redirect URI.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_SCOPE = 'Invalid OAuth2 scope.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_BCONSOLE_CFG_PATH = 'Invalid Bconsole config path.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_NAME = 'Invalid OAuth2 client name.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_CONSOLE = 'Invalid Console name.';
+ const MSG_ERROR_OAUTH2_CLIENT_INVALID_DIRECTOR = 'Invalid Director name.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Pool error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class PoolError extends GenericError {
+ const ERROR_POOL_DOES_NOT_EXISTS = 40;
+ const ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE = 41;
+
+ const MSG_ERROR_POOL_DOES_NOT_EXISTS = 'Pool does not exist.';
+ const MSG_ERROR_NO_VOLUMES_IN_POOL_TO_UPDATE= 'Pool with inputted poolid does not contain any volume to update.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Storage error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class StorageError extends GenericError {
+ const ERROR_STORAGE_DOES_NOT_EXISTS = 20;
+
+ const MSG_ERROR_STORAGE_DOES_NOT_EXISTS = 'Storage does not exist.';
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2022 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.
+ */
+
+namespace Baculum\Common\Modules\Errors;
+
+/**
+ * Volume error class.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Errors
+ * @package Baculum Common
+ */
+class VolumeError extends GenericError {
+ const ERROR_VOLUME_DOES_NOT_EXISTS = 30;
+ const ERROR_INVALID_VOLUME = 31;
+ const ERROR_INVALID_SLOT = 32;
+ const ERROR_VOLUME_ALREADY_EXISTS = 33;
+
+ const MSG_ERROR_VOLUME_DOES_NOT_EXISTS = 'Volume does not exist.';
+ const MSG_ERROR_INVALID_VOLUME = 'Invalid volume.';
+ const MSG_ERROR_INVALID_SLOT = 'Invalid slot.';
+ const MSG_ERROR_VOLUME_ALREADY_EXISTS = 'Volume already exists.';
+}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Common\Modules;
+
/**
* General requirement class with common dependencies both for API and Web.
*
*
* @param string $app_dir full path to main application directory
* @param string $base_dir full path to service specific base directory
- * @return none
*/
private function validateEnvironment($app_dir, $base_dir) {
$this->validateDirectories($app_dir, $base_dir);
*
* @param string $app_dir full path to main application directory
* @param string $base_dir full path to service specific base directory
- * @return none
*/
private function validateDirectories($app_dir, $base_dir) {
for ($i = 0; $i < count($this->req_app_rw_dirs); $i++) {
* Validate PHP extensions.
*
* @param array $req_exts extension list
- * @return none
*/
protected static function validateExtensions($req_exts) {
for ($i = 0; $i < count($req_exts); $i++) {
* Simple method to show results.
*
* @param string $product product name ('Baculum Web' or 'Baculum API'...etc.)
- * @return none
*/
protected static function showResult($product) {
if (count(self::$requirements) > 0) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Common\Modules;
+
/**
- * Common interfaces.
+ * Auth module interface.
*
* @author Marcin Haba <marcin.haba@bacula.pl>
* @category Interfaces
* @package Baculum Common
*/
-/**
- * Defines methods to work on config data.
- */
-interface ConfigFormat {
-
- public function write($source, $config);
-
- public function read($source);
-
- public function prepareConfig($config);
-}
-
-/**
- * Defines single session item.
- */
-interface SessionItem {
-
- public static function getRecordId();
-
- public static function getPrimaryKey();
-
- public static function getSessionFile();
-}
-
/**
* Defines auth module methods.
*/
-interface AuthModule {
+interface IAuthModule {
public function getAuthType();
public function getRequestHeaderValue($header);
}
-
-/**
- * Defined user manager methods.
- */
-interface UserManager {
-
- public function init($config);
-
- public function validateUser($username, $password);
-}
-?>
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2020 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.
+ */
+
+namespace Baculum\Common\Modules;
+
+/**
+ * User manager interface.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Interfaces
+ * @package Baculum Common
+ */
+
+/**
+ * Defined user manager methods.
+ */
+interface IBUserManager {
+
+ public function init($config);
+
+ public function validateUser($username, $password);
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2020 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.
+ */
+
+namespace Baculum\Common\Modules;
+
+/**
+ * Config format interface.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Interfaces
+ * @package Baculum Common
+ */
+
+/**
+ * Defines methods to work on config data.
+ */
+interface IConfigFormat {
+
+ public function write($source, $config);
+
+ public function read($source);
+
+ public function prepareConfig($config);
+}
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2020 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.
+ */
+
+namespace Baculum\Common\Modules;
+
+/**
+ * Session item interface.
+ *
+ * @author Marcin Haba <marcin.haba@bacula.pl>
+ * @category Interfaces
+ * @package Baculum Common
+ */
+
+/**
+ * Defines single session item.
+ */
+interface ISessionItem {
+
+ public static function getRecordId();
+
+ public static function getPrimaryKey();
+
+ public static function getSessionFile();
+}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* The module supports basic operations on LDAP server.
* Parameters are set after successful validation.
*
* @param array $param parameters to work with LDAP
- * @return none
*/
public function setParams(array $params) {
if ($this->validateConnectionParams($params)) {
/**
* Set LDAP connection specific options.
*
- * @return none
*/
public function setConnectionOpts() {
ldap_set_option($this->conn, LDAP_OPT_PROTOCOL_VERSION, $this->params['protocol_ver']);
* Set LDAP errors in error property.
* Used to get the most information from LDAP server.
*
- * @return none
*/
public function setLdapError() {
ldap_get_option($this->conn, LDAP_OPT_DIAGNOSTIC_MESSAGE, $error);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
+
+use Prado\Prado;
/**
* Logger class.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+namespace Baculum\Common\Modules;
+
+use Prado\TModule;
/**
* Module with miscellaneous tools.
}
public function getJobState($jobStateLetter = null) {
- $state;
+ $state = '';
if(is_null($jobStateLetter)) {
$state = $this->jobStates;
} else {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Generic OAuth2 abstraction.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Params class.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
-Prado::using('Application.Common.Class.Interfaces');
+namespace Baculum\Common\Modules;
/**
* Store data in session.
* @category Module
* @package Baculum Common
*/
-class SessionRecord extends CommonModule implements SessionItem {
+class SessionRecord extends CommonModule implements ISessionItem {
const SESS_FILE_PERM = 0600;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic SHA-1 hashing function module
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic SHA-256 hashing function module
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic SHA-512 hashing function module
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.CommonModule');
+namespace Baculum\Common\Modules;
/**
* Cryptographic SHA-1 hashing function module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BaculumPage');
+use Baculum\Common\Modules\BaculumPage;
/**
* Common page class.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+
+namespace Baculum\Common\Portlets;
+
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
+use Prado\Web\UI\ActiveControls\ICallbackEventHandler;
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\WebControls\TButton;
/**
* Baculum Active Button control.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+namespace Baculum\Common\Portlets;
+
+use Prado\Web\UI\WebControls\TButton;
+
/**
* Baculum Button control.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.WebControls.TDataBoundControl');
-Prado::using('Application.Common.Portlets.BSimpleRepeaterItem');
+namespace Baculum\Common\Portlets;
+
+use Prado\Web\UI\ITemplate;
+use Prado\Web\UI\WebControls\TDataBoundControl;
/**
* Baculum simple repeater control.
* Set template for items.
*
* @param ITemplate $tpl template
- * @return none
*/
public function setItemTemplate($tpl) {
if ($tpl instanceof \Prado\Web\UI\ITemplate) {
* Data binding.
*
* @param $data data from data source
- * @return none
*/
protected function performDataBinding($data) {
for ($i = 0; $i < count($data); $i++) {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TControl');
+namespace Baculum\Common\Portlets;
/**
* Baculum simple repeater item control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveHiddenField');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.TTemplateControl');
-Prado::using('Application.Common.Class.OAuth2');
-Prado::using('Application.Common.Class.BasicUserConfig');
-Prado::using('Application.Common.Portlets.PortletTemplate');
+use Prado\TPropertyValue;
+use Prado\Web\UI\TCommandEventParameter;
+use Baculum\Common\Portlets\PortletTemplate;
/**
* New auth client control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.TTemplateControl');
-Prado::using('Application.Common.Class.OAuth2');
-Prado::using('Application.Common.Portlets.PortletTemplate');
+use Prado\TPropertyValue;
+use Prado\Web\UI\TCommandEventParameter;
+use Baculum\Common\Portlets\PortletTemplate;
/**
* New host control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Common\Portlets;
+
+use Prado\Web\UI\TTemplateControl;
+
/**
* Portlet template control.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Portlets.PortletTemplate');
+namespace Baculum\Common\Portlets;
/**
* Table default options control.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Class.WebUserRoles');
+
+namespace Baculum\Web\Layouts;
+
+use Prado\Web\UI\TTemplateControl;
/**
* Main layout class.
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/datatables.net-responsive-dt/css/responsive.dataTables.min.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/datatables.net-buttons-dt/css/buttons.dataTables.min.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../../themes/Baculum-v2/css/baculum.css %> />
- <com:Application.Common.Portlets.TableDefaults />
+ <com:Baculum.Common.Portlets.TableDefaults />
<!-- Top container -->
<div class="w3-bar w3-top w3-black w3-large" style="z-index:4">
<button type="button" class="w3-bar-item w3-button w3-hover-none w3-hover-text-light-grey" onclick="W3SideBar.open();"><i class="fa fa-bars"></i> Â Menu</button>
<img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/logo.png" alt="" />
</span>
</div>
- <com:Application.Web.Portlets.MainSideBar />
+ <com:Baculum.Web.Portlets.MainSideBar />
<!-- !PAGE CONTENT! -->
<div class="w3-main page_main_el" id="page_main" style="margin-left: 250px; margin-top: 43px;">
<span class="w3-tag w3-large w3-purple w3-right w3-padding-small w3-margin-top w3-margin-right">
</div>
</com:TForm>
<div id="small" class="w3-hide-large"></div>
-<com:Application.Web.Portlets.ErrorMessageBox />
-<com:Application.Web.Portlets.ResourceMonitor />
-<com:Application.Web.Portlets.MsgEnvelope Visible="<%=($this->Application->getModule('web_config')->isMessagesLogEnabled() && $this->User->isInRole(WebUserRoles::ADMIN))%>" />
+<com:Baculum.Web.Portlets.ErrorMessageBox />
+<com:Baculum.Web.Portlets.ResourceMonitor />
+<com:Baculum.Web.Portlets.MsgEnvelope Visible="<%=($this->Application->getModule('web_config')->isMessagesLogEnabled() && $this->User->isInRole(WebUserRoles::ADMIN))%>" />
<script>
var is_small = $('#small').is(':visible');
$(function() {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Web\Layouts;
+
+use Prado\Web\UI\TTemplateControl;
+
/**
* Message box class.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Params');
+namespace Baculum\Web\Layouts;
+
+use Prado\Web\UI\TTemplateControl;
/**
* Simple layout class.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
+
+namespace Baculum\Web\Layouts;
+
+use Prado\Web\UI\TTemplateControl;
+
/**
* Wizard layout.
*
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/datatables.net-buttons-dt/css/buttons.dataTables.min.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/opentip/css/opentip.css %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../../themes/Baculum-v2/css/baculum.css %> />
- <com:Application.Common.Portlets.TableDefaults />
+ <com:Baculum.Common.Portlets.TableDefaults />
<!-- Top container -->
<com:TContentPlaceHolder ID="Wizard" />
</com:TForm>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.Common.Class.Miscellaneous');
-Prado::using('Application.Web.Class.WebModule');
-Prado::using('Application.Web.Class.HostConfig');
-Prado::using('Application.Web.Class.OAuth2Record');
-Prado::using('Application.Web.Class.HostRecord');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\Errors\ConnectionError;
+use Baculum\Common\Modules\Logging;
+use Prado\Xml\TXmlElement;
/**
* Internal API client module.
* @access public
* @param string $host host name
* @param array $params host parameters
- * @return none
*/
public function setHostParams($host, $params) {
new HostRecord($host, $params);
* Parse and set response headers.
* Note, header names are lower case.
*
- * @return none
*/
public function parseHeader($header) {
$headers = array();
*
* @access public
* @param bool $force if true then cache is force initialized
- * @return none
*/
public function initSessionCache($force = false) {
if (!isset($_SESSION) || !array_key_exists('cache', $_SESSION) || !is_array($_SESSION['cache']) || $force === true) {
* @param string $host host name
* @param array $params command parameters as numeric array
* @param mixed $value value to save in cache
- * @return none
*/
private function setSessionCache($host, array $params, $value) {
$key = $this->getSessionKey($host, $params);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Pages.Requirements');
-Prado::using('Application.Common.Class.BaculumPage');
-Prado::using('Application.Web.Init');
-Prado::using('Application.Web.Class.WebConfig');
-Prado::using('Application.Web.Class.PageCategory');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\BaculumPage;
+use Baculum\Common\Modules\Logging;
/**
* Baculum Web page module.
* Check if default API host is set.
* If it isn't direct to API host selection page.
*
- * @return none
*/
private function isDefaultAPIHost() {
$def_api_host = $this->User->getDefaultAPIHost();
/**
* Set page session values.
*
- * @return none
*/
private function setSessionUserVars() {
// Set director
*
* @access public
* @param array $params HTTP GET method parameters in associative array
- * @return none
*/
public function goToDefaultPage($params = null) {
$def_page = $this->Service->DefaultPage;
* Common actions which has to be done for each web page just after
* page pre-loading.
*
- * @return none
*/
private function postInitActions() {
/**
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BasicUserConfig');
+namespace Baculum\Web\Modules;
+
+use Prado\Prado;
+use Baculum\Common\Modules\BasicUserConfig;
/**
* Manage HTTP Basic auth method users.
/**
* Users login and password file for HTTP Basic auth.
*/
- const USERS_FILE_NAME = 'Application.Web.Config.baculum';
+ const USERS_FILE_NAME = 'Baculum.Web.Config.baculum';
const USERS_FILE_EXTENSION = '.users';
public function getConfigPath() {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.:Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Prado\Prado;
/**
* Module responsible for checking and keeping Bacula config dependencies.
/**
* Data dependencies file
*/
- const DATA_DEPS_FILE = 'Application.Web.Data.data_deps';
+ const DATA_DEPS_FILE = 'Baculum.Web.Data.data_deps';
private static $data_deps = null;
$data_deps = json_decode($deps_file);
} else {
$emsg = "Data dependencies file '$deps_file' does not exist or is not readable.";
- $this->Application->getModule('logging')->log(
- __FUNCTION__,
- $emsg,
- Logging::CATEGORY_APPLICATION,
- __FILE__,
- __LINE__
- );
+ $this->Application->getModule('logging')->log(__FUNCTION__, $emsg, Logging::CATEGORY_APPLICATION, __FILE__, __LINE__);
}
return $data_deps;
}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Prado\Prado;
/**
* Data description module.
/**
* Data description file
*/
- const DATA_DESC_FILE = 'Application.Web.Data.data_desc';
+ const DATA_DESC_FILE = 'Baculum.Web.Data.data_desc';
private static $data_desc = null;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use DOMDocument;
+use Prado\Prado;
/**
* Directive documentation module.
/**
* Directive documentation file path.
*/
- const DOC_PATH = 'Application.Web.Data.dir_docs';
+ const DOC_PATH = 'Baculum.Web.Data.dir_docs';
/**
* Documentation file extension.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
+use Baculum\Common\Modules\Logging;
/**
* Manage hosts configuration.
/**
* Host config file path
*/
- const CONFIG_FILE_PATH = 'Application.Web.Config.hosts';
+ const CONFIG_FILE_PATH = 'Baculum.Web.Config.hosts';
/**
* Host config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.SessionRecord');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ISessionItem;
+use Baculum\Common\Modules\SessionRecord;
+use Prado\Prado;
/**
* Host session record class.
* @category Database
* @package Baculum Web
*/
-class HostRecord extends SessionRecord implements SessionItem {
+class HostRecord extends SessionRecord implements ISessionItem {
public $host;
public $protocol;
}
public static function getSessionFile() {
- return Prado::getPathOfNamespace('Application.Web.Config.session', '.dump');
+ return Prado::getPathOfNamespace('Baculum.Web.Config.session', '.dump');
}
/**
* @public
* @param string $host host name in config
* @param array $params host parameters in associative array
- * @return none
*/
public function setHost($host, array $params) {
$this->host = $host;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.:Web.Class.WebModule');
+namespace Baculum\Web\Modules;
/**
* Module responsible for providing information about job.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
/**
* Bacula logs parser module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.:Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Prado\Prado;
/**
* Module responsible for managing messages log.
/**
* Messages log file path.
*/
- const LOG_FILE_PATH = 'Application.Web.Logs.messages';
+ const LOG_FILE_PATH = 'Baculum.Web.Logs.messages';
/**
* Messages log file extension.
/**
* Truncate messages log.
*
- * @return none
*/
public function truncate() {
$f = Prado::getPathOfNamespace(self::LOG_FILE_PATH, self::LOG_FILE_EXT);
* Save logs to file.
*
* @param array $logs log messages
- * @return none
*/
public function save(array $logs) {
$f = Prado::getPathOfNamespace(self::LOG_FILE_PATH, self::LOG_FILE_EXT);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Interfaces');
-Prado::using('Application.Common.Class.SessionRecord');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ISessionItem;
+use Baculum\Common\Modules\SessionRecord;
+use Prado\Prado;
/**
* OAuth2 session record module.
* @category Module
* @package Baculum Web
*/
-class OAuth2Record extends SessionRecord implements SessionItem {
+class OAuth2Record extends SessionRecord implements ISessionItem {
public $host;
public $state;
}
public static function getSessionFile() {
- return Prado::getPathOfNamespace('Application.Web.Config.session', '.dump');
+ return Prado::getPathOfNamespace('Baculum.Web.Config.session', '.dump');
}
}
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.:Web.Class.HostConfig');
-Prado::using('Application.:Web.Class.WebModule');
+namespace Baculum\Web\Modules;
/**
* Page category module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\IBUserManager;
+use Prado\Xml\TXmlElement;
/**
* Web HTTP Basic user manager module.
* @category Module
* @package Baculum Web
*/
-class WebBasicUserManager extends WebModule implements UserManager {
+class WebBasicUserManager extends WebModule implements IBUserManager {
/**
* Module initialization.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
-Prado::using('Application.Common.Class.Crypto');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
+use Baculum\Common\Modules\Crypto;
+use Baculum\Common\Modules\Logging;
+use Prado\Xml\TXmlElement;
/**
* Manage webGUI configuration.
/**
* Web config file path
*/
- const CONFIG_FILE_PATH = 'Application.Web.Config.settings';
+ const CONFIG_FILE_PATH = 'Baculum.Web.Config.settings';
/**
* Web config file format
* Initialize module configuration.
*
* @param TXmlElement $config module configuration
- * @return none
*/
public function init($config) {
// add event handler to set page language
* Set culture for whole page.
* Uses currently set language settings.
*
- * @return none
*/
public function setCulture() {
$this->Application->getGlobalization()->Culture = $this->getLanguage();
* Set language for current page.
* Note, it is done in session only.
*
- * @return none
*/
public function setLanguage($lang) {
$_SESSION['language'] = $lang;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\IBUserManager;
+use Prado\Xml\TXmlElement;
/**
* Web LDAP user manager module.
* @category Module
* @package Baculum Web
*/
-class WebLdapUserManager extends WebModule implements UserManager {
+class WebLdapUserManager extends WebModule implements IBUserManager {
/**
* LDAP module object.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\IBUserManager;
+use Prado\Xml\TXmlElement;
/**
* Web local user manager module.
* @category Module
* @package Baculum Web
*/
-class WebLocalUserManager extends WebModule implements UserManager {
+class WebLocalUserManager extends WebModule implements IBUserManager {
/**
* Module initialization.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.TModule');
+namespace Baculum\Web\Modules;
+
+use Prado\TModule;
/**
* Abstract Web module.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
+use Baculum\Common\Modules\Logging;
+use Couchbase\Role;
/**
* Manage web role configuration.
/**
* Web role config file path
*/
- const CONFIG_FILE_PATH = 'Application.Web.Config.roles';
+ const CONFIG_FILE_PATH = 'Baculum.Web.Config.roles';
/**
* Web role config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.TUrlMapping');
+use Baculum\Common\Modules\BaculumUrlMapping;
+use Prado\Web\TUrlMappingPattern;
/**
* Web URL mapper class.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Web\Modules;
+
+use Prado\Prado;
+use Prado\Security\IUser;
+use Prado\Security\TUser;
+use Prado\TPropertyValue;
/**
* Web user module.
* Username setter.
*
* @param string $username user name
- * @return none
*/
public function setUsername($username) {
$this->setName($username);
* Long name setter.
*
* @param string $long_name long name
- * @return none
*/
public function setLongName($long_name) {
$this->setCurrentState(self::LONG_NAME, $long_name);
* E-mail address setter.
*
* @param string $email e-mail address
- * @return none
*/
public function setEmail($email) {
$this->setCurrentState(self::EMAIL, $email);
* Description setter.
*
* @param string $desc description
- * @return none
*/
public function setDescription($desc) {
$this->setCurrentState(self::DESCRIPTION, $desc);
* Set user roles.
*
* @param mixed $value roles assigned to user
- * @return none
*/
public function setRoles($value) {
if (is_array($value)) {
* Set API hosts.
*
* @param array $api_hosts user API hosts
- * @return none
*/
public function setAPIHosts($api_hosts) {
$this->setCurrentState(self::API_HOSTS, $api_hosts);
* and the console capabilities.
*
* @param string $api_host default API host
- * @return none
*/
public function setDefaultAPIHost($api_host) {
$this->setState(self::DEFAULT_API_HOST, $api_host);
* IP address restriction setter.
*
* @param string $ips comma separated IP addresses
- * @return none
*/
public function setIps($ips) {
$this->setCurrentState(self::IPS, $ips);
* Enabled setter
*
* @param boolean $enabled enabled flag state
- * @return none
*/
public function setEnabled($enabled) {
$enabled = TPropertyValue::ensureBoolean($enabled);
* Set if user exists in configuration file.
*
* @param boolean $in_config in config state value
- * @return none
*/
public function setInConfig($in_config) {
$in_config = TPropertyValue::ensureBoolean($in_config);
*
* @param string $key state key
* @param mixed $value value to set
- * @return none
*/
private function setCurrentState($key, $value) {
$this->current_state[$key] = $value;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.ConfigFileModule');
-Prado::using('Application.Web.Class.WebUserRoles');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\ConfigFileModule;
+use Baculum\Common\Modules\Logging;
/**
* Manage web user configuration.
/**
* Web user config file path
*/
- const CONFIG_FILE_PATH = 'Application.Web.Config.users';
+ const CONFIG_FILE_PATH = 'Baculum.Web.Config.users';
/**
* Web user config file format
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebUser');
-Prado::using('Application.Web.Class.WebModule');
+namespace Baculum\Web\Modules;
+
+use Baculum\Common\Modules\Logging;
+use Prado\Prado;
+use Prado\Security\IUserManager;
+use Prado\Security\TAuthorizationRule;
+use Prado\TApplication;
+use Prado\Web\Services\TPageService;
+use Prado\Web\THttpCookie;
+use Prado\Xml\TXmlElement;
/**
* Web user manager module.
* Initialize module configuration.
*
* @param TXmlElement $config module configuration
- * @return none
*/
public function init($config) {
$this->user_factory = Prado::createComponent($this->user_class, $this);
* User class setter.
*
* @param string $cls user class name
- * @return none
*/
public function setUserClass($cls) {
$this->user_class = $cls;
* Guest name setter.
*
* @param string guest name
- * @return none
*/
public function setGuestName($name) {
$this->guest_name = $name;
* Useful to keep login between sessions.
*
* @param THttpCookie $cookie cookie object
- * @return none
*/
public function getUserFromCookie($cookie) {
// not implemented
* Useful to keep login between sessions.
*
* @param THttpCookie $cookie cookie object
- * @return none
*/
public function saveUserToCookie($cookie) {
// not implemented
switch ($auth_method) {
case WebConfig::AUTH_METHOD_LOCAL:
- $cls = 'Application.Web.Class.WebLocalUserManager';
+ $cls = 'Baculum.Web.Modules.WebLocalUserManager';
break;
case WebConfig::AUTH_METHOD_BASIC:
- $cls = 'Application.Web.Class.WebBasicUserManager';
+ $cls = 'Baculum.Web.Modules.WebBasicUserManager';
break;
case WebConfig::AUTH_METHOD_LDAP:
- $cls = 'Application.Web.Class.WebLdapUserManager';
+ $cls = 'Baculum.Web.Modules.WebLdapUserManager';
break;
default:
- $cls = 'Application.Web.Class.WebBasicUserManager';
+ $cls = 'Baculum.Web.Modules.WebBasicUserManager';
}
return $cls;
}
* authorization rules before they are used in authorization phase.
*
* @param TApplication $application application object
- * @return none
*/
public function doAuthentication($application) {
if ($this->getModule('web_config')->isAuthMethodBasic() && $application->getUser()->IsGuest) {
* done by the framework.
*
* @param string|null $state flag state
- * @return none
*/
public function setAuthorizedFlag($state) {
$this->Application->getSession()->add(self::SET_AUTHROIZED_FLAG, $state);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.WebModule');
-Prado::using('Application.Web.Class.PageCategory');
+namespace Baculum\Web\Modules;
/**
* Web user roles module.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<com:BClientScript ScriptUrl=<%~ ../../vendor/bower-asset/opentip/downloads/opentip-jquery.min.js %> />
<com:BStyleSheet StyleSheetUrl=<%~ ../../vendor/bower-asset/opentip/css/opentip.css %> />
</div>
</div>
<div class="w3-container w3-row w3-padding">
- <com:Application.Web.Portlets.DirectiveTimePeriod
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
ID="JobAgeOnJobStatusGraph"
DirectiveName="Age"
Label="<%[ Job age on the job status graph ]%>"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('Application.Web.Pages.Monitor');
+use Baculum\Web\Modules\WebConfig;
+use Baculum\Web\Modules\BaculumWebPage;
+
/**
* Application settings class.
$this->DecimalBytes->Checked = true;
if(count($this->web_config) > 0) {
$this->Debug->Checked = ($this->web_config['baculum']['debug'] == 1);
- $this->MaxJobs->Text = (key_exists('max_jobs', $this->web_config['baculum']) ? intval($this->web_config['baculum']['max_jobs']) : Monitor::DEFAULT_MAX_JOBS);
+ $this->MaxJobs->Text = (key_exists('max_jobs', $this->web_config['baculum']) ? intval($this->web_config['baculum']['max_jobs']) : WebConfig::DEF_MAX_JOBS);
if (key_exists('size_values_unit', $this->web_config['baculum'])) {
$this->DecimalBytes->Checked = ($this->web_config['baculum']['size_values_unit'] === 'decimal');
$this->BinaryBytes->Checked = ($this->web_config['baculum']['size_values_unit'] === 'binary');
-<%@ MasterClass="Application.Web.Layouts.MessageBox" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\MessageBox" Theme="Baculum-v2"%>
<com:TContent ID="Message">
<div class="w3-container w3-red">
<h2><%[ Baculum problem ]%></h2>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BaculumPage');
+use Baculum\Common\Modules\BaculumPage;
/**
* Baculum error page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Client list page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
>
<i class="fa fa-file-medical-alt"></i> <%[ Status client ]%>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.ComponentActionsMenu
+ <com:Baculum.Web.Portlets.ComponentActionsMenu
ID="CompActions"
BigButtons="true"
/>
</tr>
<tr>
<td><%[ Bandwidth limit: ]%></td>
- <td><span id="status_client_bwlimit"></span><com:Application.Web.Portlets.ClientBandwidthLimit ID="BWLimit" OnCallback="status" /></td>
+ <td><span id="status_client_bwlimit"></span><com:Baculum.Web.Portlets.ClientBandwidthLimit ID="BWLimit" OnCallback="status" /></td>
</tr>
<tr>
<td><%[ Debug: ]%></td>
<h5 id="status_client_no_jobs_running" style="display: none"><%[ No jobs running ]%></h5>
<div id="status_client_running_jobs"></div>
</div>
-<com:Application.Web.Portlets.JobBandwidthLimit
+<com:Baculum.Web.Portlets.JobBandwidthLimit
ID="JobBandwidth"
OnCallback="status"
/>
});
</script>
<div class="w3-container tab_item" id="client_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="DIRClientConfig"
ComponentType="dir"
ResourceType="Client"
CssClass="w3-text-red"
Display="None"
/>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="FDFileDaemonConfig"
ComponentType="fd"
ResourceType="FileDaemon"
/>
</div>
<div id="filedaemon_resources_config_form" class="subtab_item" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigResourceList
+ <com:Baculum.Web.Portlets.BaculaConfigResourceList
ID="FileDaemonResourcesConfig"
ComponentType="fd"
ResourceList="<%=[[ 'name' => 'Name', 'label' => 'Name' ]]%>"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.JuiControls.TJuiProgressbar');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Common\Modules\Params;
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Client view page.
/**
* Set client clientid.
*
- * @return none;
*/
public function setClientId($clientid) {
$clientid = intval($clientid);
/**
* Set client name.
*
- * @return none;
*/
public function setClientName($client_name) {
$this->BWLimit->setClientName($client_name);
/**
* Set client address.
*
- * @return none;
*/
public function setClientAddress($address) {
$this->setViewState(self::CLIENT_ADDRESS, $address);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
<b><i class="fa fa-terminal"></i> <%[ Console ]%></b>
</h5>
</header>
- <com:Application.Web.Portlets.Bconsole ID="Bconsole" />
+ <com:Baculum.Web.Portlets.Bconsole ID="Bconsole" />
</com:TContent>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Bacula console page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</a>
</div>
<div id="console_resources_config_form" class="subtab_item"<%=empty($_SESSION['bcons']) ? ' style="display: none"': ''%>>
- <com:Application.Web.Portlets.BaculaConfigResourceList
+ <com:Baculum.Web.Portlets.BaculaConfigResourceList
ID="ConsoleResourcesConfig"
ComponentType="bcons"
ResourceList="<%=[[ 'name' => 'Name', 'label' => 'Name' ]]%>"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Console view page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
<p style="margin: 3px 0"><%[ Perform restore ]%> <i class="fa fa-reply w3-small"></i></p>
</div>
</a>
- <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
+ <com:Baculum.Web.Portlets.RunJob ID="RunJobModal" />
</div>
<div class="w3-threequarter">
<table id="last_jobs_list" class="w3-table w3-striped w3-hoverable w3-white w3-margin-bottom" style="width: 100%">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Main dashboard page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</div>
<div class="w3-container tab_item" id="configure_device" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="DeviceConfig"
ComponentType="sd"
ResourceType="Device"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Device view page.
/**
* Set storage storageid.
*
- * @return none;
*/
public function setStorageId($storageid) {
$storageid = intval($storageid);
/**
* Set storage name.
*
- * @return none;
*/
public function setStorageName($storage_name) {
$this->setViewState(self::STORAGE_NAME, $storage_name);
/**
* Set device name.
*
- * @return none;
*/
public function setDeviceName($device_name) {
$this->setViewState(self::DEVICE_NAME, $device_name);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
>
<i class="fa fa-file-medical-alt"></i> <%[ Status director ]%>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.ComponentActionsMenu
+ <com:Baculum.Web.Portlets.ComponentActionsMenu
ID="CompActions"
BigButtons="true"
ComponentType="dir"
</a>
</div>
<div id="director_director_config_form" class="subtab_item">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="DirDirectorConfig"
ComponentType="dir"
ResourceType="Director"
<p><%[ The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool. ]%></p>
</div>
<div id="director_resources_config_form" class="subtab_item" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigResourceList
+ <com:Baculum.Web.Portlets.BaculaConfigResourceList
ID="DirectorResourcesConfig"
ComponentType="dir"
ResourceList="<%=[[ 'name' => 'Name', 'label' => 'Name' ]]%>"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TCommandEventParameter');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Common\Modules\Params;
+use Prado\Web\UI\TCommandEventParameter;
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Director view page.
/**
* Set director name.
*
- * @return none;
*/
public function setDirectorName($client_name) {
$this->setViewState(self::DIRECTOR_NAME, $client_name);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* FileSet list page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
<a class="w3-button w3-bar-item" href="<%=$this->Service->constructUrl('FileSetList')%>"><i class="fa fa-angle-left"></i></a>
</div>
<div class="w3-container">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="FileSetConfig"
ComponentType="dir"
ResourceType="Fileset"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* FileSet view page.
/**
* Set fileset name.
*
- * @return none;
*/
public function setFileSetName($fileset_name) {
$this->setViewState(self::FILESET_NAME, $fileset_name);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</h5>
</header>
<div style="clear: both"></div>
- <com:Application.Web.Portlets.JobGraphs ID="Graphs" />
+ <com:Baculum.Web.Portlets.JobGraphs ID="Graphs" />
</com:TContent>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Graphs page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</table>
<p class="info w3-hide-medium w3-hide-small"><%[ Tip: Use left-click to select table row. Use CTRL + left-click to multiple row selection. Use SHIFT + left-click to add a range of rows to selection. ]%></p>
</div>
- <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
+ <com:Baculum.Web.Portlets.RunJob ID="RunJobModal" />
<com:TCallback ID="RunJobCb" OnCallback="runJobAgain">
<prop:ClientSide.OnLoading>
show_btn_loader(sender.options.CallbackParameter);
oMonitor();
</prop:ClientSide.OnComplete>
</com:TCallback>
-<com:Application.Web.Portlets.BulkActionsModal ID="BulkActions" />
+<com:Baculum.Web.Portlets.BulkActionsModal ID="BulkActions" />
</com:TContent>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('Application.Web.Portlets.RunJob');
+use Prado\Web\UI\ActiveControls\TCallback;
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Job history list page.
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function cancelJobs($sender, $param) {
$result = [];
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function deleteJobs($sender, $param) {
$result = [];
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
<h3><%[ Warning ]%></h3>
<p id="status_running_job_warning_msg"></p>
<div id="status_running_job_warning_label_btn" class="w3-section" style="display: none">
- <com:Application.Web.Portlets.LabelVolume ID="LabelMedia" />
+ <com:Baculum.Web.Portlets.LabelVolume ID="LabelMedia" />
</div>
</div>
<a href="javascript:void(0)" onclick="W3SubTabs.open('status_running_job_subtab_graphical', 'status_running_job_graphical_output');"<%=!$this->allow_graph_mode ? ' style="display: none"' : ''%>>
<span style="line-height: 41px"><%[ Refresh interval (sec.): ]%></span> <input type="text" id="status_running_job_refresh_interval" class="w3-input w3-border w3-right w3-margin-left" value="5" style="width: 50px"/>
</div>
<div id="status_running_job"><table></table></div>
- <com:Application.Web.Portlets.JobBandwidthLimit
+ <com:Baculum.Web.Portlets.JobBandwidthLimit
ID="JobBandwidth"
OnCallback="runningJobStatus"
JobId="<%=$this->SourceTemplateControl->getJobId()%>"
</div>
</div>
<div id="jobfiles_list" class="subtab_item" style="display: none">
- <com:Application.Web.Portlets.JobListFiles
+ <com:Baculum.Web.Portlets.JobListFiles
ID="FileList"
/>
</div>
}
}, 3000);
</script>
- <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
+ <com:Baculum.Web.Portlets.RunJob ID="RunJobModal" />
</div>
<div class="w3-container tab_item" id="job_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="JobConfig"
ComponentType="dir"
ResourceType="Job"
/>
</div>
<div class="w3-container tab_item" id="fileset_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="FileSetConfig"
ComponentType="dir"
ResourceType="Fileset"
/>
</div>
<div class="w3-container tab_item" id="schedule_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ScheduleConfig"
ComponentType="dir"
ResourceType="Schedule"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.JuiControls.TJuiProgressbar');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Prado\TPropertyValue;
+use Prado\Web\UI\ActiveControls\TActiveLabel;
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Job history view page.
/**
* Set jobid to run job again.
*
- * @return none
*/
public function setJobId($jobid) {
$jobid = intval($jobid);
/**
* Set job clientid
*
- * @return none
*/
public function setClientId($clientid) {
$clientid = intval($clientid);
/**
* Set job name to run job again.
*
- * @return none;
*/
public function setJobName($job_name) {
$this->setViewState(self::JOB_NAME, $job_name);
/**
* Set job uname.
*
- * @return none;
*/
public function setJobUname($job_uname) {
$this->setViewState(self::JOB_UNAME, $job_uname);
/**
* Set job type.
*
- * @return none;
*/
public function setJobType($job_type) {
$this->setViewState(self::JOB_TYPE, $job_type);
/**
* Set job level.
*
- * @return none;
*/
public function setJobLevel($job_level) {
$this->setViewState(self::JOB_LEVEL, $job_level);
/**
* Set job information from show job output.
*
- * @return none
*/
public function setJobInfo($job_name) {
$job_show = $this->getModule('api')->get(
/**
* Set all storage information.
*
- * @return none
*/
public function setStorageInfo() {
$storages_show = $this->getModule('api')->get(
*
* @param BaculaConfigDirectives $sender sender object
* @param mixed $param save event parameter
- * @return none
*/
public function reloadJobInfo($sender, $param) {
$job_name = $this->getJobName();
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</tfoot>
</table>
</div>
- <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
+ <com:Baculum.Web.Portlets.RunJob ID="RunJobModal" />
<script type="text/javascript">
var oJobList = {
ids: {
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Job list page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
>
<i class="fa fa-undo"></i> <%[ Run job ]%>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
+ <com:Baculum.Web.Portlets.RunJob ID="RunJobModal" />
<div id="job_graph_container">
<div>
<div id="jobs_summary_graph"></div>
</script>
</div>
<div class="w3-container tab_item" id="job_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="JobConfig"
ComponentType="dir"
ResourceType="Job"
/>
</div>
<div class="w3-container tab_item" id="fileset_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="FileSetConfig"
ComponentType="dir"
ResourceType="Fileset"
/>
</div>
<div class="w3-container tab_item" id="schedule_config" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ScheduleConfig"
ComponentType="dir"
ResourceType="Schedule"
</script>
</div>
<div class="w3-container tab_item" id="job_schedules" style="display: none">
- <com:Application.Web.Portlets.StatusSchedule
+ <com:Baculum.Web.Portlets.StatusSchedule
ID="Schedules"
/>
</div>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Job view page.
/**
* Set job name to run job again.
*
- * @return none;
*/
public function setJobName($job_name) {
$this->setViewState(self::JOB_NAME, $job_name);
/**
* Set job information from show job output.
*
- * @return none
*/
public function setJobInfo($job_name) {
$job_show = $this->getModule('api')->get(
*
* @param BaculaConfigDirectives $sender sender object
* @param mixed $param save event parameter
- * @return none
*/
public function reloadJobInfo($sender, $param) {
if ($this->Request->contains('job')) {
-<%@ MasterClass="Application.Web.Layouts.Simple" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Simple" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<div style="width: 100%; height: 100%;">
<com:TPanel ID="LoginForm" CssClass="w3-display-middle w3-center" Style="width: 100%; max-width: 440px" DefaultButton="LoginBtn">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\Web\UI\WebControls\TLinkButton;
/**
* User login page.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('Application.Web.Class.WebUserRoles');
+
+use Baculum\Common\Modules\BaculumPage;
+use Baculum\Common\Modules\Errors\GenericError;
+use Baculum\Web\Modules\WebConfig;
+use Baculum\Web\Modules\WebUserRoles;
/**
* Monitor class.
*/
class Monitor extends BaculumPage {
- const DEFAULT_MAX_JOBS = 10000;
-
public function onInit($param) {
parent::onInit($param);
$monitor_data = [
$this->getModule('api')->initSessionCache(true);
$web_config = $this->getModule('web_config')->getConfig();
- $job_limit = self::DEFAULT_MAX_JOBS;
+ $job_limit = WebConfig::DEF_MAX_JOBS;
if (count($web_config) > 0 && key_exists('max_jobs', $web_config['baculum'])) {
$job_limit = $web_config['baculum']['max_jobs'];
}
-<%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:TWizard ID="NewJobWizard"
CssClass="wizard"
<p><%[ This wizard enables you to create in easy way a new backup job. ]%></p>
<!--p><%[ To start please select job type that you wish to create. ]%></p-->
</div>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Name"
DirectiveName="Name"
Label="Job Name"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Description"
DirectiveName="Description"
Label="Description"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="JobDefs"
DirectiveName="JobDefs"
Label="JobDefs"
<p><%[ Please select Client from which you want to backup data and please select FileSet with files/directories definition to backup. ]%></p>
<p><%[ If your FileSet for this backup does not exist yet, you can create it. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Client"
DirectiveName="Client"
Label="Client"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Fileset"
DirectiveName="Fileset"
Label="FileSet"
</div>
<div id="job_wizard_new_fileset" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ New FileSet ]%></h3>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="FilesetConfig"
ComponentType="dir"
ResourceType="Fileset"
<h2><%[ Storage and Pool ]%></h2>
<p><%[ Please select Storage where you want to backup data and please select Pool with volumes which Storage will use to store backup data. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Storage"
DirectiveName="Storage"
Label="Storage"
<span><a href="javascript:void(0)" onclick="$('#job_wizard_storage_directives').slideToggle();" class="w3-button w3-green w3-margin-top w3-margin-bottom"><i class="fa fa-angle-down"></i> <%[ Show Storage directives for Job ]%></a></span>
<div id="job_wizard_storage_directives" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ Spool setting ]%></h3>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="SpoolData"
DirectiveName="SpoolData"
Label="Spool Data"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="SpoolAttributes"
DirectiveName="SpoolAttributes"
Label="Spool Attributes"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveSize
+ <com:Baculum.Web.Portlets.DirectiveSize
ID="SpoolSize"
DirectiveName="SpoolSize"
Label="Spool Size"
ShowRemoveButton="false"
/>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Pool"
DirectiveName="Pool"
Label="Pool"
</div>
<div id="job_wizard_new_pool" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ New Pool ]%></h3>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="PoolConfig"
ComponentType="dir"
ResourceType="Pool"
</div>
<div id="job_wizard_pool_directives" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ Pool setting ]%></h3>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="FullBackupPool"
DirectiveName="FullBackupPool"
Label="Full Backup Pool"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="IncrementalBackupPool"
DirectiveName="IncrementalBackupPool"
Label="Incremental Backup Pool"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="DifferentialBackupPool"
DirectiveName="DifferentialBackupPool"
Label="Differential Backup Pool"
<div class="w3-container">
<h2><%[ Job directives ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Level"
DirectiveName="Level"
Label="Level"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="Accurate"
DirectiveName="Accurate"
DefaultValue="0"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="MaximumConcurrentJobs"
DirectiveName="MaximumConcurrentJobs"
DefaultValue="1"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Priority"
DirectiveName="Priority"
DefaultValue="10"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="ReRunFailedLevels"
DirectiveName="ReRunFailedLevels"
DefaultValue="0"
<div class="w3-container">
<h2><%[ Other directives ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Messages"
DirectiveName="Messages"
Label="Messages"
<div class="w3-container">
<h2><%[ Schedule ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Schedule"
DirectiveName="Schedule"
Label="Schedule"
</div>
<div id="job_wizard_new_schedule" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ New Schedule ]%></h3>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ScheduleConfig"
ComponentType="dir"
ResourceType="Schedule"
</div>
<div id="job_wizard_reschedule_directives" class="w3-card-4 w3-padding w3-margin-top" style="display: none">
<h3><%[ Reschedule setting ]%></h3>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="RescheduleOnError"
DirectiveName="RescheduleOnError"
DefaultValue="0"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="RescheduleIncompleteJobs"
DirectiveName="RescheduleIncompleteJobs"
DefaultValue="0"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTimePeriod
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
ID="RescheduleInterval"
DirectiveName="RescheduleInterval"
DefaultValue="1800"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveInteger
+ <com:Baculum.Web.Portlets.DirectiveInteger
ID="RescheduleTimes"
DirectiveName="RescheduleTimes"
Label="Reschedule Times"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.WebControls.TWizard');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\Web\UI\WebControls\TWizard;
+use Prado\Web\UI\WebControls\TWizardNavigationEventParameter;
/**
* New backup job wizard page.
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardPrev($sender, $param) {
}
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardNext($sender, $param) {
}
/**
* Load JobDefs (step 1).
*
- * @return none
*/
public function loadJobDefs() {
$jobdefs_list = array();
/**
* Setup and remember selected JobDefs values to use in next wizard steps.
*
- * @return none
*/
public function setupJobDefs() {
$directive_value = $this->JobDefs->getDirectiveValue();
/**
* Load client list (step 2).
*
- * @return none
*/
public function loadClients() {
$client_list = array();
/**
* Load fileset list (step 2).
*
- * @return none
*/
public function loadFilesets() {
$this->loadFilesetList(null, null);
/**
* Load new fileset form.
*
- * @return none
*/
public function loadNewFilesetForm() {
if ($this->IsCallBack) {
/**
* Load new pool form.
*
- * @return none
*/
public function loadNewPoolForm() {
if ($this->IsCallBack) {
/**
* Load new schedule form.
*
- * @return none
*/
public function loadNewScheduleForm() {
if ($this->IsCallBack) {
/**
* Load storage list (step 2).
*
- * @return none
*/
public function loadStorages() {
$storage_list = array();
/**
* Load pool list (step 2).
*
- * @return none
*/
public function loadPools() {
$pool_list = $this->loadPoolList(null, null);
/**
* Load job levels.
*
- * @return none
*/
public function loadLevels() {
// so far backup job levels only
/**
* Load messages.
*
- * @return none
*/
public function loadMessages() {
$message_list = array();
/**
* Load schedule.
*
- * @return none
*/
public function loadSchedules() {
$this->loadScheduleList(null, null);
/**
* Cancel wizard.
*
- * @return none
*/
public function wizardStop($sender, $param) {
$this->goToDefaultPage();
* Set selected JobDefs values.
*
* @param $jobdefs selected JobDefs values
- * @return none
*/
public function setJobDefs($jobdefs) {
$this->setViewState(self::JOBDEFS, $jobdefs);
* Set previous wizard step.
*
* @param integer $step previous step number
- * @return none
*/
public function setPrevStep($step) {
$step = intval($step);
-<%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:TWizard ID="NewJobWizard"
CssClass="wizard"
<h2><%[ New copy job wizard ]%></h2>
<p><%[ Copy jobs run copying backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. All process runs without using file daemon. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Name"
DirectiveName="Name"
Label="Job Name"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Description"
DirectiveName="Description"
Label="Description"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="JobDefs"
DirectiveName="JobDefs"
Label="JobDefs"
<p><%[ Please select a pool from which you want to copy data. ]%></p>
<p><%[ The source pool will be examined for finding backup jobs to copy. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Pool"
DirectiveName="Pool"
Label="Source Pool"
<h2><%[ Source Storage ]%></h2>
<p><%[ Please select a storage using which you want to read copy data. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="SourceStorage"
DirectiveName="Storage"
Label="Source Storage"
<h2><%[ Backup jobs selection criteria ]%></h2>
<p><%[ Please select the criteria that will be used for selecting backup jobs to copy. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="SelectionType"
DirectiveName="SelectionType"
Label="Selection Type"
Attributes.onchange="oSelectionType.show_opts(this.value);"
/>
<div id="selection_type_job" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternJob"
DirectiveName="SelectionPattern"
Label="Selection Pattern Job"
<a id="selection_type_jobs_btn" href="javascript:void(0)" onclick="oJobList.load_data();" style="display: block; width: 300px; margin: 0 auto;"><%[ See backup jobs ]%></a>
</div>
<div id="selection_type_client" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternClient"
DirectiveName="SelectionPattern"
Label="Selection Pattern Client"
<a id="selection_type_clients_btn" href="javascript:void(0)" onclick="oClientList.load_data();" style="display: block; width: 300px; margin: 0 auto;"><%[ See clients ]%></a>
</div>
<div id="selection_type_volume" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternVolume"
DirectiveName="SelectionPattern"
Label="Selection Pattern Volume"
<div id="selection_type_oldest_volume" style="display: none">
</div>
<div id="selection_type_sql_query" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternSQLQuery"
DirectiveName="SelectionPattern"
Label="Selection Pattern SQL Query"
<p><%[ Please select destination pool to which will be stored data. ]%></p>
</div>
<div style="float: none; margin: auto">
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="NextPool"
DirectiveName="NextPool"
Label="Destination Pool (NextPool)"
<p><%[ Please select a storage using which you want to write copied data. ]%></p>
</div>
<div style="float: none; margin: auto">
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="DestinationStorage"
DirectiveName="Storage"
Label="Destination Storage"
<div>
<h2><%[ Limits ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="MaximumSpawnedJobs"
DirectiveName="MaximumSpawnedJobs"
DefaultValue="600"
<div>
<h2><%[ Schedule ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Schedule"
DirectiveName="Schedule"
Label="Schedule"
<div>
<h2><%[ Messages ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Messages"
DirectiveName="Messages"
Label="Messages"
</div>
<div id="copy_job_wizard_other_options" style="float: none; margin: auto; display: none;">
<p><%[ Level, Client and FileSet are not used during copy jobs running but they are required to define in copy job resource as the standard Job directives. ]%></p>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Level"
DirectiveName="Level"
Label="Level"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Client"
DirectiveName="Client"
Label="Client"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="FileSet"
DirectiveName="Fileset"
Label="FileSet"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.WebControls.TWizard');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\Web\UI\ActiveControls\TCallback;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
+use Prado\Web\UI\WebControls\TWizard;
+use Prado\Web\UI\WebControls\TWizardNavigationEventParameter;
/**
* New copy job wizard page.
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardPrev($sender, $param) {
}
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardNext($sender, $param) {
}
/**
* Load JobDefs (step 1).
*
- * @return none
*/
public function loadJobDefs() {
$jobdefs_list = [];
/**
* Setup and remember selected JobDefs values to use in next wizard steps.
*
- * @return none
*/
public function setupJobDefs() {
$directive_value = $this->JobDefs->getDirectiveValue();
*
* @param string $name pool type directive name
* @param object $control different type of controls (usually DirectiveComboBox)
- * @return none
*/
public function setPools($name, $control) {
$pool_list = [];
/**
* Load pool list (step 2).
*
- * @return none
*/
public function loadPools() {
$this->setPools('Pool', $this->Pool);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadVolumes($sender, $param) {
$pool = $param->getCallbackParameter();
/**
* Load source storage list (step 2).
*
- * @return none
*/
public function loadSourceStorages() {
$this->setStorages($this->SourceStorage);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setSourceStorageByPool($sender, $param) {
$pool = $this->Pool->getDirectiveValue();
/**
* Load selection types (step 3).
*
- * @return none
*/
public function loadSelectionTypes() {
$this->SelectionType->setData($this->sel_types);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadJobList($sender, $param) {
$result = $this->getModule('api')->get([
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadClientList($sender, $param) {
$result = $this->getModule('api')->get(
/**
* Load pool list (step 4).
*
- * @return none
*/
public function loadNextPools() {
$this->setPools('NextPool', $this->NextPool);
/**
* Load destination storage list (step 4).
*
- * @return none
*/
public function loadDestinationStorages() {
$this->setStorages($this->DestinationStorage);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setStorageByPool($pool, $cb) {
$pool = $this->getModule('api')->get([
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setDestinationStorageByPool($sender, $param) {
$nextpool = $this->NextPool->getDirectiveValue();
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function getJobsUsingPool($sender, $param) {
$values = $param->getCallbackParameter();
/**
* Load messages (step 5).
*
- * @return none
*/
public function loadMessages() {
$message_list = [];
/**
* Load schedule (step 5).
*
- * @return none
*/
public function loadSchedules() {
$schedule_list = [];
/**
* Load job levels (step 5).
*
- * @return none
*/
public function loadLevels() {
// so far backup job levels only
/**
* Load clients (step 5).
*
- * @return none
*/
public function loadClients() {
$clients = $this->getModule('api')->get([
/**
* Load filesets (step 5).
*
- * @return none
*/
public function loadFileSets() {
$filesets = $this->getModule('api')->get([
/**
* Cancel wizard.
*
- * @return none
*/
public function wizardStop($sender, $param) {
$this->goToDefaultPage();
* Set selected JobDefs values.
*
* @param $jobdefs selected JobDefs values
- * @return none
*/
public function setJobDefs($jobdefs) {
$this->setViewState(self::JOBDEFS, $jobdefs);
* Set previous wizard step.
*
* @param integer $step previous step number
- * @return none
*/
public function setPrevStep($step) {
$step = intval($step);
-<%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:TWizard ID="NewJobWizard"
CssClass="wizard"
<h2><%[ New migrate job wizard ]%></h2>
<p><%[ Migrate jobs run moving backup jobs data from one volume to another. It is done by reading the previously backed up data from volume and writing it to another volume in a different pool. The file catalog records associated with the original backup jobs are purged. All process runs without using file daemon. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Name"
DirectiveName="Name"
Label="Job Name"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Description"
DirectiveName="Description"
Label="Description"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="JobDefs"
DirectiveName="JobDefs"
Label="JobDefs"
<p><%[ Please select a pool from which you want to migrate data. ]%></p>
<p><%[ The source pool will be examined for finding backup jobs to migrate. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Pool"
DirectiveName="Pool"
Label="Source Pool"
<h2><%[ Source Storage ]%></h2>
<p><%[ Please select a storage using which you want to read migrate data. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="SourceStorage"
DirectiveName="Storage"
Label="Source Storage"
<h2><%[ Backup jobs selection criteria ]%></h2>
<p><%[ Please select the criteria that will be used for selecting backup jobs to migrate. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="SelectionType"
DirectiveName="SelectionType"
Label="Selection Type"
/>
</div>
<div id="selection_type_job" class="w3-half" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternJob"
DirectiveName="SelectionPattern"
Label="Selection Pattern Job"
<a id="selection_type_jobs_btn" href="javascript:void(0)" onclick="oJobList.load_data();" style="display: block; width: 300px; margin: 0 auto;"><%[ See backup jobs ]%></a>
</div>
<div id="selection_type_client" class="w3-half" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternClient"
DirectiveName="SelectionPattern"
Label="Selection Pattern Client"
<a id="selection_type_clients_btn" href="javascript:void(0)" onclick="oClientList.load_data();" style="display: block; width: 300px; margin: 0 auto;"><%[ See clients ]%></a>
</div>
<div id="selection_type_volume" class="w3-half" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternVolume"
DirectiveName="SelectionPattern"
Label="Selection Pattern Volume"
<div id="selection_type_oldest_volume" style="display: none">
</div>
<div id="selection_type_sql_query" class="w3-half" style="float: none; display: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="SelectionPatternSQLQuery"
DirectiveName="SelectionPattern"
Label="Selection Pattern SQL Query"
</script>
</div>
<div id="selection_type_pool_occupancy" class="w3-half" style="display: none; float: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveSize
+ <com:Baculum.Web.Portlets.DirectiveSize
ID="MigrationHighBytes"
DirectiveName="MigrationHighBytes"
Label="Migration High Bytes"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveSize
+ <com:Baculum.Web.Portlets.DirectiveSize
ID="MigrationLowBytes"
DirectiveName="MigrationLowBytes"
Label="Migration Low Bytes"
/>
</div>
<div id="selection_type_pool_time" class="w3-half" style="display: none; float: none; margin: auto;">
- <com:Application.Web.Portlets.DirectiveTimePeriod
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
ID="MigrationTime"
DirectiveName="MigrationTime"
Label="Migration Time"
<h2><%[ Destination Pool ]%></h2>
<p><%[ Please select destination pool to which will be stored data. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="NextPool"
DirectiveName="NextPool"
Label="Destination Pool (NextPool)"
<h2><%[ Destination Storage ]%></h2>
<p><%[ Please select a storage using which you want to write migrated data. ]%></p>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="DestinationStorage"
DirectiveName="Storage"
Label="Destination Storage"
<div>
<h2><%[ Purge jobs ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="PurgeMigrationJob"
DirectiveName="PurgeMigrationJob"
DefaultValue="0"
ShowRemoveButton="false"
/>
<h2><%[ Limits ]%></h2>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="MaximumSpawnedJobs"
DirectiveName="MaximumSpawnedJobs"
DefaultValue="600"
ShowRemoveButton="false"
/>
<h2><%[ Schedule ]%></h2>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Schedule"
DirectiveName="Schedule"
Label="Schedule"
<div>
<h2><%[ Messages ]%></h2>
</div>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Messages"
DirectiveName="Messages"
Label="Messages"
<a href="javascript:void(0)" onclick="$('#migrate_job_wizard_other_options').slideToggle();"><%[ Other options ]%></a>
<div id="migrate_job_wizard_other_options" style="float: none; margin: auto; display: none;">
<p><%[ Level, Client and FileSet are not used during migrate jobs running but they are required to define in migrate job resource as the standard Job directives. ]%></p>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Level"
DirectiveName="Level"
Label="Level"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Client"
DirectiveName="Client"
Label="Client"
ShowResetButton="false"
ShowRemoveButton="false"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="FileSet"
DirectiveName="Fileset"
Label="FileSet"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.WebControls.TWizard');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\Web\UI\ActiveControls\TCallback;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
+use Prado\Web\UI\WebControls\TWizard;
+use Prado\Web\UI\WebControls\TWizardNavigationEventParameter;
/**
* New migrate job wizard page.
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardPrev($sender, $param) {
}
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardNext($sender, $param) {
}
/**
* Load JobDefs (step 1).
*
- * @return none
*/
public function loadJobDefs() {
$jobdefs_list = [];
/**
* Setup and remember selected JobDefs values to use in next wizard steps.
*
- * @return none
*/
public function setupJobDefs() {
$directive_value = $this->JobDefs->getDirectiveValue();
*
* @param string $name pool type directive name
* @param object $control different type of controls (usually DirectiveComboBox)
- * @return none
*/
public function setPools($name, $control) {
$pool_list = [];
/**
* Load pool list (step 2).
*
- * @return none
*/
public function loadPools() {
$this->setPools('Pool', $this->Pool);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadVolumes($sender, $param) {
$pool = $param->getCallbackParameter();
/**
* Load source storage list (step 2).
*
- * @return none
*/
public function loadSourceStorages() {
$this->setStorages($this->SourceStorage);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setSourceStorageByPool($sender, $param) {
$pool = $this->Pool->getDirectiveValue();
/**
* Load selection types (step 3).
*
- * @return none
*/
public function loadSelectionTypes() {
$this->SelectionType->setData($this->sel_types);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadJobList($sender, $param) {
$result = $this->getModule('api')->get([
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadClientList($sender, $param) {
$result = $this->getModule('api')->get(
/**
* Load pool list (step 4).
*
- * @return none
*/
public function loadNextPools() {
$this->setPools('NextPool', $this->NextPool);
/**
* Load destination storage list (step 4).
*
- * @return none
*/
public function loadDestinationStorages() {
$this->setStorages($this->DestinationStorage);
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setStorageByPool($pool, $cb) {
$pool = $this->getModule('api')->get([
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setDestinationStorageByPool($sender, $param) {
$nextpool = $this->NextPool->getDirectiveValue();
*
* @param TCallback $sender callback object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function getJobsUsingPool($sender, $param) {
$values = $param->getCallbackParameter();
/**
* Load messages (step 5).
*
- * @return none
*/
public function loadMessages() {
$message_list = [];
/**
* Load schedule (step 5).
*
- * @return none
*/
public function loadSchedules() {
$schedule_list = [];
/**
* Load job levels (step 5).
*
- * @return none
*/
public function loadLevels() {
// so far backup job levels only
/**
* Load clients (step 5).
*
- * @return none
*/
public function loadClients() {
$clients = $this->getModule('api')->get([
/**
* Load filesets (step 5).
*
- * @return none
*/
public function loadFileSets() {
$filesets = $this->getModule('api')->get([
/**
* Cancel wizard.
*
- * @return none
*/
public function wizardStop($sender, $param) {
$this->goToDefaultPage();
* Set selected JobDefs values.
*
* @param $jobdefs selected JobDefs values
- * @return none
*/
public function setJobDefs($jobdefs) {
$this->setViewState(self::JOBDEFS, $jobdefs);
* Set previous wizard step.
*
* @param integer $step previous step number
- * @return none
*/
public function setPrevStep($step) {
$step = intval($step);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</div>
</div>
<div id="resource_config" class="w3-container">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="NewResource"
SaveDirectiveActionOk="save_directive_action_ok();"
ShowRemoveButton="false"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* New resource page.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.BaculumPage');
+use Baculum\Common\Modules\BaculumPage;
/**
* OAuth2 redirection callback page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Pool list page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
>
<prop:Text><i class="fa fa-wrench"></i> <%=Prado::localize('Update all vols in pool')%></prop:Text>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.AssignVolumesToPool
+ <com:Baculum.Web.Portlets.AssignVolumesToPool
PoolId="<%=$this->getPoolId()%>"
/>
<i id="status_pool_loading" class="fa fa-sync w3-spin" style="display: none; vertical-align: super;"></i>
<h3><%[ Warning ]%></h3>
<p><%[ The pool has not been renamed but it has been copied with the new name. Please note that if the original pool contained volumes, they have not been moved and they are still assigned to the original pool in the catalog database. To re-assign volumes from the original pool to this one please go to the MAIN MENU ➤ Pools ➤ [NEW POOL] ➤ Tab: Actions and please use the 'Assign volumes' button. After re-assgning volumes you can delete the original pool. ]%></p>
</div>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="PoolConfig"
ComponentType="dir"
ResourceType="Pool"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Pool view page.
/**
* Set pool poolid.
*
- * @return none;
*/
public function setPoolId($poolid) {
$poolid = intval($poolid);
/**
* Set pool name.
*
- * @return none;
*/
public function setPoolName($pool_name) {
$this->setViewState(self::POOL_NAME, $pool_name);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Common.Class.GeneralRequirements');
+namespace Baculum\Web\Pages;
+
+use Baculum\Common\Modules\GeneralRequirements;
/**
* Web part requirements class.
/**
* Validate all Web environment depenencies.
*
- * @return none
*/
public function validateEnvironment() {
parent::validateExtensions($this->req_exts);
-<%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:BStyleSheet StyleSheetUrl=<%~ ../../../themes/Baculum-v2/css/restore-wizard.css %> />
<com:TWizard ID="RestoreWizard"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('System.Exceptions.TException');
-Prado::using('System.Web.UI.WebControls.TWizard');
-Prado::using('System.Web.UI.WebControls.TDataGrid');
-Prado::using('System.Web.UI.JuiControls.TJuiDroppable');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveDataGrid');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\TEventParameter;
+use Prado\Web\UI\ActiveControls\TActiveDropDownList;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
+use Prado\Web\UI\WebControls\TWizard;
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Prado\Web\UI\ActiveControls\TCallback;
+use Prado\Web\UI\WebControls\TWizardNavigationEventParameter;
+use Prado\Xml\TXmlElement;
/**
* Restore wizard page.
* Initialize restore page.
*
* @param TXmlElement $param page config
- * @return none
*/
public function onInit($param) {
parent::onInit($param);
* On pre-render action.
*
* @param TXmlElement $param page config
- * @return none
*/
public function onPreRender($param) {
parent::onPreRender($param);
* Set jobid to restore.
* Used to restore specific job by jobid.
*
- * @return none
*/
public function setJobIdToRestore($jobid) {
$jobid = intval($jobid);
/**
* Set/prepare restore wizard to restore specific jobid.
*
- * @return none
*/
public function setRestoreByJobId($jobid) {
$job = $this->getModule('api')->get(
* Set navigation buttons.
* Used for restore specific jobid (hide previous button)
*
- * @return none
*/
public function setNavigationButtons() {
$prev_btn = $this->RestoreWizard->getStepNavigation()->PreviousStepBtn;
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardNext($sender, $param) {
if ($param->CurrentStepIndex === 0) {
*
* @param TWizard $sender sender object
* @param TWizardNavigationEventParameter $param sender parameters
- * @return none
*/
public function wizardPrev($sender, $param) {
if ($param->CurrentStepIndex === 1) {
/**
* Cancel wizard.
*
- * @return none
*/
public function wizardStop($sender, $param) {
$this->resetWizard();
*
* @param TActiveDropDownList $sender sender object
* @param TCommandParameter $param parameters object
- * @return none
*/
public function loadBackupClients() {
$client_list = [];
/**
* Load restore client list.
*
- * @return none
*/
public function loadRestoreClients() {
$client_list = [];
/**
* Load backups for selected client (Step 2).
*
- * @return none
*/
public function loadBackupsForClient() {
$clientid = $this->BackupClient->SelectedValue;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param param object
- * @return none
*/
public function loadJobList($sender, $param) {
$prop = $param->getCallbackParameter();
* Set selected backup client.
*
* @param integer $clientid client identifier
- * @return none
*/
public function getBackupClient($clientid) {
$client = null;
/**
* Load backup jobs to restore for group most recent backups feature.
*
- * @return none
*/
public function loadGroupBackupToRestore() {
$jobs = $this->getModule('api')->get(['jobs'])->output;
/**
* Load filesets to restore for group most recent backups feature.
*
- * @return none
*/
public function loadGroupFileSetToRestore() {
$filesets = $this->getModule('api')->get(['filesets'])->output;
/**
* Prepare left file browser content.
*
- * @return none
*/
private function prepareBrowserContent() {
$jobids = $this->getElementaryBackup();
*
* @param TActiveLinkButton $sender sender object
* @param TEventParameter $param events parameter
- * @return none
*/
public function loadPath($sender, $param) {
$path = explode('/', $this->PathField->Text);
*
* @param string|array $path path to go
* @param bool $full_path determines if $path param is full path or relative path (singel directory)
- * @return none
*/
private function goToPath($path = '', $full_path = false) {
if (!empty($path) && !$full_path && $this->Session->contains('restore_path')) {
* Go to specific path in the file browser by pathid.
*
* @param string $pathid path to go
- * @return none
*/
private function goToPathByPathId($pathid) {
$this->setRestorePathId($pathid);
*
* @param object $sender sender object
* @param object $param param object
- * @return none
*/
public function addFileToRestore($sender, $param) {
$file_prop = [];
*
* @param TCallback $sender sender object
* @param TEventParameter $param param object
- * @return none
*/
public function removeSelectedFile($sender, $param) {
$uniqid = $param->CallbackParameter;
*
* @param TCallback $sender sender object
* @param object $param param object
- * @return none
*/
public function getVersions($sender, $param) {
list($filename, $pathid, $filenameid, $jobid) = explode('|', $param->CallbackParameter, 4);
* Helper for adding filename to versions list.
*
* @param array $el version list element
- * @return return version list element
+ * @return version list element
*/
$add_version_filename_func = function ($el) use ($filename) {
$el['name'] = $filename;
* Load file browser files to list.
*
* @param array $files files to list.
- * @return none
*/
public function loadBrowserFiles($sender, $param) {
$files = $this->Session->contains('files_browser') ? $this->Session['files_browser'] : [];
/**
* Load file versions area.
*
- * @return none;
*/
public function loadFileVersions($sender, $param) {
$versions = $this->Session->contains('files_versions') ? $this->Session['files_versions'] : [];
/**
* Load selected files in drop area.
*
- * @return none
*/
public function loadSelectedFiles($sender, $param) {
$files = $this->Session->contains('files_restore') ? $this->Session['files_restore'] : [];
/**
* Set file browser path field.
*
- * @return none
*/
private function loadBrowserPath() {
$path = $this->Session->contains('restore_path') ? $this->Session['restore_path'] : [];
* Generate Bvfs cache by job identifiers.
*
* @param string $jobids comma separated job identifiers
- * @return none
*/
private function generateBvfsCache($jobids) {
$this->getModule('api')->set(
* Set versions for selected file.
*
* @param array $versions file versions data
- * @return none
*/
private function setFileVersions($versions = []) {
$this->Session->add('files_versions', $versions);
* Get file versions for specified uniqid.
*
* @param string $uniqid file identifier
- * @return none
*/
private function getFileVersions($uniqid) {
$versions = [];
* Set browser files.
*
* @param array $files file list
- * @return none
*/
private function setBrowserFiles($files = []) {
$this->Session->add('files_browser', $files);
* Set restore browser path.
*
* @param array $path path
- * @return none
*/
private function setRestorePath($path = []) {
$this->Session->add('restore_path', $path);
* Set restore browser pathid.
*
* @param integer $pathid pathid
- * @return none
*/
private function setRestorePathId($pathid) {
$this->Session->add('restore_pathid', $pathid);
* Get browser file by uniqid.
*
* @param string $uniqid file identifier
- * @return none
*/
private function getBrowserFile($uniqid) {
$element = [];
*
* @param string $uniqid file identifier
* @param array $file file properties to mark
- * @return none
*/
private function markFileToRestore($uniqid, $file) {
if (is_null($uniqid)) {
* Unmark file to restore.
*
* @param string $uniqid file identifier
- * @return none
*/
private function unmarkFileToRestore($uniqid) {
if (key_exists($uniqid, $this->Session['files_restore'])) {
* Set files to restore
*
* @param array $files files to restore
- * @return none
*/
public function setFilesToRestore($files = []) {
$this->Session->add('files_restore', $files);
/**
* Wizard finish method.
*
- * @return none
*/
public function wizardCompleted() {
$jobids = $this->getElementaryBackup();
/**
* Load restore jobs on the list.
*
- * @return none
*/
private function loadRestoreJobs() {
$restore_job_tasks = $this->getModule('api')->get(
* Reset wizard.
* All fields are back to initial form.
*
- * @return none
*/
private function resetWizard() {
$this->setBrowserFiles();
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Schedule list page.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Schedule status list.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
- <com:Application.Web.Portlets.StatusSchedule
+ <com:Baculum.Web.Portlets.StatusSchedule
ShowClientFilter="true"
ShowScheduleFilter="true"
/>
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
<a class="w3-button w3-bar-item" href="<%=$this->Service->constructUrl('ScheduleList')%>"><i class="fa fa-angle-left"></i></a>
</div>
<div class="w3-container">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ScheduleConfig"
ComponentType="dir"
ResourceType="Schedule"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Schedule view page.
/**
* Set schedule name.
*
- * @return none;
*/
public function setScheduleName($schedule_name) {
$this->setViewState(self::SCHEDULE_NAME, $schedule_name);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
var bulk_actions_output_id = '<%=$this->SourceTemplateControl->BulkActions->BulkActionsOutput->ClientID%>';
</script>
<com:TCallback ID="RemoveRolesAction" OnCallback="TemplateControl.removeRoles" />
- <com:Application.Web.Portlets.BulkActionsModal ID="BulkActions" />
+ <com:Baculum.Web.Portlets.BulkActionsModal ID="BulkActions" />
<div class="w3-container tab_item" id="console_list" style="display: none">
<p class="w3-hide-small"><%[ The console ACLs enable to define available resources for users. The consoles are used in the Bacula configuration on the API host side. There is possible to assign the consoles to the API basic users or to the OAuth2 clients. The assign relation for the basic users is: Console ACL -> API basic user -> API host -> User account. For OAuth2 clients the assign relation is: Console ACL -> OAuth2 client -> API host -> User account. ]%></p>
<div class="w3-panel">
>
<i class="fas fa-globe"></i> <%[ Set all CommandAcls used by Baculum Web ]%>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ConsoleConfig"
ComponentType="dir"
ResourceType="Console"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveCustomValidator');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveHiddenField');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveListBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.WebControls.TCheckBox');
-Prado::using('System.Web.UI.WebControls.TLabel');
-Prado::using('System.Web.UI.WebControls.TListItem');
-Prado::using('System.Web.UI.WebControls.TRadioButton');
-Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator');
-Prado::using('System.Web.UI.WebControls.TRequiredFieldValidator');
-Prado::using('System.Web.UI.WebControls.TValidationSummary');
-Prado::using('Application.Common.Class.Crypto');
-Prado::using('Application.Common.Class.Ldap');
-Prado::using('Application.Common.Class.OAuth2');
-Prado::using('Application.Common.Class.BasicUserConfig');
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('Application.Web.Portlets.BaculaConfigResources');
+use Baculum\Common\Modules\Logging;
+use Baculum\Web\Modules\HostConfig;
+use Baculum\Web\Modules\OAuth2Record;
+use Baculum\Web\Modules\WebConfig;
+use Baculum\Web\Modules\WebUserRoles;
+use Prado\Web\UI\ActiveControls\TActiveCustomValidator;
+use Prado\Web\UI\ActiveControls\TActiveDropDownList;
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Prado\Web\UI\ActiveControls\TCallback;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
+use Prado\Web\UI\TCommandEventParameter;
+use Prado\Web\UI\WebControls\TServerValidateEventParameter;
+use Baculum\Common\Modules\Ldap;
+use Baculum\Web\Modules\BaculumWebPage;
+use Baculum\Web\Portlets\BaculaConfigResources;
/**
* Security page (auth methods, users, roles...).
* Initialize page.
*
* @param mixed $param oninit event parameter
- * @return none
*/
public function onInit($param) {
parent::onInit($param);
/**
* Initialize form with default access settings.
*
- * @return none
*/
public function initDefAccessForm() {
$this->setRoles(
/**
* Initialize form with authentication method settings.
*
- * @return none
*/
public function initAuthForm() {
if (isset($this->web_config['security']['auth_method'])) {
/**
* Initialize values in user modal window.
*
- * @return none
*/
public function initUserWindow() {
// set API hosts
*
* @param object $control control which contains role list
* @param mixed $def_val default value or null if no default value to set
- * @return none
*/
private function setRoles($control, $def_val = null) {
// set roles
* @param object $control control which contains API host list
* @param mixed $def_val default value or null if no default value to set
* @param boolean determines if add first blank item
- * @return none
*/
private function setAPIHosts($control, $def_val = null, $add_blank_item = true) {
$api_hosts = array_keys($this->getModule('host_config')->getConfig());
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setUserList($sender, $param) {
$config = $this->getModule('user_config')->getConfig();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadUserWindow($sender, $param) {
//$this->getModule('user_config')->importBasicUsers();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function saveUser($sender, $param) {
if (!$this->UserIps->IsValid) {
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeUsers($sender, $param) {
$usernames = explode('|', $param->getCallbackParameter());
/**
* Initialize values in role modal window.
*
- * @return none
*/
public function initRoleWindow() {
// set role resources
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setRoleList($sender, $param) {
$config = $this->getModule('user_role')->getRoles();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadRoleWindow($sender, $param) {
$role = $param->getCallbackParameter();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function saveRole($sender, $param) {
$role_win_type = $this->RoleWindowType->Value;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeRoles($sender, $param) {
$roles = explode('|', $param->getCallbackParameter());
* It adds user count to information about roles.
*
* @param array $role_config role config (note, passing by reference)
- * @return none
*/
private function addUserStatsToRoles(&$role_config) {
$config = [];
/**
* Set basic authentication user file.
*
- * @return none
*/
private function setBasicAuthConfig() {
$is_basic = $this->getModule('web_config')->isAuthMethodBasic();
*
* @param TActiveLinkButton $sender sender
* @param TCommandEventParameter $param event parameter object
- * @return none
*/
public function getBasicUsers($sender, $param) {
if ($param instanceof Prado\Web\UI\TCommandEventParameter && $param->getCommandParameter() === 'load') {
* Note, extra parameters are not set in config.
*
* @param array $params basic auth parameters (passing by reference)
- * @return none
*/
private function addBasicExtraParams(&$params) {
if ($this->GetUsersImportOptions->SelectedValue == self::IMPORT_OPT_CRITERIA) {
*
* @param TActiveLinkButton $sender sender object
* @param TCallbackEventParameter $param event parameter object
- * @return none
*/
public function doBasicUserFileTest($sender, $param) {
$user_file = $this->BasicAuthUserFile->Text;
*
* @param TActiveLinkButton $sender sender
* @param TCommandEventParameter $param event parameter object
- * @return none
*/
public function getLdapUsers($sender, $param) {
if ($param instanceof Prado\Web\UI\TCommandEventParameter && $param->getCommandParameter() === 'load') {
* Note, extra parameters are not set in config.
*
* @param array $params LDAP auth parameters (passing by reference)
- * @return none
*/
private function addLdapExtraParams(&$params) {
$params['attrs'] = [$params['user_attr']]; // user attribute is obligatory
*
* @param TActiveLinkButton $sender sender object
* @param TCallbackEventParameter $param event object parameter
- * @return none
*/
public function testLdapConnection($sender, $param) {
$ldap = $this->getModule('ldap');
*
* @param TActiveLinkButton $sender sender object
* @param TCallbackEventParameter $param event object parameter
- * @return none
*/
public function importUsers($sender, $param) {
if (!$this->GetUsersDefaultIps->IsValid) {
*
* @param TActiveLinkButton $sender sender object
* @param TCallbackEventParameter $param event object parameter
- * @return none
*/
public function getUsers($sender, $param) {
if ($this->BasicAuth->Checked) {
*
* @param TActiveLinkButton $sender sender object
* @param TCallbackEventParameter $param event object parameter
- * @return none
*/
public function saveSecurityConfig($sender, $param) {
$config = $this->web_config;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setConsoleList($sender, $param) {
$config = $this->getModule('api')->get(['config', 'dir', 'Console']);
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadConsoleWindow($sender, $param) {
$name = $param->getCallbackParameter();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeConsoles($sender, $param) {
$consoles = explode('|', $param->getCallbackParameter());
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setAPIBasicUserList($sender, $param) {
$basic_users = $this->getModule('api')->get(['basic', 'users']);
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadAPIBasicUserWindow($sender, $param) {
$username = $param->getCallbackParameter();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function saveAPIBasicUser($sender, $param) {
$username = $this->APIBasicUserUsername->Text;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeAPIBasicUsers($sender, $param) {
$usernames = explode('|', $param->getCallbackParameter());
*
* @param TActiveDropDownList $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function loadAPIBasicUserSettings($sender, $param) {
$username = $this->APIHostBasicUserSettings->SelectedValue;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setOAuth2ClientList($sender, $param) {
$oauth2_clients = $this->getModule('api')->get(['oauth2', 'clients']);
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadOAuth2ClientWindow($sender, $param) {
$client_id = $param->getCallbackParameter();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function saveOAuth2Client($sender, $param) {
$client_id = $this->OAuth2ClientClientId->Text;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeOAuth2Clients($sender, $param) {
$client_ids = explode('|', $param->getCallbackParameter());
*
* @param TActiveDropDownList $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function loadOAuth2ClientSettings($sender, $param) {
$client_id = $this->APIHostOAuth2ClientSettings->SelectedValue;
/**
* Load OAuth2 client list to get OAuth2 client settings.
*
- * @return none
*/
private function loadOAuth2ClientList() {
$host = $this->APIHostSettings->SelectedValue ?: null;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function setAPIHostList($sender, $param) {
$api_hosts = $this->getModule('host_config')->getConfig();
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function loadAPIHostWindow($sender, $param) {
$name = $param->getCallbackParameter();
*
* @param TActiveDropDownList $sender sender object
* @param TCallbackEventParameter callback parameter
- * @return none
*/
public function loadAPIHostSettings($sender, $param) {
$api_host = $this->APIHostSettings->SelectedValue;
*
* @param TCallback $sender sender object
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function removeAPIHosts($sender, $param) {
$names = explode('|', $param->getCallbackParameter());
*
* @param TActiveCustomValidator $sender sender object
* @param TServerValidateEventParameter $param event object parameter
- * @return none
*/
public function validateIps($sender, $param) {
$valid = true;
-<%@ MasterClass="Application.Web.Layouts.Simple" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Simple" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<div style="width: 100%; height: 100%;">
<com:TPanel ID="SelectAPIHostForm" CssClass="w3-display-middle w3-center" Style="width: 100%; max-width: 440px">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Select API host page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Storage list page.
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
>
<prop:Text><i class="fa fa-caret-up"></i> <%=Prado::localize('Umount')%></prop:Text>
</com:TActiveLinkButton>
- <com:Application.Web.Portlets.ComponentActionsMenu
+ <com:Baculum.Web.Portlets.ComponentActionsMenu
ID="CompActions"
BigButtons="true"
/>
</div>
</div>
<div class="w3-container tab_item" id="configure_storage" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="DIRStorageConfig"
ComponentType="dir"
ResourceType="Storage"
CssClass="w3-text-red"
Display="None"
/>
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="SDStorageDaemonConfig"
ComponentType="sd"
ResourceType="Storage"
/>
</div>
<div id="sd_resources_config_form" class="subtab_item" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigResourceList
+ <com:Baculum.Web.Portlets.BaculaConfigResourceList
ID="StorageDaemonResourcesConfig"
ComponentType="sd"
ResourceList="<%=[[ 'name' => 'Name', 'label' => 'Name' ]]%>"
</div>
</div>
<div class="w3-container tab_item" id="configure_autochanger" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="AutochangerConfig"
ComponentType="sd"
ResourceType="Autochanger"
<com:TCallback ID="MovingFromImportExportSlot" OnCallback="movingFromIE" />
<com:TCallback ID="ReleaseImportExportSlot" OnCallback="releaseIE" />
<com:TCallback ID="ReleasingImportExportSlot" OnCallback="releasingIE" />
- <com:Application.Web.Portlets.LabelVolume
+ <com:Baculum.Web.Portlets.LabelVolume
ID="LabelBarcodes"
ShowButton="false"
BarcodeLabel="true"
OnLabelSuccess="hideChangerLoading"
OnLabelFail="hideChangerLoading"
/>
- <com:Application.Web.Portlets.UpdateSlots
+ <com:Baculum.Web.Portlets.UpdateSlots
ID="UpdateSlots"
ShowButton="false"
Storage="<%=$this->StorageName%>"
</div>
</div>
</div>
- <com:Application.Web.Portlets.BulkActionsModal ID="BulkActions" />
+ <com:Baculum.Web.Portlets.BulkActionsModal ID="BulkActions" />
</com:TContent>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Common.Class.Errors');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Common\Modules\Errors\DeviceError;
+use Baculum\Common\Modules\Params;
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Storage view page.
private function logActionError($result) {
$emsg = sprintf('Error %s: %s', $result->error, $result->output);
+ $messages_log = $this->getModule('messages_log');
$messages_log->append($result->output);
$this->getCallbackClient()->callClientFunction(
'oStorageActions.log',
/**
* Set storage storageid.
*
- * @return none;
*/
public function setStorageId($storageid) {
$storageid = intval($storageid);
/**
* Set storage name.
*
- * @return none;
*/
public function setStorageName($storage_name) {
$this->setViewState(self::STORAGE_NAME, $storage_name);
/**
* Set device name.
*
- * @return none;
*/
public function setDeviceName($device_name) {
$this->setViewState(self::DEVICE_NAME, $device_name);
/**
* Set autochanger value for storage
*
- * @return none;
*/
public function setIsAutochanger($is_autochanger) {
settype($is_autochanger, 'bool');
/**
* Set storage address.
*
- * @return none;
*/
public function setStorageAddress($address) {
$this->setViewState(self::STORAGE_ADDRESS, $address);
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
</header>
<div class="w3-container tab_item">
<div class="w3-section">
- <com:Application.Web.Portlets.LabelVolume />
- <com:Application.Web.Portlets.UpdateSlots />
+ <com:Baculum.Web.Portlets.LabelVolume />
+ <com:Baculum.Web.Portlets.UpdateSlots />
</div>
<table id="volume_list" class="w3-table w3-striped w3-hoverable w3-white w3-margin-bottom selectable" style="width: 100%">
<thead>
oVolumeList.reset_filters();
</prop:ClientSide.OnComplete>
</com:TCallback>
-<com:Application.Web.Portlets.BulkActionsModal
+<com:Baculum.Web.Portlets.BulkActionsModal
ID="BulkActions"
RefreshPageBtn="false"
/>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
+use Prado\Web\UI\ActiveControls\TCallback;
/**
* Volume list page.
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function pruneVolumes($sender, $param) {
$result = [];
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function purgeVolumes($sender, $param) {
$result = [];
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function deleteVolumes($sender, $param) {
$result = [];
*
* @param TCallback $sender callback object
* @param TCallbackEventPrameter $param event parameter
- * @return none
*/
public function updateVolumes($sender, $param) {
$volumes = $this->getVolumes();
-<%@ MasterClass="Application.Web.Layouts.Main" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Main" Theme="Baculum-v2"%>
<com:TContent ID="Main">
<!-- Header -->
<header class="w3-container">
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Web.Class.BaculumWebPage');
+use Baculum\Web\Modules\BaculumWebPage;
/**
* Volume view page.
/**
* Set volume mediaid.
*
- * @return none;
*/
public function setMediaId($mediaid) {
$mediaid = intval($mediaid);
/**
* Set volume name.
*
- * @return none;
*/
public function setVolumeName($volume_name) {
$this->setViewState(self::VOLUME_NAME, $volume_name);
-<%@ MasterClass="Application.Web.Layouts.Wizard" Theme="Baculum-v2"%>
+<%@ MasterClass="Baculum\Web\Layouts\Wizard" Theme="Baculum-v2"%>
<com:TContent ID="Wizard">
<com:TWizard ID="InstallWizard"
CssClass="wizard"
<com:TWizardStep ID="Step2" Title="<%[ Step 2 - add API instances ]%>" StepType="Auto">
<div class="w3-half" style="float: none; margin: auto">
<p><%[ Baculum web interface requires to add at least one Baculum API instance with shared Catalog access. Please add API instance. ]%></p>
- <com:Application.Common.Portlets.NewHost
+ <com:Baculum.Common.Portlets.NewHost
ID="AddNewHost"
ForceHostName="Main"
ShowButtons="false"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Class.BaculumWebPage');
-Prado::using('Application.Web.Class.HostConfig');
-Prado::using('Application.Web.Class.BasicWebUserConfig');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
+use Baculum\Common\Modules\Logging;
+use Baculum\Web\Modules\BaculumWebPage;
+use Baculum\Web\Modules\HostConfig;
+use Baculum\Web\Modules\WebUserRoles;
/**
* Web config wizard page.
</paths>
<modules>
<!-- config modules -->
- <module id="web_config" class="Application.Web.Class.WebConfig" />
- <module id="host_config" class="Application.Web.Class.HostConfig" />
- <module id="user_config" class="Application.Web.Class.WebUserConfig" />
- <module id="role_config" class="Application.Web.Class.WebRoleConfig" />
+ <module id="web_config" class="Baculum\Web\Modules\WebConfig" />
+ <module id="host_config" class="Baculum\Web\Modules\HostConfig" />
+ <module id="user_config" class="Baculum\Web\Modules\WebUserConfig" />
+ <module id="role_config" class="Baculum\Web\Modules\WebRoleConfig" />
<!-- data modules -->
- <module id="api" class="Application.Web.Class.BaculumAPIClient" />
- <module id="data_desc" class="Application.Web.Class.DataDescription" />
- <module id="data_deps" class="Application.Web.Class.DataDependencies" />
- <module id="doc_dir" class="Application.Web.Class.DirectiveDoc" />
+ <module id="api" class="Baculum\Web\Modules\BaculumAPIClient" />
+ <module id="data_desc" class="Baculum\Web\Modules\DataDescription" />
+ <module id="data_deps" class="Baculum\Web\Modules\DataDependencies" />
+ <module id="doc_dir" class="Baculum\Web\Modules\DirectiveDoc" />
<module id="globalization" class="TGlobalization">
- <translation type="gettext" source="Application.Web.Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
+ <translation type="gettext" source="Baculum\Web\Lang" marker="@@" autosave="false" cache="false" DefaultCulture="en" />
</module>
- <module id="log" class="System.Util.TLogRouter">
- <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Application.Web.Logs" LogFile="baculum-web.log" MaxFileSize="1000" MaxLogFiles="5" />
+ <module id="log" class="System\Util\TLogRouter">
+ <route class="TFileLogRoute" Categories="Execute, External, Application, General, Security" LogPath="Baculum\Web\Logs" LogFile="baculum-web.log" MaxFileSize="1000" MaxLogFiles="5" />
</module>
- <module id="log_parser" class="Application.Web.Class.LogParser" />
+ <module id="log_parser" class="Baculum\Web\Modules\LogParser" />
<!-- auth modules -->
- <module id="basic_webuser" class="Application.Web.Class.BasicWebUserConfig" />
- <module id="page_category" class="Application.Web.Class.PageCategory" />
- <module id="user_role" class="Application.Web.Class.WebUserRoles" />
- <module id="auth" class="System.Security.TAuthManager" UserManager="users" LoginPage="LoginPage" />
- <module id="users" class="Application.Web.Class.WebUserManager" UserClass="Application.Web.Class.WebUser" />
+ <module id="basic_webuser" class="Baculum\Web\Modules\BasicWebUserConfig" />
+ <module id="page_category" class="Baculum\Web\Modules\PageCategory" />
+ <module id="user_role" class="Baculum\Web\Modules\WebUserRoles" />
+ <module id="auth" class="Prado\Security\TAuthManager" UserManager="users" LoginPage="LoginPage" />
+ <module id="users" class="Baculum\Web\Modules\WebUserManager" UserClass="Baculum\Web\Modules\WebUser" />
<!-- data modules -->
- <module id="job_info" class="Application.Web.Class.JobInfo" />
- <module id="messages_log" class="Application.Web.Class.MessagesLog" />
+ <module id="job_info" class="Baculum\Web\Modules\JobInfo" />
+ <module id="messages_log" class="Baculum\Web\Modules\MessagesLog" />
</modules>
</configuration>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
+
+use Prado\Prado;
/**
* Assign volumes to pool control.
/**
* Set pool identifier.
*
- * @return none;
*/
public function setPoolId($pool) {
settype($pool, 'integer');
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.WebControls.TConditional');
+use Prado\IDataRenderer;
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
+use Prado\Web\UI\TTemplateControl;
/**
* Baculum conditional control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Portlets.ComponentListTemplate');
-Prado::using('Application.Web.Portlets.NewResourceMenu');
-Prado::using('Application.Web.Class.Miscellaneous');
+namespace Baculum\Web\Portlets;
/**
* Bacula config components control.
<i class="fa fa-sync w3-spin" style="display: none"><i/>
</td>
<td class="right" style="width: 20%">
- <com:Application.Web.Portlets.ComponentActionsMenu ID="CompActions" Visible="<%=$this->CompActions->getComponentType() !== 'bcons'%>" />
+ <com:Baculum.Web.Portlets.ComponentActionsMenu ID="CompActions" Visible="<%=$this->CompActions->getComponentType() !== 'bcons'%>" />
<a class="w3-button w3-green w3-right button_fixed" href="javascript:void(0)" onmousedown="openElementOnCursor(event, '<%=$this->ResourcesMenu->ClientID%>_new_resource', -80, 20);"><i class="fa fa-plus"></i> <%[ Add ]%></a>
- <com:Application.Web.Portlets.NewResourceMenu ID="ResourcesMenu"/>
+ <com:Baculum.Web.Portlets.NewResourceMenu ID="ResourcesMenu"/>
</td>
</tr>
</table>
- <com:Application.Web.Portlets.BaculaConfigResources />
+ <com:Baculum.Web.Portlets.BaculaConfigResources />
</com:TPanel>
</prop:ItemTemplate>
</com:TActiveRepeater>
<!-- New resource -->
<h2 rel="<%[ Add new %resource_type resource on %component_name (%component_type) ]%>"></h2>
<hr />
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="NewResource"
LoadValues="<%=false%>"
SaveDirectiveActionOk="$('#<%=$this->ResourceCreatedOk->ClientID%>').show();"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TCommandEventParameter');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveComboBox');
-Prado::using('Application.Web.Portlets.DirectiveInteger');
-Prado::using('Application.Web.Portlets.DirectiveListBox');
-Prado::using('Application.Web.Portlets.DirectivePassword');
-Prado::using('Application.Web.Portlets.DirectiveSize');
-Prado::using('Application.Web.Portlets.DirectiveSpeed');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveMultiComboBox');
-Prado::using('Application.Web.Portlets.DirectiveMultiTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTimePeriod');
-Prado::using('Application.Web.Portlets.DirectiveRunscript');
-Prado::using('Application.Web.Portlets.DirectiveMessages');
+use Baculum\Common\Modules\Logging;
+use Prado\TPropertyValue;
+use Prado\Web\UI\TCommandEventParameter;
+use Baculum\Web\Portlets\DirectiveListTemplate;
/**
* Bacula config directives control.
public $resource_names = array();
private $directive_types = array(
- 'DirectiveCheckBox',
- 'DirectiveComboBox',
- 'DirectiveInteger',
- 'DirectiveListBox',
- 'DirectivePassword',
- 'DirectiveTextBox',
- 'DirectiveSize',
- 'DirectiveSpeed',
- 'DirectiveTimePeriod'
+ 'Baculum\Web\Portlets\DirectiveCheckBox',
+ 'Baculum\Web\Portlets\DirectiveComboBox',
+ 'Baculum\Web\Portlets\DirectiveInteger',
+ 'Baculum\Web\Portlets\DirectiveListBox',
+ 'Baculum\Web\Portlets\DirectivePassword',
+ 'Baculum\Web\Portlets\DirectiveTextBox',
+ 'Baculum\Web\Portlets\DirectiveSize',
+ 'Baculum\Web\Portlets\DirectiveSpeed',
+ 'Baculum\Web\Portlets\DirectiveTimePeriod'
);
private $directive_list_types = array(
- 'DirectiveFileSet',
- 'DirectiveSchedule',
- 'DirectiveMessages',
- 'DirectiveRunscript',
- 'DirectiveMultiComboBox',
- 'DirectiveMultiTextBox'
+ 'Baculum\Web\Portlets\DirectiveFileSet',
+ 'Baculum\Web\Portlets\DirectiveSchedule',
+ 'Baculum\Web\Portlets\DirectiveMessages',
+ 'Baculum\Web\Portlets\DirectiveRunscript',
+ 'Baculum\Web\Portlets\DirectiveMultiComboBox',
+ 'Baculum\Web\Portlets\DirectiveMultiTextBox'
);
private $field_multple_values = array(
// skip not changed values that don't exist in config
continue;
}
- if ($this->directive_types[$i] === 'DirectiveCheckBox') {
+ if ($this->directive_types[$i] === 'Baculum\Web\Portlets\DirectiveCheckBox') {
settype($default_value, 'bool');
- } elseif ($this->directive_types[$i] === 'DirectiveInteger') {
+ } elseif ($this->directive_types[$i] === 'Baculum\Web\Portlets\DirectiveInteger') {
settype($directive_value, 'int');
}
if ($directive_value === $default_value && $in_config === false) {
$directives[$directive_name] = array();
}
if (is_array($directive_value)) {
- if ($this->directive_list_types[$i] === 'DirectiveMessages') {
+ if ($this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveMessages') {
$directives = array_merge($directives, $directive_value);
- } elseif ($this->directive_list_types[$i] === 'DirectiveRunscript') {
+ } elseif ($this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveRunscript') {
if (!isset($directives[$directive_name])) {
$directives[$directive_name] = array();
}
$directives[$directive_name] = array_merge($directives[$directive_name], $directive_value[$directive_name]);
- } elseif ($this->directive_list_types[$i] === 'DirectiveFileSet') {
+ } elseif ($this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveFileSet') {
if (key_exists('Exclude', $directive_value) && count($directive_value['Exclude']) > 0) {
$directives['Exclude'] = array($directive_value['Exclude']);
}
$directives[$directive_name] = $directive_value[$directive_name];
- } elseif ($this->directive_list_types[$i] === 'DirectiveSchedule') {
+ } elseif ($this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveSchedule') {
$directives[$directive_name] = $directive_value[$directive_name];
- } elseif ($this->directive_list_types[$i] === 'DirectiveMultiTextBox' || $this->directive_list_types[$i] === 'DirectiveMultiComboBox') {
+ } elseif ($this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveMultiTextBox' || $this->directive_list_types[$i] === 'Baculum\Web\Portlets\DirectiveMultiComboBox') {
if (key_exists($directive_name, $directives)) {
$directive_value = array_merge($directives[$directive_name], $directive_value);
}
*
* @return object $sender sender instance
* @return mixed $param additional parameters
- * @return none
*/
public function removeResource($sender, $param) {
if (!$this->getPage()->IsCallback) {
*
* @param string $resource_type removed resource type
* @param string $resource_name removed resource name
- * @return none
*/
private function showRemovedResourceInfo($resource_type, $resource_name) {
$msg = Prado::localize('Resource %s "%s" removed successfully.');
* Show removed resource error message.
*
* @param string $error_message error message
- * @return none
*/
private function showRemovedResourceError($error_message) {
$this->RemoveResourceError->Text = $error_message;
* @param array $deps list dependencies for the removing resource
* @param string $resource_type resource type of the removing resource
* @param string $resource_name resource name of the removing resource
- * @return none
*/
private function showDependenciesError($deps, $resource_type, $resource_name) {
$emsg = Prado::localize('Resource %s "%s" is used in the following resources:');
* @param array $config entire config
* @param string $resource_type resource type to remove
* @param string $resource_name resource name to remove
- * @return none
*/
private function removeResourceFromConfig(&$config, $resource_type, $resource_name) {
for ($i = 0; $i < count($config); $i++) {
* @param string $resource_type resource type to rename
* @param string $resource_name resource name to rename
* @param string $resource_name_new new resource name to set
- * @return none
*/
private function renameResourceInConfig(&$config, $deps, $resource_type, $resource_name, $resource_name_new) {
for ($i = 0; $i < count($config); $i++) {
/**
* Set if remove button should be available.
*
- * @return none;
*/
public function setShowRemoveButton($show) {
$show = TPropertyValue::ensureBoolean($show);
/**
* Set if cancel button should be available.
*
- * @return none;
*/
public function setShowCancelButton($show) {
$show = TPropertyValue::ensureBoolean($show);
/**
* Set if buttons should be flexible and available at the bottom of the page.
*
- * @return none
*/
public function setShowBottomButtons($show) {
$show = TPropertyValue::ensureBoolean($show);
/**
* On save event fired when resource is saved.
*
- * @return none
*/
public function onSave($param) {
$this->raiseEvent('OnSave', $this, $param);
/**
* On rename event fired when resource is renamed.
*
- * @return none
*/
public function onRename($param) {
$this->raiseEvent('OnRename', $this, $param);
/**
* Set if name field should be disabled.
*
- * @return none;
*/
public function setDisableRename($rename) {
$rename = TPropertyValue::ensureBoolean($rename);
<com:TActivePanel ID="ConfigDirectives" Style="margin-bottom: 48px">
<com:TActiveRepeater
ID="RepeaterDirectives"
- ItemRenderer="Application.Web.Portlets.DirectiveRenderer"
+ ItemRenderer="Baculum.Web.Portlets.DirectiveRenderer"
>
</com:TActiveRepeater>
<div class="w3-row w3-center<%=$this->ShowBottomButtons ? ' w3-border bottom_buttons' : ''%> page_main_el"<%=$this->ShowBottomButtons ? ' style="margin-left: 250px"' : ''%>>
- <com:Application.Web.Portlets.DirectiveSetting
+ <com:Baculum.Web.Portlets.DirectiveSetting
ID="DirectiveSetting"
Resource="<%=$this->getResource()%>"
OnLoadDirectives="loadDirectives"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Portlets.BaculaConfigResources');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
/**
* Bacula config resource list control.
<thead>
<tr>
<th></th>
- <com:Application.Common.Portlets.BSimpleRepeater ID="ResourceListHeaderRepeater">
+ <com:Baculum.Common.Portlets.BSimpleRepeater ID="ResourceListHeaderRepeater">
<prop:ItemTemplate>
<th class="center"><%=$this->Data['label']%></th>
</prop:ItemTemplate>
- </com:Application.Common.Portlets.BSimpleRepeater>
+ </com:Baculum.Common.Portlets.BSimpleRepeater>
<th><%[ Actions ]%></th>
</tr>
</thead>
<tfoot>
<tr>
<th></th>
- <com:Application.Common.Portlets.BSimpleRepeater ID="ResourceListFooterRepeater">
+ <com:Baculum.Common.Portlets.BSimpleRepeater ID="ResourceListFooterRepeater">
<prop:ItemTemplate>
<th class="center"><%=$this->Data['label']%></th>
</prop:ItemTemplate>
- </com:Application.Common.Portlets.BSimpleRepeater>
+ </com:Baculum.Common.Portlets.BSimpleRepeater>
<th><%[ Actions ]%></th>
</tr>
</tfoot>
data: null,
defaultContent: '<button type="button" class="w3-button w3-blue"><i class="fa fa-angle-down"></i></button>'
}
- <com:Application.Common.Portlets.BSimpleRepeater ID="ResourceListColumnsRepeater">
+ <com:Baculum.Common.Portlets.BSimpleRepeater ID="ResourceListColumnsRepeater">
<prop:ItemTemplate>
,{data: '<%=$this->Data['name']%>'}
</prop:ItemTemplate>
- </com:Application.Common.Portlets.BSimpleRepeater>
+ </com:Baculum.Common.Portlets.BSimpleRepeater>
,{
data: 'Name',
render: function (data, type, row) {
</div>
</div>
<div class="w3-container w3-margin-left w3-margin-right w3-margin-top">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
ID="ResourceConfig"
ShowRemoveButton="false"
ShowCancelButton="false"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Portlets.ResourceListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\Prado;
/**
* Bacula config resource control.
*
* @return object $sender sender instance
* @return mixed $param additional parameters
- * @return none
*/
public function removeResource($sender, $param) {
if (!$this->getPage()->IsCallback) {
*
* @param string $resource_type removed resource type
* @param string $resource_name removed resource name
- * @return none
*/
private function showRemovedResourceInfo($resource_type, $resource_name) {
$msg = Prado::localize('Resource %s "%s" removed successfully.');
* Show removed resource error message.
*
* @param string $error_message error message
- * @return none
*/
private function showRemovedResourceError($error_message) {
$this->RemoveResourceError->Text = $error_message;
* @param array $config entire config
* @param string $resource_type resource type to remove
* @param string $resource_name resource name to remove
- * @return none
*/
public static function removeResourceFromConfig(&$config, $resource_type, $resource_name) {
for ($i = 0; $i < count($config); $i++) {
</tr>
</table>
<div class="config_directives w3-khaki" style="display: none">
- <com:Application.Web.Portlets.BaculaConfigDirectives
+ <com:Baculum.Web.Portlets.BaculaConfigDirectives
Resource="<%#$this->Data['resource_name']%>"
LoadValues="<%=true%>"
ShowRemoveButton="false"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Class.HostConfig');
-Prado::using('Application.Web.Portlets.HostListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Baculum\Web\Modules\HostConfig;
+use Prado\Web\UI\TCommandEventParameter;
/**
* Bacula hosts control.
<button type="button" class="w3-button w3-green w3-margin-left" onclick="$('#new_host').slideToggle()"><i class="fa fa-plus"></i> <%[ Add API host]%></button>
-<com:Application.Common.Portlets.NewHost ID="AddNewHost" APIRequired="config" ClientMode="true" OnCallback="loadConfig" />
+<com:Baculum.Common.Portlets.NewHost ID="AddNewHost" APIRequired="config" ClientMode="true" OnCallback="loadConfig" />
<div class="w3-margin-left config_hosts">
<com:TActiveRepeater ID="RepeaterHosts" OnItemCreated="createHostListElement">
<prop:ItemTemplate>
</tr>
</table>
- <com:Application.Web.Portlets.BaculaConfigComponents />
+ <com:Baculum.Web.Portlets.BaculaConfigComponents />
</com:TPanel>
</prop:ItemTemplate>
</com:TActiveRepeater>
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveButton');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.Portlets');
+
+namespace Baculum\Web\Portlets;
/**
* Bconsole control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\TPropertyValue;
+use Baculum\Web\Portlets\Portlets;
/**
* Bulk actions modal control.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveSpeed');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Baculum\Web\Portlets\Portlets;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
/**
* Set client bandwidth limit control.
*
* @param TActiveLinkButton $sender sender
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setupBandwidthLimit($sender, $param) {
$clientid = $this->getClientId();
* Callback event method.
*
* @param mixed $param callback parameter or null
- * @return none
*/
public function onCallback($param) {
$this->raiseEvent('OnCallback', $this, $param);
/**
* Set client clientid.
*
- * @return none;
*/
public function setClientId($clientid) {
$clientid = intval($clientid);
/**
* Set client name.
*
- * @return none;
*/
public function setClientName($client_name) {
$this->setViewState(self::CLIENT_NAME, $client_name);
* Set bandwidth limit value in field.
*
* @param integer $bwlimit bandiwdth limit in bytes
- * @return none
*/
public function setBandwidthLimit($bwlimit) {
$this->BandwidthLimit->setDirectiveValue($bwlimit);
<p><%[ Here you can set bandwidth limit on client. This change is applied on running client. There is no need to restart it. ]%></p>
<p><%[ Setting 0 (zero) value disables bandwidth limitation. ]%></p>
<div class="w3-row w3-section w3-medium">
- <com:Application.Web.Portlets.DirectiveSpeed
+ <com:Baculum.Web.Portlets.DirectiveSpeed
ID="BandwidthLimit"
DirectiveName="BandwidthLimit"
DefaultValue="0"
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+use Prado\TPropertyValue;
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Baculum\Web\Portlets\DirectiveListTemplate;
+use Prado\Web\UI\TCommandEventParameter;
/**
* Component actions control responsible for start,
*
* @param TActiveLinkButton $sender sender object
* @param TCommandEventParameter $param command parameter
- * @return none
*/
public function componentAction($sender, $param) {
$action = $param->getCommandParameter();
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
-Prado::using('Application.Web.Portlets.ConfigListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\ICallbackEventHandler;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
/**
* Component list template control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveControlTemplate');
+namespace Baculum\Web\Portlets;
/**
* Config list template control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* Checkbox directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* Combobox directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.TTemplateControl');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\TTemplateControl;
/**
* Abstraction to directive control template.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
/**
* Days of month directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
+use Baculum\Common\Modules\Params;
/**
* Days of week directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveComboBox');
-Prado::using('Application.Web.Portlets.DirectiveInteger');
-Prado::using('Application.Web.Portlets.FileSetOptionRenderer');
+namespace Baculum\Web\Portlets;
/**
* FileSet directive template.
class DirectiveFileSet extends DirectiveListTemplate {
private $directive_types = array(
- 'DirectiveCheckBox',
- 'DirectiveTextBox',
- 'DirectiveComboBox',
- 'DirectiveListBox',
- 'DirectiveInteger'
+ 'Baculum\Web\Portlets\DirectiveCheckBox',
+ 'Baculum\Web\Portlets\DirectiveTextBox',
+ 'Baculum\Web\Portlets\DirectiveComboBox',
+ 'Baculum\Web\Portlets\DirectiveListBox',
+ 'Baculum\Web\Portlets\DirectiveInteger'
);
private $directive_list_types = array(
- 'DirectiveMultiTextBox'
+ 'Baculum\Web\Portlets\DirectiveMultiTextBox'
);
private $directive_inc_exc_types = array(
- 'DirectiveTextBox'
+ 'Baculum\Web\Portlets\DirectiveTextBox'
);
public function loadConfig() {
// option not set or removed
continue;
}
- if ($this->directive_types[$i] === 'DirectiveCheckBox') {
+ if ($this->directive_types[$i] === 'Baculum\Web\Portlets\DirectiveCheckBox') {
settype($default_value, 'bool');
}
if ($directive_value === $default_value) {
<button type="button" onmousedown="openElementOnCursor(event, '<%=$this->FileSetIncludeMenu->ClientID%>_new_fileset', 0, 20);" class="w3-button w3-green w3-margin-bottom" style="display: <%=$this->getDirectiveName() == 'Include' ? '' : 'none'%>"><i class="fa fa-plus"></i> <%[ Add ]%></button>
-<com:Application.Web.Portlets.NewFileSetIncExcMenu ID="FileSetIncludeMenu" />
+<com:Baculum.Web.Portlets.NewFileSetIncExcMenu ID="FileSetIncludeMenu" />
<com:TActiveRepeater ID="RepeaterFileSetIncludes" OnItemDataBound="createFileSetIncludes">
<prop:ItemTemplate>
<div class="w3-card-4 w3-padding w3-margin-bottom directive incexc">
<h3><%#$this->SourceTemplateControl->getDirectiveName()%> #<%#$this->ItemIndex + 1%></h3>
<button type="button" onmousedown="openElementOnCursor(event, '<%=$this->FileSetFileOptMenu->ClientID%>_new_fileset', 0, 20);" class="w3-button w3-green w3-margin-bottom"><i class="fa fa-plus"></i> <%[ Add ]%></button>
- <com:Application.Web.Portlets.NewFileSetFileOptMenu ID="FileSetFileOptMenu" FileSetBrowserId="<%=$this->SourceTemplateControl->FSBrowser->ClientID%>" />
+ <com:Baculum.Web.Portlets.NewFileSetFileOptMenu ID="FileSetFileOptMenu" FileSetBrowserId="<%=$this->SourceTemplateControl->FSBrowser->ClientID%>" />
<com:TActiveRepeater
ID="RepeaterFileSetOptions"
- ItemRenderer="Application.Web.Portlets.FileSetOptionRenderer"
+ ItemRenderer="Baculum.Web.Portlets.FileSetOptionRenderer"
>
<prop:HeaderTemplate>
<div class="w3-border w3-padding w3-margin-bottom directive">
</div>
</prop:FooterTemplate>
</com:TActiveRepeater>
- <com:TActiveRepeater ID="RepeaterFileSetInclude" ItemRenderer="Application.Web.Portlets.DirectiveRenderer" CssClass="incexc_item">
+ <com:TActiveRepeater ID="RepeaterFileSetInclude" ItemRenderer="Baculum.Web.Portlets.DirectiveRenderer" CssClass="incexc_item">
<prop:HeaderTemplate>
<div class="w3-border w3-padding w3-margin-bottom directive include_file">
<h3><%[ Files ]%></h3>
</div>
</prop:FooterTemplate>
</com:TActiveRepeater>
- <com:TActiveRepeater ID="RepeaterFileSetPlugin" ItemRenderer="Application.Web.Portlets.DirectiveRenderer" CssClass="incexc_item">
+ <com:TActiveRepeater ID="RepeaterFileSetPlugin" ItemRenderer="Baculum.Web.Portlets.DirectiveRenderer" CssClass="incexc_item">
<prop:HeaderTemplate>
<div class="w3-border w3-padding w3-margin-bottom directive include_plugin">
<h3><%[ Plugins ]%></h3>
<div class="w3-card-4 w3-padding w3-margin-bottom directive">
<h2><%[ Exclude ]%></h2>
<button type="button" onmousedown="openElementOnCursor(event, '<%=$this->FileSetExcMenu->ClientID%>_new_fileset', 0, 20);" class="w3-button w3-green w3-margin-bottom"><i class="fa fa-plus"></i> <%[ Add ]%></button>
- <com:Application.Web.Portlets.NewFileSetExcMenu ID="FileSetExcMenu" />
+ <com:Baculum.Web.Portlets.NewFileSetExcMenu ID="FileSetExcMenu" />
<h3><%[ Files ]%></h3>
</prop:HeaderTemplate>
<prop:ItemTemplate>
<div class="directive_field exclude_file">
- <com:Application.Web.Portlets.DirectiveTextBox />
+ <com:Baculum.Web.Portlets.DirectiveTextBox />
</div>
</prop:ItemTemplate>
<prop:FooterTemplate>
<div class="w3-modal-content w3-card-4 w3-padding-large w3-animate-zoom" style="width: 85%">
<span onclick="document.getElementById('<%=$this->FSBrowser->ClientID%>fileset_browser').style.display = 'none'" class="w3-button w3-xlarge w3-hover-red w3-display-topright">×</span>
<h2><%[ Include files to FileSet]%></h2>
- <com:Application.Web.Portlets.FileSetBrowser ID="FSBrowser" />
+ <com:Baculum.Web.Portlets.FileSetBrowser ID="FSBrowser" />
<com:TCallback ID="NewIncExcFile" OnCallback="newIncludeExcludeFile" />
<div class="w3-center w3-margin-top">
<button type="button" class="w3-button w3-red" onclick="document.getElementById('<%=$this->FSBrowser->ClientID%>fileset_browser').style.display = 'none'"><i class="fa fa-times"></i> <%[ Cancel ]%></button>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* Integer directive template.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveListBox');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* ListBox directive template.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
-Prado::using('Application.Web.Portlets.ConfigListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\ICallbackEventHandler;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
/**
* Directive list template.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\TCommandEventParameter;
/**
* Messages directive.
class DirectiveMessages extends DirectiveListTemplate {
private $directive_types = array(
- 'DirectiveTextBox'
+ 'Baculum\Web\Portlets\DirectiveTextBox'
);
public $destination_simple = array(
$controls = $this->RepeaterMessages->getControls();
for ($i = 0; $i < $controls->count(); $i++) {
$directive_values = array();
- $where_control = $controls->itemAt($i)->findControlsByType('DirectiveTextBox');
+ $where_control = $controls->itemAt($i)->findControlsByType('Baculum\Web\Portlets\DirectiveTextBox');
if (count($where_control) === 1 && $where_control[0]->getShow() === true) {
$directive_values = array($where_control[0]->getDirectiveValue());
}
$controls = $this->RepeaterMessages->getItems();
foreach ($controls as $control) {
$directive_values = array();
- $where_control = $control->findControlsByType('DirectiveTextBox');
+ $where_control = $control->findControlsByType('Baculum\Web\Portlets\DirectiveTextBox');
if (count($where_control) === 1 && $where_control[0]->getShow() === true) {
$where_control[0]->setValue();
$directive_values['Where'] = array($where_control[0]->getDirectiveValue());
}
public function removeMessages($sender, $param) {
- if ($param instanceof Prado\Web\UI\TCommandEventParameter) {
+ if ($param instanceof TCommandEventParameter) {
$idx = $param->getCommandName();
$data = $this->getDirectiveData();
array_splice($data, $idx, 1);
<button type="button" class="w3-button w3-green w3-margin" onclick="openElementOnCursor(event, '<%=$this->MessagesMenu->ClientID%>_new_messages', 0, 20);"><i class="fa fa-plus"></i> <%[ Add ]%></button>
<p class="bold"><%[ Tip: checking 'All' message type causes, that rest checked message types are saved with negation ex. Catalog = All, !Debug, !Saved, !Skipped ]%></p>
-<com:Application.Web.Portlets.NewMessagesMenu ID="MessagesMenu" />
+<com:Baculum.Web.Portlets.NewMessagesMenu ID="MessagesMenu" />
<com:TActiveRepeater ID="RepeaterMessages" OnItemCreated="createDirectiveListElement" OnItemDataBound="loadMessageTypes">
<prop:ItemTemplate>
<div class="w3-card w3-padding directive">
<i class="fa fa-trash-alt"></i> <%[ Remove ]%>
</com:TActiveLinkButton>
<h2><%#$this->Data['directive_name']%></h2>
- <com:Application.Web.Portlets.DirectiveTextBox />
- <com:Application.Web.Portlets.MessageTypes ID="Types" />
+ <com:Baculum.Web.Portlets.DirectiveTextBox />
+ <com:Baculum.Web.Portlets.MessageTypes ID="Types" />
</div>
</prop:ItemTemplate>
</com:TActiveRepeater>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+use Prado\TPropertyValue;
+use Baculum\Common\Modules\Params;
+use Baculum\Web\Portlets\DirectiveTemplate;
/**
* Months of the year directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* Multi-combobox directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* Multi-textbox directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* Password directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('System.Web.UI.WebControls.TItemDataRenderer');
-Prado::using('System.Web.UI.WebControls.THeader3');
-Prado::using('System.Web.UI.WebControls.TLiteral');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveComboBox');
-Prado::using('Application.Web.Portlets.DirectiveInteger');
-Prado::using('Application.Web.Portlets.DirectiveListBox');
-Prado::using('Application.Web.Portlets.DirectivePassword');
-Prado::using('Application.Web.Portlets.DirectiveSize');
-Prado::using('Application.Web.Portlets.DirectiveSpeed');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveMultiComboBox');
-Prado::using('Application.Web.Portlets.DirectiveMultiTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTimePeriod');
-Prado::using('Application.Web.Portlets.DirectiveRunscript');
-Prado::using('Application.Web.Portlets.DirectiveMessages');
+namespace Baculum\Web\Portlets;
+
+use Prado\Prado;
+use Prado\Web\UI\WebControls\TItemDataRenderer;
/**
* Directive renderer control.
}
private function getField($field_type) {
- return 'Application.Web.Portlets.Directive' . $field_type;
+ return 'Baculum.Web.Portlets.Directive' . $field_type;
}
}
?>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveComboBox');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\TCommandEventParameter;
+use stdClass;
/**
* Runscript directive control.
class DirectiveRunscript extends DirectiveListTemplate {
private $directive_types = array(
- 'DirectiveCheckBox',
- 'DirectiveComboBox',
- 'DirectiveTextBox'
+ 'Baculum\Web\Portlets\DirectiveCheckBox',
+ 'Baculum\Web\Portlets\DirectiveComboBox',
+ 'Baculum\Web\Portlets\DirectiveTextBox'
);
public function loadConfig() {
// skip not changed values that don't exist in config
continue;
}
- if ($this->directive_types[$i] === 'DirectiveCheckBox') {
+ if ($this->directive_types[$i] === 'Baculum\Web\Portlets\DirectiveCheckBox') {
settype($default_value, 'bool');
}
if ($directive_value === $default_value) {
}
public function removeRunscript($sender, $param) {
- if ($param instanceof Prado\Web\UI\TCommandEventParameter) {
+ if ($param instanceof TCommandEventParameter) {
$idx = $param->getCommandName();
$data = $this->getDirectiveValue();
if (is_array($data)) {
<button type="button" class="w3-button w3-green w3-margin-bottom" onmousedown="openElementOnCursor(event, '<%=$this->RunscriptMenu->ClientID%>_new_runscript', 0, 20);"><i class="fa fa-plus"></i> <%[ Add ]%></button>
-<com:Application.Web.Portlets.NewRunscriptMenu ID="RunscriptMenu" />
-<com:TActiveRepeater ID="RepeaterRunscriptOptions" ItemRenderer="Application.Web.Portlets.JobRunscriptRenderer">
+<com:Baculum.Web.Portlets.NewRunscriptMenu ID="RunscriptMenu" />
+<com:TActiveRepeater ID="RepeaterRunscriptOptions" ItemRenderer="Baculum.Web.Portlets.JobRunscriptRenderer">
<prop:HeaderTemplate>
<div class="w3-card-4 w3-padding w3-margin-bottom directive runscript">
</prop:HeaderTemplate>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveHiddenField');
-Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
-Prado::using('Application.Web.Portlets.DirectiveComboBox');
-Prado::using('Application.Web.Portlets.DirectiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTimePeriod');
-Prado::using('Application.Web.Portlets.DirectiveTime');
-Prado::using('Application.Web.Portlets.DirectiveDaysOfWeek');
-Prado::using('Application.Web.Portlets.DirectiveDaysOfMonth');
-Prado::using('Application.Web.Portlets.DirectiveWeeksOfMonth');
-Prado::using('Application.Web.Portlets.DirectiveWeeksOfYear');
+namespace Baculum\Web\Portlets;
+
+use Baculum\Common\Modules\Params;
+use Prado\Web\UI\TCommandEventParameter;
+use stdClass;
/**
* Schedule directive control.
}
public function removeSchedule($sender, $param) {
- if ($param instanceof Prado\Web\UI\TCommandEventParameter) {
+ if ($param instanceof TCommandEventParameter) {
$idx = (integer)$param->getCommandName();
$data = $this->getDirectiveValue(true);
array_splice($data, $idx, 1);
if (is_null($subdirective_value)) {
continue;
}
- if (get_class($control) === 'DirectiveCheckBox') {
+ if (get_class($control) === 'Baculum\Web\Portlets\DirectiveCheckBox') {
settype($default_value, 'bool');
}
- if (get_class($control) === 'DirectiveTextBox') {
+ if (get_class($control) === 'Baculum\Web\Portlets\DirectiveTextBox') {
settype($default_value, 'string');
}
continue;
}
$obj->{$subdirective_name} = $subdirective_value;
- if (get_class($control) === 'DirectiveCheckBox') {
+ if (get_class($control) === 'Baculum\Web\Portlets\DirectiveCheckBox') {
$subdirective_value = Params::getBoolValue($subdirective_value);
}
$directive_values[] = "{$subdirective_name}=\"{$subdirective_value}\"";
<button type="button" class="w3-button w3-green w3-margin-bottom" onmousedown="openElementOnCursor(event, '<%=$this->ScheduleMenu->ClientID%>_new_schedule', 0, 20);"><i class="fa fa-plus"></i> <%[ Add ]%></button>
-<com:Application.Web.Portlets.NewScheduleMenu ID="ScheduleMenu" />
+<com:Baculum.Web.Portlets.NewScheduleMenu ID="ScheduleMenu" />
<com:TActiveRepeater ID="RepeaterScheduleRuns" OnItemDataBound="createRunItem">
<prop:ItemTemplate>
<div class="w3-card-4 w3-padding w3-margin-bottom directive runscript">
</div>
<div class="w3-border w3-hide w3-animate-right status_content <%=$this->ScheduleMode->Value == DirectiveSchedule::SCHEDULE_MODE_HOURLY ? 'w3-show': ''%>">
<div class="w3-padding">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeHourly"
Label="<%[ Run hourly at minute ]%>"
InConfig="false"
</div>
<div class="w3-border w3-hide w3-animate-right status_content <%=$this->ScheduleMode->Value == DirectiveSchedule::SCHEDULE_MODE_DAILY ? 'w3-show': ''%>">
<div class="w3-padding">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeDaily"
Label="<%[ Run at ]%>"
InConfig="false"
</div>
<div class="w3-border w3-hide w3-animate-right status_content <%=$this->ScheduleMode->Value == DirectiveSchedule::SCHEDULE_MODE_WEEKLY ? 'w3-show': ''%>">
<div class="w3-padding">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeWeekly"
Label="<%[ Run at ]%>"
InConfig="false"
Show="true"
CssClass="xtinybox"
/>
- <com:Application.Web.Portlets.DirectiveDaysOfWeek
+ <com:Baculum.Web.Portlets.DirectiveDaysOfWeek
ID="DaysOfWeekWeekly"
Label="<%[ Days of the week ]%>"
InConfig="false"
</div>
<div class="w3-border w3-hide w3-animate-right status_content <%=$this->ScheduleMode->Value == DirectiveSchedule::SCHEDULE_MODE_MONTHLY ? 'w3-show': ''%>">
<div class="w3-padding">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeMonthly"
Label="<%[ Run at ]%>"
InConfig="false"
Show="true"
CssClass="xtinybox"
/>
- <com:Application.Web.Portlets.DirectiveWeeksOfMonth
+ <com:Baculum.Web.Portlets.DirectiveWeeksOfMonth
ID="WeeksOfMonthMonthly"
Label="<%[ Weeks of the month ]%>"
InConfig="false"
ShowResetButton="false"
Show="true"
/>
- <com:Application.Web.Portlets.DirectiveDaysOfWeek
+ <com:Baculum.Web.Portlets.DirectiveDaysOfWeek
ID="DaysOfWeekMonthly"
Label="<%[ Days of the week ]%>"
InConfig="false"
</script>
</div>
<div class="w3-hide custom_hourly <%=$this->TimeHourlyCustomOption->Checked ? 'w3-show' : 'w3-hide'%>">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeHourlyCustom"
Label="<%[ Run hourly at minute ]%>"
InConfig="false"
/>
</div>
<div class="w3-hide custom_time <%=$this->TimeAtCustomOption->Checked ? 'w3-show' : 'w3-hide'%>">
- <com:Application.Web.Portlets.DirectiveTime
+ <com:Baculum.Web.Portlets.DirectiveTime
ID="TimeCustom"
Label="<%[ Run at ]%>"
InConfig="false"
CssClass="xtinybox"
/>
</div>
- <com:Application.Web.Portlets.DirectiveWeeksOfMonth
+ <com:Baculum.Web.Portlets.DirectiveWeeksOfMonth
ID="WeeksOfMonthCustom"
Label="<%[ Weeks of the month ]%>"
InConfig="false"
ShowOptions="true"
Show="true"
/>
- <com:Application.Web.Portlets.DirectiveDaysOfWeek
+ <com:Baculum.Web.Portlets.DirectiveDaysOfWeek
ID="DaysOfWeekCustom"
Label="<%[ Days of the week ]%>"
InConfig="false"
ShowOptions="true"
Show="true"
/>
- <com:Application.Web.Portlets.DirectiveDaysOfMonth
+ <com:Baculum.Web.Portlets.DirectiveDaysOfMonth
ID="DaysOfMonthCustom"
Label="<%[ Days of the month ]%>"
InConfig="false"
ShowOptions="true"
Show="true"
/>
- <com:Application.Web.Portlets.DirectiveMonthsOfYear
+ <com:Baculum.Web.Portlets.DirectiveMonthsOfYear
ID="MonthsOfYearCustom"
Label="<%[ Months of the year ]%>"
InConfig="false"
ShowOptions="true"
Show="true"
/>
- <com:Application.Web.Portlets.DirectiveWeeksOfYear
+ <com:Baculum.Web.Portlets.DirectiveWeeksOfYear
ID="WeeksOfYearCustom"
Label="<%[ Weeks of the year ]%>"
InConfig="false"
</div>
<com:TActiveHiddenField ID="ScheduleMode" Value="daily" />
<h3 class="<%=$this->Level->Show || $this->Pool->Show || $this->Storage->Show || $this->Messages->Show || $this->NextPool->Show || $this->FullPool->Show || $this->DifferentialPool->Show || $this->IncrementalPool->Show || $this->Accurate->Show || $this->Priority->Show || $this->SpoolData->Show || $this->MaxRunSchedTime->Show || $this->MaxConnectTime->Show ? 'w3-show' : 'w3-hide'%>"><%[ Override directives ]%></h3>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Level"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Pool"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Storage"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="Messages"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="NextPool"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="FullPool"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="DifferentialPool"
/>
- <com:Application.Web.Portlets.DirectiveComboBox
+ <com:Baculum.Web.Portlets.DirectiveComboBox
ID="IncrementalPool"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="Accurate"
/>
- <com:Application.Web.Portlets.DirectiveTextBox
+ <com:Baculum.Web.Portlets.DirectiveTextBox
ID="Priority"
CssClass="smallbox"
/>
- <com:Application.Web.Portlets.DirectiveCheckBox
+ <com:Baculum.Web.Portlets.DirectiveCheckBox
ID="SpoolData"
/>
- <com:Application.Web.Portlets.DirectiveTimePeriod
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
ID="MaxRunSchedTime"
/>
- <com:Application.Web.Portlets.DirectiveTimePeriod
+ <com:Baculum.Web.Portlets.DirectiveTimePeriod
ID="MaxConnectTime"
/>
</div>
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* Directive settings control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* Size directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Exception;
/**
* Speed directive control.
* If not set, there supported are both decimal and binary.
*
* @param string $unit_type unit type value (decimal or binary)
- * @return none
* @throw Exception if provided invalid unit type value
*/
public function setUnitType($unit_type) {
* Get unit type to show in control.
* If unit type is not set, returned is empty string that means both unit types are supported.
*
- * @return none
*/
public function getUnitType() {
return $this->getViewState(self::UNIT_TYPE, '');
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
-Prado::using('Application.Web.Portlets.DirectiveControlTemplate');
-Prado::using('Application.Web.Portlets.IDirectiveField');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
+use Prado\Web\UI\TCommandEventParameter;
/**
* Directive template control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
/**
* TextBox directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-use Prado\TPropertyValue;
+namespace Baculum\Web\Portlets;
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+use Prado\TPropertyValue;
/**
* Time directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\Prado;
/**
* Time period directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
+use Baculum\Common\Modules\Params;
/**
* Weeks of month directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('Application.Common.Class.Params');
-Prado::using('Application.Web.Portlets.DirectiveTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
/**
* Weeks of year directive control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
/**
* Error message box - displays global errors and problems.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\Web\UI\ActiveControls\TActiveDropDownList;
+use Baculum\Web\Portlets\Portlets;
/**
* FileSet browser control.
/**
* Load client list.
*
- * @return none
*/
public function loadClients($sender, $param) {
$client_list = array();
*
* @param TActiveDropDownList $sender, sender object
* @param TCommandParameter $param parameters object
- * @return none
*/
public function selectClient($sender, $param) {
$client_id = $this->Client->getSelectedValue();
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveRenderer');
+namespace Baculum\Web\Portlets;
/**
* FileSet option renderer.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
-Prado::using('Application.Web.Portlets.ConfigListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\ICallbackEventHandler;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
/**
* Host list template control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Web\Portlets;
+
/**
* Directive field interface.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveSpeed');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Baculum\Web\Portlets\Portlets;
+use Prado\Web\UI\ActiveControls\TCallbackEventParameter;
/**
* Set job bandwidth limit control.
*
* @param TActiveLinkButton $sender sender
* @param TCallbackEventParameter $param callback parameter
- * @return none
*/
public function setupBandwidthLimit($sender, $param) {
$jobid = $this->getJobId();
* Callback event method.
*
* @param mixed $param callback parameter or null
- * @return none
*/
public function onCallback($param) {
$this->raiseEvent('OnCallback', $this, $param);
/**
* Set job jobid.
*
- * @return none;
*/
public function setJobId($jobid) {
$jobid = intval($jobid);
/**
* Set job uname.
*
- * @return none;
*/
public function setJobUname($job_uname) {
$this->setViewState(self::JOB_UNAME, $job_uname);
* Set bandwidth limit value in field.
*
* @param integer $bwlimit bandiwdth limit in bytes
- * @return none
*/
public function setBandwidthLimit($bwlimit) {
$this->BandwidthLimit->setDirectiveValue($bwlimit);
<p><%[ Here you can set bandwidth limit for job. This change is applied on running job. ]%></p>
<p><%[ Setting 0 (zero) value disables bandwidth limitation. ]%></p>
<div class="w3-row w3-section w3-medium">
- <com:Application.Web.Portlets.DirectiveSpeed
+ <com:Baculum.Web.Portlets.DirectiveSpeed
ID="BandwidthLimit"
DirectiveName="BandwidthLimit"
DefaultValue="0"
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.Portlets');
+use Baculum\Web\Portlets\Portlets;
/**
* Job graphs control.
class JobGraphs extends Portlets {
const JOB = 'Job';
+ const CLIENT = 'Client';
public function onInit($param) {
parent::onInit($param);
/**
* Set client to show graphs.
*
- * @return none
*/
public function setClient($client) {
$this->setViewState(self::CLIENT, $client);
/**
* Get client to show graph.
*
- * @return none
*/
public function getClient() {
return $this->getViewState(self::CLIENT);
/**
* Set job to show graphs.
*
- * @return none
*/
public function setJob($job) {
$this->setViewState(self::JOB, $job);
/**
* Get job to show graph.
*
- * @return none
*/
public function getJob() {
return $this->getViewState(self::JOB);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveRepeater');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.WebControls.TListItem');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
/**
* Job list files control.
/**
* Set job identifier to show files.
*
- * @return none
*/
public function setJobId($jobid) {
$jobid = intval($jobid);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveRenderer');
+use Prado\Web\UI\ActiveControls\TActiveLinkButton;
+use Baculum\Web\Portlets\DirectiveRenderer;
/**
* Job runscript renderer.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\TPropertyValue;
+use Baculum\Web\Portlets\Portlets;
/**
* Label volume control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
/**
* Main side-bar control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.Ui.ActiveControls.TActiveRepeater');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
-Prado::using('Application.Web.Portlets.DirectiveCheckBox');
+namespace Baculum\Web\Portlets;
/**
* Message types control.
}
public function getDirectiveValues() {
- $type_controls = $this->RepeaterMessageTypes->findControlsByType('DirectiveCheckBox');
+ $type_controls = $this->RepeaterMessageTypes->findControlsByType('Baculum\Web\Portlets\DirectiveCheckBox');
$is_all = false;
$types = array();
for ($i = 0; $i < count($type_controls); $i++) {
// skip parent repeater items
return;
}
- $control = $this->getChildControl($param->Item, 'DirectiveCheckBox');
+ $control = $this->getChildControl($param->Item, 'Baculum\Web\Portlets\DirectiveCheckBox');
if (is_object($control)) {
$control->setHost($param->Item->Data['host']);
$control->setComponentType($param->Item->Data['component_type']);
<com:TActiveRepeater ID="RepeaterMessageTypes" OnItemCreated="createTypeListElement">
<prop:ItemTemplate>
- <com:Application.Web.Portlets.DirectiveCheckBox />
+ <com:Baculum.Web.Portlets.DirectiveCheckBox />
</prop:ItemTemplate>
</com:TActiveRepeater>
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('Application.Web.Class.WebUserRoles');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
+
+use Baculum\Web\Modules\WebUserRoles;
/**
* Message envelope control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New FileSet exclude menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New FileSet file options menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New FileSet include and exclude menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New messages menu control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New resource menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New runscript menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.DirectiveListTemplate');
+namespace Baculum\Web\Portlets;
/**
* New schedule menu.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\TTemplateControl;
+
/**
* Portlets control base.
*
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
-Prado::using('Application.Web.Portlets.ConfigListTemplate');
+namespace Baculum\Web\Portlets;
+
+use Prado\Web\UI\ActiveControls\IActiveControl;
+use Prado\Web\UI\ActiveControls\ICallbackEventHandler;
+use Prado\Web\UI\ActiveControls\TActiveControlAdapter;
/**
* Resource list template control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
/**
* Resource monitor.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActivePanel');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveCustomValidator');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
+
+use Prado\Prado;
+use stdClass;
/**
* Run job control.
$jobshow = $this->getModule('api')->get(
array('jobs', $jobdata->jobid, 'show'), null, true, self::USE_CACHE
)->output;
- $jobdata->storage = $this->getResourceName('storage', $jobshow);
+ $jsh = $this->getModule('job_info')->parseResourceDirectives($jobshow);
+ $storage = key_exists('storage', $jsh) ? $jsh['storage']['name'] : null;
+ $autochanger = key_exists('autochanger', $jsh) ? $jsh['autochanger']['name'] : null;
+ $jobdata->storage = $storage ?: $autochanger;
}
$storage_list = array();
$storages = $this->getModule('api')->get(array('storages'), null, true, self::USE_CACHE)->output;
/**
* set jobid to run job again.
*
- * @return none;
*/
public function setJobId($jobid) {
$jobid = intval($jobid);
/**
* set job name to run job again.
*
- * @return none;
*/
public function setJobName($job_name) {
$this->setViewState(self::JOB_NAME, $job_name);
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.JuiControls.TJuiDatePicker');
-Prado::using('System.Web.UI.ActiveControls.TActiveLinkButton');
-Prado::using('Application.Web.Portlets.Portlets');
+namespace Baculum\Web\Portlets;
+
+use Prado\TPropertyValue;
/**
* Schedule status control.
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
-Prado::using('System.Web.UI.ActiveControls.TCallback');
-Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
-Prado::using('System.Web.UI.ActiveControls.TActiveDropDownList');
-Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
-Prado::using('Application.Web.Portlets.Portlets');
+use Prado\TPropertyValue;
+use Baculum\Web\Portlets\Portlets;
/**
* Update slots control.
<application id="baculum" mode="Debug">
<paths>
<using namespace="System.I18N.*" />
- <using namespace="Application.Common.Portlets.BButton" />
- <using namespace="Application.Common.Portlets.BActiveButton" />
- <using namespace="Application.Common.Class.BClientScript" />
- <using namespace="Application.Common.Class.BStyleSheet" />
+ <alias id="Baculum" path="" />
+ <using namespace="Baculum.Common.Modules.*" />
+ <using namespace="Baculum.Common.Portlets.*" />
</paths>
<modules>
<!-- generic common modules -->
- <module id="asset" class="Application.Common.Class.BAssetManager" />
- <module id="logging" class="Application.Common.Class.Logging" />
- <module id="misc" class="Application.Common.Class.Miscellaneous" />
- <module id="config_ini" class="Application.Common.Class.ConfigIni" />
- <module id="config_bacula" class="Application.Common.Class.ConfigBacula" />
+ <module id="asset" class="Baculum\Common\Modules\BAssetManager" />
+ <module id="logging" class="Baculum\Common\Modules\Logging" />
+ <module id="misc" class="Baculum\Common\Modules\Miscellaneous" />
+ <module id="config_ini" class="Baculum\Common\Modules\ConfigIni" />
+ <module id="config_bacula" class="Baculum\Common\Modules\ConfigBacula" />
<!-- authentication and authorization modules -->
- <module id="auth_basic" class="Application.Common.Class.AuthBasic" />
- <module id="auth_oauth2" class="Application.Common.Class.AuthOAuth2" />
- <module id="ldap" class="Application.Common.Class.Ldap" />
+ <module id="auth_basic" class="Baculum\Common\Modules\AuthBasic" />
+ <module id="auth_oauth2" class="Baculum\Common\Modules\AuthOAuth2" />
+ <module id="ldap" class="Baculum\Common\Modules\Ldap" />
<!-- cryptographic modules -->
- <module id="crypto" class="Application.Common.Class.Crypto" />
- <module id="apr1md5" class="Application.Common.Class.Apr1Md5" />
- <module id="bcrypt" class="Application.Common.Class.BCrypt" />
- <module id="sha1" class="Application.Common.Class.Sha1" />
- <module id="ssha1" class="Application.Common.Class.Ssha1" />
- <module id="sha256" class="Application.Common.Class.Sha256" />
- <module id="sha512" class="Application.Common.Class.Sha512" />
+ <module id="crypto" class="Baculum\Common\Modules\Crypto" />
+ <module id="apr1md5" class="Baculum\Common\Modules\Apr1Md5" />
+ <module id="bcrypt" class="Baculum\Common\Modules\BCrypt" />
+ <module id="sha1" class="Baculum\Common\Modules\Sha1" />
+ <module id="ssha1" class="Baculum\Common\Modules\Ssha1" />
+ <module id="sha256" class="Baculum\Common\Modules\Sha256" />
+ <module id="sha512" class="Baculum\Common\Modules\Sha512" />
<!-- communication modules -->
<module id="request" class="THttpRequest" UrlManager="url_manager" UrlFormat="HiddenPath" />
- <module id="url_manager" class="Application.Common.Class.BaculumUrlMapping" EnableCustomUrl="true" />
+ <module id="url_manager" class="Baculum\Common\Modules\BaculumUrlMapping" EnableCustomUrl="true" />
</modules>
<services>
- <service id="page" class="TPageService" BasePath="Application.Common.Pages" DefaultPage="CommonPage" />
- <service id="oauth" class="TPageService" BasePath="Application.API.Pages.OAuth2" DefaultPage="Authorize" />
- <service id="api" class="TPageService" BasePath="Application.API.Pages.API" DefaultPage="Welcome" />
- <service id="panel" class="TPageService" BasePath="Application.API.Pages.Panel" DefaultPage="APIHome" />
- <service id="web" class="TPageService" BasePath="Application.Web.Pages" DefaultPage="Dashboard" />
+ <service id="page" class="TPageService" BasePath="Baculum.Common.Pages" DefaultPage="CommonPage" />
+ <service id="oauth" class="TPageService" BasePath="Baculum.API.Pages.OAuth2" DefaultPage="Authorize" />
+ <service id="api" class="TPageService" BasePath="Baculum.API.Pages.API" DefaultPage="Welcome" />
+ <service id="panel" class="TPageService" BasePath="Baculum.API.Pages.Panel" DefaultPage="APIHome" />
+ <service id="web" class="TPageService" BasePath="Baculum.Web.Pages" DefaultPage="Dashboard" />
</services>
</application>
$namespaces = [
'Prado\\' => APPLICATION_DIRECTORY . '/protected/vendor/pradosoft/prado/framework',
- 'JSMin\\' => APPLICATION_DIRECTORY . '/protected/vendor/mrclay/jsmin-php/src/JSMin'
+ 'JSMin\\' => APPLICATION_DIRECTORY . '/protected/vendor/mrclay/jsmin-php/src/JSMin',
+ 'Baculum\\' => APPLICATION_DIRECTORY . '/protected'
];
class BaculumAutoloader {