Perform a stateless HTTP Basic login attempt.

@param  string $field
@param  array $extraConditions
@return Response|null
323980
public function onceBasic( $field = 'email', $extraConditions = [] )
	{
		$credentials = $this->getBasicCredentials( $this->getRequest(), $field );

		if ( !$this->once( array_merge( $credentials, $extraConditions ) ) )
			return $this->getBasicResponse();

		return null;
	}
758630
protected function addWhere(&$conditions, $key, $extraValue) {
        if ($extraValue === 'NULL') {
            $conditions[$key] = null;
        } elseif ($extraValue === 'NOT_NULL') {
            $conditions[$key . '!='] = null;
        } else {
            $conditions[$key] = $extraValue;
        }
    }
743079
public function is($condition, $field) {
		if (!isset($this->_fields[$field])) {
			return null;
		}
		return isset($this->_fields[$field][$condition]) && $this->_fields[$field][$condition];
	}
930626
public function validate($field, $input, array $params = array())
    {
        try {
            if ($input == '' || empty($params['0'])) {
                return false;
            }
            $params = $params['0'];
            if (empty($params['gcs_access_key']) || empty($params['gcs_secret_key'])) {
                return false;
            }
            
            $client = m62Gcs::getRemoteClient($params['gcs_access_key'], $params['gcs_secret_key']);
            $client->listBuckets();
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
880022
public function addHeader( Net_HTTP_Header_Field $field, $emptyBefore = NULL )
	{
		$this->headers->setField( $field, $emptyBefore );
	}
854313
public function onceBasic($field = 'email', Request $request = null)
    {
        $request = $request ?: $this->getRequest();

        if (! $this->once($this->getBasicCredentials($request, $field))) {
            return $this->getBasicResponse();
        }
    }
131816
public function block( $user, array $extraParams = [] ) {
		if ( !$user instanceof User && !is_string( $user ) ) {
			throw new InvalidArgumentException( '$user must be either a string or User object' );
		}

		if ( $user instanceof User ) {
			$user = $user->getName();
		}

		$params = [
			'user' => $user,
			'token' => $this->api->getToken( 'block' ),
		];

		$params = array_merge( $extraParams, $params );

		$this->api->postRequest( new SimpleRequest( 'block', $params ) );
		return true;
	}
532727
def login(self, request, extra_context=None):
        
        redirect_to = request.POST.get(REDIRECT_FIELD_NAME, request.GET.get(REDIRECT_FIELD_NAME))

        if not redirect_to or not is_safe_url(url=redirect_to, allowed_hosts=[request.get_host()]):
            redirect_to = resolve_url(settings.LOGIN_REDIRECT_URL)

        return redirect_to_login(redirect_to)
491382
public function processAuthenticate($signature, $extra = null)
    {

        \Facebook\FacebookSession::setDefaultApplication($this->appId, $this->appSecret);

        $session     = new \Facebook\FacebookSession($signature);
        $sessionInfo = $session->getSessionInfo();

        //Make sure that we received a valid token
        if ($sessionInfo->isValid()) {
            return ["SUCCESS"];
        } else {
            return ["FAILURE"];
        }
    }
1131704
protected function getSingleFieldActivationConditionFunction(Validation $validation, $fieldConditionExpression)
    {
        $fieldName = GeneralUtility::quoteJSvalue($validation->getParentField()->getName());
        $validationName = GeneralUtility::quoteJSvalue($validation->getName());
        $fieldConditionExpression = implode(CRLF . str_repeat(' ', 20), $fieldConditionExpression);

        return <<<JS
            field = form.getFieldByName($fieldName);

            if (null !== field) {
                field.addActivationConditionForValidator(
                    '__auto',
                    $validationName,
                    function (field, continueValidation) {
                        var flag = false;
                        $fieldConditionExpression
                        continueValidation(flag);
                    }
                );
            }
JS;
    }
509002
public function beforeSave(Event $event, EntityInterface $entity, ArrayObject $options) {
		$formField = $this->_config['formField'];
		$field = $this->_config['field'];

		$PasswordHasher = $this->_getPasswordHasher($this->_config['passwordHasher']);

		if ($entity->get($formField) !== null) {
			$entity->set($field, $PasswordHasher->hash($entity->get($formField)));

			if (!$entity->get($field)) {
				throw new RuntimeException('Empty field');
			}

			$entity->unsetProperty($formField);
			//$entity->set($formField, null);

			if ($this->_config['confirm']) {
				$formFieldRepeat = $this->_config['formFieldRepeat'];
				$entity->unsetProperty($formFieldRepeat);
			}
			if ($this->_config['current']) {
				$formFieldCurrent = $this->_config['formFieldCurrent'];
				$entity->unsetProperty($formFieldCurrent);
			}
		} else {
			// To help mitigate timing-based user enumeration attacks.
			$PasswordHasher->hash('');
		}
	}
1072890
public function append($elements, $extra = null)
    {
        $conditions = (array)$elements;

        if (!$this->_where) {
            $this->_where = new Where();
        }

        foreach ($conditions as $condition) {
            $logicInner = 'AND';
            $value      = null;

            if (is_array($condition)) {
                $value      = isset($condition[1]) ? $condition[1] : null;
                $logicInner = isset($condition[2]) ? $condition[2] : 'AND';
                $condition  = $condition[0];
            }

            $this->_where->append(array($condition, $value), $logicInner);
        }
    }
248734
protected function _injectConditions(Query $query, ArrayObject $options, array $fields)
    {
        foreach (array_keys($fields) as $field) {
            $path = $this->getConfig('propertiesMap.' . $field);

            $check = false;
            $query->traverseExpressions(function ($expression) use (&$check, $field, $query) {
                if ($expression instanceof IdentifierExpression) {
                    !$check && $check = $expression->getIdentifier() === $field;

                    return;
                }
                $alias = $this->_table->aliasField($field);
                !$check && $check = preg_match(
                    '/^' . $alias . '/',
                    $expression->sql($query->getValueBinder())
                );
            });

            if (!$check && $value = Hash::get((array)$options, $path)) {
                $query->where([$this->_table->aliasField($field) => $value]);
            }
        }
    }
980097
protected function validateField($field = null)
    {
        $field = $field ?: post(self::PARAM_FIELD);

        if ($field && $field != $this->field) {
            $this->initRelation($this->model, $field);
        }

        if (!$field && !$this->field) {
            throw new ApplicationException(Lang::get('backend::lang.relation.missing_definition', compact('field')));
        }

        return $field ?: $this->field;
    }
117608
def extra(request, provider):
    
    identity = request.session.get('identity', None)
    if not identity:
        raise Http404

    if request.method == "POST":
        form = str_to_class(settings.EXTRA_FORM)(request.POST)
        if form.is_valid():
            user = form.save(request, identity, provider)
            del request.session['identity']
            if not settings.ACTIVATION_REQUIRED:
                user = auth.authenticate(identity=identity, provider=provider)
                if user:
                    auth.login(request, user)
                    return redirect(request.session.pop('next_url', settings.LOGIN_REDIRECT_URL))
            else:
                messages.warning(request, lang.ACTIVATION_REQUIRED_TEXT)
                return redirect(settings.ACTIVATION_REDIRECT_URL)
    else:
        initial = request.session['extra']
        form = str_to_class(settings.EXTRA_FORM)(initial=initial)

    return render_to_response('netauth/extra.html', {'form': form }, context_instance=RequestContext(request))
700758
public function validate($field, $input, array $params = array())
    {
        try {
            if ($input == '' || empty($params['0'])) {
                return false;
            }
            
            $params = $params['0'];
            if (empty($params['s3_access_key']) || empty($params['s3_secret_key']) || empty($params['s3_bucket'])) {
                return false;
            }
            
            $region = ($params['s3_region'] ? $params['s3_region'] : '');
            $client = m62S3::getRemoteClient($params['s3_access_key'], $params['s3_secret_key'], $region);
            if ($client->doesBucketExist($params['s3_bucket'])) {
                $filesystem = new Remote(new m62S3($client, $params['s3_bucket']));
                $filesystem->getAdapter()->listContents();
                return true;
            }
        } catch (\Exception $e) {
            return false;
        }
    }
1087519
public function getUser(string $query, array $extra_args = null)
    {
        if (is_numeric($query)) {
            $response = $this->getUserByID($query, $extra_args);
            if (!isset($response['errors'])) {
                return $response;
            }
        }
        return $this->getUserByUsername($query, $extra_args);
    }