Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bacula Community Edition
Bacula Community
Commits
d07be344
Commit
d07be344
authored
Dec 13, 2022
by
Marcin Haba
Browse files
baculum: Add option to enable/disable audit log
parent
e654a550
Changes
12
Hide whitespace changes
Inline
Side-by-side
gui/baculum/protected/API/Lang/en/messages.mo
View file @
d07be344
No preview for this file type
gui/baculum/protected/API/Lang/en/messages.po
View file @
d07be344
...
...
@@ -688,3 +688,6 @@ msgstr "Configs:"
msgid "Dedicated Bconsole config"
msgstr "Dedicated Bconsole config"
msgid "Audit log:"
msgstr "Audit log:"
gui/baculum/protected/API/Lang/pl/messages.mo
View file @
d07be344
No preview for this file type
gui/baculum/protected/API/Lang/pl/messages.po
View file @
d07be344
...
...
@@ -694,3 +694,6 @@ msgstr "Pliki konfig.:"
msgid "Dedicated Bconsole config"
msgstr "Dedykowana konfiguracja Bconsole"
msgid "Audit log:"
msgstr "Audit log:"
gui/baculum/protected/API/Lang/pt/messages.mo
View file @
d07be344
No preview for this file type
gui/baculum/protected/API/Lang/pt/messages.po
View file @
d07be344
...
...
@@ -695,3 +695,6 @@ msgstr "Configurações:"
msgid "Dedicated Bconsole config"
msgstr "Configuração do Bconsole dedicado"
msgid "Audit log:"
msgstr "Audit log:"
gui/baculum/protected/API/Lang/ru/messages.mo
View file @
d07be344
No preview for this file type
gui/baculum/protected/API/Lang/ru/messages.po
View file @
d07be344
...
...
@@ -695,3 +695,6 @@ msgstr "Настройка:"
msgid "Dedicated Bconsole config"
msgstr "Выделенная Bconsole"
msgid "Audit log:"
msgstr "Audit log:"
gui/baculum/protected/API/Modules/BaculumAPIServer.php
View file @
d07be344
...
...
@@ -173,6 +173,7 @@ abstract class BaculumAPIServer extends TPage {
$config
=
$this
->
getModule
(
'api_config'
)
->
getConfig
(
'api'
);
Logging
::
$audit_enabled
=
(
!
key_exists
(
'audit_log'
,
$config
)
||
$config
[
'audit_log'
]
==
1
);
Logging
::
$debug_enabled
=
(
key_exists
(
'debug'
,
$config
)
&&
$config
[
'debug'
]
==
1
);
if
(
$this
->
authenticate
()
===
false
)
{
...
...
gui/baculum/protected/API/Pages/Panel/APISettings.page
View file @
d07be344
...
...
@@ -31,6 +31,15 @@
</com:TActiveDropDownList>
</div>
</div>
<div class="w3-row w3-section">
<div class="w3-col w3-quarter"><com:TLabel ForControl="GeneralAuditLog" Text="<%[ Audit log: ]%>" /></div>
<div class="w3-col w3-threequarter">
<com:TActiveCheckBox
ID="GeneralAuditLog"
CssClass="w3-check"
/>
</div>
</div>
<div class="w3-row w3-section">
<div class="w3-col w3-quarter"><com:TLabel ForControl="GeneralDebug" Text="<%[ Debug: ]%>" /></div>
<div class="w3-col w3-threequarter">
...
...
gui/baculum/protected/API/Pages/Panel/APISettings.php
View file @
d07be344
...
...
@@ -64,6 +64,8 @@ class APISettings extends BaculumAPIPage {
return
;
}
$this
->
GeneralLang
->
SelectedValue
=
$this
->
config
[
'api'
][
'lang'
];
// NOTE: Default audit log is enabled
$this
->
GeneralAuditLog
->
Checked
=
(
!
key_exists
(
'audit_log'
,
$this
->
config
[
'api'
])
||
$this
->
config
[
'api'
][
'audit_log'
]
==
1
);
$this
->
GeneralDebug
->
Checked
=
(
$this
->
config
[
'api'
][
'debug'
]
==
1
);
}
...
...
@@ -393,6 +395,7 @@ class APISettings extends BaculumAPIPage {
$reload_page
=
true
;
}
$this
->
config
[
'api'
][
'lang'
]
=
$this
->
GeneralLang
->
SelectedValue
;
$this
->
config
[
'api'
][
'audit_log'
]
=
$this
->
GeneralAuditLog
->
Checked
?
1
:
0
;
$this
->
config
[
'api'
][
'debug'
]
=
$this
->
GeneralDebug
->
Checked
?
1
:
0
;
$this
->
getModule
(
'api_config'
)
->
setConfig
(
$this
->
config
);
if
(
$reload_page
)
{
...
...
gui/baculum/protected/Common/Modules/Logging.php
View file @
d07be344
...
...
@@ -41,6 +41,14 @@ class Logging extends CommonModule {
*/
public
static
$debug_enabled
=
false
;
/*
* Stores audit enable state.
* Default audit log is enabled.
*
* @var bool
*/
public
static
$audit_enabled
=
true
;
/**
* Log categories.
*/
...
...
@@ -72,7 +80,7 @@ class Logging extends CommonModule {
*/
private
function
isEnabled
(
$category
)
{
$is_enabled
=
false
;
if
(
self
::
$debug_enabled
===
true
||
$category
===
self
::
CATEGORY_AUDIT
)
{
if
(
(
self
::
$debug_enabled
===
true
&&
$category
!==
self
::
CATEGORY_AUDIT
)
||
(
self
::
$audit_enabled
===
true
&&
$category
===
self
::
CATEGORY_AUDIT
)
)
{
// NOTE: Audit log is written always, it is not possible to disable it
$is_enabled
=
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment