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");
|
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
|
//initialize variables
|
||||||
$errormsg = '';
|
$errormsg = '';
|
||||||
|
@ -95,7 +96,7 @@
|
||||||
|
|
||||||
/// Check if the user has actually submitted login data to us
|
/// 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");
|
$errormsg = get_string("cookiesnotenabled");
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td width="20%">
|
<td width="20%">
|
||||||
<input type="submit" value="<?php print_string("login") ?>" />
|
<input type="submit" value="<?php print_string("login") ?>" />
|
||||||
|
<input type="hidden" name="testcookies" value="1" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -58,6 +59,7 @@
|
||||||
<form action="index.php" method="post" name="guestlogin">
|
<form action="index.php" method="post" name="guestlogin">
|
||||||
<input type="hidden" name="username" value="guest" />
|
<input type="hidden" name="username" value="guest" />
|
||||||
<input type="hidden" name="password" value="guest" />
|
<input type="hidden" name="password" value="guest" />
|
||||||
|
<input type="hidden" name="testcookies" value="1" />
|
||||||
<input type="submit" value="<?php print_string("loginguest") ?>" />
|
<input type="submit" value="<?php print_string("loginguest") ?>" />
|
||||||
</form>
|
</form>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue