# HG changeset patch # User Matti Hamalainen # Date 1446740800 -7200 # Node ID b7ebc845e740b481a39cfd7345b21e7ae01210f7 # Parent 6e8ae77e1a253357b909fc07999729a5e9e4ca6f Improve registration form error processing. diff -r 6e8ae77e1a25 -r b7ebc845e740 pages/register.inc.php --- a/pages/register.inc.php Thu Nov 05 18:26:05 2015 +0200 +++ b/pages/register.inc.php Thu Nov 05 18:26:40 2015 +0200 @@ -56,6 +56,22 @@ } +function stPrintRegistrationErrors() +{ + global $errorMsgs; + + echo + "

Following errors occured:

\n". + "\n"; + stPrintFormData("Go back", "start", array("botcheck")); +} + + // Convert integer value to hash code function intValueToHash($val) { @@ -186,15 +202,8 @@ if ($errorSet) { // There were errors or missing data - echo - "

Following errors occured:

\n". - "\n"; - stPrintFormData("Go back", "start", array("botcheck")); + stPrintRegistrationErrors(); + $errorSet = FALSE; } else if ($mode == "register") @@ -238,4 +247,10 @@ stPrintFormData("Register", "register"); } } +else + stError("Invalid operation registration mode."); + +if ($errorSet) + stPrintRegistrationErrors(); + ?> \ No newline at end of file