You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2014/07/25 18:03:12 UTC

[6/8] git commit: [#7524] ticket:620 Log password reset and account disabling

[#7524] ticket:620 Log password reset and account disabling


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/563d6754
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/563d6754
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/563d6754

Branch: refs/heads/master
Commit: 563d675405250f641f029a13e07598d9e9125a0f
Parents: 2e92047
Author: Igor Bondarenko <je...@gmail.com>
Authored: Fri Jul 25 12:02:58 2014 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Jul 25 16:02:58 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py | 1 +
 Allura/allura/lib/plugin.py       | 4 ++++
 2 files changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/563d6754/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 50a0782..801bdf2 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -370,6 +370,7 @@ class AuthController(BaseController):
         flash('Password changed')
         del session['pwd-expired']
         session.save()
+        M.AuditLog.log_user('Password reset (via expiration process)')
         if return_to and return_to != request.url:
             redirect(return_to)
         else:

http://git-wip-us.apache.org/repos/asf/allura/blob/563d6754/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index a5c3f65..59949ce 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -141,6 +141,8 @@ class AuthenticationProvider(object):
             self.session['userid'] = user._id
             if self.is_password_expired(user):
                 self.session['pwd-expired'] = True
+                from allura.model import AuditLog
+                AuditLog.log_user('Password expired', user=user)
             self.session.save()
             g.zarkov_event('login', user=user)
             g.statsUpdater.addUserLogin(user)
@@ -297,6 +299,8 @@ class LocalAuthenticationProvider(AuthenticationProvider):
     def disable_user(self, user):
         user.disabled = True
         session(user).flush(user)
+        from allura.model import AuditLog
+        AuditLog.log_user('Account disabled', user=user)
 
     def validate_password(self, user, password):
         return self._validate_password(user, password)