コード例 #1
0
ファイル: events.py プロジェクト: adam139/Products.CMFPlone
def handle_use_email_as_login(obj, event):
    """Additional configuration when the ``use_email_as_login``
    setting is updated in the ``Security```control panel.

    If the setting is enabled, existing users' login names are migrated
    to email. If the setting is disabled, then the login names are migrated
    back to user ids.
    """
    if event.record.fieldName != 'use_email_as_login':
        return

    value = event.newValue
    if value == event.oldValue:
        # no change
        return
    context = getSite()
    if value:
        migrate_to_email_login(context)
    else:
        migrate_from_email_login(context)
コード例 #2
0
def handle_use_email_as_login(obj, event):
    """Additional configuration when the ``use_email_as_login``
    setting is updated in the ``Security```control panel.

    If the setting is enabled, existing users' login names are migrated
    to email. If the setting is disabled, then the login names are migrated
    back to user ids.
    """
    if event.record.fieldName != 'use_email_as_login':
        return

    value = event.newValue
    if value == event.oldValue:
        # no change
        return
    context = getSite()
    if value:
        migrate_to_email_login(context)
    else:
        migrate_from_email_login(context)
コード例 #3
0
ファイル: security.py プロジェクト: urska19/Plone_site
 def switch_to_email(self):
     # This is not used and is only here for backwards
     # compatibility.  It avoids a test failure in
     # Products.CMFPlone.
     # XXX: check if this can be removed
     migrate_to_email_login(self.context)
コード例 #4
0
 def switch_to_email(self):
     # This is not used and is only here for backwards
     # compatibility.  It avoids a test failure in
     # Products.CMFPlone.
     # XXX: check if this can be removed
     migrate_to_email_login(self.context)