diff --git a/html/autocomplete.php b/html/autocomplete.php index 00c2ebac90c7efdf4274dcf7be4b94af3c80d450..0a400bb6b3dfe15fa90ddd5b1802e3490163e115 100644 --- a/html/autocomplete.php +++ b/html/autocomplete.php @@ -26,7 +26,7 @@ session_cache_limiter("private"); session::start(); -session::global_set('errorsAlreadyPosted', array()); +reset_errors(); /* Logged in? Simple security check */ if (!session::global_is_set('ui')) { diff --git a/html/getbin.php b/html/getbin.php index 40c472ff4de83914a113d369368167ee649339ef..631e0560b20e4639f38667c4d0e35dc955da8d2b 100644 --- a/html/getbin.php +++ b/html/getbin.php @@ -27,7 +27,7 @@ error_reporting (0); session_cache_limiter('private'); session::start(); -session::global_set('errorsAlreadyPosted', array()); +reset_errors(); /* Logged in? Simple security check */ if (!session::global_is_set('ui')) { diff --git a/html/geticon.php b/html/geticon.php index 334d254d952bb4c72467c98e6ee2b50076fb7034..dbd9cf1016e2c4cd8c7a0d6875adecc00045605b 100644 --- a/html/geticon.php +++ b/html/geticon.php @@ -25,7 +25,7 @@ session_cache_limiter("private"); session::start(); -session::global_set('errorsAlreadyPosted', array()); +reset_errors(); $theme = ''; if (session::global_is_set('config')) { diff --git a/html/index.php b/html/index.php index 4f1e1cc4259a59189e54b0424b877c8e89f9c009..3af61a05fe4241f90ee189caa18a21684585d235 100644 --- a/html/index.php +++ b/html/index.php @@ -63,9 +63,7 @@ if (isset($_REQUEST['signout']) && $_REQUEST['signout']) { } /* Reset errors */ -session::set('errors', ''); -session::set('errorsAlreadyPosted', ''); -session::set('LastError', ''); +reset_errors(); /* Check if we need to run setup */ if (!file_exists(CONFIG_DIR.'/'.CONFIG_FILE)) { diff --git a/html/main.php b/html/main.php index 2b199e82119ec187a37f8fa3e6f44c8e1ab4a6f2..dc621151976cb514564ea2adc7fc34c536c731a9 100644 --- a/html/main.php +++ b/html/main.php @@ -37,7 +37,7 @@ textdomain($domain); /* Remember everything we did after the last click */ session::start(); -session::set('errorsAlreadyPosted', array()); +reset_errors(); session::global_set('runtime_cache', array()); session::set('limit_exceeded', FALSE); @@ -280,23 +280,12 @@ if (isset($_POST) && count($_POST) && !isset($_POST['php_c_check'])) { } /* Assign errors to smarty */ -if (session::is_set('errors')) { - $smarty->assign("errors", session::get('errors')); -} if ($error_collector != "") { $smarty->assign("php_errors", preg_replace("/%BUGBODY%/", $error_collector_mailto, $error_collector)."</div>"); } else { $smarty->assign("php_errors", ""); } -/* Set focus to the error button if we've an error message */ -$focus = ""; -if (session::is_set('errors') && session::get('errors') != "") { - $focus = '<script type="text/javascript">'; - $focus .= 'document.forms[0].error_accept.focus();'; - $focus .= '</script>'; -} - $focus = '<script type="text/javascript">'; $focus .= 'next_msg_dialog();'; $focus .= '</script>'; @@ -336,6 +325,4 @@ echo $display; /* Save plist and config */ session::global_set('plist', $plist); session::global_set('config', $config); -session::set('errorsAlreadyPosted', array()); - -?> +reset_errors(); diff --git a/html/setup.php b/html/setup.php index 908503bde350c7a7b0aa26565c95836cf7699bb4..62dd14c357dc212377f87ee1b0f442a93da3495d 100644 --- a/html/setup.php +++ b/html/setup.php @@ -50,7 +50,6 @@ ini_set("session.gc_maxlifetime", 24 * 60 * 60); /* Start session */ session::start(); session::global_set('DEBUGLEVEL', 0); -session::set('errorsAlreadyPosted', array()); CSRFProtection::check(); @@ -107,16 +106,6 @@ require_once("../setup/main.inc"); $smarty->assign("date", date("l, dS F Y H:i:s O")); $header = $smarty->fetch(get_template_path('headers.tpl')); - - -/* Set focus to the error button if we've an error message */ -$focus = ""; -if (session::is_set('errors') && session::get('errors') != "") { - $focus = '<script type="text/javascript">'; - $focus .= 'document.forms[0].error_accept.focus();'; - $focus .= '</script>'; -} - $focus = '<script type="text/javascript">'; $focus .= 'next_msg_dialog();'; $focus .= '</script>'; diff --git a/ihtml/themes/breezy/framework.tpl b/ihtml/themes/breezy/framework.tpl index ba6b98d155fff9cd70cbf57049f9705644410e85..4230424f95cecfd7e423e6326ad96923bd7e4ad5 100644 --- a/ihtml/themes/breezy/framework.tpl +++ b/ihtml/themes/breezy/framework.tpl @@ -52,7 +52,6 @@ </tbody> </table> - {$errors} {$focus} <input type="hidden" name="php_c_check" value="1"/> <input type="hidden" name="CSRFtoken" value="{$CSRFtoken}"/> diff --git a/ihtml/themes/breezy/login.tpl b/ihtml/themes/breezy/login.tpl index 1f7f6674c566ddc24e9036e518e05135cc2d88f8..6c7b5a13e632752483d567f8e5d9549aa9994549 100644 --- a/ihtml/themes/breezy/login.tpl +++ b/ihtml/themes/breezy/login.tpl @@ -72,8 +72,6 @@ </form> </div> -{$errors} - </div> {include file={filePath file="copynotice.tpl"}} diff --git a/ihtml/themes/legacy/login.tpl b/ihtml/themes/legacy/login.tpl index fd469c89505a558766b58fdd4146168f281fcb0c..ffea8967067db8a6f9aefb4bf8967480b34cd592 100644 --- a/ihtml/themes/legacy/login.tpl +++ b/ihtml/themes/legacy/login.tpl @@ -72,8 +72,6 @@ </form> </div> -{$errors} - </div> {include file={filePath file="copynotice.tpl"}} diff --git a/include/class_standAlonePage.inc b/include/class_standAlonePage.inc index ad7ddc7ef3e9a5ef0e1287fcf5c41962e7c9fcd5..be278aca593c8ab1e7b618a2b6a1da13ac4cb879 100644 --- a/include/class_standAlonePage.inc +++ b/include/class_standAlonePage.inc @@ -163,9 +163,6 @@ class standAlonePage { $smarty = get_smarty(); $smarty->assign('PHPSESSID', session_id()); - if (session::is_set('errors')) { - $smarty->assign('errors', session::get('errors')); - } if ($error_collector != '') { $smarty->assign('php_errors', preg_replace('/%BUGBODY%/', $error_collector_mailto, $error_collector).'</div>'); } else { diff --git a/include/functions.inc b/include/functions.inc index 88819467729ebee268d6aef443e2dca35d9c7d31..11d86370cb5e7a4b4afeb54a12c701401fe2a127 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -411,7 +411,7 @@ function ldap_get_user ($username) $ldap = $config->get_ldap_link(); if (!$ldap->success()) { msg_dialog::display(_('LDAP error'), - msgPool::ldaperror($ldap->get_error(), '', LDAP_AUTH).'<br/><br/>'.session::get('errors'), + msgPool::ldaperror($ldap->get_error(), '', LDAP_AUTH), FATAL_ERROR_DIALOG); exit(); } @@ -2215,9 +2215,7 @@ function mark($needle, $haystack) function reset_errors() { - session::set('errors', ''); session::set('errorsAlreadyPosted', array()); - session::set('LastError', ''); } function load_all_classes() diff --git a/include/login/class_LoginPost.inc b/include/login/class_LoginPost.inc index 61d3ec659f17fcc04eae9d059c4b881830ba899f..e1d9ff8f4fc2d3379d45fdf875bbed8d72126b4b 100644 --- a/include/login/class_LoginPost.inc +++ b/include/login/class_LoginPost.inc @@ -63,15 +63,6 @@ class LoginPost extends LoginMethod /* Translation of cookie-warning. Whether to display it, is determined by JavaScript */ $smarty->assign('cookies', '<b>'._('Warning').':</b> '._('Your browser has cookies disabled. Please enable cookies and reload this page before logging in!')); - /* Set focus to the error button if we've an error message */ - $focus = ''; - if (session::is_set('errors') && session::get('errors') != '') { - $focus = '<script type="text/javascript">'; - $focus .= 'document.forms[0].error_accept.focus();'; - $focus .= '</script>'; - } - $smarty->assign('focus', $focus); - static::displayLogin(); } @@ -127,9 +118,6 @@ class LoginPost extends LoginMethod /* show login screen */ $smarty->assign('PHPSESSID', session_id()); - if (session::is_set('errors')) { - $smarty->assign('errors', session::get('errors')); - } if ($error_collector != '') { $smarty->assign('php_errors', preg_replace('/%BUGBODY%/', $error_collector_mailto, $error_collector).'</div>'); } else { diff --git a/setup/setup_frame.tpl b/setup/setup_frame.tpl index 03dd16c5076b26a1e9a6be823a8c540a602b61a7..a5b10331d72b0ce6227307df428feadf99dbd2d5 100644 --- a/setup/setup_frame.tpl +++ b/setup/setup_frame.tpl @@ -36,7 +36,6 @@ </tbody> </table> - {$errors} {$focus} <input type="hidden" name="setup_goto_step" value=""/> <input type="hidden" name="CSRFtoken" value="{$CSRFtoken}"/>