You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2017/07/17 16:11:44 UTC

[1/2] allura git commit: Also fire after_login() for expired pwds; clarify audit log message

Repository: allura
Updated Branches:
  refs/heads/master bdcdcbf5a -> 3470ed196


Also fire after_login() for expired pwds; clarify audit log message


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

Branch: refs/heads/master
Commit: 3470ed19617175b1495cae348e9ca1efd0c2347c
Parents: e4cb795
Author: Dave Brondsema <da...@brondsema.net>
Authored: Wed Jul 12 13:31:50 2017 -0400
Committer: Kenton Taylor <kt...@slashdotmedia.com>
Committed: Mon Jul 17 14:23:10 2017 +0000

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/3470ed19/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index ddb5f38..6e71dcb 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -189,11 +189,11 @@ class AuthenticationProvider(object):
         if self.is_password_expired(user):
             self.session['pwd-expired'] = True
             self.session['expired-username'] = user.username
-            h.auditlog_user('Password expired', user=user)
+            h.auditlog_user('Successful login; Password expired', user=user)
         else:
             self.session['username'] = user.username
             h.auditlog_user('Successful login', user=user)
-            self.after_login(user, self.request)
+        self.after_login(user, self.request)
 
         if 'rememberme' in self.request.params:
             remember_for = int(config.get('auth.remember_for', 365))


[2/2] allura git commit: Provide a AuthProvider hook to do things after login

Posted by ke...@apache.org.
Provide a AuthProvider hook to do things after login


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

Branch: refs/heads/master
Commit: e4cb79584b3205a5fe2292e2eb371011c969a70e
Parents: bdcdcbf
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Jun 29 15:14:53 2017 -0400
Committer: Kenton Taylor <kt...@slashdotmedia.com>
Committed: Mon Jul 17 14:23:10 2017 +0000

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/e4cb7958/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index a8008ed..ddb5f38 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -163,6 +163,12 @@ class AuthenticationProvider(object):
         '''
         raise NotImplementedError('_login')
 
+    def after_login(self, user, request):
+        '''
+        This is a hook so that custom AuthenticationProviders can do things after a successful login.
+        '''
+        pass
+
     def login(self, user=None, multifactor_success=False):
         from allura import model as M
         if user is None:
@@ -187,6 +193,7 @@ class AuthenticationProvider(object):
         else:
             self.session['username'] = user.username
             h.auditlog_user('Successful login', user=user)
+            self.after_login(user, self.request)
 
         if 'rememberme' in self.request.params:
             remember_for = int(config.get('auth.remember_for', 365))