public function getInfoMe($socialnetworktype, $options = array())
    {
        $infoMe = null;
        $provider = ucfirst(strtolower($socialnetworktype));
        if (is_string($socialnetworktype)) {
            try {
                $adapter = $this->getHybridAuth()->authenticate($provider);
                if ($adapter->isConnected()) {
                    $infoMe = $adapter->getUserProfile();
                }
            } catch (\Exception $ex) {
                // The following retry is efficient in case a user previously registered on his social account
                // with the app has unsubsribed from the app
                // cf http://hybridauth.sourceforge.net/userguide/HybridAuth_Sessions.html

                if (($ex->getCode() == 6) || ($ex->getCode() == 7)) {
                    // Réinitialiser la session HybridAuth
                    $this->getHybridAuth()->getAdapter($provider)->logout();
                    // Essayer de se connecter à nouveau
                    $adapter = $this->getHybridAuth()->authenticate($provider);
                    if ($adapter->isConnected()) {
                        $infoMe = $adapter->getUserProfile();
                    }
                } else {
                    // $authEvent->setCode(\Zend\Authentication\Result::FAILURE)
                    // ->setMessages(array('Invalid provider'));
                    // $this->setSatisfied(false);

                    return null;
                }
            }
        }

        return $infoMe;
    }
public function getInfoMe($socialnetworktype, $options = array())
    {
        $infoMe = null;
        $provider = ucfirst(strtolower($socialnetworktype));
        if (is_string($socialnetworktype)) {
            try {
                $adapter = $this->getHybridAuth()->authenticate($provider);
                if ($adapter->isConnected()) {
                    $infoMe = $adapter->getUserProfile();
                }
            } catch (\Exception $ex) {
                // The following retry is efficient in case a user previously registered on his social account
                // with the app has unsubsribed from the app
                // cf http://hybridauth.sourceforge.net/userguide/HybridAuth_Sessions.html

                if (($ex->getCode() == 6) || ($ex->getCode() == 7)) {
                    // Réinitialiser la session HybridAuth
                    $this->getHybridAuth()->getAdapter($provider)->logout();
                    // Essayer de se connecter à nouveau
                    $adapter = $this->getHybridAuth()->authenticate($provider);
                    if ($adapter->isConnected()) {
                        $infoMe = $adapter->getUserProfile();
                    }
                } else {
                    // $authEvent->setCode(\Zend\Authentication\Result::FAILURE)
                    // ->setMessages(array('Invalid provider'));
                    // $this->setSatisfied(false);

                    return null;
                }
            }
        }

        return $infoMe;
    }
public function getInfoMe ( $ socialnetworktype , $ options = array ( ) ) { $ infoMe = null ; $ provider = ucfirst ( strtolower ( $ socialnetworktype ) ) ; if ( is_string ( $ socialnetworktype ) ) { try { $ adapter = $ this -> getHybridAuth ( ) -> authenticate ( $ provider ) ; if ( $ adapter -> isConnected ( ) ) { $ infoMe = $ adapter -> getUserProfile ( ) ; } } catch ( \ Exception $ ex ) { // The following retry is efficient in case a user previously registered on his social account // with the app has unsubsribed from the app // cf http://hybridauth.sourceforge.net/userguide/HybridAuth_Sessions.html if ( ( $ ex -> getCode ( ) == 6 ) || ( $ ex -> getCode ( ) == 7 ) ) { // Réinitialiser la session HybridAuth $ this -> getHybridAuth ( ) -> getAdapter ( $ provider ) -> logout ( ) ; // Essayer de se connecter à nouveau $ adapter = $ this -> getHybridAuth ( ) -> authenticate ( $ provider ) ; if ( $ adapter -> isConnected ( ) ) { $ infoMe = $ adapter -> getUserProfile ( ) ; } } else { // $authEvent->setCode(\Zend\Authentication\Result::FAILURE) // ->setMessages(array('Invalid provider')); // $this->setSatisfied(false); return null ; } } } return $ infoMe ; }
Retourne mes infos
@param  string                    $socialnetworktype
@param  array                     $options
@return NULL|\Hybrid_User_Profile
Retourne mes infos