Mailing List Archive

[Zope-PTK] SQLMember portal error
OK, figured I'd try an SQL Memberbase dportal, so created the tables
required, and took a swing.

After cicking the final button, I am presented with the following
traceback:
Traceback (innermost last):
File /local/home/Web/lib/python/ZPublisher/Publish.py, line 214, in
publish_module
File /local/home/Web/lib/python/ZPublisher/Publish.py, line 179, in
publish
File /local/home/Web/lib/python/Zope/__init__.py, line 202, in
zpublisher_exception_hook
File /local/home/Web/lib/python/ZPublisher/Publish.py, line 165, in
publish
File /local/home/Web/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: Portal_add)
File /local/home/Web/lib/python/ZPublisher/Publish.py, line 102, in
call_object
(Object: Portal_add)
File /local/home/Web/lib/python/OFS/DTMLMethod.py, line 150, in
__call__
(Object: Portal_add)
File /local/home/Web/lib/python/DocumentTemplate/DT_String.py, line
502, in __call__
(Object: Portal_add)
File /local/home/Web/lib/python/DocumentTemplate/DT_With.py, line 148,
in render
(Object: Portal.createInObjectManager(REQUEST['id'], REQUEST))
File /local/home/Web/lib/python/DocumentTemplate/DT_Util.py, line 335,
in eval
(Object: apply_wizard(REQUEST))
(Info: REQUEST)
File <string>, line 0, in ?
File /local/home/Web/lib/python/Products/PTKDemo/Portal.py, line 248,
in apply_wizard
(Object: DemoPortalBase)
File /local/home/Web/lib/python/Products/PTKDemo/Portal.py, line 172,
in addMember
(Object: DemoPortalBase)
File /local/home/Web/lib/python/AccessControl/User.py, line 501, in
_addUser
(Object: DemoSQLMemberFolderBase)
File /local/home/Web/lib/python/Products/PTKDemo/SQLMember.py, line
101, in getUser
(Object: DemoSQLMemberFolderBase)
File /local/home/Web/lib/python/OFS/PropertySheets.py, line 569, in
__getitem__
File /local/home/Web/lib/python/ZClasses/Property.py, line 403, in
__propsets__
File /local/home/Web/lib/python/OFS/PropertySheets.py, line 558, in
__propsets__
AttributeError: (see above)


Anybody solved this and I just missed it?

On that note, is -anyone- here testing against the SQLMemeber based
portal?

Bill


--
Bill Anderson Linux/Unix Administrator, Security Analyst
ESBU (ARC) bill_anderson@boi.hp.com
My opinions are just that; _my_ opinions.
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
Hi, Bill.

I think you are probably the only person to attempt to use the SQL
user forlder in some time. Sometime soon (this month by the look of
it, but I daren't be more specific) LoginManager will replace both the
ZODB and SQL member folders that I rolled. This will be a much saner
and more managable situation. If SQL membership is something you just
gotta have in the mean time, let me know and I'll try to kick the
kinks back out of the existing one.

Mike.

On Tue, 4 Apr 2000, Bill Anderson wrote:

> OK, figured I'd try an SQL Memberbase dportal, so created the tables
> required, and took a swing.
>
> After cicking the final button, I am presented with the following
> traceback:

> Anybody solved this and I just missed it?
>
> On that note, is -anyone- here testing against the SQLMemeber based
> portal?
>
> Bill

--
Mike Pelletier email: mike@digicool.com
Mild mannered software developer icq: 7127228
by day, super villain by night. phone: 519-884-2434
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
Mike Pelletier wrote:
>
> Hi, Bill.
>
> I think you are probably the only person to attempt to use the SQL
> user forlder in some time. Sometime soon (this month by the look of
> it, but I daren't be more specific) LoginManager will replace both the
> ZODB and SQL member folders that I rolled. This will be a much saner
> and more managable situation. If SQL membership is something you just
> gotta have in the mean time, let me know and I'll try to kick the
> kinks back out of the existing one.

Well, I do need it this month, so if the LM will be usable and handle
SQL membership will handle that this month, that will work for me.



--
Bill Anderson Linux/Unix Administrator, Security Analyst
ESBU (ARC) bill_anderson@boi.hp.com
My opinions are just that; _my_ opinions.
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
Mike Pelletier wrote:
>
> Hi, Bill.
>
> I think you are probably the only person to attempt to use the SQL
> user forlder in some time. Sometime soon (this month by the look of
> it, but I daren't be more specific) LoginManager will replace both the
> ZODB and SQL member folders that I rolled. This will be a much saner
> and more managable situation. If SQL membership is something you just
> gotta have in the mean time, let me know and I'll try to kick the
> kinks back out of the existing one.
>
> Mike.

In case anyone's interested, I ran into the same problem that Bill did,
looked at it for a few minutes, then decided it would be simpler to use
the LoginManager and create a sqlUserSource, which I did using the
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.

Unfortunately I've been to busy working on this project to begin
contributing back, and haven't updated from CVS in a while to find out
if the problems I had to fix in LoginManager were fixed there yet, but
if anyone's interested in seeing how I've implemented the sqlUserSource,
let me know.

--
Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
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! :^)

> if anyone's interested in seeing how I've implemented the sqlUserSource,
> let me know.

Yes, I sure am! So far, you're the only other person besides Mike and us
to have written one that I know of, and it would be nice to see.

BTW, the next release will have some incompatible changes that break
existing user sources (and Login Methods, but AFAIK nobody else has
written any new ones yet) because of a new, cleaner registration
mechanism. We hope this will represent the last of the interface
shakeout and things will settle down then. The new PlugIns system is
very cool, though, and I hope people will feel it was worth it :-)
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
Ty Sarna wrote:
...
> BTW, the next release will have some incompatible changes that break
> existing user sources (and Login Methods, but AFAIK nobody else has
> written any new ones yet) because of a new, cleaner registration
> mechanism.

Is that the forthcoming we-think-this-week release?

--
In flying I have learned that carelessness and overconfidence are
usually far more dangerous than deliberately accepted risks.
-- Wilbur Wright in a letter to his father, September 1900
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
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
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
As it happens, we've done the same fix, except for the bit I've left below.
I'm not sure what the purpose of setting the _v__marker__ on the user
during the forbiddenPage call is for, since AUTHENTICATED_USER is normally
'LoggingInUser' when displaying ForbiddenPage, and 'user' is the variable
which contains the authenticated user. It might be useful to reverse this
convention, I suppose, but I'm not sure what for.

At 09:16 AM 4/6/00 -0700, Nick Garcia wrote:
>
>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
>@@ -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())
Re: [Zope-PTK] LoginManager release (was Re: SQLMember portal error) [ In reply to ]
At 08:46 PM 4/5/00 -0600, Bill Anderson wrote:
>Ty Sarna wrote:
>...
>> BTW, the next release will have some incompatible changes that break
>> existing user sources (and Login Methods, but AFAIK nobody else has
>> written any new ones yet) because of a new, cleaner registration
>> mechanism.
>
>Is that the forthcoming we-think-this-week release?
>

