def METHOD_NAME(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)