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:
moodler 2004-01-25 09:37:28 +00:00
parent 0609562b64
commit 18845ac357

View File

@ -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();
}
}
}
}
?>