@@ -323,13 +323,12 class User < Principal | |||
|
323 | 323 | return auth_source.allow_password_changes? |
|
324 | 324 | end |
|
325 | 325 | |
|
326 | # Returns true if the user password has expired | |
|
326 | 327 | def password_expired? |
|
327 | changed_on = self.passwd_changed_on || Time.at(0) | |
|
328 | period = Setting.password_max_age.to_i | |
|
329 | ||
|
330 | if period.zero? | |
|
328 | if Setting.password_max_age.to_i.zero? | |
|
331 | 329 | false |
|
332 | 330 | else |
|
331 | changed_on = self.passwd_changed_on || Time.at(0) | |
|
333 | 332 | changed_on < period.days.ago |
|
334 | 333 | end |
|
335 | 334 | end |
General Comments 0
You need to be logged in to leave comments.
Login now