Check that this individual is not on the ban list.
421971
def checkBanlist(sender, **kwargs):
    '''
    
    '''

    if not getConstant('registration__enableBanList'):
        return

    logger.debug('Signal to check RegistrationContactForm handled by banlist app.')

    formData = kwargs.get('formData', {})
    first = formData.get('firstName')
    last = formData.get('lastName')
    email = formData.get('email')

    request = kwargs.get('request', {})
    session = getattr(request, 'session', {}).get(REG_VALIDATION_STR, {})
    registrationId = getattr(kwargs.get('registration', None), 'id', None)

    records = BannedPerson.objects.exclude(
        disabled=True
    ).exclude(
        expirationDate__lte=timezone.now()
    ).filter(
        (Q(firstName__iexact=first) & Q(lastName__iexact=last)) |
        Q(bannedemail__email__iexact=email)
    )

    if not records.exists():
        return

    # Generate an "error code" to reference so that it is easier to lookup
    # the record on why they were flagged.
    flagCode = ''.join(random.choice(string.ascii_uppercase) for x in range(8))
    ip = get_client_ip(request)
    respondTo = getConstant('registration__banListContactEmail') or getConstant('contact__businessEmail')

    for record in records:
        flagRecord = BanFlaggedRecord.objects.create(
            flagCode=flagCode,
            person=record,
            ipAddress=ip,
            data={'session': session, 'formData': formData, 'registrationId': registrationId}
        )

    notify = getConstant('registration__banListNotificationEmail')
    if notify:
        send_from = getConstant('contact__businessEmail')
        subject = _('Notice of attempted registration by banned individual')
        message = _(
            'This is an automated notification that the following individual has attempted ' +
            'to register for a class series or event:\n\n' +
            'Name: %s\n' % record.fullName +
            'Email: %s\n' % email +
            'Date/Time: %s\n' % flagRecord.dateTime +
            'IP Address: %s\n\n' % ip +
            'This individual has been prevented from finalizing their registration, and they ' +
            'have been asked to notify the school at %s with code %s to proceed.' % (respondTo, flagCode)
        )

        sendEmail(subject, message, send_from, to=[notify])

    message = ugettext('There appears to be an issue with this registration. '
                       'Please contact %s to proceed with the registration process. '
                       'You may reference the error code %s.' % (respondTo, flagCode))

    if request.user.has_perm('banlist.ignore_ban'):
        messages.warning(request, message)

    else:
        raise ValidationError(message)
150431
def clean(self):
        
        super().clean()

        # At least a poster (user) or a session key must be associated with
        # the post.
        if self.poster is None and self.anonymous_key is None:
            raise ValidationError(
                _('A user id or an anonymous key must be associated with a post.'),
            )
        if self.poster and self.anonymous_key:
            raise ValidationError(
                _('A user id or an anonymous key must be associated with a post, but not both.'),
            )

        if self.anonymous_key and not self.username:
            raise ValidationError(_('A username must be specified if the poster is anonymous'))
117183
def unban(user, reason = nil)
      API::Server.unban_user(@bot.token, @id, user.resolve_id, reason)
    end
449473
def _is_whitelisted(self, email):
        """"""

        return hasattr(settings, "SAFE_EMAIL_WHITELIST") and \
            any(re.match(m, email) for m in settings.SAFE_EMAIL_WHITELIST)
1333066
def remove_user(name, **client_args):
    '''
    
    '''
    if not user_exists(name, **client_args):
        log.info('User \'%s\' does not exist', name)
        return False

    client = _client(**client_args)
    client.drop_user(name)

    return True
861557
def user_remove(user,
                host='localhost',
                **connection_args):
    '''
    
    '''
    dbc = _connect(**connection_args)
    if dbc is None:
        return False

    cur = dbc.cursor()
    qry = 'DROP USER %(user)s@%(host)s'
    args = {}
    args['user'] = user
    args['host'] = host
    try:
        _execute(cur, qry, args)
    except MySQLdb.OperationalError as exc:
        err = 'MySQL Error {0}: {1}'.format(*exc.args)
        __context__['mysql.error'] = err
        log.error(err)
        return False

    if not user_exists(user, host, **connection_args):
        log.info('User \'%s\'@\'%s\' has been removed', user, host)
        return True

    log.info('User \'%s\'@\'%s\' has NOT been removed', user, host)
    return False
43707
def check_user(user_id, u_pass):
        '''
        
        '''
        user_count = TabMember.select().where(TabMember.uid == user_id).count()
        if user_count == 0:
            return -1
        the_user = TabMember.get(uid=user_id)
        if the_user.user_pass == tools.md5(u_pass):
            return 1
        return 0
1011695
public function onBanSelf()
    {
        $rulesToRemove = ['notSubmitterIpHostname'];
        $rules         = (array) array_get($this->rules, 'value', []);

        foreach ($rules as $index => $rule) {
            if (in_array($rule, $rulesToRemove, true)) {
                unset($this->rules['value'][$index]);
            }
        }
    }
994790
def blockUser(self, user_id):
        
        data = {"fbid": user_id}
        r = self._post(self.req_url.BLOCK_USER, data)
        return r.ok
1266426
def check_nick_matches_authenticated_user
      campfire.user("me") do |user|
        name = irc_name user.name
        if name != nick
          user_reply :nick, name
          @nick = name
        end
      end
    end
780275
function isBannable() {
        if($this->id === $this->guild->ownerID || $this->id === $this->client->user->id) {
            return false;
        }
        
        $member = $this->guild->me;
        if(!$member->permissions->has(\CharlotteDunois\Yasmin\Models\Permissions::PERMISSIONS['BAN_MEMBERS'])) {
            return false;
        }
        
        return ($member->getHighestRole()->comparePositionTo($this->getHighestRole()) > 0);
    }
967808
def check_user_by_name(user_name, u_pass):
        '''
        
        '''
        the_query = TabMember.select().where(TabMember.user_name == user_name)
        if the_query.count() == 0:
            return -1

        the_user = the_query.get()
        if the_user.user_pass == tools.md5(u_pass):
            return 1
        return 0
1107950
def check_user(self, username, email):
        ''''''
        users = self.router.user
        avail = yield users.filter(username=username).count()
        if avail:
            raise FieldError('Username %s not available' % username)
        if email:
            avail = yield users.filter(email=email).count()
            if avail:
                raise FieldError('Email %s not available' % email)
1111482
def blocked?(user)
      (blocked_friend_ids + blocked_inverse_friend_ids + blocked_pending_inverse_friend_ids).include?(user.id) or user.blocked_pending_inverse_friend_ids.include?(self.id)
    end
1207479
def __check_valid(self, post_data):
        '''
        
        '''
        user_create_status = {'success': False, 'code': '00'}

        if not tools.check_username_valid(post_data['user_name']):
            user_create_status['code'] = '11'
            return user_create_status
        elif not tools.check_email_valid(post_data['user_email']):
            user_create_status['code'] = '21'
            return user_create_status
        elif MUser.get_by_name(post_data['user_name']):
            user_create_status['code'] = '12'
            return user_create_status
        elif MUser.get_by_email(post_data['user_email']):
            user_create_status['code'] = '22'
            return user_create_status

        user_create_status['success'] = True
        return user_create_status
874530
def not_user_filter(config, message, fasnick=None, *args, **kw):
    

    fasnick = kw.get('fasnick', fasnick)
    if not fasnick:
        return False

    fasnick = (fasnick or []) and fasnick.split(',')
    valid = True
    for nick in fasnick:
        if nick.strip() in fmn.rules.utils.msg2usernames(message, **config):
            valid = False
            break

    return valid
1338846
function check(user, obj, guards) {
  if (!Array.isArray(guards))
    guards = Array.prototype.slice.call(arguments, 2);
  for (var i = 0; i < guards.length; i++) {
    if (guards[i] === undefined)
      continue;
    var test = guards[i].check(user, obj);
    if (test !== undefined)
      return test;
  }
  return undefined;
}