myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2605] trunk/app: Use recaptcha plugin.


From: noreply
Subject: [myexperiment-hackers] [2605] trunk/app: Use recaptcha plugin.
Date: Tue, 7 Jun 2011 08:48:36 -0400 (EDT)

Revision
2605
Author
dtm
Date
2011-06-07 08:48:36 -0400 (Tue, 07 Jun 2011)

Log Message

Use recaptcha plugin.

Modified Paths

Diff

Modified: trunk/app/controllers/users_controller.rb (2604 => 2605)


--- trunk/app/controllers/users_controller.rb	2011-06-07 12:37:46 UTC (rev 2604)
+++ trunk/app/controllers/users_controller.rb	2011-06-07 12:48:36 UTC (rev 2605)
@@ -147,10 +147,18 @@
     # check that captcha was entered correctly
 
     unless RAILS_ENV == 'test'
-      if !captcha_valid?(params[:validation][:captcha_id], params[:validation][:captcha_validation])
-        flash.now[:error] = 'Verification text was not entered correctly - please try again.'
-        render :action ="" 'new'
-        return
+      if true
+        if !verify_recaptcha()
+          flash.now[:error] = 'Recaptcha text was not entered correctly - please try again.'
+          render :action ="" 'new'
+          return
+        end
+      else
+        if !captcha_valid?(params[:validation][:captcha_id], params[:validation][:captcha_validation])
+          flash.now[:error] = 'Verification text was not entered correctly - please try again.'
+          render :action ="" 'new'
+          return
+        end
       end
     end
 

Modified: trunk/app/views/users/new.rhtml (2604 => 2605)


--- trunk/app/views/users/new.rhtml	2011-06-07 12:37:46 UTC (rev 2604)
+++ trunk/app/views/users/new.rhtml	2011-06-07 12:48:36 UTC (rev 2605)
@@ -28,6 +28,9 @@
 
   <center>
     <h2>Anti-spam verification</h2>
+  <% if true -%>
+    <%= recaptcha_tags -%> 
+  <% else -%>
     <table style="margin-top: 2em;">
       <tr>
         <td>
@@ -41,6 +44,7 @@
         </td>
       </tr>
     </table>
+  <% end -%>
   </center>
       
   <br />

reply via email to

[Prev in Thread] Current Thread [Next in Thread]