summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/auth_source.rb3
-rw-r--r--db/migrate/084_change_auth_sources_account_limit.rb9
2 files changed, 12 insertions, 0 deletions
diff --git a/app/models/auth_source.rb b/app/models/auth_source.rb
index 47eec106d..2f651ade5 100644
--- a/app/models/auth_source.rb
+++ b/app/models/auth_source.rb
@@ -20,6 +20,9 @@ class AuthSource < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name
+ validates_length_of :name, :host, :account_password, :maximum => 60
+ validates_length_of :account, :base_dn, :maximum => 255
+ validates_length_of :attr_login, :attr_firstname, :attr_lastname, :attr_mail, :maximum => 30
def authenticate(login, password)
end
diff --git a/db/migrate/084_change_auth_sources_account_limit.rb b/db/migrate/084_change_auth_sources_account_limit.rb
new file mode 100644
index 000000000..6a933b894
--- /dev/null
+++ b/db/migrate/084_change_auth_sources_account_limit.rb
@@ -0,0 +1,9 @@
+class ChangeAuthSourcesAccountLimit < ActiveRecord::Migration
+ def self.up
+ change_column :auth_sources, :account, :string
+ end
+
+ def self.down
+ change_column :auth_sources, :account, :string, :limit => 60
+ end
+end