infopark_rails_connector 6.8.0.beta.200.856.8c0fec5 → 6.8.0.beta.200.869.9609b39

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,7 +106,8 @@ module RailsConnector
106
106
  @user.load(Crm::CONTACT_DEFAULT_ATTRS.merge(sanitize_user_params(params[:user],
107
107
  self.class.editable_attributes_on_register)))
108
108
  if request.post?
109
- unless validate_recap(params, @user.errors)
109
+ if RailsConnector::Configuration.use_recaptcha_on_user_registration &&
110
+ !validate_recap(params, @user.errors)
110
111
  raise ActiveResource::ResourceInvalid, "captcha failed"
111
112
  end
112
113
  before_register
@@ -233,6 +234,7 @@ module RailsConnector
233
234
  #
234
235
  # Used as a filter in this controller.
235
236
  def check_recaptcha_keypair
237
+ return true unless RailsConnector::Configuration.use_recaptcha_on_user_registration
236
238
  unless Object.const_defined?(:RCC_PUB) && Object.const_defined?(:RCC_PRIV)
237
239
  raise RuntimeError, <<-EOS
238
240
 
@@ -2,10 +2,12 @@
2
2
 
3
3
  <%= form_for @user, :as => :user, :url => { :controller => 'user', :action => "new" } do |f| -%>
4
4
  <%= profile_fields_for(f, UserController.editable_attributes_on_register) %>
5
- <%= content_tag(:div,
6
- label_tag('', t("rails_connector.views.user.captcha")),
7
- :class => "label"
8
- ) %>
9
- <%= get_captcha(:options => {:lang => I18n.locale, :theme => 'clean'}).html_safe %>
5
+ <% if RailsConnector::Configuration.use_recaptcha_on_user_registration %>
6
+ <%= content_tag(:div,
7
+ label_tag('', t("rails_connector.views.user.captcha")),
8
+ :class => "label"
9
+ ) %>
10
+ <%= get_captcha(:options => {:lang => I18n.locale, :theme => 'clean'}).html_safe %>
11
+ <% end %>
10
12
  <%= f.submit t('rails_connector.views.user.register_button') %>
11
13
  <% end -%>
@@ -12,6 +12,7 @@ module RailsConnector
12
12
 
13
13
  def install_configuration
14
14
  copy_file "initializers/rails_connector.rb", "config/initializers/rails_connector.rb"
15
+ copy_file 'initializers/crm_connector.rb', 'config/initializers/crm_connector.rb'
15
16
  copy_file "obj_extensions.rb", "lib/obj_extensions.rb"
16
17
  copy_file "local/configuration.rb", "config/local/configuration.rb"
17
18
  end
@@ -0,0 +1,22 @@
1
+ # OMC:
2
+ #
3
+ # require 'infopark_crm_connector'
4
+ #
5
+ # Infopark::Crm.configure do |config|
6
+ # config.url = "http://<crm-domain>:<port>"
7
+ # config.login = 'webservice'
8
+ # config.api_key = '<password>'
9
+ # # config.live_server_groups_callback = lambda {|contact|
10
+ # # case contact.account.name
11
+ # # when "My Company"
12
+ # # %w(internal)
13
+ # # else
14
+ # # []
15
+ # # end
16
+ # # }
17
+ # end
18
+ #
19
+ # Re-captcha public/private key pair (used for creating a new user)
20
+ # You can get those by signing up at http://recaptcha.net/
21
+ # RCC_PUB=""
22
+ # RCC_PRIV=""
@@ -35,24 +35,3 @@ RailsConnector::Configuration::PdfGenerator.host_whitelist('localhost')
35
35
  # '<your.domain.com>' => '<your-ga-code-1>',
36
36
  # '<your.domain.de>' => '<your-ga-code-2>'
37
37
  # )
38
-
39
- # OMC:
40
- #
41
- # Infopark::Crm.configure do |config|
42
- # config.url = "http://<crm-domain>:<port>"
43
- # config.login = 'webservice'
44
- # config.api_key = '<password>'
45
- # # config.live_server_groups_callback = lambda {|contact|
46
- # # case contact.account.name
47
- # # when "My Company"
48
- # # %w(internal)
49
- # # else
50
- # # []
51
- # # end
52
- # # }
53
- # end
54
- #
55
- # Re-captcha public/private key pair (used for creating a new user)
56
- # You can get those by signing up at http://recaptcha.net/
57
- # RCC_PUB=""
58
- # RCC_PRIV=""
@@ -35,6 +35,10 @@ module RailsConnector
35
35
  # Should never be used in a production environment.
36
36
  attr_accessor :cache_editable_workspaces
