summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-08-05 17:58:33 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-08-05 17:58:33 +0000
commitb764e398475c26217bcca8ac9063f053bc1cf627 (patch)
treef8c44b9b990ff60f3cf51fe65bb8dad9dae8bd35 /app/models
parentbd4fba08e5bec539a746e9be422b9c2baab51406 (diff)
downloadredmine-b764e398475c26217bcca8ac9063f053bc1cf627.tar.gz
redmine-b764e398475c26217bcca8ac9063f053bc1cf627.zip
Option to force a user to change his password (#3872).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12081 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 441e6b5b8..9020295d0 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -280,6 +280,10 @@ class User < Principal
return auth_source.allow_password_changes?
end
+ def must_change_password?
+ must_change_passwd? && change_password_allowed?
+ end
+
def generate_password?
generate_password == '1' || generate_password == true
end
@@ -568,6 +572,7 @@ class User < Principal
safe_attributes 'status',
'auth_source_id',
'generate_password',
+ 'must_change_passwd',
:if => lambda {|user, current_user| current_user.admin?}
safe_attributes 'group_ids',