# HG changeset patch # User Matti Hamalainen # Date 1354805558 -7200 # Node ID ea0f98a0bed85932dbf06c84aef1e346ef5ddd5c # Parent e36c4d2b09c48e9f061189e4aff34c68b43ca304 Fix some issues and bugs caused by recent changes. diff -r e36c4d2b09c4 -r ea0f98a0bed8 admin.inc.php --- a/admin.inc.php Thu Dec 06 16:13:08 2012 +0200 +++ b/admin.inc.php Thu Dec 06 16:52:38 2012 +0200 @@ -49,7 +49,7 @@ "
\n". stGetFormHiddenInput("mode", "check")."\n". stGetFormHiddenInput("goto", $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"])."\n". - stGetFormPasswordInput("admpass", "pass", "")."\n". + stGetFormPasswordInput("admpass","", "")."\n". " \n". "
\n"; diff -r e36c4d2b09c4 -r ea0f98a0bed8 dovote.php --- a/dovote.php Thu Dec 06 16:13:08 2012 +0200 +++ b/dovote.php Thu Dec 06 16:52:38 2012 +0200 @@ -3,6 +3,19 @@ require "msite.inc.php"; stSetupCacheControl(); + +// Initiate SQL database connection +if (!stConnectSQLDB()) +{ + header("Location: vote"); + exit; +} + +// Get settings +stReloadSettings(); + + +// Start vote session if (!stVoteSessionStart()) { header("Location: vote"); @@ -13,7 +26,7 @@ stSetVoteStatus(0); -if (stCheckHTTPS() && stChkSetting("allowVoting") && stConnectSQLDB()) +if (stCheckHTTPS() && stChkSetting("allowVoting")) { stGetCompoList(FALSE); $mode = stGetRequestItem("mode"); diff -r e36c4d2b09c4 -r ea0f98a0bed8 login.php --- a/login.php Thu Dec 06 16:13:08 2012 +0200 +++ b/login.php Thu Dec 06 16:52:38 2012 +0200 @@ -6,6 +6,10 @@ if (stGetRequestItem("admpass", FALSE) == stGetSetting("admPassword")) stAdmSessionStart(); +else +{ + if (stGetSetting("debug")) error_log("Admin session AUTH LOGIN failed (".stGetRequestItem("admpass", FALSE).")"); +} header("Location: https://".stGetRequestItem("goto")); ?> \ No newline at end of file diff -r e36c4d2b09c4 -r ea0f98a0bed8 msite.inc.php --- a/msite.inc.php Thu Dec 06 16:13:08 2012 +0200 +++ b/msite.inc.php Thu Dec 06 16:52:38 2012 +0200 @@ -275,7 +275,7 @@ function stPrintFormTextInput($text1, $text2, $size, $len, $name, $extra="") { echo " ".chentities($text1)."". - stGetFormTextInput($size, $len, $name, "", "", $_REQUEST[$name], $extra). + stGetFormTextInput($size, $len, $name, "", "", stGetRequestItem($name), $extra). "".chentities($text2)."\n"; } diff -r e36c4d2b09c4 -r ea0f98a0bed8 vote.inc.php --- a/vote.inc.php Thu Dec 06 16:13:08 2012 +0200 +++ b/vote.inc.php Thu Dec 06 16:52:38 2012 +0200 @@ -32,12 +32,12 @@ echo "

Voting system

\n". "
\n". - stGetFormHiddenInput("mode", "key")."\n". + " ".stGetFormHiddenInput("mode", "key")."\n". "
\n". - " Enter your vote key: ". - stGetFormTextInput(30, 30, "key", "key", "", stGetSessionItem("key"), "autocomplete=\"off\""). - " ". - "
\n"; + " Enter your vote key:\n". + " ".stGetFormTextInput(30, 30, "key", "", "", stGetSessionItem("key"), "autocomplete=\"off\"")."\n". + " \n". + " \n". "
\n"; } else