mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merged from MOODLE_15_STABLE : Much better namespace collision fix to apacheloguser thing
This commit is contained in:
parent
9238584876
commit
2b287cacba
1 changed files with 9 additions and 9 deletions
|
@ -427,26 +427,26 @@ $CFG->httpswwwroot = $CFG->wwwroot;
|
||||||
/// Apache log intergration. In apache conf file one can use ${MOODULEUSER}n in
|
/// Apache log intergration. In apache conf file one can use ${MOODULEUSER}n in
|
||||||
/// LogFormat to get the current logged in username in moodle.
|
/// LogFormat to get the current logged in username in moodle.
|
||||||
if ($USER && function_exists('apache_note') && !empty($CFG->apacheloguser)) {
|
if ($USER && function_exists('apache_note') && !empty($CFG->apacheloguser)) {
|
||||||
$username = clean_filename($USER->username);
|
$apachelog_username = clean_filename($USER->username);
|
||||||
$name = clean_filename($USER->firstname. " ".$USER->lastname);
|
$apachelog_name = clean_filename($USER->firstname. " ".$USER->lastname);
|
||||||
$userid = $USER->id;
|
$apachelog_userid = $USER->id;
|
||||||
if (isset($USER->realuser)) {
|
if (isset($USER->realuser)) {
|
||||||
if ($realuser = get_record('user', 'id', $USER->realuser)) {
|
if ($realuser = get_record('user', 'id', $USER->realuser)) {
|
||||||
$username = clean_filename($realuser->username." as ".$username);
|
$apachelog_username = clean_filename($realuser->username." as ".$apachelog_username);
|
||||||
$name = clean_filename($realuser->firstname." ".$realuser->lastname ." as ".$name);
|
$apachelog_name = clean_filename($realuser->firstname." ".$realuser->lastname ." as ".$apachelog_name);
|
||||||
$userid = clean_filename($realuser->id." as ".$userid);
|
$apachelog_userid = clean_filename($realuser->id." as ".$apachelog_userid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch ($CFG->apacheloguser) {
|
switch ($CFG->apacheloguser) {
|
||||||
case 3:
|
case 3:
|
||||||
$logname = $username;
|
$logname = $apachelog_username;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$logname = $name;
|
$logname = $apachelog_name;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
$logname = $userid;
|
$logname = $apachelog_userid;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
apache_note('MOODLEUSER', $logname);
|
apache_note('MOODLEUSER', $logname);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue