require_once("../config.php");
- $loginguest = optional_param('loginguest', 0, PARAM_BOOL); // determines whether visitors are logged in as guest automatically
+ $loginguest = optional_param('loginguest', 0, PARAM_BOOL); // determines whether visitors are logged in as guest automatically
+ $testcookies = optional_param('testcookies', 0, PARAM_BOOL); // request cookie test
//initialize variables
$errormsg = '';
/// Check if the user has actually submitted login data to us
- if (empty($CFG->usesid) and $frm and (get_moodle_cookie() == '') and ($frm->username!='guest') and !$user and empty($CFG->alternateloginurl)) { // Login without cookie
+ if (empty($CFG->usesid) and $testcookies and (get_moodle_cookie() == '')) { // Login without cookie when test requested
$errormsg = get_string("cookiesnotenabled");
</td>
<td width="20%">
<input type="submit" value="<?php print_string("login") ?>" />
+ <input type="hidden" name="testcookies" value="1" />
</td>
</tr>
</table>
<form action="index.php" method="post" name="guestlogin">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
+ <input type="hidden" name="testcookies" value="1" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
</form>
<?php } ?>