# HG changeset patch # User Matti Hamalainen # Date 1416549927 -7200 # Node ID 24bbd1f89794aae4576059991961b2858c69e7dd # Parent da0ddfe1b704b2e668f637d1983bc74be2372f9f Add few new settings, bump database version. diff -r da0ddfe1b704 -r 24bbd1f89794 dbdefs.inc.php --- a/dbdefs.inc.php Fri Nov 21 08:04:13 2014 +0200 +++ b/dbdefs.inc.php Fri Nov 21 08:05:27 2014 +0200 @@ -1,6 +1,6 @@ array(VT_TEXT, " +

Sorry, voting disabled!

+

Voting functionality not available at this time.

+", + "Error message for voting disabled"), + + "voteAuthError" => array(VT_TEXT, " +

Not authenticated to vote

+

+You are not authenticated currently. Try to login again. +

+", + "Error message for vote auth failure"), ), ); diff -r da0ddfe1b704 -r 24bbd1f89794 pages/noauthvote.inc.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pages/noauthvote.inc.php Fri Nov 21 08:05:27 2014 +0200 @@ -0,0 +1,13 @@ + \ No newline at end of file diff -r da0ddfe1b704 -r 24bbd1f89794 pages/vote.inc.php --- a/pages/vote.inc.php Fri Nov 21 08:04:13 2014 +0200 +++ b/pages/vote.inc.php Fri Nov 21 08:05:27 2014 +0200 @@ -19,11 +19,7 @@ // Check if voting is enabled if (!stChkSetting("allowVoting")) -{ - echo - "

Sorry, voting disabled!

\n". - "

Voting functionality not available at this time.

\n"; -} + echo stGetSetting("votingDisabled"); else if (!stUserSessionAuth(FALSE)) { @@ -120,6 +116,7 @@ stGetFormStart("vote", "usrajax.php"). " ".stGetFormHiddenInput("mode", "done")."\n". " ".stGetFormHiddenInput("action", "submit")."\n". + " ".stGetFormHiddenInput("onerror", "noauthvote")."\n". stGetVoteButton(); foreach (stExecSQL("SELECT * FROM compos WHERE visible<>0 AND voting<>0") as $compo) diff -r da0ddfe1b704 -r 24bbd1f89794 usrajax.php --- a/usrajax.php Fri Nov 21 08:04:13 2014 +0200 +++ b/usrajax.php Fri Nov 21 08:05:27 2014 +0200 @@ -55,9 +55,18 @@ stSessionEnd(SESS_USER); - stError("You are not authenticated currently. Try to login again."); - stSetStatus(902, "Not authenticated."); - stDumpAJAXStatusErrors(); + switch (stGetRequestItem("action")) + { + case "submit": + header("Location: ".stGetRequestItem("onerror", stGetSetting("defaultPage"))); + break; + + default: + stError("You are not authenticated currently. Try to login again."); + stSetStatus(902, "Not authenticated."); + stDumpAJAXStatusErrors(FALSE); + break; + } exit; }