[Zope-dev] Adding a new UserSource

Harry Henry Gebel hgebel@inet.net
Sun, 15 Oct 2000 10:10:22 -0400


I am trying to add a new UserSource for LoginManager. I placed a directory
SampleUserSource in /usr/lib/zope/lib/python/Products , in this directory I
placed two files __init__.py and SampleUserSource.py . Here are the
contents of the files:

__init__.py:

from SampleUserSource import SampleUserSource

def initialize(context):
  ''' Register SampleUserSource class as a ZPatterns Plug-in'''
  context.registerPlugInClass(
    SampleUserSource,
    permission = 'Add Sample User Source',
    constructors = defaultConstructors(SampleUserSource, globals()))

  context.registerBaseClass(SampleUserSource)


SampleUserSource.py:

from Products.LoginManager.UserSources import BasicUserSource

class SampleUserSource(BasicUserSource):
  """ Sample UserSource plugin """

  meta_type = "Sample User Source"

  def retrieveItem(self, name):
    raise NotImplementedError

  def rolesForUser(self, user):
    raise NotImplementedError

  def domainsForUser(self, user):
    raise NotImplementedError

  def authenticateUser(self, user, password, request):
    raise NotImplementedError


I restart Zope, but the new user source does not show up in the products
list, nor does it show up in the list of available user sources. Obviously,
I am missing something here either about making Python Products or
plug-ins. If anyone could point out to me what I am doing wrong I would
appreciate it. There are .pyc files in the SampleUserSource directory so I
know Zope at least is aware of the files existence.

-- 
Harry Henry Gebel, ICQ# 76308382
West Dover Hundred, Delaware