Closes #1024. Do not create user with ldap auth if wrong password

This commit is contained in:
rverchere 2010-04-16 04:23:14 +08:00 committed by Eric Allen
parent b9f1f57740
commit c769b2a7eb

View file

@ -71,9 +71,17 @@ class UsersController < ApplicationController
render :action => "nosignup", :layout => "login"
return
end
user = User.new(params['user'])
if Tracks::Config.auth_schemes.include?('ldap') &&
user.auth_type == 'ldap' &&
!SimpleLdapAuthenticator.valid?(user.login, params['user']['password'])
notify :warning, "Incorrect password"
redirect_to :action => 'new'
return
end
if Tracks::Config.auth_schemes.include?('cas')
if user.auth_type.eql? "cas"
user.crypted_password = "cas"