From d2a5833d9a00ff1ad35a2dfa83e96aef65797826 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Mon, 3 Sep 2007 03:41:52 +0200 Subject: [PATCH] CGI: Anti-captcha hidden fields This should keep most of the bots hopefully out. --- cgi/regproj.cgi | 6 ++++++ cgi/reguser.cgi | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/cgi/regproj.cgi b/cgi/regproj.cgi index bea024d..f5379b2 100755 --- a/cgi/regproj.cgi +++ b/cgi/regproj.cgi @@ -14,6 +14,11 @@ my $cgi = $repo->cgi; my $name = $cgi->param('name'); $name ||= ''; +if ($cgi->param('mail')) { + print "

Go away, bot.

"; + exit; +} + if ($cgi->param('mode')) { # submitted, let's see # FIXME: racy, do a lock @@ -98,6 +103,7 @@ about the hosting and terms and conditions.

Description:

Homepage URL:

README (HTML, lt 8kb):

+

Anti-captcha (leave empty!):

EOT diff --git a/cgi/reguser.cgi b/cgi/reguser.cgi index 0128e6b..e649066 100755 --- a/cgi/reguser.cgi +++ b/cgi/reguser.cgi @@ -11,6 +11,11 @@ use Git::RepoCGI; my $repo = Git::RepoCGI->new('User Registration'); my $cgi = $repo->cgi; +if ($cgi->param('mail')) { + print "

Go away, bot.

"; + exit; +} + if ($cgi->param('name')) { # submitted, let's see # FIXME: racy, do a lock @@ -52,6 +57,7 @@ and no content that would violate any law of Czech Republic. Have fun!

Login:

Email:

Public SSH key(s):

+

Anti-captcha (leave empty!):

EOT -- 2.11.4.GIT