incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] git commit: [#5271] Added disabled flag to user
Date Tue, 13 Nov 2012 17:02:36 GMT
[#5271] Added disabled flag to user

Signed-off-by: Cory Johns <johnsca@geek.net>


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

Branch: refs/heads/master
Commit: 2b2049f7f88e98d40e655beaa0b724f13953c757
Parents: 7f20d9a
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Nov 12 15:31:52 2012 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Nov 13 16:42:55 2012 +0000

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


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b2049f7/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index b8f565c..ed32e01 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -70,6 +70,9 @@ class AuthenticationProvider(object):
         user = M.User.query.get(_id=self.session.get('userid', None))
         if user is None:
             return M.User.anonymous()
+        if user.disabled:
+            self.logout()
+            return M.User.anonymous()
         return user
 
     def register_user(self, user_doc):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b2049f7/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index c12ff9e..b5c8567 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -291,8 +291,9 @@ class User(MappedClass, ActivityNode, ActivityObject):
     projects=FieldProperty(S.Deprecated)
     tool_preferences=FieldProperty({str:{str:None}}) # full mount point: prefs dict
     tool_data = FieldProperty({str:{str:None}}) # entry point: prefs dict
-    # Don't use directly, use get/set_pref() instead
     display_name=FieldProperty(str)
+    disabled=FieldProperty(bool, if_missing=False)
+    # Don't use directly, use get/set_pref() instead
     preferences=FieldProperty(dict(
             results_per_page=int,
             email_address=str,


Mime
View raw message