Hi all,
I'm trying to get a simple UserKit user management to work, but I have
a bit of a problem with this. It might be my missing understanding of
how UserKit is supposed to work, but nevertheless:
In my the incomplete draft of the user management, only the "Create"
_action_ of a WebKit page is implemented so far. self.mgr is an
instance of UserManagerToFile in the following. In the instantiation I
added a call to self.mgr.clearCache()
"Create" calls a function with two strings 'name' and 'password'
def add(self, name, password=None):
newUser = self.mgr.createUser(name, password)
return newUser
This is intentionally written without error checking. Now if I call
this from a page form like this:
if req.hasValue('username'):
name = req.value('username')
if req.hasValue('password'):
passwd = req.value('password')
newUser = self.hood.add(name, passwd)
it works for the first user, that tries to create herself. I get a
file "1.user" im my user dir.
But if I try to create another user, this fails with:
File "/dos/ibm/hdc18/f/src/python/webware/workdir/thehood/Main.py", line 71, in
Create
newUser = self.hood.add(name, passwd)
File "/dos/ibm/hdc18/f/src/python/webware/workdir/thehood/Main.py", line 22, in add
newUser = self.mgr.createUser(name, password)
File "./UserKit/UserManager.py", line 146, in createUser
File "./UserKit/UserManagerToFile.py", line 109, in addUser
File "./UserKit/UserManager.py", line 152, in addUser
AssertionError
Line 152 in UserManager.py says:
assert not self._cachedUsersBySerialNum.has_key(user.serialNum())
So it seems, that the second attempt to create a user runs into a
caching problem.
Do I miss something in my way, how to use UserKit? This all is under
WebWare 0.7 and running under OneShot.cgi or the AppServer
(I'm sending this a second time, because the first mail didn't come
through, probably because of the attachment, that is missing now.)
ciao
--
Frank Barknecht _ ______footils.org__
-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss