aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-12 15:44:13 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-12 15:44:13 -0700
commit2a47f5ab463012d63cf72a7729627f00fd90f721 (patch)
treebec396a972d28d712c2471a91506d4247790d1fb /mod
parentdfd3cef734be3bc1bf2d16dfe8b2f71d6aff18a7 (diff)
downloadvolse-hubzilla-2a47f5ab463012d63cf72a7729627f00fd90f721.tar.gz
volse-hubzilla-2a47f5ab463012d63cf72a7729627f00fd90f721.tar.bz2
volse-hubzilla-2a47f5ab463012d63cf72a7729627f00fd90f721.zip
make it harder for the Russian spammers to register
Diffstat (limited to 'mod')
-rw-r--r--mod/register.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/mod/register.php b/mod/register.php
index 65b7fa6be..451cb1246 100644
--- a/mod/register.php
+++ b/mod/register.php
@@ -44,12 +44,22 @@ function register_post(&$a) {
$err = '';
+ // TODO fix some of these regex's for int'l/utf-8.
+
if(!eregi('[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z]{2,6}',$email))
$err .= t(' Not a valid email address.');
if(strlen($username) > 48)
$err .= t(' Please use a shorter name.');
if(strlen($username) < 3)
$err .= t(' Name too short.');
+
+ // I don't really like having this rule, but it cuts down
+ // on the number of auto-registrations by Russian spammers
+
+ if(! preg_match("/^[a-zA-Z]* [a-zA-Z]*$/",$username))
+ $err .= t(' That doesn\'t appear to be your full name.');
+
+
$r = q("SELECT `uid` FROM `user`
WHERE `email` = '%s' LIMIT 1",
dbesc($email)