Get Garp_Auth instance
@param Garp_Store_Interface $store Session or cookie, for instance
@return Garp_Auth
193026
public static function getInstance(Garp_Store_Interface $store = null) {
        if (!Garp_Auth::$_instance) {
            Garp_Auth::$_instance = new Garp_Auth($store);
        }
        return Garp_Auth::$_instance;
    }
1312091
public function getLogin($provider = null)
	{
		if (empty($provider)) {
			App::abort(404);
		}
		
		$referer = Request::header('referer', '/');
		$referer_parts = parse_url($referer);
		$onerror = array_get($referer_parts, 'path');
		if (array_get($referer_parts, 'query')) {
			$onerror .= '?' . array_get($referer_parts, 'query');
		}
		
		if (!Input::get('code') && !Input::get('oauth_token')) {
			Session::put('mmanos.social.onsuccess', Input::get('onsuccess', '/'));
			Session::put('mmanos.social.onerror', Input::get('onerror', $onerror));
		}
		
		if (Auth::check()) {
			return Redirect::to(Session::pull('mmanos.social.onsuccess', '/'));
		}
		
		Session::forget('mmanos.social.pending');
		Session::forget('mmanos.social.failed_fields');
		
		if (Input::get('denied') || Input::get('error')) {
			return Redirect::to(Session::pull('mmanos.social.onerror', '/'))
				->with(
					Config::get('laravel-social::error_flash_var'),
					'There was a problem logging in to your account (1).'
				);
		}
		
		$provider = ucfirst($provider);
		
		try {
			$service = Social::service($provider);
			
			if (Config::get('laravel-social::providers.' . strtolower($provider) . '.offline')) {
				$service->setAccessType('offline');
			}
		} catch (Exception $e) {
			App::abort(404);
		}
		
		if (2 === Social::oauthSpec($provider)) {
			return $this->oauth2Login($provider, $service);
		}
		else {
			return $this->oauth1Login($provider, $service);
		}
	}
308690
public function getUser()
    {
        if (! $this->getState()) {
            $oauth_verifier = $this->request->get('oauth_verifier');
            if ($oauth_verifier !== null) {
                $this->setState(App::STATE_AUTHORIZED);

                $secret = $this->storage->getRequestSecret();
                $oauth_token = $this->request->get('oauth_token');
                $credentials = $this->ttools->getAccessTokens($oauth_token, $secret, $oauth_verifier);

                if (!empty($credentials['access_token'])) {
                    if (!$this->strip_credentials) {
                        $credentials = array_merge($credentials, $this->getCredentials());
                    }

                    $this->storage->storeLoggedUser($credentials);
                    $this->setState(App::STATE_LOGGED);
                }
            }
        }

        return $this->getLoggedUser();
    }
192104
function fetch_and_store_current_user_gdpr_anonymously() {
            $pong = $this->ping( null, true );

            if ( ! $this->get_api_plugin_scope()->is_valid_ping( $pong ) ) {
                return false;
            } else {
                FS_GDPR_Manager::instance()->store_is_required( $pong->is_gdpr_required );

                return $pong->is_gdpr_required;
            }
        }
370510
public function authenticate(Zend_Controller_Request_Abstract $request,
        Zend_Controller_Response_Abstract $response) {
        $authVars = new Garp_Util_Configuration($this->_getAuthVars()->toArray());
        $authVars->obligate('model')
                 ->obligate('identityColumn')
                 ->obligate('credentialColumn')
                 ->setDefault('hashMethod', 'MD5')
                 ->setDefault('salt', '');

        if (!$request->getPost($authVars['identityColumn']) ||
            !$request->getPost($authVars['credentialColumn'])) {
            $this->_addError('Insufficient data received');
            return false;
        }

        $identityValue = $request->getPost($authVars['identityColumn']);
        $credentialValue = $request->getPost($authVars['credentialColumn']);

        $ini = Zend_Registry::get('config');
        $sessionColumns = null;
        if (!empty($ini->auth->login->sessionColumns)) {
            $sessionColumns = $ini->auth->login->sessionColumns;
            $sessionColumns = explode(',', $sessionColumns);
        }

        $model = new Model_AuthLocal();
        try {
            $result = $model->tryLogin($identityValue, $credentialValue, $authVars, $sessionColumns);
            return $result->toArray();
        } catch (Garp_Auth_Adapter_Db_UserNotFoundException $e) {
            $this->_addError('The email address is not found');
        } catch (Garp_Auth_Adapter_Db_InvalidPasswordException $e) {
            $this->_addError('The password is invalid');
        }
        return false;
    }
1346431
protected function getMailCount($store)
    {
        if (array_key_exists($store, $this->mailCount)) {
            $count = $this->mailCount[$store];
        } else {
            $count = 0;
        }
        return $count;
    }
1242450
public static function makePersistentDataStore($store = null)
    {
        if (is_null($store) || $store === 'session') {
            return new SessionPersistentDataStore();
        }

        if ($store instanceof PersistentDataStoreInterface) {
            return $store;
        }

        throw new InvalidArgumentException('The persistent data store must be set to null, "session" or be an instance of use \Kunnu\Dropbox\Store\PersistentDataStoreInterface');
    }
597745
public function AccessToken($Token = NULL, $Secret = NULL) {
      if (!$this->IsConfigured()) 
         return FALSE;
      
      if (is_object($Token)) {
         $this->_AccessToken = $Token;
      } if ($Token !== NULL && $Secret !== NULL) {
         $this->_AccessToken = new OAuthToken($Token, $Secret);
//         setcookie('tw_access_token', $Token, 0, C('Garden.Cookie.Path', '/'), C('Garden.Cookie.Domain', ''));
      } elseif ($this->_AccessToken == NULL) {
//         $Token = GetValue('tw_access_token', $_COOKIE, NULL);
         if ($Token)
            $this->_AccessToken = $this->GetOAuthToken($Token);
         elseif (Gdn::Session()->User) {
            $AccessToken = GetValueR(self::ProviderKey.'.AccessToken', Gdn::Session()->User->Attributes);
            
            if (is_array($AccessToken)) {
               $this->_AccessToken = new OAuthToken($AccessToken[0], $AccessToken[1]);
            }
         }
      }
      return $this->_AccessToken;
   }
217525
public static function instance ( $store = 'SESSION', $options = array() )
	{
	    if (!OAuthSession::$instance)
	    {
			// Select the store you want to use
			if (strpos($store, '/') === false)
			{
				$class = 'OAuthSession'.$store;
				$file  = dirname(__FILE__) . '/session/'.$class.'.php';
			}
			else
			{
				$file  = $store;
				$store = basename($file, '.php');
				$class = $store;
			}

			if (is_file($file))
			{
				require_once $file;
				
				if (class_exists($class))
				{
					OAuthSession::$instance = new $class($options);
				}
				else
				{
					throw new OAuthException2('Could not find class '.$class.' in file '.$file);
				}
			}
			else
			{
				throw new OAuthException2('No OAuthSession for '.$store.' (file '.$file.')');
			}
	    }
	    return OAuthSession::$instance;	
	}
1060137
public static function getSession($credentials)
    {
        $connectionData = new PagSeguroConnectionData($credentials, 'sessionService');

        $url = self::buildSessionURL($connectionData)  . "?" . $connectionData->getCredentialsUrlQuery();

        try {
            $connection = new PagSeguroHttpConnection();
            $connection->post(
                $url,
                array(),
                $connectionData->getServiceTimeout(),
                $connectionData->getCharset()
            );

            $httpStatus = new PagSeguroHttpStatus($connection->getStatus());

            switch ($httpStatus->getType()) {
                case 'OK':

                    $session = PagSeguroSessionParser::readResult($connection->getResponse());

                    return $session->getId();

                    LogPagSeguro::info(
                        "PagSeguroSessionService.getSession()(" . $session->toString() . ") - end {1}"
                    );
                    break;
                    case 'BAD_REQUEST':
                        $errors = PagSeguroSessionParser::readErrors($connection->getStatus());
                        $e = new PagSeguroServiceException($httpStatus, $errors);
                        LogPagSeguro::error(
                            "PagSeguroSessionService.getSession() - error " .
                            $e->getOneLineMessage()
                        );
                    throw $e;
                    break;
                    default:

                        $e = new PagSeguroServiceException($httpStatus);
                        LogPagSeguro::error(
                            "PagSeguroSessionService.getSession() - error " .
                            $e->getOneLineMessage()
                        );
                    throw $e;
                    break;
            }
        } catch (PagSeguroServiceException $e) {
            throw $e;
        } catch (Exception $e) {
            LogPagSeguro::error("Exception: " . $e->getMessage());
            throw $e;
        }
    }
444606
public static function set_Hstore( $store )
    {
        if( $store instanceof Hstore ) {
            return $store;
        }
        try {
            $store = new Hstore( $store );
            return $store;
        } catch ( \InvalidArgumentException $e ) {
            return null;
        }
    }
1261058
private function getAuthProvider($authProvider)
    {
        if (is_null($this->authProvider)) {
            // auth provider config
            $authProviderConfig = $this->getAuthProviderConfig($authProvider);

            // optional params that will be passed to auth provider constructor
            $params = $authProviderConfig->get('Params', [], true);

            try {
                $this->authProvider = $this->factory($authProviderConfig->Driver, $this->authenticationInterface, $params);
            } catch (Exception $e) {
                throw new FirewallException($e->getMessage());
            }
        }

        return $this->authProvider;
    }
131976
public function getAccountData($storeId = null)
    {
        $url = $this->_getAdyenUrls($storeId);
        $wsUsername = $this->getConfigDataWsUserName($storeId);
        $wsPassword = $this->getConfigDataWsPassword($storeId);
        $account = array(
            'url' => $url,
            'login' => $wsUsername,
            'password' => $wsPassword
        );
        return $account;
    }
786736
public static function get_Hstore( &$store )
    {
        if( $store instanceof Hstore ) {
            return $store;
        }
        return !is_null($store)
            ? new Hstore($store)
            : null
            ;
    }
815495
public function getPrefetchShipping($store = null)
    {
        return $this->getScopeConfig()->isSetFlag(
            self::XML_PATH_PREFETCH_SHIPPING,
            ScopeInterface::SCOPE_STORE,
            $store
        );
    }
806212
protected function getAuthorization($response)
    {
        $method = Arr::get($response, 'method');

        if ('card' == $method) {
            return Arr::get($response, 'authorization');
        }

        if ('bank_account' == $method) {
            $payment = Arr::get($response, 'payment_method', []);

            return Arr::get($payment, 'clabe');
        }

        if ('store' == $method) {
            $payment = Arr::get($response, 'payment_method', []);

            return Arr::get($payment, 'barcode_url');
        }
    }
1134035
protected function _getApiKey() {
        $ini = Zend_Registry::get('config');
        if (!$apiKey = $ini->mailchimp->apiKey) {
            throw new Garp_Service_MailChimp_Exception('No API key was given, nor found in application.ini');
        }
        return $apiKey;
    }