Just checks if this event ever permits/permitted registration
554481
def registrationEnabled(self):
        '''  '''
        return self.status in [self.RegStatus.enabled,self.RegStatus.heldOpen,self.RegStatus.heldClosed]
743576
public function registerEvents()
    {
        // Delete user tokens after login
        if (config('passwordless.empty_tokens_after_login') === true) {
            Event::listen(
                Authenticated::class,
                function (Authenticated $event) {
                    $event->user->tokens()
                        ->delete();
                }
            );
        }
    }
1332594
def __event_exist(self, event_type):
        
        for i in range(self.len()):
            if self.events_list[i][1] < 0 and self.events_list[i][3] == event_type:
                return i
        return -1
577790
private boolean isApplicable(QueryCacheEventData event) {
        if (!getInfo().isPublishable()) {
            return false;
        }

        final int partitionId = event.getPartitionId();

        if (isEndEvent(event)) {
            sequenceProvider.reset(partitionId);
            removeFromBrokenSequences(event);
            return false;
        }

        if (isNextEvent(event)) {
            long currentSequence = sequenceProvider.getSequence(partitionId);
            sequenceProvider.compareAndSetSequence(currentSequence, event.getSequence(), partitionId);

            removeFromBrokenSequences(event);
            return true;
        }

        handleUnexpectedEvent(event);

        return false;
    }
758864
private function checkAccess()
    {
        $tokenStorage = $this->get('security.token_storage');
        $configHandler = $this->get('claroline.config.platform_config_handler');
        $isSelfRegistrationAllowed = $configHandler->getParameter('allow_self_registration');

        if (!$tokenStorage->getToken()->getUser() instanceof User && $isSelfRegistrationAllowed) {
            return;
        }

        throw new AccessDeniedHttpException();
    }
594210
public function isRegistrationEnabled()
    {
        if (false === $xml = simplexml_load_string($this->get_prefs())) {
            return false;
        }

        $element = $xml->xpath('/baseprefs/caninscript');

        if (count($element) === 0) {
            return $this->databox->isRegistrationEnabled();
        }

        foreach ($element as $caninscript) {
            if (false !== (bool)(string)$caninscript) {
                return true;
            }
        }

        return false;
    }
683067
def time_check_allow?(key, stamp)
      Time.now.to_i - stamp.to_i > apply_limit(key)
    end
43976
function Registrations() {
    Object.defineProperty(this,'_registrations',{
        value: {}
        ,enumerable: false
        ,configurable: false
        ,writable: false
    })
    this.get = this.get.bind(this)
    this.put = this.put.bind(this)
    this.clear = this.clear.bind(this)
    this.has = this.has.bind(this)
}
709650
function isValidQuery(definition) {
  var requiredKeys = [
    'event_name',
    'resource_type',
    'tracker_id'
  ];

  return _.all(requiredKeys, function(key) {
    return _.has(definition, key);
  });
}
1140074
def invitation_accepted(event):
    
    request = getRequest()
    storage = get_storage()
    if event.token_id not in storage:
        return

    ws_uid, username = storage[event.token_id]
    storage[event.token_id]
    acl_users = api.portal.get_tool('acl_users')
    acl_users.updateCredentials(
        request,
        request.response,
        username,
        None
    )
    catalog = api.portal.get_tool(name="portal_catalog")
    brain = catalog.unrestrictedSearchResults(UID=ws_uid)[0]
    with api.env.adopt_roles(["Manager"]):
        ws = IWorkspace(brain.getObject())
        for name in ws.members:
            member = api.user.get(username=name)
            if member is not None:
                if member.getUserName() == username:
                    api.portal.show_message(
                        _('Oh boy, oh boy, you are already a member'),
                        request,
                    )
                    break
        else:
            ws.add_to_team(user=username)
            api.portal.show_message(
                _('Welcome to our family, Stranger'),
                request,
            )
206114
function (events, context) {
    if (!_.isObject(events)) {
      console.warn('Only registration objects can be passed to dispatcher.register()');
      return;
    }

    return this.dispatcher.register(function (payload) {
      // Switch statements be damned...
      if (events[payload.type]) {
        events[payload.type].apply(context || null, [payload.data]);
      }
    });
  }
110616
protected function _allow()
    {
        $url = Wasabi::getCurrentUrlArray();
        if ($this->Guardian->isGuestAction($url)) {
            $this->Auth->allow($this->request->params['action']);
        }
    }
