コード例 #1
0
    def validate_email(self, value):
        """Validate the uniqueness of the email address.

        Only do this when we use emaillogins.
        """
        if email_login_is_active():
            return validate_unique_email(self, value)
コード例 #2
0
    def validate_email(self, value):
        """Validate the uniqueness of the email address.

        Only do this when we use emaillogins.
        """
        if email_login_is_active():
            return validate_unique_email(self, value)
コード例 #3
0
## Script (Python) "mail_password"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##title=Mail a user's password
##parameters=

from Products.CMFPlone import PloneMessageFactory as pmf
from Products.remember.pas.utils import getUserIdForEmail
from Products.remember.pas.utils import email_login_is_active

REQUEST = context.REQUEST
userid = REQUEST['userid']
if '@' in userid and email_login_is_active():
    userid = getUserIdForEmail(context, userid) or userid
try:
    response = context.portal_registration.mailPassword(userid, REQUEST)
except ValueError, e:
    context.plone_utils.addPortalMessage(pmf(str(e)))
    response = context.mail_password_form()
return response
コード例 #4
0
 def email_login(self):
     """True when the email PAS plugin is used and site property is set.
     """
     return email_login_is_active()
コード例 #5
0
## Script (Python) "mail_password"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##title=Mail a user's password
##parameters=

from Products.CMFPlone import PloneMessageFactory as pmf
from Products.remember.pas.utils import getUserIdForEmail
from Products.remember.pas.utils import email_login_is_active

REQUEST=context.REQUEST
userid = REQUEST['userid']
if '@' in userid and email_login_is_active():
    userid = getUserIdForEmail(context, userid) or userid
try:
    response = context.portal_registration.mailPassword(userid, REQUEST)
except ValueError, e:
    context.plone_utils.addPortalMessage(pmf(str(e)))
    response = context.mail_password_form()
return response