From 7e755a53b8536caf0c792e0d83270a9aac1da893 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 14 Aug 2007 09:14:33 +0000 Subject: [PATCH] Firstname, lastname and email LDAP attributes are now required if "on-the-fly register" is checked. git-svn-id: http://redmine.rubyforge.org/svn/trunk@631 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/auth_source_ldap.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/auth_source_ldap.rb b/app/models/auth_source_ldap.rb index 31259afc9..3adca62ae 100644 --- a/app/models/auth_source_ldap.rb +++ b/app/models/auth_source_ldap.rb @@ -20,7 +20,8 @@ require 'iconv' class AuthSourceLdap < AuthSource validates_presence_of :host, :port, :attr_login - + validates_presence_of :attr_firstname, :attr_lastname, :attr_mail, :if => Proc.new { |a| a.onthefly_register? } + def after_initialize self.port = 389 if self.port == 0 end