620921
protected static function events()
    {
        foreach (self::fetch('app/events', false) as $file) {
            Bus::need($file);
        }
        //
        Event::register();
    }
702291
public function checkRegistryRequestsAnswers()
    {
        if ($this->token instanceof \Gems_Tracker_Token) {

            $this->wasAnswered = $this->token->isCompleted();

            return ($this->request instanceof \Zend_Controller_Request_Abstract) &&
                    ($this->view instanceof \Zend_View) &&
                    parent::checkRegistryRequestsAnswers();
        } else {
            return false;
        }
    }
1218696
def can_handle(cls, pkt, rpc):
        """"""
        # type = 0 => request
        if rpc.getfieldval("type") == 0 and \
                str(rpc.object_uuid).startswith("dea00000-6c97-11d1-8271-"):
            return True
        return False
1355805
def processCheckIn(request):
    '''
    
    '''

    if request.method == 'POST':
        event_id = request.POST.get('event_id')
        reg_ids = request.POST.getlist('reg_id')

        if not event_id:
            return HttpResponse(_("Error at start."))

        # Get all possible registrations, so that we can set those that are not included to False (and set those that are included to True)
        all_eventreg = list(EventRegistration.objects.filter(event__id=event_id))

        for this_reg in all_eventreg:
            if str(this_reg.registration.id) in reg_ids and not this_reg.checkedIn:
                this_reg.checkedIn = True
                this_reg.save()
            elif str(this_reg.registration.id) not in reg_ids and this_reg.checkedIn:
                this_reg.checkedIn = False
                this_reg.save()
        return HttpResponse("OK.")
588753
@Override
    public boolean validateEventsAndOutcomes(String handlerName, List<Map<String, Object>> configuredEvents) {

        if (configuredEvents.isEmpty()) {
            if (tc.isDebugEnabled()) {
                Tr.debug(tc, "configuredEvents is empty, returning true as all events are valid");
            }
            return true;
        }
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "configuredEvents: " + configuredEvents.toString());
        }
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "size of configuredEvents: " + configuredEvents.size());
        }

        for (Map<String, Object> events : configuredEvents) {

            if (events.isEmpty()) {
                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "no events or outcomes specified, all events and outcomes are honoured");
                }
                return true;
            } else {
                boolean isFoundEventName = false;
                String foundEventName = null;
                boolean isFoundOutcome = false;
                String foundOutcome = null;
                for (Entry<String, Object> entry : events.entrySet()) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, "entry: " + entry.toString());
                    }

                    // if the event is a custom one, we cannot validate, so return true:  buyer beware
                    if (entry.getKey().equals(AuditConstants.CUSTOM) && entry.getValue().equals(Boolean.TRUE)) {
                        return true;
                    } else {
                        if (entry.getKey().equals(AuditConstants.EVENT_NAME)) {
                            isFoundEventName = true;
                            foundEventName = (String) entry.getValue();
                            if (!validateEventName((String) entry.getValue())) {
                                String eventsList = "";
                                for (String temp : AuditConstants.validEventNamesList) {
                                    eventsList = eventsList.concat(temp).concat(" ");
                                }
                                Tr.error(tc, INCORRECT_AUDIT_EVENT_CONFIGURATION, new Object[] { foundEventName, handlerName, eventsList });
                                return false;
                            }
                        } else if (entry.getKey().equals(AuditConstants.OUTCOME)) {
                            isFoundOutcome = true;
                            foundOutcome = (String) entry.getValue();
                            if (!validateOutcomeName((String) entry.getValue())) {
                                String outcomesList = "";
                                for (String temp : AuditConstants.validOutcomesList) {
                                    outcomesList = outcomesList.concat(temp).concat(" ");
                                }
                                Tr.error(tc, INCORRECT_AUDIT_OUTCOME_CONFIGURATION, new Object[] { foundOutcome, handlerName, outcomesList });
                                return false;
                            }
                        }
                    }
                }
                if (!isFoundEventName && isFoundOutcome) {
                    String eventsList = "";
                    for (String temp : AuditConstants.validEventNamesList) {
                        eventsList = eventsList.concat(temp).concat(" ");
                    }
                    Tr.error(tc, "INCORRECT_AUDIT_CONFIGURATION_OUTCOME_SPECIFIED_MISSING_EVENTNAME",
                             new Object[] { foundOutcome, handlerName, eventsList });
                    return false;
                }
            }
        }
        return true;
    }