@@ -323,13 +323,12 class User < Principal | |||||
323 | return auth_source.allow_password_changes? |
|
323 | return auth_source.allow_password_changes? | |
324 | end |
|
324 | end | |
325 |
|
325 | |||
|
326 | # Returns true if the user password has expired | |||
326 | def password_expired? |
|
327 | def password_expired? | |
327 | changed_on = self.passwd_changed_on || Time.at(0) |
|
328 | if Setting.password_max_age.to_i.zero? | |
328 | period = Setting.password_max_age.to_i |
|
|||
329 |
|
||||
330 | if period.zero? |
|
|||
331 | false |
|
329 | false | |
332 | else |
|
330 | else | |
|
331 | changed_on = self.passwd_changed_on || Time.at(0) | |||
333 | changed_on < period.days.ago |
|
332 | changed_on < period.days.ago | |
334 | end |
|
333 | end | |
335 | end |
|
334 | end |
@@ -17,7 +17,7 | |||||
17 | <%= submit_tag l(:button_apply) %> |
|
17 | <%= submit_tag l(:button_apply) %> | |
18 | <% end %> |
|
18 | <% end %> | |
19 |
|
19 | |||
20 |
<% unless @user.must_change_passw |
|
20 | <% unless @user.must_change_password? %> | |
21 | <% content_for :sidebar do %> |
|
21 | <% content_for :sidebar do %> | |
22 | <%= render :partial => 'sidebar' %> |
|
22 | <%= render :partial => 'sidebar' %> | |
23 | <% end %> |
|
23 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now