[freeside-commits] freeside/httemplate/edit/process svc_acct.cgi, 1.19, 1.20

Mark Wells mark at wavetail.420.am
Tue Mar 15 18:43:31 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv16832/httemplate/edit/process

Modified Files:
	svc_acct.cgi 
Log Message:
google account export tweaks, #11760

Index: svc_acct.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/svc_acct.cgi,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -d -r1.19 -r1.20
--- svc_acct.cgi	10 Dec 2010 22:08:36 -0000	1.19
+++ svc_acct.cgi	16 Mar 2011 01:43:29 -0000	1.20
@@ -56,14 +56,29 @@
 
 my $error = '';
 
+# google captcha auth
+if ( $cgi->param('captcha_response') ) {
+  my $part_svc = $svcnum ? 
+                  $old->part_svc : 
+                  qsearchs( 'part_svc', 
+                    { 'svcpart' => $cgi->param('svcpart') }
+                  );
+  my ($export) = $part_svc->part_export('acct_google');
+  if ( $export and
+      ! $export->captcha_auth($cgi->param('captcha_response')) ) { 
+    $error = 'Re-enter the security word.';
+  }
+}
+
 $new->_password($old->_password) if $old;
 if (     $cgi->param('clear_password') eq '*HIDDEN*'
       || $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) {
   die "fatal: no previous account to recall hidden password from!" unless $old;
 } else {
-  $error = $new->set_password($cgi->param('clear_password'));
+  $error ||= $new->set_password($cgi->param('clear_password'));
 }
 
+if ( ! $error ) {
 if ( $svcnum ) {
   foreach ( grep { $old->$_ != $new->$_ }
                  qw( seconds upbytes downbytes totalbytes )
@@ -82,5 +97,6 @@
   $error ||= $new->insert;
   $svcnum = $new->svcnum;
 }
+}
 
 </%init>



More information about the freeside-commits mailing list