incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#5271] Added disabled flag to user
Date Mon, 12 Nov 2012 22:09:16 GMT
Updated Branches:
  refs/heads/cj/5271 6f53be341 -> 92f8967f6 (forced update)


[#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/92f8967f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/92f8967f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/92f8967f

Branch: refs/heads/cj/5271
Commit: 92f8967f6bb845f42ea9d65618b2656a696ffb8c
Parents: ee3b451
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Nov 12 15:31:52 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Mon Nov 12 21:05:23 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/92f8967f/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/92f8967f/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