myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2661] trunk: made use of recaptcha optional (dis


From: noreply
Subject: [myexperiment-hackers] [2661] trunk: made use of recaptcha optional (disabled by default)
Date: Tue, 2 Aug 2011 08:41:08 -0400 (EDT)

Revision
2661
Author
dgc
Date
2011-08-02 08:41:07 -0400 (Tue, 02 Aug 2011)

Log Message

made use of recaptcha optional (disabled by default)

Modified Paths

Diff

Modified: trunk/app/controllers/users_controller.rb (2660 => 2661)


--- trunk/app/controllers/users_controller.rb	2011-08-02 00:27:47 UTC (rev 2660)
+++ trunk/app/controllers/users_controller.rb	2011-08-02 12:41:07 UTC (rev 2661)
@@ -146,10 +146,12 @@
 
     unless RAILS_ENV == 'test'
       if true
-        if !verify_recaptcha()
-          flash.now[:error] = 'Recaptcha text was not entered correctly - please try again.'
-          render :action ="" 'new'
-          return
+        if Conf.recaptcha_enable
+          if !verify_recaptcha(:private_key => Conf.recaptcha_private)
+            flash.now[:error] = 'Recaptcha text was not entered correctly - please try again.'
+            render :action ="" 'new'
+            return
+          end
         end
       else
         if !captcha_valid?(params[:validation][:captcha_id], params[:validation][:captcha_validation])

Modified: trunk/app/views/users/new.rhtml (2660 => 2661)


--- trunk/app/views/users/new.rhtml	2011-08-02 00:27:47 UTC (rev 2660)
+++ trunk/app/views/users/new.rhtml	2011-08-02 12:41:07 UTC (rev 2661)
@@ -29,7 +29,7 @@
   <center>
     <h2>Anti-spam verification</h2>
   <% if true -%>
-    <%= recaptcha_tags -%> 
+    <%= recaptcha_tags(:public_key => Conf.recaptcha_public) if Conf.recaptcha_enable -%> 
   <% else -%>
     <table style="margin-top: 2em;">
       <tr>

Modified: trunk/config/default_settings.yml (2660 => 2661)


--- trunk/config/default_settings.yml	2011-08-02 00:27:47 UTC (rev 2660)
+++ trunk/config/default_settings.yml	2011-08-02 12:41:07 UTC (rev 2661)
@@ -437,3 +437,15 @@
 rdfgen_enable: false
 
 rdfgen_tool:
+
+# recaptcha_enable - This enables the ReCaptcha system.  Be sure to set
+#                    recaptcha_public and recaptcha_private to the public key
+#                    and private keys from the ReCaptcha website if this is
+#                    enabled.
+
+recaptcha_enable: false
+
+recaptcha_public:
+
+recaptcha_private:
+

Modified: trunk/lib/conf.rb (2660 => 2661)


--- trunk/lib/conf.rb	2011-08-02 00:27:47 UTC (rev 2660)
+++ trunk/lib/conf.rb	2011-08-02 12:41:07 UTC (rev 2661)
@@ -153,6 +153,18 @@
     self.fetch_entry('rdfgen_tool')
   end
 
+  def self.recaptcha_enable
+    self.fetch_entry('recaptcha_enable')
+  end
+
+  def self.recaptcha_public
+    self.fetch_entry('recaptcha_public')
+  end
+
+  def self.recaptcha_private
+    self.fetch_entry('recaptcha_private')
+  end
+
   # This method is required to create an administrator in the test fixtures
 
   def self.admins=(value)
@@ -231,6 +243,5 @@
 
     default
   end
-
 end
 

reply via email to

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