Ejemplo n.º 1
0
 def notify_access_event(self, REQUEST, event_type='view'):
     """ Shortcut to easier call a view/download notify event for NyZzz """
     from Products.NaayaCore.AuthenticationTool.AuthenticationTool import is_anonymous
     if REQUEST and not is_anonymous(REQUEST.AUTHENTICATED_USER):
         if event_type == 'view':
             from naaya.content.base.events import NyContentObjectViewEvent
             event_factory = NyContentObjectViewEvent
         elif event_type == 'download':
             from naaya.content.base.events import NyContentObjectDownloadEvent
             event_factory = NyContentObjectDownloadEvent
         else:
             log.error("Unkown access event type %r", event_type)
             return None
         notify(event_factory(self, REQUEST.AUTHENTICATED_USER.getUserName()))
Ejemplo n.º 2
0
def info_required(parent, request):
    """ What information do we require from this submitter?  """
    return {
        'captcha': not parent.checkPermissionSkipCaptcha(),
        'name_and_email': is_anonymous(request.AUTHENTICATED_USER),
    }
Ejemplo n.º 3
0
def info_required(parent, request):
    """ What information do we require from this submitter?  """
    return {
        "captcha": not parent.checkPermissionSkipCaptcha(),
        "name_and_email": is_anonymous(request.AUTHENTICATED_USER),
    }