diff --git a/Web/Pages/ApplicationSettings.php b/Web/Pages/ApplicationSettings.php index 492beea..419af83 100644 --- a/Web/Pages/ApplicationSettings.php +++ b/Web/Pages/ApplicationSettings.php @@ -129,6 +129,12 @@ public function saveGeneral($sender, $param) $web_config = $this->getModule('web_config'); $web_config->setConfig($this->web_config); $web_config->setLanguage($this->Language->SelectedValue); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_APPLICATION, + "Save application general settings" + ); } } @@ -151,6 +157,12 @@ public function saveDisplay($sender, $param) $this->web_config['baculum']['date_time_format'] = $this->DateTimeFormat->Text; $this->web_config['baculum']['job_age_on_job_status_graph'] = $this->JobAgeOnJobStatusGraph->getValue(); $this->getModule('web_config')->setConfig($this->web_config); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_APPLICATION, + "Save application display settings" + ); } } @@ -159,6 +171,12 @@ public function saveFeatures($sender, $param) if (count($this->web_config) > 0) { $this->web_config['baculum']['enable_messages_log'] = ($this->EnableMessagesLog->Checked === true) ? 1 : 0; $this->getModule('web_config')->setConfig($this->web_config); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_APPLICATION, + "Save application features settings" + ); } } @@ -233,11 +251,21 @@ public function startSelfTest($sender, $param): void 'oAppSettingsSelfTest.load_table_cb', [$result->output] ); + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_APPLICATION, + "Run application self test" + ); } else { $this->getCallbackClient()->callClientFunction( 'oAppSettingsSelfTest.set_error', [$result->output] ); + $this->getModule('audit')->audit( + AuditLog::TYPE_ERROR, + AuditLog::CATEGORY_APPLICATION, + "Error while running application self test" + ); } } } diff --git a/Web/Pages/Deployment.php b/Web/Pages/Deployment.php index 3a7f7c1..8c81e30 100644 --- a/Web/Pages/Deployment.php +++ b/Web/Pages/Deployment.php @@ -1462,6 +1462,12 @@ public function deployAPIAccessLink($sender, $param) [$step_id, $url] ); + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_APPLICATION, + "New API has been deployed to host: {$host}" + ); + // It is last step. Add new API host to host config $this->saveAPIHost( $host, diff --git a/Web/Pages/NewVirtualFullJobWizard.php b/Web/Pages/NewVirtualFullJobWizard.php index 8f921c0..80ff9bd 100644 --- a/Web/Pages/NewVirtualFullJobWizard.php +++ b/Web/Pages/NewVirtualFullJobWizard.php @@ -13,6 +13,7 @@ * terms pursuant to its AGPLv3 Section 7. */ +use Bacularis\Common\Modules\AuditLog; use Bacularis\Common\Modules\Params; use Bacularis\Web\Modules\BaculumWebPage; use Prado\Web\Javascripts\TJavaScript; @@ -860,10 +861,20 @@ public function wizardCompleted($sender, $param) ); if ($result->error === 0) { $this->getModule('api')->set(['console'], ['reload']); + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_CONFIG, + "Create new virtual full backup job. Name: {$job['Name']}" + ); $this->goToPage('JobList'); } else { $this->CreateResourceErrMsg->Display = 'Dynamic'; $this->CreateResourceErrMsg->Text = $result->output; + $this->getModule('audit')->audit( + AuditLog::TYPE_ERROR, + AuditLog::CATEGORY_CONFIG, + "Error while creating new virtual full backup job. Name: {$job['Name']}, Error: {$result->error}, Output: {$result->output}" + ); } } diff --git a/Web/Pages/Patterns.php b/Web/Pages/Patterns.php index 6584a00..ec32121 100644 --- a/Web/Pages/Patterns.php +++ b/Web/Pages/Patterns.php @@ -14,6 +14,7 @@ */ use Prado\Prado; +use Bacularis\Common\Modules\AuditLog; use Bacularis\Web\Modules\BaculumWebPage; use Bacularis\Web\Modules\ConfigConfig; use Bacularis\Web\Modules\PatternConfig; @@ -194,6 +195,12 @@ public function saveConfigs($sender, $param) // update config list $this->loadConfigList(null, null); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_CONFIG, + "Save config. Name: {$name}" + ); } else { $cb->callClientFunction( 'oConfig.show_error', @@ -202,6 +209,11 @@ public function saveConfigs($sender, $param) Prado::localize('Error while writing config.') ] ); + $this->getModule('audit')->audit( + AuditLog::TYPE_ERROR, + AuditLog::CATEGORY_CONFIG, + "Error while saving config. Name: {$name}" + ); } } @@ -246,6 +258,12 @@ public function removeConfigs($sender, $param) // update config list $this->loadConfigList(null, null); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_CONFIG, + "Remove configs. Name: {$names}" + ); } public function loadPattern($sender, $param) @@ -338,6 +356,12 @@ public function savePattern($sender, $param) // update config list $this->loadConfigList(null, null); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_CONFIG, + "Save pattern. Name: {$name}" + ); } else { $cb->callClientFunction( 'oPattern.show_error', @@ -346,6 +370,12 @@ public function savePattern($sender, $param) Prado::localize('Error while writing pattern.') ] ); + + $this->getModule('audit')->audit( + AuditLog::TYPE_ERROR, + AuditLog::CATEGORY_CONFIG, + "Error while saving pattern. Name: {$name}" + ); } } @@ -366,5 +396,11 @@ public function removePatterns($sender, $param) // update config list $this->loadConfigList(null, null); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_CONFIG, + "Remove patterns. Name: {$names}" + ); } } diff --git a/Web/Pages/Security.php b/Web/Pages/Security.php index 0a198ca..3b1e628 100644 --- a/Web/Pages/Security.php +++ b/Web/Pages/Security.php @@ -2398,6 +2398,12 @@ public function saveUserAPIHostResourceAccess($sender, $param) $api_host, 'user_access_window_error' ); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_SECURITY, + "Save user API host access to resources. API host: $api_host" + ); } /** @@ -2480,6 +2486,12 @@ public function saveAPIHostResourceAccess($sender, $param) $api_host, 'api_host_access_window_error' ); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_SECURITY, + "Save API host access to resources. API host: $api_host" + ); } /** @@ -3291,5 +3303,11 @@ public function saveAPIHostGroupAPIHostResourceAccess($sender, $param) $api_host, 'api_host_group_access_window_error' ); + + $this->getModule('audit')->audit( + AuditLog::TYPE_INFO, + AuditLog::CATEGORY_SECURITY, + "Save API host group access to resources. API host: $api_host" + ); } }