# HG changeset patch # User Matti Hamalainen # Date 1382468700 -10800 # Node ID e04f6e3c04f7827ef9dca3af76ad45c1833439de # Parent 57de66a604c501a15889f89a22139b02d7683a43 Add some comments. diff -r 57de66a604c5 -r e04f6e3c04f7 register.inc.php --- a/register.inc.php Tue Oct 22 22:04:30 2013 +0300 +++ b/register.inc.php Tue Oct 22 22:05:00 2013 +0300 @@ -6,6 +6,7 @@ // $mode = stGetRequestItem("mode", "start"); +// Settings for robot check hash generator $botCheckIDs = "aBcdefghIjklmnopqrsTuvxyz0123456"; $botCheckOPs = "bit"; $botCheckROPs = "+-*"; @@ -26,6 +27,7 @@ } +// Convert integer value to hash code function intValueToHash($val) { global $botCheckIDs; @@ -40,6 +42,7 @@ } +// Convert integer hash to integer value function intHashToValue($hash) { global $botCheckIDs; @@ -56,6 +59,7 @@ } +// Split hash into parts function splitHash($hash) { global $botCheckOPs; @@ -86,6 +90,7 @@ return $res; } +// Check if user registration is available stCheckRegistrationAvailable(); // Check if registration is enabled @@ -112,6 +117,10 @@ else if ($mode == "start") { + // + // Show registration form + // + // Generate bot-check $botCheckHash = intValueToHash(rand(1,5)). $botCheckOPs[rand(0,2)]. @@ -142,6 +151,9 @@ else if ($mode == "check") { + // + // Check the registrant's details + // if (stChkDataItem("name") || strlen(stGetRequestItem("name")) < 3) stError("Handle / name not given, or too short.");