diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-14 11:54:14 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-14 11:54:14 +0200 |
commit | 25d1637ec4b980d6ac8daf2f028f0ff579d5c977 (patch) | |
tree | b3c810eb4987bfed4a6596305993935444dcdef7 /mod/admin.php | |
parent | 5dc8fbccb29169601ad5fed2b5289631e32e5ac5 (diff) | |
download | volse-hubzilla-25d1637ec4b980d6ac8daf2f028f0ff579d5c977.tar.gz volse-hubzilla-25d1637ec4b980d6ac8daf2f028f0ff579d5c977.tar.bz2 volse-hubzilla-25d1637ec4b980d6ac8daf2f028f0ff579d5c977.zip |
simple plugin details and log view in admin
Diffstat (limited to 'mod/admin.php')
-rw-r--r-- | mod/admin.php | 58 |
1 files changed, 56 insertions, 2 deletions
diff --git a/mod/admin.php b/mod/admin.php index 054b49a21..e40c50396 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -19,10 +19,12 @@ function admin_post(&$a){ // urls if ($a->argc > 1){ switch ($a->argv[1]){ - case 'site': { + case 'site': admin_page_site_post($a); break; - } + case 'logs': + admin_page_logs_post($a); + break; } } @@ -83,6 +85,9 @@ function admin_content(&$a) { case 'plugins': $o = admin_page_plugins($a); break; + case 'logs': + $o = admin_page_logs($a); + break; default: notice( t("Item not found.") ); } @@ -386,3 +391,52 @@ function admin_page_plugins(&$a){ )); } + +/** + * Logs admin page + */ + +function admin_page_logs_post(&$a) { + if (x($_POST,"page_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); + + + } + + goaway($a->get_baseurl() . '/admin/logs' ); + return; // NOTREACHED +} + +function admin_page_logs(&$a){ + + $log_choices = Array( + LOGGER_NORMAL => 'Normal', + LOGGER_TRACE => 'Trace', + LOGGER_DEBUG => 'Debug', + LOGGER_DATA => 'Data', + LOGGER_ALL => 'All' + ); + + $t = get_markup_template("admin_logs.tpl"); + return replace_macros($t, array( + '$title' => t('Administration'), + '$page' => t('Logs'), + '$submit' => t('Submit'), + '$clear' => t('Clear'), + '$baseurl' => $a->get_baseurl(), + '$logname' => get_config('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'), "Must be writable by web server. Relative to your Friendika index.php."), + '$loglevel' => array('loglevel', t("Log level"), get_config('system','loglevel'), "", $log_choices), + )); +} + |