Commit f11f7b41 authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-25152 guest logging can be disabled now

parent e7f93d5c
......@@ -185,6 +185,8 @@ $temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('d
48 => get_string('numdays', '', 2),
24 => get_string('numdays', '', 1))));
$temp->add(new admin_setting_configcheckbox('logguests', get_string('logguests', 'admin'),
get_string('logguests_help', 'admin'), 1));
$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
1000 => get_string('numdays', '', 1000),
365 => get_string('numdays', '', 365),
......@@ -200,7 +202,7 @@ $temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime
$temp->add(new admin_setting_configcheckbox('disablegradehistory', get_string('disablegradehistory', 'grades'),
get_string('disablegradehistory_help', 'grades'), 0, PARAM_INT));
get_string('disablegradehistory_help', 'grades'), 0));
$temp->add(new admin_setting_configselect('gradehistorylifetime', get_string('gradehistorylifetime', 'grades'),
get_string('gradehistorylifetime_help', 'grades'), 0, array(0 => get_string('neverdeletehistory', 'grades'),
......
......@@ -658,6 +658,8 @@ $string['location'] = 'Location';
$string['locationsettings'] = 'Location settings';
$string['locked'] = 'locked';
$string['log'] = 'Logs';
$string['logguests'] = 'Log guest access';
$string['logguests_help'] = 'This setting enables logging of actions by guest account and not logged in users. High profile sites may want to disable this logging for performance reasons. It is recommended to keep this setting enabled on production sites.';
$string['loginhttps'] = 'Use HTTPS for logins';
$string['loglifetime'] = 'Keep logs for';
$string['longtimewarning'] = '<b>Please note that this process can take a long time.</b>';
......
......@@ -1645,6 +1645,12 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
$userid = empty($USER->id) ? '0' : $USER->id;
}
if (isset($CFG->logguests) and !$CFG->logguests) {
if (!$userid or isguestuser($userid)) {
return;
}
}
$REMOTE_ADDR = getremoteaddr();
$timenow = time();
......
......@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2010111000; // YYYYMMDD = date of the last version bump
$version = 2010111001; // YYYYMMDD = date of the last version bump
// XX = daily increments
$release = '2.0 RC1 (Build: 20101111)'; // Human-friendly version name
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment