mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Bug #4698 - Login block is broken!, improved cookie test
This commit is contained in:
parent
68f039dedf
commit
3294198a19
2 changed files with 5 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
require_once("../config.php");
|
||||
|
||||
$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");
|
||||
|
||||
|
|
|
@ -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 } ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue