UserKit.UserManagerToMiddleKit | index /usr/local/share/webware/UserKit/UserManagerToMiddleKit.py

`The UserManagerToMiddleKit class.`

Classes

``

UserKit.UserManager.UserManager(__builtin__.object)
  UserManagerToMiddleKit

class UserManagerToMiddleKit(UserKit.UserManager.UserManager)

``

`UserManagerToMiddleKit stores users in a given MiddleKit object store.
However, the manager itself does not keep any information there.
This might change in the future.
In your MiddleKit model, your User class should have the attributes:
name, password and externalId; all of type string.
The max len for external id should be at least 14.
You can decide what you like for the others.
Only name and password have to be required.
Then you must edit User.py so that:
* In addition to inheriting GenUser, it also inherits UserKit.User
* It invokes both base class' __init__()s
* The __init__ takes manager, name and password, and passes them on.
from UserKit.User import User
class User(GenUser, User):
def __init__(self, manager=None, name=None, password=None):
GenUser.__init__(self)
User.__init__(self, manager, name, password)
If your user class is called something other than 'User', then you must
pass it to the store:
from MyUser import MyUser
userMgr = UserManagerToMiddleKit(userClass=MyUser, store=store)
`

Method resolution order:
  UserManagerToMiddleKit
  UserKit.UserManager.UserManager
  __builtin__.object

Methods defined here:

__init__(self, userClass=None, store=None, useSQL=None)

activeUsers(self)

addUser(self, user)

inactiveUsers(self)

loadUser(self, serialNum, default=<class 'MiscUtils.NoDefault'>)

setUserClass(self, userClass)
  `Overridden to verify that our userClass is really a MiddleObject.`

userForExternalId(self, externalId, default=<class 'MiscUtils.NoDefault'>)

userForName(self, name, default=<class 'MiscUtils.NoDefault'>)

userForSerialNum(self, id, default=<class 'MiscUtils.NoDefault'>)

users(self)

Methods inherited from UserKit.UserManager.UserManager:

activeUserTimeout(self)

cachedUserTimeout(self)

clearCache(self)
  `Clear the cache of the manager.
  Use with extreme caution. If your program maintains a reference
  to a user object, but the manager loads in a new copy later on,
  then consistency problems could occur.
  The most popular use of this method is in the regression test suite.`

createUser(self, name, password, userClass=None)
  `Return a newly created user that is added to the manager.
  If userClass is not specified, the manager's default user class
  is instantiated. This not imply that the user is logged in.
  This method invokes addUser().
  See also: userClass(), setUserClass()`

login(self, user, password)
  `Return the user if the login is successful, otherwise return None.`

loginExternalId(self, externalId, password)

loginName(self, userName, password)

loginSerialNum(self, serialNum, password)

logout(self, user)

modifiedUserTimeout(self)

numActiveUsers(self)
  `Return the number of active users, e.g., users that are logged in.`

setActiveUserTimeout(self, value)

setCachedUserTimeout(self, value)

setModifiedUserTimeout(self, value)

shutDown(self)
  `Perform any tasks necessary to shut down the user manager.
  Subclasses may override and must invoke super as their *last* step.`

userClass(self)
  `Return the userClass, which is used by createUser.
  The default value is UserKit.User.User.`

Data descriptors inherited from UserKit.UserManager.UserManager:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`