aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Admin/Logs.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-06 11:05:22 +0000
committerMario <mario@mariovavti.com>2024-07-06 11:05:22 +0000
commit45275910e606a02b12393714ea3b0409da440d61 (patch)
tree10b2d173d58cb930f8df28fe75af73dd4974c08c /Zotlabs/Module/Admin/Logs.php
parent0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff)
parentc04e781926a78e514cdf211fa24930a331149072 (diff)
downloadvolse-hubzilla-master.tar.gz
volse-hubzilla-master.tar.bz2
volse-hubzilla-master.zip
Merge branch '9.2RC'master
Diffstat (limited to 'Zotlabs/Module/Admin/Logs.php')
-rw-r--r--Zotlabs/Module/Admin/Logs.php49
1 files changed, 25 insertions, 24 deletions
diff --git a/Zotlabs/Module/Admin/Logs.php b/Zotlabs/Module/Admin/Logs.php
index c83fc6a9a..73c890e26 100644
--- a/Zotlabs/Module/Admin/Logs.php
+++ b/Zotlabs/Module/Admin/Logs.php
@@ -2,11 +2,12 @@
namespace Zotlabs\Module\Admin;
+use Zotlabs\Lib\Config;
class Logs {
-
+
/**
* @brief POST handler for logs admin page.
*
@@ -15,20 +16,20 @@ class Logs {
function post() {
if (x($_POST, 'page_logs')) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
-
+
$logfile = ((x($_POST,'logfile')) ? notags(trim($_POST['logfile'])) : '');
$debugging = ((x($_POST,'debugging')) ? true : false);
$loglevel = ((x($_POST,'loglevel')) ? intval(trim($_POST['loglevel'])) : 0);
-
- set_config('system','logfile', $logfile);
- set_config('system','debugging', $debugging);
- set_config('system','loglevel', $loglevel);
+
+ Config::Set('system','logfile', $logfile);
+ Config::Set('system','debugging', $debugging);
+ Config::Set('system','loglevel', $loglevel);
}
-
+
info( t('Log settings updated.') );
goaway(z_root() . '/admin/logs' );
}
-
+
/**
* @brief Logs admin page.
*
@@ -36,7 +37,7 @@ class Logs {
*/
function get() {
-
+
$log_choices = Array(
LOGGER_NORMAL => 'Normal',
LOGGER_TRACE => 'Trace',
@@ -44,15 +45,15 @@ class Logs {
LOGGER_DATA => 'Data',
LOGGER_ALL => 'All'
);
-
+
$t = get_markup_template('admin_logs.tpl');
-
- $f = get_config('system', 'logfile');
-
+
+ $f = Config::Get('system', 'logfile');
+
$data = '';
-
+
if(!file_exists($f)) {
- $data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is
+ $data = t("Error trying to open <strong>$f</strong> log file.\r\n<br/>Check to see if file $f exist and is
readable.");
}
else {
@@ -77,7 +78,7 @@ class Logs {
fclose($fp);
}
}
-
+
return replace_macros($t, array(
'$title' => t('Administration'),
'$page' => t('Logs'),
@@ -85,17 +86,17 @@ class Logs {
'$clear' => t('Clear'),
'$data' => $data,
'$baseurl' => z_root(),
- '$logname' => get_config('system','logfile'),
-
+ '$logname' => Config::Get('system','logfile'),
+
// name, label, value, help string, extra data...
- '$debugging' => array('debugging', t("Debugging"),get_config('system','debugging'), ""),
- '$logfile' => array('logfile', t("Log file"), get_config('system','logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")),
- '$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices),
-
+ '$debugging' => array('debugging', t("Debugging"),Config::Get('system','debugging'), ""),
+ '$logfile' => array('logfile', t("Log file"), Config::Get('system','logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")),
+ '$loglevel' => array('loglevel', t("Log level"), Config::Get('system','loglevel'), "", $log_choices),
+
'$form_security_token' => get_form_security_token('admin_logs'),
));
}
-
-} \ No newline at end of file
+
+}