Normalize the identity_url when it's set.
OpenId uses a specific format for the url it uses which requires the protocol and trailing slash. This change will normalize the value to when a user sets it. #699 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2453 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
14e445c600
commit
60dc357271
2 files changed
+28
No files matched your search
@@ -80,6 +80,15 @@ class User < ActiveRecord::Base
|
||||
super
|
||||
end
|
||||
|
||||
def identity_url=(url)
|
||||
begin
|
||||
self.write_attribute(:identity_url, OpenIdAuthentication.normalize_identifier(url))
|
||||
rescue InvalidOpenId
|
||||
# Invlaid url, don't save
|
||||
end
|
||||
self.read_attribute(:identity_url)
|
||||
end
|
||||
|
||||
# Returns the user that matches provided login and password, or nil
|
||||
def self.try_to_login(login, password)
|
||||
# Make sure no one can sign in with an empty password
|
||||
|
||||
Reference in new issue
Block a user