Mercurial > hg > fapweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
15:ea0f98a0bed8 | 16:6da681d1f62a |
---|---|
113 stPrintFormTextInput("Group(s):", "(elite crew^supahmen)", 40, 64, "groups"); | 113 stPrintFormTextInput("Group(s):", "(elite crew^supahmen)", 40, 64, "groups"); |
114 stPrintFormTextInput("E-mail:", "(to be informed of location etc)", 40, 64, "email"); | 114 stPrintFormTextInput("E-mail:", "(to be informed of location etc)", 40, 64, "email"); |
115 stPrintFormTextInput("Oneliner:", "(whatever)", 64, 64, "oneliner"); | 115 stPrintFormTextInput("Oneliner:", "(whatever)", 64, 64, "oneliner"); |
116 stPrintFormTextInput(hashToCheckStr($botCheckHash)." = ", "(I.Q. / robot check". | 116 stPrintFormTextInput(hashToCheckStr($botCheckHash)." = ", "(I.Q. / robot check". |
117 //" [".hashToAnswer($botCheckHash)."]". | 117 //" [".hashToAnswer($botCheckHash)."]". |
118 ")", 20, 20, "botcheck"); | 118 ")", 20, 20, "botcheck", "autocomplete=\"off\""); |
119 ?> | 119 ?> |
120 <tr><td colspan="2"></td><td><input type="submit" value="Register" /></td></tr> | 120 <tr><td colspan="2"></td><td><input type="submit" value="Register" /></td></tr> |
121 </table> | 121 </table> |
122 </form> | 122 </form> |
123 <p> | |
124 Only your <b>handle</b> and the answer to the botcheck are strictly required. If you plan on joining the IRC channel | |
125 (<? stPrintSpecURL("irc") ?>) or staying up to date by other means, | |
126 <b>e-mail</b> is not required either. | |
127 </p> | |
128 | |
129 <? | 123 <? |
124 echo stGetSetting("registerInfoText"); | |
130 } | 125 } |
131 else | 126 else |
132 if ($mode == "check") | 127 if ($mode == "check") |
133 { | 128 { |
134 if (stChkDataItem("name") || strlen(stGetRequestItem("name")) < 3) | 129 if (stChkDataItem("name") || strlen(stGetRequestItem("name")) < 3) |
135 stError("Handle / name not given, or too short."); | 130 stError("Handle / name not given, or too short."); |
136 | 131 |
137 if (stChkDataItem("hash")) | 132 if (stChkDataItem("hash")) |
138 stError("Invalid data."); | 133 stError("Invalid data."); |
134 | |
135 $email = stGetRequestItem("email"); | |
136 if (stGetSetting("requireEMail")) | |
137 { | |
138 if (stChkDataItem("email") || strlen($email) < 4) | |
139 stError("E-mail address not given, or it is too short."); | |
140 } | |
141 | |
142 if (strlen($email >= 4) && (strpos($email, "@") === FALSE || strpos($email, ".") === FALSE)) | |
143 stError("E-mail address not in proper format."); | |
139 | 144 |
140 $hash = stGetRequestItem("hash"); | 145 $hash = stGetRequestItem("hash"); |
141 $answer = stGetRequestItem("botcheck"); | 146 $answer = stGetRequestItem("botcheck"); |
142 if (hashToAnswer($hash) != intval($answer)) | 147 if (hashToAnswer($hash) != intval($answer)) |
143 stError("Incorrect answer to I.Q. / bot check."); | 148 stError("Incorrect answer to I.Q. / bot check."); |
154 "INSERT INTO attendees (regtime,name,groups,oneliner,email) VALUES (%d,%S,%S,%S,%S)", | 159 "INSERT INTO attendees (regtime,name,groups,oneliner,email) VALUES (%d,%S,%S,%S,%S)", |
155 time(), "name", "groups", "oneliner", "email"); | 160 time(), "name", "groups", "oneliner", "email"); |
156 | 161 |
157 if (stExecSQL($sql) !== FALSE) | 162 if (stExecSQL($sql) !== FALSE) |
158 { | 163 { |
159 echo "<h1>Registration successful</h1>\n"; | 164 echo "<h1>Registration successful</h1>\n". |
160 echo "<p>Now go make a demo about it!</p>\n"; | 165 stGetSetting("registerPostText"); |
166 | |
161 if (stChkDataItem("email")) | 167 if (stChkDataItem("email")) |
162 { | 168 echo stGetSetting("registerPostNoEmail"); |
163 echo "<h2>By the way ...</h2>". | |
164 "<p>As you did not specify an e-mail contact address, you'll have to get updates ". | |
165 "and information about the location (if you don't already know it) by ". | |
166 "some other means (<b>".stSpecURL("irc").", for example.</b>)</p>"; | |
167 } | |
168 } | 169 } |
169 else | 170 else |
170 { | 171 { |
171 echo "<h1>An error occured.</h1>\n"; | 172 echo "<h1>An error occured.</h1>\n"; |
172 echo "<p>Oh noes! SQL error happenstance!</p>"; | 173 echo "<p>Oh noes! SQL error happenstance!</p>"; |