summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2018-11-27 01:09:09 -0800
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2018-11-27 01:09:09 -0800
commitff6c62dcb4b5f323172788d1d90c3c3492651da9 (patch)
treeeabfe3115eb8a69d4654209ee25cfec46cb7433b
parent4f593e7108258b8a4abb033cbc6b2eca2fc7845a (diff)
downloadpiny-code-ff6c62dcb4b5f323172788d1d90c3c3492651da9.tar.gz
piny-code-ff6c62dcb4b5f323172788d1d90c3c3492651da9.zip
pinyweb: newuser: remove google's broken captcha api
-rwxr-xr-xpinyweb/cgi-bin/newuser.cgi26
-rw-r--r--pinyweb/debian/control2
2 files changed, 12 insertions, 16 deletions
diff --git a/pinyweb/cgi-bin/newuser.cgi b/pinyweb/cgi-bin/newuser.cgi
index 9675a5e..159db63 100755
--- a/pinyweb/cgi-bin/newuser.cgi
+++ b/pinyweb/cgi-bin/newuser.cgi
@@ -9,8 +9,7 @@ use CGI;
use Crypt::CBC;
use IPC::Open2;
-use MIME::Base32 qw( RFC );
-use Captcha::reCAPTCHA;
+use MIME::Base32;
use Piny::Auth;
@@ -53,23 +52,20 @@ if( scalar( $q->param("n") ) && scalar( $q->param("a") ) && scalar( $q->param("p
print( "I'm sorry, the link you followed is invalid.\n" );
};
} else { # No hash, they need one sent to their address
- # CAPTCHA check
- if ( -f "/etc/recaptcha/private.key" ) {
- if ( scalar( $q->param('recaptcha_response_field') ) && scalar( $q->param('recaptcha_challenge_field') ) ) {
- open(RECAPTCHA, '/etc/recaptcha/private.key') || ( print "Can't read recaptcha key: [$!]\n" && exit 0 );
- my $recaptchakey = <RECAPTCHA>;
- close (RECAPTCHA);
- chomp($recaptchakey);
- my $c = Captcha::reCAPTCHA->new;
- my $result = $c->check_answer( $recaptchakey, $ENV{'REMOTE_ADDR'}, scalar( $q->param( 'recaptcha_challenge_field' ) ), scalar( $q->param( 'recaptcha_response_field' ) ) );
- if ( $result->{is_valid} ) {
- print "Good recaptcha submission.\n"
+ if ( -f "/etc/piny/captcha" ) {
+ if ( scalar( $q->param('c') ) ) {
+ open(CAPTCHA, '/etc/piny/captcha') || ( print "Can't read captcha file: [$!]\n" && exit 0 );
+ my $captcha = <CAPTCHA>;
+ close (CAPTCHA);
+ chomp( $captcha );
+ if ( $captcha eq scalar( $q->param('c') ) ) {
+ print "Good captcha submission.\n"
} else {
- print "Bad recaptcha submission: $result->{error}\n";
+ print "Bad captcha submission.\n";
exit 0;
};
} else {
- print( "Missing recaptcha parameters." );
+ print( "Missing or incorrect \"c\" captcha parameter." );
exit 0;
};
};
diff --git a/pinyweb/debian/control b/pinyweb/debian/control
index fd44de3..618b3b2 100644
--- a/pinyweb/debian/control
+++ b/pinyweb/debian/control
@@ -8,7 +8,7 @@ Standards-version: 3.9.1
Package: pinyweb
Architecture: any
-Depends: ${perl:Depends}, ${misc:Depends}, ${shlibs:Depends}, libcrypt-blowfish-perl, libcrypt-cbc-perl, libjson-perl, libmime-base32-perl, libcaptcha-recaptcha-perl, libpiny-perl (>= 0.14), pinyadmin (>= 0.10)
+Depends: ${perl:Depends}, ${misc:Depends}, ${shlibs:Depends}, libcrypt-blowfish-perl, libcrypt-cbc-perl, libjson-perl, libmime-base32-perl, libpiny-perl (>= 0.14), pinyadmin (>= 0.10)
Description: CGIs for managing piny repositories
The CGI programs for day-to-day administrative tasks in the Piny
infrastructure.