Bug #4698 - Login block is broken!, improved cookie test; merged from MOODLE_16_STABLE

This commit is contained in:
skodak 2006-07-06 10:11:06 +00:00
parent 68d07f8b01
commit 2cc14e87d3
2 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,8 @@
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 = '';
@ -95,7 +96,7 @@
/// 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");

View File

@ -47,6 +47,7 @@
</td>
<td width="20%">
<input type="submit" value="<?php print_string("login") ?>" />
<input type="hidden" name="testcookies" value="1" />
</td>
</tr>
</table>
@ -58,6 +59,7 @@
<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 } ?>