Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug #4698 - Login block is broken!, improved cookie test; merged from…
… MOODLE_16_STABLE
  • Loading branch information
skodak committed Jul 6, 2006
1 parent 68d07f8 commit 2cc14e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions login/index.php
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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");

Expand Down
2 changes: 2 additions & 0 deletions login/index_form.html
Expand Up @@ -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>
Expand All @@ -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 } ?>
Expand Down

0 comments on commit 2cc14e8

Please sign in to comment.