Yep. It's looking good, although Ty and I both had to raise our Zope
internals Zen a few levels of mastery to finish the PlugIns framework
today. Tomorrow we plan to do cleanup, documentation, testing, and general
review before release. The release includes the PlugIns framework, which
everything is now based on, and it includes the base class for
SheetProvider plugins. By implementing SheetProviders, you can give user
objects property sheet data from absolutely anywhere Zope can access.

Unfortunately, in this release you will have to implement the actual
property sheets yourself, because the SheetProvider base class just has a
stub method for returning a property sheet, but it doesn't actually know
how to make one yet. :(
Re: [Zope-PTK] SQLMember portal error [ In reply to ]
"Phillip J. Eby" wrote:
>
> As it happens, we've done the same fix, except for the bit I've left below.
> I'm not sure what the purpose of setting the _v__marker__ on the user
> during the forbiddenPage call is for, since AUTHENTICATED_USER is normally
> 'LoggingInUser' when displaying ForbiddenPage, and 'user' is the variable
> which contains the authenticated user. It might be useful to reverse this
> convention, I suppose, but I'm not sure what for.

Ahhh, the purpose of that might be useful only for the site we're
building. Basically there's a protected section of the site that
requires some information that the user doesn't have to fill in right
away when they first register. When they try to access this section, we
pop up a form for the to fill in additional information. What we're
actually doing there, is setting the user *back* to the original user,
and not LoggingInUser, so that they can fill out the form and change
their information, at which point they'll get the role required to
access the site.
Re: [Zope-PTK] LoginManager release (was Re: SQLMember portalerror) [ In reply to ]
"Phillip J. Eby" wrote:
>
> At 08:46 PM 4/5/00 -0600, Bill Anderson wrote:
> >Ty Sarna wrote:
> >...
> >> BTW, the next release will have some incompatible changes that break
> >> existing user sources (and Login Methods, but AFAIK nobody else has
> >> written any new ones yet) because of a new, cleaner registration
> >> mechanism.
> >
> >Is that the forthcoming we-think-this-week release?
> >
>
> Yep. It's looking good, although Ty and I both had to raise our Zope
> internals Zen a few levels of mastery to finish the PlugIns framework
> today. Tomorrow we plan to do cleanup, documentation, testing, and general
> review before release. The release includes the PlugIns framework, which
> everything is now based on, and it includes the base class for
> SheetProvider plugins. By implementing SheetProviders, you can give user
> objects property sheet data from absolutely anywhere Zope can access.
>
> Unfortunately, in this release you will have to implement the actual
> property sheets yourself, because the SheetProvider base class just has a
> stub method for returning a property sheet, but it doesn't actually know
> how to make one yet. :(


I was working on somehting like this for Banners and the KnowledgeKit
until I heard of the rack concept. I'll be very glad to see this. :)

--
In flying I have learned that carelessness and overconfidence are
usually far more dangerous than deliberately accepted risks.
-- Wilbur Wright in a letter to his father, September 1900
Re: [Zope-PTK] LoginManager release [ In reply to ]
At 07:27 PM 4/6/00 -0500, Phillip J. Eby wrote:
>
>Yep. It's looking good, although Ty and I both had to raise our Zope
>internals Zen a few levels of mastery to finish the PlugIns framework
>today. Tomorrow we plan to do cleanup, documentation, testing, and general
>review before release.

Unfortunately, testing uncovered a very nasty bug in GenericUserSource that
had to do with recursion of calls to getRolesForUser under very specific
circumstances, which took up most of our work day figuring out why the
%&$)#&%$ Zope crashed and dumped core every time a freshly logged-in
GUS-based user went to a "manage_workspace" method as the first thing they
did, but if they went anywhere else, everything after that worked.
Including manage_workspace. It took us hours just to figure out how to
consistently reproduce the problem.

So, no release yet, and we have to do our tests over again because the
changes we made to fix the recursion bug might have had an effect on the
things that already passed testing. :(