37
37
 
38
+ # Include ReCaptcha tags in user registration form and validate the captcha
39
+ # when creating a new user registration (default: true).
40
+ attr_accessor :use_recaptcha_on_user_registration
41
+
38
42
  def search_options
39
43
  @search_options || local_config_file["search"].symbolize_keys
40
44
  end
@@ -253,6 +257,7 @@ module RailsConnector
253
257
  # defaults
254
258
  self.auto_liquid_editmarkers = true
255
259
  self.cache_editable_workspaces = false
260
+ self.use_recaptcha_on_user_registration = true
256
261
 
257
262
  register_features(
258
263
  :search, :time_machine, :pdf_generator, :rss, :comments, :ratings,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_rails_connector
3
3
  version: !ruby/object:Gem::Version
4
- hash: 255745265
4
+ hash: -18044330508
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 6
@@ -9,13 +9,11 @@ version: !ruby/object:Gem::Version
9
9
  - 0
10
10
  - beta
11
11
  - 200
12
- - 856
13
- - 8
14
- - c
15
- - 0
16
- - fec
17
- - 5
18
- version: 6.8.0.beta.200.856.8c0fec5
12
+ - 869
13
+ - 9609
14
+ - b
15
+ - 39
16
+ version: 6.8.0.beta.200.869.9609b39
19
17
  platform: ruby
20
18
  authors:
21
19
  - Infopark AG
@@ -23,10 +21,11 @@ autorequire:
23
21
  bindir: bin
24
22
  cert_chain: []
25
23
 
26
- date: 2012-07-23 00:00:00 +02:00
24
+ date: 2012-07-26 00:00:00 +02:00
27
25
  default_executable:
28
26
  dependencies:
29
27
  - !ruby/object:Gem::Dependency
28
+ type: :runtime
30
29
  requirement: &id001 !ruby/object:Gem::Requirement
31
30
  none: false
32
31
  requirements:
@@ -38,11 +37,11 @@ dependencies:
38
37
  - 2
39
38
  - 1
40
39
  version: 3.2.1
41
- version_requirements: *id001
42
- name: rails
43
40
  prerelease: false
44
- type: :runtime
41
+ name: rails
42
+ version_requirements: *id001
45
43
  - !ruby/object:Gem::Dependency
44
+ type: :runtime
46
45
  requirement: &id002 !ruby/object:Gem::Requirement
47
46
  none: false
48
47
  requirements:
@@ -55,11 +54,11 @@ dependencies:
55
54
  - 2
56
55
  - 2
57
56
  version: 0.9.2.2
58
- version_requirements: *id002
59
- name: rake
60
57
  prerelease: false
61
- type: :runtime
58
+ name: rake
59
+ version_requirements: *id002
62
60
  - !ruby/object:Gem::Dependency
61
+ type: :runtime
63
62
  requirement: &id003 !ruby/object:Gem::Requirement
64
63
  none: false
65
64
  requirements:
@@ -71,11 +70,11 @@ dependencies:
71
70
  - 5
72
71
  - 1
73
72
  version: 1.5.1
74
- version_requirements: *id003
75
- name: json
76
73
  prerelease: false
77
- type: :runtime
74
+ name: json
75
+ version_requirements: *id003
78
76
  - !ruby/object:Gem::Dependency
77
+ type: :runtime
79
78
  requirement: &id004 !ruby/object:Gem::Requirement
80
79
  none: false
81
80
  requirements:
@@ -87,11 +86,11 @@ dependencies:
87
86
  - 6
88
87
  - 0
89
88
  version: 0.6.0
90
- version_requirements: *id004
91
- name: maruku
92
89
  prerelease: false
93
- type: :runtime
90
+ name: maruku
91
+ version_requirements: *id004
94
92
  - !ruby/object:Gem::Dependency
93
+ type: :runtime
95
94
  requirement: &id005 !ruby/object:Gem::Requirement
96
95
  none: false
97
96
  requirements:
@@ -103,11 +102,11 @@ dependencies:
103
102
  - 0
104
103
  - 0
105
104
  version: 2.0.0
106
- version_requirements: *id005
107
- name: liquid
108
105
  prerelease: false
109
- type: :runtime
106
+ name: liquid
107
+ version_requirements: *id005
110
108
  - !ruby/object:Gem::Dependency
109
+ type: :runtime
111
110
  requirement: &id006 !ruby/object:Gem::Requirement
112
111
  none: false
113
112
  requirements:
@@ -119,11 +118,11 @@ dependencies:
119
118
  - 0
120
119
  - 2
121
120
  version: 3.0.2
122
- version_requirements: *id006
123
- name: will_paginate
124
121
  prerelease: false
125
- type: :runtime
122
+ name: will_paginate
123
+ version_requirements: *id006
126
124
  - !ruby/object:Gem::Dependency
125
+ type: :runtime
127
126
  requirement: &id007 !ruby/object:Gem::Requirement
128
127
  none: false
129
128
  requirements:
@@ -135,11 +134,11 @@ dependencies:
135
134
  - 0
136
135
  - 5
137
136
  version: 1.0.5
138
- version_requirements: *id007
139
- name: ruby-recaptcha
140
137
  prerelease: false
141
- type: :runtime
138
+ name: ruby-recaptcha
139
+ version_requirements: *id007
142
140
  - !ruby/object:Gem::Dependency
141
+ type: :runtime
143
142
  requirement: &id008 !ruby/object:Gem::Requirement
144
143
  none: false
145
144
  requirements:
@@ -151,11 +150,11 @@ dependencies:
151
150
  - 9
152
151
  - 2
153
152
  version: 0.9.2
154
- version_requirements: *id008
155
- name: infopark_crm_connector
156
153
  prerelease: false
157
- type: :runtime
154
+ name: infopark_crm_connector
155
+ version_requirements: *id008
158
156
  - !ruby/object:Gem::Dependency
157
+ type: :runtime
159
158
  requirement: &id009 !ruby/object:Gem::Requirement
160
159
  none: false
161
160
  requirements:
@@ -167,11 +166,11 @@ dependencies:
167
166
  - 1
168
167
  - 2
169
168
  version: 1.1.2
170
- version_requirements: *id009
171
- name: tidy
172
169
  prerelease: false
173
- type: :runtime
170
+ name: tidy
171
+ version_requirements: *id009
174
172
  - !ruby/object:Gem::Dependency
173
+ type: :runtime
175
174
  requirement: &id010 !ruby/object:Gem::Requirement
176
175
  none: false
177
176
  requirements:
@@ -183,11 +182,11 @@ dependencies:
183
182
  - 0
184
183
  - 19
185
184
  version: 1.0.19
186
- version_requirements: *id010
187
- name: jquery-rails
188
185
  prerelease: false
189
- type: :runtime
186
+ name: jquery-rails
187
+ version_requirements: *id010
190
188
  - !ruby/object:Gem::Dependency
189
+ type: :runtime
191
190
  requirement: &id011 !ruby/object:Gem::Requirement
192
191
  none: false
193
192
  requirements:
@@ -199,10 +198,9 @@ dependencies:
199
198
  - 1
200
199
  - 0
201
200
  version: 0.1.0
202
- version_requirements: *id011
203
- name: helpful_configuration
204
201
  prerelease: false
205
- type: :runtime
202
+ name: helpful_configuration
203
+ version_requirements: *id011
206
204
  description: The Rails Connector for Infopark CMS Fiona enables you to develop modern, dynamic Web 2.0 applications using Ruby on Rails and at the same time display CMS managed content.
207
205
  email: info@infopark.de
208
206
  executables: []
@@ -210,55 +208,55 @@ executables: []
210
208
  extensions: []
211
209
 
212
210
  extra_rdoc_files:
213
- - app/helpers/cms_helper.rb
214
- - app/helpers/user_helper.rb
215
- - app/helpers/ratings_helper.rb
216
- - app/helpers/cms_routing_helper.rb
217
- - app/helpers/rails_connector/menu_helper.rb
218
- - app/helpers/rails_connector/mandatory_label_helper.rb
219
- - app/helpers/rails_connector/seo_helper.rb
220
- - app/helpers/rails_connector/link_helper.rb
221
- - app/helpers/rails_connector/default_user_helper.rb
222
- - app/helpers/rails_connector/default_cms_helper.rb
223
- - app/helpers/rails_connector/micronav_helper.rb
224
- - app/helpers/rails_connector/marker_helper.rb
225
- - app/helpers/rails_connector/layout_helper.rb
226
- - app/helpers/rails_connector/display_helper.rb
227
- - app/helpers/rails_connector/cms_asset_helper.rb
228
- - app/helpers/rails_connector/default_ratings_helper.rb
229
- - app/helpers/rails_connector/tracking_helper.rb
230
- - app/helpers/rails_connector/default_cms_routing_helper.rb
231
- - app/helpers/rails_connector/table_of_contents_helper.rb
232
- - app/helpers/rails_connector/time_machine_helper.rb
233
- - app/helpers/rails_connector/default_crm_form_helper.rb
234
- - app/helpers/rails_connector/error_messages_helper.rb
235
- - app/helpers/crm_form_helper.rb
236
- - app/controllers/user_controller.rb
237
- - app/controllers/rss_controller.rb
238
- - app/controllers/ratings_controller.rb
239
- - app/controllers/pdf_controller.rb
240
211
  - app/controllers/cms_controller.rb
241
- - app/controllers/search_controller.rb
242
- - app/controllers/rails_connector/pdf_external_controller.rb
243
- - app/controllers/rails_connector/default_ratings_controller.rb
212
+ - app/controllers/comments_controller.rb
213
+ - app/controllers/crm_form_controller.rb
214
+ - app/controllers/pdf_controller.rb
244
215
  - app/controllers/rails_connector/default_cms_controller.rb
245
- - app/controllers/rails_connector/default_user_controller.rb
246
216
  - app/controllers/rails_connector/default_comments_controller.rb
247
- - app/controllers/rails_connector/default_rss_controller.rb
248
- - app/controllers/rails_connector/default_pdf_controller.rb
249
217
  - app/controllers/rails_connector/default_crm_form_controller.rb
218
+ - app/controllers/rails_connector/default_pdf_controller.rb
219
+ - app/controllers/rails_connector/default_ratings_controller.rb
220
+ - app/controllers/rails_connector/default_rss_controller.rb
250
221
  - app/controllers/rails_connector/default_search_controller.rb
222
+ - app/controllers/rails_connector/default_user_controller.rb
223
+ - app/controllers/rails_connector/pdf_external_controller.rb
251
224
  - app/controllers/rails_connector/time_machine_controller.rb
225
+ - app/controllers/ratings_controller.rb
226
+ - app/controllers/rss_controller.rb
227
+ - app/controllers/search_controller.rb
252
228
  - app/controllers/seo_sitemap_controller.rb
253
- - app/controllers/comments_controller.rb
254
- - app/controllers/crm_form_controller.rb
229
+ - app/controllers/user_controller.rb
230
+ - app/helpers/cms_helper.rb
231
+ - app/helpers/cms_routing_helper.rb
232
+ - app/helpers/crm_form_helper.rb
233
+ - app/helpers/rails_connector/cms_asset_helper.rb
234
+ - app/helpers/rails_connector/default_cms_helper.rb
235
+ - app/helpers/rails_connector/default_cms_routing_helper.rb
236
+ - app/helpers/rails_connector/default_crm_form_helper.rb
237
+ - app/helpers/rails_connector/default_ratings_helper.rb
238
+ - app/helpers/rails_connector/default_user_helper.rb
239
+ - app/helpers/rails_connector/display_helper.rb
240
+ - app/helpers/rails_connector/error_messages_helper.rb
241
+ - app/helpers/rails_connector/layout_helper.rb
242
+ - app/helpers/rails_connector/link_helper.rb
243
+ - app/helpers/rails_connector/mandatory_label_helper.rb
244
+ - app/helpers/rails_connector/marker_helper.rb
245
+ - app/helpers/rails_connector/menu_helper.rb
246
+ - app/helpers/rails_connector/micronav_helper.rb
247
+ - app/helpers/rails_connector/seo_helper.rb
248
+ - app/helpers/rails_connector/table_of_contents_helper.rb
249
+ - app/helpers/rails_connector/time_machine_helper.rb
250
+ - app/helpers/rails_connector/tracking_helper.rb
251
+ - app/helpers/ratings_helper.rb
252
+ - app/helpers/user_helper.rb
253
+ - app/mailers/confirmation_mailer.rb
255
254
  - app/models/crm_form.rb
256
- - app/models/obj.rb
257
255
  - app/models/named_link.rb
258
- - app/models/rails_connector/link_list.rb
259
- - app/models/rails_connector/default_rating.rb
256
+ - app/models/obj.rb
260
257
  - app/models/rails_connector/default_comment.rb
261
- - app/mailers/confirmation_mailer.rb
258
+ - app/models/rails_connector/default_rating.rb
259
+ - app/models/rails_connector/link_list.rb
262
260
  - README
263
261
  files:
264
262
  - app/assets/images/admin/minus.gif
@@ -394,6 +392,7 @@ files:
394
392
  - lib/generators/rails_connector/comments/comments_generator.rb
395
393
  - lib/generators/rails_connector/comments/templates/migration.rb
396
394
  - lib/generators/rails_connector/install/install_generator.rb
395
+ - lib/generators/rails_connector/install/templates/initializers/crm_connector.rb
397
396
  - lib/generators/rails_connector/install/templates/initializers/rails_connector.rb
398
397
  - lib/generators/rails_connector/install/templates/local/configuration.rb
399
398
  - lib/generators/rails_connector/install/templates/obj_extensions.rb