diff options
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 5 |
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', |