Commit 1308c6af authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Loosened the cookie checking somewhat, as it makes it easier for mechanize

robots to move about the site.
parent 009fa91f
...@@ -549,7 +549,6 @@ function auth_get_login_form() { ...@@ -549,7 +549,6 @@ function auth_get_login_form() {
function get_login_form_js($form) { function get_login_form_js($form) {
$form = str_replace('/', '\/', str_replace("'", "\'", (str_replace(array("\n", "\t"), '', $form)))); $form = str_replace('/', '\/', str_replace("'", "\'", (str_replace(array("\n", "\t"), '', $form))));
$strcookiesnotenabled = get_string('cookiesnotenabled'); $strcookiesnotenabled = get_string('cookiesnotenabled');
$strjavascriptnotenabled = get_string('javascriptnotenabled');
$cookiename = get_config('cookieprefix') . 'ctest'; $cookiename = get_config('cookieprefix') . 'ctest';
return <<<EOF return <<<EOF
<script type="text/javascript"> <script type="text/javascript">
...@@ -557,14 +556,12 @@ var loginbox = $('loginbox'); ...@@ -557,14 +556,12 @@ var loginbox = $('loginbox');
document.cookie = '$cookiename=1;expires=0'; document.cookie = '$cookiename=1;expires=0';
if (document.cookie) { if (document.cookie) {
loginbox.innerHTML = '$form'; loginbox.innerHTML = '$form';
document.cookie = '$cookiename=1;expires=1/1/1990 00:00:00';
} }
else { else {
appendChildNodes(loginbox, P(null, $strcookiesnotenabled)); replaceChildNodes(loginbox, P(null, '$strcookiesnotenabled'));
} }
</script> </script>
<noscript>
<p>$strjavascriptnotenabled</p>
</noscript>
EOF; EOF;
} }
...@@ -580,14 +577,6 @@ function login_submit($values) { ...@@ -580,14 +577,6 @@ function login_submit($values) {
log_debug('auth details supplied, attempting to log user in'); log_debug('auth details supplied, attempting to log user in');
// Check if the cookie set to test cookies is actually set
if (!get_cookie('ctest')) {
set_cookie('ctest', '', time() - 3600);
log_debug('cookie for detecting cookies not set');
redirect(get_config('wwwroot'));
}
set_cookie('ctest', '', time() - 3600);
$username = $values['login_username']; $username = $values['login_username'];
$password = $values['login_password']; $password = $values['login_password'];
$institution = (isset($values['login_institution'])) ? $values['login_institution'] : 'mahara'; $institution = (isset($values['login_institution'])) ? $values['login_institution'] : 'mahara';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment