Get auth values related to this adapter
@return Zend_Config
434967
protected function _getAuthVars() {
        if (!$this->_configKey) {
            throw new Garp_Auth_Exception('No config key found in '.__CLASS__.'::_configKey.');
        }
        $config = Zend_Registry::get('config');
        if ($config->auth && $config->auth->adapters && $config->auth->adapters->{$this->_configKey}) {
            return $config->auth->adapters->{$this->_configKey};
        }
        return null;
    }
995096
protected function getPasswordAttempts()
    {
        if ($this->_user == NULL)
            return false;

        $this->_attempts = UserMetadata::model()->getPrototype('UserMetadata', array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts'
            ), array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts',
                'value' => 0
        ));

        return $this->_attempts;
    }
95593
private function getAclAdapter() {
        $config = $this->getConfig();

        // Access control adapter
        $accessControl = $config['accessControl'];

        if (is_callable($accessControl) && !($accessControl instanceof AdapterInterface)) {
            $accessControl = $accessControl();
        }

        if (!$accessControl instanceof AdapterInterface) {
            throw new RuntimeException('Invalid access control adapter');
        }

        if (!$accessControl instanceof MutableAdapterInterface) {
            throw new RuntimeException('The configured access control adapter is not mutable');
        }

        return $accessControl;
    }
140061
public function getAuthorisedViewLevels()
	{
		if (is_null($this->authLevels))
		{
			$this->authLevels = array();
		}

		if (empty($this->_authLevels))
		{
			$this->authLevels = Access::getAuthorisedViewLevels($this->get('id'));
		}

		return $this->authLevels;
	}
219752
protected function getAuth()
    {
        if (is_null($this->auth)) {
            $this->auth = app($this->config('auth'));
        }

        return $this->auth;
    }
89616
public function getAuthService()
    {
        if (null === $this->authService) {
            $this->authService = $this->getServiceManager()->get('zfcuser_auth_service');
        }
        return $this->authService;
    }
395460
public function authenticate()
    {
        if (empty($this->_request) ||
            empty($this->_response)) {
            /**
             * @see Zend_Auth_Adapter_Exception
             */
            require_once 'Zend/Auth/Adapter/Exception.php';
            throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling '
                                                . 'authenticate()');
        }

        if ($this->_imaProxy) {
            $getHeader = 'Proxy-Authorization';
        } else {
            $getHeader = 'Authorization';
        }

        $authHeader = $this->_request->getHeader($getHeader);
        if (!$authHeader) {
            return $this->_challengeClient();
        }

        list($clientScheme) = explode(' ', $authHeader);
        $clientScheme = strtolower($clientScheme);

        // The server can issue multiple challenges, but the client should
        // answer with only the selected auth scheme.
        if (!in_array($clientScheme, $this->_supportedSchemes)) {
            $this->_response->setHttpResponseCode(400);
            return new Zend_Auth_Result(
                Zend_Auth_Result::FAILURE_UNCATEGORIZED,
                array(),
                array('Client requested an incorrect or unsupported authentication scheme')
            );
        }

        // client sent a scheme that is not the one required
        if (!in_array($clientScheme, $this->_acceptSchemes)) {
            // challenge again the client
            return $this->_challengeClient();
        }

        switch ($clientScheme) {
            case 'basic':
                $result = $this->_basicAuth($authHeader);
                break;
            case 'digest':
                $result = $this->_digestAuth($authHeader);
            break;
            default:
                /**
                 * @see Zend_Auth_Adapter_Exception
                 */
                require_once 'Zend/Auth/Adapter/Exception.php';
                throw new Zend_Auth_Adapter_Exception('Unsupported authentication scheme');
        }

        return $result;
    }
