本文整理匯總了PHP中Hybrid_Auth::getErrorMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hybrid_Auth::getErrorMessage方法的具體用法?PHP Hybrid_Auth::getErrorMessage怎麽用?PHP Hybrid_Auth::getErrorMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Hybrid_Auth
的用法示例。
在下文中一共展示了Hybrid_Auth::getErrorMessage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: socialAction
public function socialAction()
{
// hack to import all GLOBAL_HYBRID_ into global namespace
foreach (token_get_all(file_get_contents(APPLICATION_PATH . '/../hybridauth/hybridauth.php')) as $token) {
if ($token[0] == T_VARIABLE) {
$var = substr($token[1], 1);
if (strstr($var, 'GLOBAL_HYBRID_AUTH_') !== FALSE) {
global ${$var};
}
}
}
require_once APPLICATION_PATH . '/../hybridauth/hybridauth.php';
$hauth = new Hybrid_Auth();
if ($hauth->hasError()) {
var_dump($hauth->getErrorMessage());
exit;
}
if (!$hauth->hasSession()) {
$adapter = $hauth->setup($this->_getParam('provider'), array('hauth_return_to' => 'http:///auth/social/provider/' . $this->_getParam('provider')));
$adapter->login();
} else {
$adapter = $hauth->wakeup();
$userData = $adapter->user();
$adapter = $this->_helper->service('auth.adapter.social');
$adapter->setProvider($userData->providerId)->setProviderUserId($userData->providerUID);
$result = $this->auth->authenticate($adapter);
if ($result->getCode() == Zend_Auth_Result::SUCCESS) {
$this->_helper->redirector('index', 'dashboard');
}
$this->_forward('social', 'register', 'default', array('userData' => $userData));
}
}