1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

Fixes #771 - System Log preferences not being saved.

This commit is contained in:
Cameron 2014-10-14 16:23:16 -07:00
parent dc4a6c938f
commit 238864b66a
4 changed files with 18 additions and 13 deletions

View File

@ -123,7 +123,7 @@ class admin_log_ui extends e_admin_ui
{
protected $pluginTitle = ADLAN_155;
protected $pluginName = 'adminlog';
protected $pluginName = 'core';
protected $table = 'admin_log';
protected $pid = 'dblog_id';
protected $perPage = 10;
@ -159,7 +159,7 @@ class admin_log_ui extends e_admin_ui
'user_audit_class' => array('title'=> RL_LAN_123, 'type'=>'userclass', 'data' => 'int','help'=>''),
'user_audit_opts' => array('title'=> RL_LAN_031, 'type'=>'method', 'data' => 'array','help'=>''),
'roll_log_active' => array('title'=> RL_LAN_008, 'type'=>'boolean', 'data' => 'int','help'=>''),
'roll_log_days' => array('title'=> RL_LAN_009, 'type'=>'text', 'data' => 'string','help'=>''),
'roll_log_days' => array('title'=> RL_LAN_009, 'type'=>'number', 'data' => 'string','help'=>''),
// 'Delete admin log events older than ' => array('title'=> RL_LAN_045, 'type'=>'method', 'data' => 'string','help'=>'Help Text goes here'),
// 'Delete user audit trail log events older' => array('title'=> 'Delete user audit trail log events older', 'type'=>'method', 'data' => 'string','help'=>'Help Text goes here'),
);
@ -184,7 +184,10 @@ class admin_log_ui extends e_admin_ui
// optional
public function init()
{
$this->prefs['sys_log_perpage']['writeParms'] = array(10, 20, 30, 40, 50);
$perPage = e107::getConfig()->get('sys_log_perpage');
$this->perPage = vartrue($perPage,10);
$this->prefs['sys_log_perpage']['writeParms'] = array(10=>10, 20=>20, 30=>30, 40=>40, 50=>50);
$sql = e107::getDb();
@ -382,7 +385,7 @@ class admin_log_form_ui extends e_admin_form_ui
function user_audit_opts($curVal,$mode)
{
$pref = e107::getPref();
$frm = e107::getForm();
// User Audit log options (for info)
@ -407,15 +410,14 @@ class admin_log_form_ui extends e_admin_form_ui
USER_AUDIT_ADD_ADMIN => RL_LAN_080, USER_AUDIT_MAIL_BOUNCE => RL_LAN_081, USER_AUDIT_BANNED => RL_LAN_082, USER_AUDIT_BOUNCE_RESET => RL_LAN_083,
USER_AUDIT_TEMP_ACCOUNT => RL_LAN_084);
$user_signup_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
$userAuditOpts = e107::getConfig()->get('user_audit_opts');
$text = "";
foreach($audit_checkboxes as $k => $t)
{
$checked = isset($user_signup_opts[$k]) ? true : false;
$text .= $frm->checkbox('user_audit_opts[]',$k, $checked, array('label'=>$t));
$checked = isset($userAuditOpts[$k]) ? true : false;
$text .= $frm->checkbox('user_audit_opts['.$k.']',$k, $checked, array('label'=>$t));
}
$text .= $frm->admin_button('check_all', 'jstarget:user_audit_opts', 'checkall', LAN_CHECKALL).$frm->admin_button('uncheck_all', 'jstarget:user_audit_opts', 'checkall', LAN_UNCHECKALL);
@ -807,7 +809,7 @@ $mes = e107::getMessage();
$frm = e107::getForm();
define('AL_DATE_TIME_FORMAT', 'y-m-d H:i:s');
/*
if(isset($_POST['setoptions']))
{
unset($temp);
@ -839,6 +841,7 @@ if(isset($_POST['setoptions']))
}
}
*/
$ns->tablerender($caption, $mes->render() . $text);

View File

@ -151,7 +151,8 @@ else
$class_list[] = e_UC_MEMBER;
$class_list[] = e_UC_PUBLIC;
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'], ''), $class_list))
{ // Need to note in user audit trail
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, '', $user_id, $user_name);

View File

@ -383,12 +383,13 @@ class e_admin_log
*/
function user_audit($event_type, $event_data, $id = '', $u_name = '')
{
global $e107,$tp,$pref;
global $e107,$tp;
list($time_usec, $time_sec) = explode(" ", microtime()); // Log event time immediately to minimise uncertainty
$time_usec = $time_usec * 1000000;
// See whether we should log this
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
if (!isset($user_logging_opts[$event_type]))
return; // Finished if not set to log this event type

View File

@ -629,7 +629,7 @@ if ($dataToSave && !$promptPassword)
// Now see if we need to log anything. First check the options and class membership
// (Normally we would leave logging decision to the log class. But this one's a bit more complicated)
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
$do_log = array();
$log_action = '';
if ($_uid)