Modified: trunk/app/controllers/users_controller.rb (2882 => 2883)
--- trunk/app/controllers/users_controller.rb 2011-12-14 16:08:28 UTC (rev 2882)
+++ trunk/app/controllers/users_controller.rb 2011-12-15 11:11:37 UTC (rev 2883)
@@ -409,7 +409,13 @@
def process_invitations
# first of all, check that captcha was entered correctly
- if !captcha_valid?(params[:invitations][:captcha_id], params[:invitations][:captcha_validation])
+ 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
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/users/_invite.rhtml (2882 => 2883)
--- trunk/app/views/users/_invite.rhtml 2011-12-14 16:08:28 UTC (rev 2882)
+++ trunk/app/views/users/_invite.rhtml 2011-12-15 11:11:37 UTC (rev 2883)
@@ -26,6 +26,9 @@
<table style="margin-top: 2em;">
<tr>
<td>
+ <% if Conf.recaptcha_enable -%>
+ <%= recaptcha_tags(:public_key => Conf.recaptcha_public) -%>
+ <% else -%>
<% c = prepare_captcha :type => :image -%>
<%= captcha_image_tag c -%>
</td>
@@ -33,6 +36,7 @@
<%= 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>
</table>