Merge pull request #5169 from jaideng123/5157-Increase_captcha_field_length

Increase max length of simple_captcha to 12
This commit is contained in:
Jonne Haß 2014-08-27 01:28:44 +02:00
commit b53ee9c7b3
5 changed files with 14 additions and 5 deletions

View file

@ -25,6 +25,7 @@ The default for including jQuery from a CDN has changed. If you want to continue
* Better character limit message [#5151](https://github.com/diaspora/diaspora/pull/5151)
* Remember whether a AccountDeletion was performed [#5156](https://github.com/diaspora/diaspora/pull/5156)
* Increased the number of notifications shown in drop down bar to 15 [#5129](https://github.com/diaspora/diaspora/pull/5129)
* Increase possible captcha length [#5169](https://github.com/diaspora/diaspora/pull/5169)
# 0.4.1.0

View file

@ -289,7 +289,7 @@ configuration: ## Section
## Captcha image size (default='120x20')
#image_size: '120x20'
## Length of captcha text (default=5)
## Length of captcha text (default=5)(max=12)
#captcha_length: 5
## Captcha image style (default='simply_green')

View file

@ -1,7 +1,7 @@
SimpleCaptcha.setup do |sc|
sc.image_size = AppConfig.settings.captcha.image_size
sc.length = AppConfig.settings.captcha.captcha_length.to_i
sc.length = [1, [AppConfig.settings.captcha_length.to_i, 12].min].max
sc.image_style = AppConfig.settings.captcha.image_style
sc.distortion = AppConfig.settings.captcha.distortion
p AppConfig.settings.captcha
end
end

View file

@ -0,0 +1,8 @@
class IncreaseSimpleCaptchaLimit < ActiveRecord::Migration
def self.up
change_column :simple_captcha_data, :value, :string, :limit => 12
end
def self.down
change_column :simple_captcha_data, :value, :string, :limit => 6
end
end

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140824230505) do
ActiveRecord::Schema.define(version: 20140826165533) do
create_table "account_deletions", force: true do |t|
t.string "diaspora_handle"
@ -449,7 +449,7 @@ ActiveRecord::Schema.define(version: 20140824230505) do
create_table "simple_captcha_data", force: true do |t|
t.string "key", limit: 40
t.string "value", limit: 6
t.string "value", limit: 12
t.datetime "created_at"
t.datetime "updated_at"
end