Commit c819851b authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1978425: Adjust event log option 'masq' to 'masquerade'



To make things easier to read in registration data

Change-Id: Ibbdc7bc3e53f29712b571401de6b3ca1bd59463a
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 6ef59892
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ $siteoptionform = array(
                    'defaultvalue' => get_config('eventloglevel'),
                    'options'      => array(
                        'none'       => get_string('eventloglevelnone', 'admin'),
                        'masq' => get_string('eventloglevelmasq', 'admin'),
                        'masquerade' => get_string('eventloglevelmasq', 'admin'),
                        'all'        => get_string('eventloglevelall', 'admin'),
                    ),
                    'help'         => true,
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ $string['cliinstallerdescription'] = 'Install Mahara and create required data di
$string['cliinstallingmahara'] = 'Installing Mahara';
$string['versionnumber'] = 'Version: %s';
$string['plugintype'] = 'Plugin: %s';
$string['updateeventlogconfigoption'] = 'The value for $cfg->eventloglevel may need to be updated from "masq" to "masquerade" in your config.php file.';

// CLI upgrade script
$string['cli_upgrade_description'] = 'Upgrade the Mahara database and data to the version of Mahara installed.';
+5 −5
Original line number Diff line number Diff line
@@ -1718,7 +1718,7 @@ $cfg->saml_log_attributes = false;
 *
 * Valid values:
 *  - none       : Nothing is logged in the database.
 *  - masq : Only masquerading sessions are logged. This setting needs to be
 *  - masquerade : Only masquerading sessions are logged. This setting needs to be
 *                 turned on if you wish to report on administrator masquerading of
 *                 account holders.
 *  - all        : All events that can be logged in the database are logged.
+7 −0
Original line number Diff line number Diff line
@@ -2465,5 +2465,12 @@ function xmldb_core_upgrade($oldversion=0) {
        }
    }

    if ($oldversion < 2021080222) {
        if (get_config('eventloglevel') === 'masq') {
            set_config('eventloglevel', 'masquerade');
            log_warn(get_string('updateeventlogconfigoption', 'admin'), true, false);
        }
    }

    return $status;
}
+1 −1
Original line number Diff line number Diff line
@@ -2131,7 +2131,7 @@ function handle_event($event, $data, $ignorefields = array()) {
    $parentuser = $USER->get('parentuser');
    $eventloglevel = get_config('eventloglevel');
    if ($eventloglevel === 'all'
            or ($parentuser and $eventloglevel === 'masq')) {
            or ($parentuser and $eventloglevel === 'masquerade')) {
        $logentry = (object) array(
            'usr'      => $USER->get('id'),
            'realusr'  => $parentuser ? $parentuser->id : $USER->get('id'),
Loading