myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2903] trunk: removed validates_captcha plugin (M


From: noreply
Subject: [myexperiment-hackers] [2903] trunk: removed validates_captcha plugin (MYEXP-95)
Date: Tue, 17 Jan 2012 10:21:01 -0500 (EST)

Revision
2903
Author
dgc
Date
2012-01-17 10:21:01 -0500 (Tue, 17 Jan 2012)

Log Message

removed validates_captcha plugin (MYEXP-95)

Modified Paths

Diff

Modified: trunk/app/controllers/feedback_controller.rb (2902 => 2903)


--- trunk/app/controllers/feedback_controller.rb	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/app/controllers/feedback_controller.rb	2012-01-17 15:21:01 UTC (rev 2903)
@@ -21,15 +21,12 @@
         format.html { redirect_to "/feedback" }
       end
     else
-      captcha_verified = false
-      if Conf.recaptcha_enable
-        captcha_verified = verify_recaptcha(:private_key => Conf.recaptcha_private)
+      if Conf.recaptcha_enable && !verify_recaptcha(:private_key => Conf.recaptcha_private)
+        respond_to do |format|
+          flash[:error] = 'Your feedback has not been submitted. CAPTCHA was not entered correctly.'
+          format.html { redirect_to "/feedback?from="+String(params[:from])+"&email="+String(params[:email])+"&subject="+String(params[:subject])+"&content="+String(params[:content]) }
+        end
       else
-        captcha_verified = params[:feedback] && captcha_valid?(params[:feedback][:captcha_id], params[:feedback][:captcha_validation])
-      end
-
-      if captcha_verified
-    
         from_user = ( params[:from].blank? ? 'no from': params[:from] ) + ' (' + (!params[:email].blank? ? params[:email] : 'no email') + ')';
         Mailer.deliver_feedback(from_user, params[:subject], params[:content])
     
@@ -37,11 +34,6 @@
           flash[:notice] = 'Your feedback has been submitted. Thank you very much.'
           format.html { redirect_to "/feedback" }
         end
-      else
-        respond_to do |format|
-          flash[:error] = 'Your feedback has not been submitted. CAPTCHA was not entered correctly.'
-          format.html { redirect_to "/feedback?from="+String(params[:from])+"&email="+String(params[:email])+"&subject="+String(params[:subject])+"&content="+String(params[:content]) }
-        end
       end
     end
   end

Modified: trunk/app/controllers/users_controller.rb (2902 => 2903)


--- trunk/app/controllers/users_controller.rb	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/app/controllers/users_controller.rb	2012-01-17 15:21:01 UTC (rev 2903)
@@ -151,12 +151,6 @@
           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
 
@@ -410,12 +404,7 @@
   def process_invitations
     # first of all, check that captcha was entered correctly
     captcha_verified = false
-    if Conf.recaptcha_enable
-      captcha_verified = verify_recaptcha(:private_key => Conf.recaptcha_private)
-    else
-      captcha_verified = captcha_valid?(params[:invitations][:captcha_id], params[:invitations][:captcha_validation])
-    end
-    if !captcha_verified
+    if Conf.recaptcha_enable && !verify_recaptcha(:private_key => Conf.recaptcha_private)
       respond_to do |format|
         flash.now[:error] = 'Verification text was not entered correctly - your invitations have not been sent.'
         format.html { render :action ="" 'invite' }

Modified: trunk/app/views/feedback/index.rhtml (2902 => 2903)


--- trunk/app/views/feedback/index.rhtml	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/app/views/feedback/index.rhtml	2012-01-17 15:21:01 UTC (rev 2903)
@@ -50,15 +50,6 @@
 		<% if !logged_in? %>
 			<% if Conf.recaptcha_enable -%>
 				<%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
-			<% else -%>
-				<% c = prepare_captcha :type => :image -%>	
-				<br/>
-				<p style="text-align: center;">
-				<%= captcha_hidden_field c, 'feedback' %>
-				<%= captcha_image_tag c %><br/>
-				</p>
-				<p style="text-align: center;"><%= captcha_label 'feedback', 'Type in the text from the image above' %></p>
-				<p style="text-align: center;"><%= captcha_text_field 'feedback' %></p>
 			<% end %>
 		<% end %>
 		  <br/><br>

Modified: trunk/app/views/users/_invite.rhtml (2902 => 2903)


--- trunk/app/views/users/_invite.rhtml	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/app/views/users/_invite.rhtml	2012-01-17 15:21:01 UTC (rev 2903)
@@ -28,14 +28,6 @@
 				<td>
 		<% if Conf.recaptcha_enable -%>
 			<%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
-		 <% else -%>
-		      <% c = prepare_captcha :type => :image -%>
-					<%= captcha_image_tag c -%>
-				</td>
-				<td style="vertical-align: top;">
-				  <%= captcha_hidden_field c, 'invitations' -%>
-					<%= captcha_label 'invitations', 'Type in the text from the image on the left:' -%><br/>
-	        <%= captcha_text_field 'invitations', :size => 40 -%>
 		<% end %>
 				</td>
 			</tr>

Modified: trunk/app/views/users/new.rhtml (2902 => 2903)


--- trunk/app/views/users/new.rhtml	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/app/views/users/new.rhtml	2012-01-17 15:21:01 UTC (rev 2903)
@@ -26,30 +26,17 @@
 
 <% form_for(:user, :url ="" users_path) do |f| %>
 
-  <center>
-    <h2>Anti-spam verification</h2>
   <% if Conf.recaptcha_enable -%>
-    <%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%> 
-  <% else -%>
-    <table style="margin-top: 2em;">
-      <tr>
-        <td>
-          <% c = prepare_captcha :type => :image -%>
-          <%= captcha_image_tag c -%>
-        </td>
-        <td style="vertical-align: top;">
-          <%= captcha_hidden_field c, 'validation' -%>
-          <%= captcha_label 'validation', 'Type in the text from the image on the left:' -%><br/>
-          <%= captcha_text_field 'validation', :size => 40 -%>
-        </td>
-      </tr>
-    </table>
+    <center>
+      <h2>Anti-spam verification</h2>
+      <%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%> 
+    </center>
+
+    <br />
+    <br />
+
   <% end -%>
-  </center>
       
-  <br />
-  <br />
-
   	<div class="fold">
   		<div class="foldTitle">
       	Register with a Username and Password

Modified: trunk/config/environment.rb (2902 => 2903)


--- trunk/config/environment.rb	2012-01-17 13:11:27 UTC (rev 2902)
+++ trunk/config/environment.rb	2012-01-17 15:21:01 UTC (rev 2903)
@@ -54,7 +54,6 @@
     :recaptcha,
     :simile_timeline,
     :structured_data,
-    :validates_captcha,
     :validates_email_veracity_of
   ]
 

reply via email to

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