durusmail: quixote-users: User class for Quixote
User class for Quixote
2002-11-21
2002-11-21
2002-11-21
FastCGI, Apache, Windows, Bad Combo?
2002-11-27
User class for Quixote
Jim Dukarm
2002-11-21
I saw some discussion in the Quixote-users archive about including a
simple User class in Quixote. I guess the consensus was that it might
be nice, but there were more pressing issues to deal with.

My User and UserManager classes (attached) are pretty lightweight and
might be the right sort of thing for Quixote. I just revised them,
using some tricks from Quixote's Session and SessionManager to make
them more friendly to subclassing.

The UserManager, like the SessionManager, can be initialized with any
kind of mapping for storage - persistent or not - of User instances.
The maximum allowable number of Users can also be specified.  (Note
that this is not the same thing as limiting the number of concurrent
logins. I am doing that in an authenticate() function in the page
generation code).

As written, the User keeps its password in encrypted form. By
subclassing User and overriding the _encrypt method, you can keep the
password as open text, if desired.

The User has an integer security level, which is useful for
discriminating between, say, read-only users, data-entry users, and
admin users.

Anyone who wishes to use these is welcome to them.

Jim Dukarm
DELTA-X RESEARCH
reply