1017716
public function getGridConfig()
	{
		$config = new Zend_Config(array(), true);
		if(Zend_Registry::isRegistered('config') && isset(Zend_Registry::get('config')->dataGrid))
		{
			$config->merge(Zend_Registry::get('config')->dataGrid);
		}
		$config->merge(new Zend_Config($this->_settings));

		foreach($config as $optionName => $optionValue)
		{
			if(!isset($optionValue->title) && isset($optionValue->label))
			{
				$config->$optionName->title = $optionValue->label;
				unset($config->$optionName->label);
			}
			if(isset($optionValue->visible) && !$optionValue->visible)
			{
				$config->$optionName->hidden = true;
			}

			if(isset($optionValue->type))
			{
				if(!isset($config->$optionName->jqg))
				{
					$config->$optionName->jqg = new Zend_Config(array(), true);
				}
				switch($optionValue->type)
				{
					case "select":
						$multiOptions = array();
						$multiOptions[''] = 'LABEL_ALL';
						$multiOptions += $config->$optionName->multiOptions->toArray();

						$multiOptions = array_map(function($key, $row){
							$translate = App_Translate::getInstance();
							return $key.':'.$translate->translate($row);
						}, array_keys($multiOptions), $multiOptions);
						ksort($multiOptions);

						$multiOptions = implode(';', $multiOptions);

						$config->$optionName->jqg->merge(new Zend_Config(array(
							'stype' => 'select',
							'searchoptions' => array(
								'sopt' => array(
									'eq'
								),
								'value' => $multiOptions
							),
							'searchType' => '='
						)), true);
						break;
					case "date":
						$config->$optionName->merge(new Zend_Config(array(
							'sorttype' => 'date',
							'format'   => array(
								'date',
								array(
									'date_format' => Zend_Date::DATE_MEDIUM
								)
							),
							'jqg'      => array(
								'searchoptions' => array(
									'dataInit' => new Zend_Json_Expr('function(el){
											jQuery(el).datepicker({
													dateFormat: "yy-mm-dd",
													onSelect: function(dateText, inst){
															jQuery(el).parents(".ui-jqgrid").find(".ui-jqgrid-btable").get(0).triggerToolbar();
													}
											});
									}')
								)
							)
						)), true);

						if(!isset($config->$optionName->defaultvalue))
						{
							$config->$optionName->defaultvalue = null;
						}
						break;
					case "datetime":
						$config->$optionName->merge(new Zend_Config(array(
							'sorttype' => 'date',
							'format'   => array(
								'date',
								array(
									'date_format' => Zend_Date::DATETIME_SHORT
								)
							),
							'jqg'      => array(
								'searchoptions' => array(
									'dataInit' => new Zend_Json_Expr('function(el){
											jQuery(el).datetimepicker({
													dateFormat: "yy-mm-dd",
													timeFormat: "hh:mm",
													onSelect: function(dateText, inst){
															jQuery(el).parents(".ui-jqgrid").find(".ui-jqgrid-btable").get(0).triggerToolbar();
													}
											});
									}')
								)
							)
						)), true);

						if(!isset($config->$optionName->defaultvalue))
						{
							$config->$optionName->defaultvalue = null;
						}
						break;
					case "time":
						$config->$optionName->merge(new Zend_Config(array(
							'sorttype' => 'date',
							'format'   => array(
								'date',
								array(
									'date_format' => Zend_Date::TIME_SHORT
								)
							),
							'jqg'      => array(
								'searchoptions' => array(
									'dataInit' => new Zend_Json_Expr('function(el){
											jQuery(el).timepicker({
													timeFormat: "hh:mm",
													onSelect: function(dateText, inst){
															jQuery(el).parents(".ui-jqgrid").find(".ui-jqgrid-btable").get(0).triggerToolbar();
													}
											});
									}')
								)
							)
						)), true);

						if(!isset($config->$optionName->defaultvalue))
						{
							$config->$optionName->defaultvalue = null;
						}
						break;
					case "boolean":
					case "bool":
						$multiOptions = array(
							'' => 'LABEL_ALL',
							'0' => 'LABEL_NO',
							'1' => 'LABEL_YES'
						);
						$multiOptions = array_map(function($key, $row){
							$translate = App_Translate::getInstance();
							return $key.':'.$translate->translate($row);
						}, array_keys($multiOptions), $multiOptions);

						$multiOptions = implode(';', $multiOptions);

						$config->$optionName->merge(new Zend_Config(array(
							'width' => 30,
							'align' => 'center',
							'jqg' => array(
								'stype' => 'select',
								'searchoptions' => array(
									'sopt' => array(
										'eq'
									),
									'value' => $multiOptions
								)
							),
							'searchType' => '='
						)), true);

						if(!isset($config->$optionName->helper) && !isset($config->$optionName->callback))
						{
							$config->$optionName->merge(new Zend_Config(array(
								'jqg' => array(
									'formatter' => 'checkbox'
								)
							)), true);
						}

						break;
					case "int":
						$config->$optionName->merge(new Zend_Config(array(
							'searchType' => '='
						)), true);

						break;
					default:
						debug_assert(false !== array_search($optionValue->type, self::$types), "Unknown Grid Cell Type `{$optionValue->type}`");
				}
			}

		}

		return $config;
	}
667262
protected function getProfileConfig()
    {
        $configCallable = $this->config;
        $config = $configCallable($this->getProfileConfigKey());

        if (!is_array($config)) {
            $config = [$config];
        }

        return array_filter($config);
    }
432246
public function getMetaInfo()
    {
        if ($this->getAuthenticationDetails() instanceof AuthenticationDetails) {
            $authId     = $this->getAuthenticationDetails()->getAuthId();
            $authMethod = $this->getAuthenticationDetails()->getAuthMethod();
            $authRole   = $this->getAuthenticationDetails()->getAuthRole();
            $authRoles  = $this->getAuthenticationDetails()->getAuthRoles();
        } else {
            $authId     = 'anonymous';
            $authMethod = 'anonymous';
            $authRole   = 'anonymous';
            $authRoles  = [];
        }

        return [
            'realm'         => $this->getRealm()->getRealmName(),
            'authprovider'  => null,
            'authid'        => $authId,
            'authrole'      => $authRole,
            'authroles'     => $authRoles,
            'authmethod'    => $authMethod,
            'session'       => $this->getSessionId(),
            'role_features' => $this->getRoleFeatures()
        ];
    }
199862
public function &getAccessControlConfig()
    {
        if (!isset($this->_accessControlConfigCache)) {
            $this->_accessControlConfigCache = new CKFinder_Connector_Core_AccessControlConfig(isset($GLOBALS['config']['AccessControl']) ? $GLOBALS['config']['AccessControl'] : array());
        }

        return $this->_accessControlConfigCache;
    }
1178937
public static function getAuth()
    {
        $result = null;
        if ($user = Arr::key('PHP_AUTH_USER', $_SERVER, true)) {
            $result .= $user;

            if ($password = Arr::key('PHP_AUTH_PW', $_SERVER, true)) {
                $result .= ':' . $password;
            }

            $result .= '@';
        }

        return $result;
    }
364235
protected function _gatherConfigVars() {
        $source = $this->_stdin ?
            $this->_parseStdin($this->_stdin) :
            Zend_Registry::get('config')->toArray();
        $cdnConfig = f\prop('cdn', $source);
        $s3Config = f\prop('s3', $cdnConfig);
        return array(
            'apikey'          => f\prop('apikey', $s3Config),
            'secret'          => f\prop('secret', $s3Config),
            'bucket'          => f\prop('bucket', $s3Config),
            'region'          => f\prop('region', $s3Config),
            'readonly'        => f\prop('readonly', $cdnConfig),
            'gzip'            => f\prop('gzip', $cdnConfig),
            'gzip_exceptions' => f\prop('gzip_exceptions', $cdnConfig)
        );
    }
1111913
public function getGeneralSettings()
    {
        return [
            'guard' => [
                'path' => '/config/auth.php',
                'search' => "'guards' => [",
                'stub' => __DIR__ . '/../stubs/config/guards.stub',
                'prefix' => false,
            ],
            'provider' => [
                'path' => '/config/auth.php',
                'search' => "'providers' => [",
                'stub' => __DIR__ . '/../stubs/config/providers.stub',
                'prefix' => false,
            ],
            'passwords' => [
                'path' => '/config/auth.php',
                'search' => "'passwords' => [",
                'stub' => __DIR__ . '/../stubs/config/passwords.stub',
                'prefix' => false,
            ],
            'kernel' => [
                'path' => '/app/Http/Kernel.php',
                'search' => 'protected $routeMiddleware = [',
                'stub' => __DIR__ . '/../stubs/Middleware/Kernel.stub',
                'prefix' => false,
            ],
            'map_register' => [
                'path' => '/app/Providers/RouteServiceProvider.php',
                'search' => '$this->mapWebRoutes();',
                'stub' => __DIR__ . '/../stubs/routes/map-register.stub',
                'prefix' => false,
            ],
            'map_method' => [
                'path' => '/app/Providers/RouteServiceProvider.php',
                'search' => "    /**\n" . '     * Define the "web" routes for the application.',
                'stub' => __DIR__ . '/../stubs/routes/map-method.stub',
                'prefix' => true,
            ],
        ];
    }
1365206
public function authenticateAction()
    {
        if ($this->zfcUserAuthentication()->getAuthService()->hasIdentity()) {
            return $this->redirect()->toRoute($this->getOptions()->getLoginRedirectRoute());
        }
        $adapter = $this->zfcUserAuthentication()->getAuthAdapter();
        $redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false));
        
        $routeLoginAdmin = $this->params()->fromPost('routeLoginAdmin', $this->params()->fromQuery('routeLoginAdmin', false));

        $result = $adapter->prepareForAuthentication($this->getRequest());

        // Return early if an adapter returned a response
        if ($result instanceof Response) {
            return $result;
        }

        $auth = $this->zfcUserAuthentication()->getAuthService()->authenticate($adapter);

        if (!$auth->isValid()) {
            $this->flashMessenger()->setNamespace('zfcuser-login-form')->addMessage($this->failedLoginMessage);
            $adapter->resetAdapters();

            if (!empty($routeLoginAdmin)) {
                return $this->redirect()->toUrl($routeLoginAdmin);
            }

            return $this->redirect()->toUrl(
                $this->url()->fromRoute('frontend/zfcuser/login')
                . ($redirect ? '?redirect='.$redirect : '')
            );
        }

        $user = $this->zfcUserAuthentication()->getIdentity();
        $this->getEventManager()->trigger('login.post', $this, array('user' => $user));

        if ($this->getOptions()->getUseRedirectParameterIfPresent() && $redirect) {
            return $this->redirect()->toUrl($redirect);
        }

        return $this->redirect()->toUrl(
            $this->url()->fromRoute(
                $this->getOptions()->getLoginRedirectRoute()
            )
        );
    }
740328
public function getPagSeguroCredentials()
    {
        $email = $this->_scopeConfig->getValue('payment/pagseguro/email');
        $token = $this->_scopeConfig->getValue('payment/pagseguro/token');
        //Set the credentials
        \PagSeguro\Configuration\Configure::setAccountCredentials($email, $token);
        return \PagSeguro\Configuration\Configure::getAccountCredentials();
    }
867777
protected function getAuthHeaderValue()
    {
        $value = "";
        if (isset($this->credentials['username']) && isset($this->credentials['password'])){
            $value = $this->credentials['username'].":".$this->credentials['password'];
            $value = base64_encode($value);
        }
        return static::$_AUTH_TYPE." ".$value;
    }