mirror of
https://github.com/moodle/moodle.git
synced 2025-03-18 22:50:19 +01:00
If $CFG->opentogoogle is defined then
- google can get in as guest - visitiors referred from google get in as guest
This commit is contained in:
parent
0609562b64
commit
18845ac357
@ -228,4 +228,19 @@
|
||||
setlocale (LC_CTYPE, $CFG->locale);
|
||||
}
|
||||
|
||||
if (!empty($CFG->opentogoogle)) {
|
||||
if (empty($_SESSION['USER'])) {
|
||||
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
|
||||
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Googlebot') !== false ) {
|
||||
$USER = guest_user();
|
||||
}
|
||||
}
|
||||
if (empty($_SESSION['USER']) and !empty($_SERVER['HTTP_REFERER'])) {
|
||||
if (strpos($_SERVER['HTTP_REFERER'], 'google') !== false ) {
|
||||
$USER = guest_user();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user