changeset 138:e04f6e3c04f7

Add some comments.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Oct 2013 22:05:00 +0300
parents 57de66a604c5
children 75cf14ee99a7
files register.inc.php
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.");