Skip to content

Commit

Permalink
MDL-25152 guest logging can be disabled now
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Nov 11, 2010
1 parent e7f93d5 commit f11f7b4
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion admin/settings/server.php
Original file line number Diff line number Diff line change
@@ -185,6 +185,8 @@
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_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'),
2 changes: 2 additions & 0 deletions lang/en/admin.php
Original file line number Diff line number Diff line change
@@ -658,6 +658,8 @@
$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>';
6 changes: 6 additions & 0 deletions lib/datalib.php
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f11f7b4

Please sign in to comment.