mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-24 01:11:12 +00:00
Code cleanup (#19458).
git-svn-id: http://svn.redmine.org/redmine/trunk@14265 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
51f7060aa8
commit
c8fb0956d1
@ -323,13 +323,12 @@ class User < Principal
|
|||||||
return auth_source.allow_password_changes?
|
return auth_source.allow_password_changes?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns true if the user password has expired
|
||||||
def password_expired?
|
def password_expired?
|
||||||
changed_on = self.passwd_changed_on || Time.at(0)
|
if Setting.password_max_age.to_i.zero?
|
||||||
period = Setting.password_max_age.to_i
|
|
||||||
|
|
||||||
if period.zero?
|
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
|
changed_on = self.passwd_changed_on || Time.at(0)
|
||||||
changed_on < period.days.ago
|
changed_on < period.days.ago
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
<%= submit_tag l(:button_apply) %>
|
<%= submit_tag l(:button_apply) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% unless @user.must_change_passwd? || @user.password_expired? %>
|
<% unless @user.must_change_password? %>
|
||||||
<% content_for :sidebar do %>
|
<% content_for :sidebar do %>
|
||||||
<%= render :partial => 'sidebar' %>
|
<%= render :partial => 'sidebar' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user