[Zope-PTK] SQLMember portal error

Nick Garcia ngarcia@codeit.com
Thu, 06 Apr 2000 09:16:38 -0700


Ty Sarna wrote:
> 
> In article <38EB7939.333FC3AA@codeit.com>,
> Nick Garcia  <ngarcia@codeit.com> wrote:
> > PersistentUserSource as an initial base.  So far everything works great,
> > although I did have to make a couple of changed to the LoginManager to
> > get it to work.
> 
> You might want to tell us about such things so that they don't become
> unfixed in the next release! :^)

Here's a cvs diff with the changes I made to the LoginManager.  I'll
send my sqlUserSource in private email to everyone who requested it (so
as to not clutter the list).

Index: LoginManager.py
===================================================================
RCS file: /cvs-repository/ZopePTK/LoginManager/LoginManager.py,v
retrieving revision 1.5
diff -u -b -r1.5 LoginManager.py
--- LoginManager.py     2000/03/02 17:22:34     1.5
+++ LoginManager.py     2000/04/06 16:11:56
@@ -4,12 +4,12 @@
 from AccessControl.User import User, super, nobody
 from AccessControl.PermissionRole import _what_not_even_god_should_do
 from Globals import HTMLFile, MessageDialog
-_marker = []
+from ZPublisher.BaseRequest import _marker

-
 # XXX need to add __ac_permissions__ on everything

 _LoggingInUser = User('LoggingInUser', '', ['LoggingIn'], [])
+_LoggingInUser._v__marker__ = _marker

 _LoginMethods = []
 _UserSources = []
@@ -188,6 +188,7 @@
                                loginMethod.logoutCurrentUser(self,
name)

        def validate(self, request, auth='', roles=None):
+
                request.set('LOGIN_METHODS',[])
                if roles is _what_not_even_god_should_do:
                        request.response.notFoundError()
@@ -212,12 +213,17 @@

                if user is not None:
                        # We got a user, check him out
+
                        user=getattr(user,'aq_base',user).__of__(self)
                        if user.allowed(parent, roles): return user

                        # Give the app a chance to tell the user he's
logged
                        # in, but not allowed
+
                        if hasattr(self,'forbiddenPage'):
+                            # Keep the person the same. -Scott
+                            user._v__marker__ = _marker
+                            request['AUTHENTICATED_USER'] = user
                            self.forbiddenPage(self, request, user=user,
                                needroles=roles,
userroles=user.getRoles())

Index: LoginMethods.py
===================================================================
RCS file: /cvs-repository/ZopePTK/LoginManager/LoginMethods.py,v
retrieving revision 1.4
diff -u -b -r1.4 LoginMethods.py

-- 
Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com