summaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 10:30:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-05-10 10:30:10 +0000
commitc8fb0956d15b8518c4fa38cc0ed5acff52e4c4b8 (patch)
tree11aa226d1d0dd3644ac170746fcc3673eea13efa /app/models/user.rb
parent51f7060aa8464f51f78403f87b3556a7ffaa1995 (diff)
downloadredmine-c8fb0956d15b8518c4fa38cc0ed5acff52e4c4b8.tar.gz
redmine-c8fb0956d15b8518c4fa38cc0ed5acff52e4c4b8.zip
Code cleanup (#19458).
git-svn-id: http://svn.redmine.org/redmine/trunk@14265 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 5978f06de..3ecf03c18 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -323,13 +323,12 @@ class User < Principal
return auth_source.allow_password_changes?
end
+ # Returns true if the user password has expired
def password_expired?
- changed_on = self.passwd_changed_on || Time.at(0)
- period = Setting.password_max_age.to_i
-
- if period.zero?
+ if Setting.password_max_age.to_i.zero?
false
else
+ changed_on = self.passwd_changed_on || Time.at(0)
changed_on < period.days.ago
end
end