diff options
author | elijah <elijah@riseup.net> | 2016-01-31 14:43:19 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-01-31 15:10:10 -0800 |
commit | e7e16318d056dbd9ec272085487cce6039627b09 (patch) | |
tree | 6ff86c1ae638da1ad620924037ccd41f9418b4b8 /app/models/account.rb | |
parent | 16fb1c2bf33ca418a6db06217e286964077a730f (diff) |
remove cert fingerprints for disabled users, so that they cannot send email anymore. closes #7690
Diffstat (limited to 'app/models/account.rb')
-rw-r--r-- | app/models/account.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index a5cd833..46e5446 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -69,6 +69,17 @@ class Account @user.destroy end + # when a user is disable, all their data and associations remain + # in place, but the user should not be able to send email or + # create new authentication certificates. + def disable + if @user && !@user.tmp? + @user.enabled = false + @user.save + Identity.remove_cert_fingerprints_for(@user) + end + end + protected def update_login(login) |