允许您使用电子邮件地址登录。
betahaus.emaillogin的Python项目详细描述
betahaus.emaillogin
内容
- What is betahaus.emaillogin?
- Installation
- How it works
- Performance
- Extensions
- Issues
- Change history
- Contributors
什么是betahaus.emaillogin?
使用emailaddress的速度越来越快,但plone没有 有一个方便的方式使用用户注册的电子邮件地址登录。
betahaus.emaillogin允许使用电子邮件地址登录 在用户配置文件中指定。
plone有一个非常强大且可修改的身份验证系统,名为 可插拔认证服务(PAS)。顾名思义 是可插入的,因此很容易被第三方产品扩展 像这样。
安装
- 构建:
- 在适当的构建配置文件中将betahaus.emaillogin项添加到eggs和zcml中。
- 重新运行Buildout。
- 通过门户快速安装程序或plone中的站点设置进行安装
工作原理
betahaus.emaillogin正在安装,请将其放在 提取插件。如果指定了电子邮件地址和相应的 找到用户。请求中的电子邮件地址替换为 然后模拟提取失败以继续正常登录过程。
性能
当前的默认实现通过遍历所有pas用户来查找电子邮件,直到 找到相应的电子邮件。这种方法对于拥有大量用户的大量站点来说是很好的。 然而,当用户数量增加时,它的计算代价很高,速度也很慢。如果您遇到性能问题 可以应用名为extended的genericsetup配置文件。此扩展添加自定义电子邮件->;用户标识 允许从电子邮件地址快速查找用户标识的目录。
扩展配置文件通过portal_setup->;Import->;选择并应用配置文件Extended performance for EmailLogin Support应用。
如果要卸载此扩展配置文件,只需从站点根目录中删除email_catalog,emaillogin将 回到默认的查找实现。
扩展
您可以编写自定义电子邮件查找方法,用于将电子邮件转换为一个或多个用户名。 要记住,使用基于contenttype的成员实现,并且电子邮件出现在 目录,门户目录或自定义目录。有两个例子是betahaus.memberprofile 以及Products.remember。然后通过重用已经存储的目录数据 不需要另一个目录。要实现这一点,您需要注册一个实现接口IEmailPluginExtension的实用程序。 警告:当使用基于内容的成员身份实现时,默认情况下plone在第一次登录时创建成员contenttype。 这可能会导致初次登录时出现问题,因为门户目录中尚未提供该信息。
实用程序示例:
from zope.interface import implements from betahaus.emaillogin.interfaces import IEmailPluginExtension class Dummy(object): implements(IEmailPluginExtension) def getUserNames(self, context, login_email, get_all = False): usernames = context.custom_catalog(email = login_email) if usernames and get_all == False: return usernames[0].username return [x.username for x in usernames] dummy_extension = Dummy()
ZCML注册示例:
<utility provides="betahaus.emaillogin.interfaces.IEmailPluginExtension" component="betahaus.emaillogin.tests.test_extension.dummy_extension" permission="zope.Public" />
问题
问题可以在plone.org的products页面上的the issue tracker处提交。 更新到plone 4兼容性之后,可能引入了一些bug。所有的PLONE 3测试都通过了,但是如果你发现任何错误 不愿意归档。
变更历史
0.6.1(2012-02-16)
- 去掉未使用的导入——特别是在plone 4.1.4上失败的导入。[丽兹]
0.6(2011-04-11)
- Fixed a bug with correct formatted non existant email when resetting password, thanks James Whisnant for this. [mlundwall]
- Added zcml auto slug. [mlundwall]
- Fixed some import errors that caused exeptions when someone entered an email that doesn’t exist [robinharms]
- Plone 4 support. [mlundwall]
0.5(2009-12-28)
- Fixed a bug when removing a user. [mlundwall]
- No warning when removing a user with duplicate email. [mlundwall]
- Possibility of writing custom email to username utility. [mlundwall]
- LDAP support. Thanks to Tom Switzer for the patch (http://plone.org/products/betahaus.emaillogin/issues/1) [mlundwall]
0.4(2009-09-17)
- Added i18n to for some texts that could not be reused from plone. [mlundwall]
- Fixed the problem with non working forgotten password retrieval via email. Thanks Winn for reporting. [mlundwall]
0.3(2009-07-27)
- Added a warning to managers when changing email in the prefs_users_overview to an already existing email. [mlundwall]
- Added a optional custom email catalog, for better performance with large number of users. [mlundwall]
0.2(2009-05-22)
- Fix bug in personalize_form.vpy that prevented editing user profiles. [davisagli]
0.1(2009-05-11)
- Added custom personalize_form.vpy to prevent changing an existing user’s e-mail address to one that already exists. [davisagli]
- Avoid applying the custom import steps when other profiles are applied. [davisagli]
- Duplicate email warning at install [mlundwall]
- Check at registration to not allow multiple users with same email [mlundwall]
- Moved to collective. [mlundwall]
- Created recipe with ZopeSkel [Robin Harms Oredsson].
贡献者
- Martin Lundwall, Author
- Robin Harms Oredsson, Idea for this product.
- David Glick, GenericSetup stuff and restrictions on changing email.
- Tom Switzer, <http://plone.org/products/betahaus.emaillogin/issues/1>`_, LDAP patch