diff register.inc.php @ 16:6da681d1f62a

Moar work.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Dec 2012 17:30:12 +0200
parents 8019b357cc03
children 7be3f8cf1f7a
line wrap: on
line diff
--- a/register.inc.php	Thu Dec 06 16:52:38 2012 +0200
+++ b/register.inc.php	Thu Dec 06 17:30:12 2012 +0200
@@ -115,18 +115,13 @@
 stPrintFormTextInput("Oneliner:", "(whatever)", 64, 64, "oneliner");
 stPrintFormTextInput(hashToCheckStr($botCheckHash)." = ", "(I.Q. / robot check".
 //" [".hashToAnswer($botCheckHash)."]".
-")", 20, 20, "botcheck");
+")", 20, 20, "botcheck", "autocomplete=\"off\"");
 ?>
   <tr><td colspan="2"></td><td><input type="submit" value="Register" /></td></tr>
  </table>
 </form>
-<p>
-Only your <b>handle</b> and the answer to the botcheck are strictly required. If you plan on joining the IRC channel
-(<? stPrintSpecURL("irc") ?>) or staying up to date by other means,
-<b>e-mail</b> is not required either.
-</p>
-
 <?
+echo stGetSetting("registerInfoText");
 }
 else
 if ($mode == "check")
@@ -137,6 +132,16 @@
   if (stChkDataItem("hash"))
     stError("Invalid data.");
 
+  $email = stGetRequestItem("email");
+  if (stGetSetting("requireEMail"))
+  {
+    if (stChkDataItem("email") || strlen($email) < 4)
+      stError("E-mail address not given, or it is too short.");
+  }
+
+  if (strlen($email >= 4) && (strpos($email, "@") === FALSE || strpos($email, ".") === FALSE))
+    stError("E-mail address not in proper format.");
+
   $hash = stGetRequestItem("hash");
   $answer = stGetRequestItem("botcheck");
   if (hashToAnswer($hash) != intval($answer))
@@ -156,15 +161,11 @@
 
     if (stExecSQL($sql) !== FALSE)
     {
-      echo "<h1>Registration successful</h1>\n";
-      echo "<p>Now go make a demo about it!</p>\n";
+      echo "<h1>Registration successful</h1>\n".
+      stGetSetting("registerPostText");
+
       if (stChkDataItem("email"))
-      {
-        echo "<h2>By the way ...</h2>".
-        "<p>As you did not specify an e-mail contact address, you'll have to get updates ".
-        "and information about the location (if you don't already know it) by ".
-        "some other means (<b>".stSpecURL("irc").", for example.</b>)</p>";
-      }
+        echo stGetSetting("registerPostNoEmail");
     }
     else
     {