当前位置: 首页>>代码示例>>PHP>>正文


PHP Hybrid_Auth::logoutAllProviders方法代码示例

本文整理汇总了PHP中Hybrid_Auth::logoutAllProviders方法的典型用法代码示例。如果您正苦于以下问题:PHP Hybrid_Auth::logoutAllProviders方法的具体用法?PHP Hybrid_Auth::logoutAllProviders怎么用?PHP Hybrid_Auth::logoutAllProviders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Hybrid_Auth的用法示例。


在下文中一共展示了Hybrid_Auth::logoutAllProviders方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: logout

 public function logout()
 {
     $oauth = new \Hybrid_Auth(base_path() . '/app/config/fb_Auth.php');
     $oauth->logoutAllProviders();
     Session::flush();
     Auth::logout();
     return Redirect::to("home");
 }
开发者ID:olax,项目名称:epetitions,代码行数:8,代码来源:LoginController.php

示例2: Logout

 /**
  * Destroys all sessions
  *
  * @return void
  */
 function Logout()
 {
     if (is_object($this->Hybrid_Auth)) {
         $this->Hybrid_Auth->logoutAllProviders();
     }
     $logout_data = array();
     if (!empty($this->config['loginContext'])) {
         $logout_data['login_context'] = $this->config['loginContext'];
     }
     if (!empty($this->config['addContexts'])) {
         $logout_data['add_contexts'] = $this->config['addContexts'];
     }
     $response = $this->modx->runProcessor('security/logout', $logout_data);
     if ($response->isError()) {
         $this->modx->log(modX::LOG_LEVEL_ERROR, '[HybridAuth] logout error. Username: ' . $this->modx->user->get('username') . ', uid: ' . $this->modx->user->get('id') . '. Message: ' . implode(', ', $response->getAllErrors()));
         $_SESSION['HA']['error'] = implode(', ', $response->getAllErrors());
     }
     unset($_SESSION['HA::CONFIG']);
     $this->Refresh('logout');
 }
开发者ID:govza,项目名称:modx-hybridauth,代码行数:25,代码来源:hybridauth.class.php

示例3: catch

            }
        }
    } catch (Exception $e) {
        echo $e->getMessage();
    }
});
$app->get('/:add', $authenticate($app), function () use($app, $model) {
    $session_identifier = Hybrid_Auth::storage()->get('user');
    $avatarUrl = $model->getAvatarUrl($session_identifier);
    $app->render('add.php', ['datajs' => 'words.js', 'datagroupjs' => 'words-io.js', 'name' => 'Add Word', 'model' => $model, 'avatarURL' => $avatarUrl, 'identifier' => $session_identifier, 'scriptID' => 'i']);
})->conditions(array('add' => '[+]'));
// moved to words page. remove soon
$app->get('/logout/', function () use($app, $model) {
    $app->hybridInstance;
    $model->logout_user();
    Hybrid_Auth::logoutAllProviders();
    $app->redirect('/login/');
});
$app->get('/welcome/', $authenticate($app, $model), function () use($app, $model) {
    $session_identifier = Hybrid_Auth::storage()->get('user');
    $avatarUrl = $model->getAvatarUrl($session_identifier);
    $app->render('welcome.php', ['datajs' => 'welcome', 'datagroupjs' => 'account', 'name' => 'Welcome', 'model' => $model, 'avatarURL' => $avatarUrl, 'identifier' => $session_identifier, 'scriptID' => 'i']);
});
$app->get('/words/', $authenticate($app, $model), function () use($app, $model) {
    $session_identifier = Hybrid_Auth::storage()->get('user');
    $avatarUrl = $model->getAvatarUrl($session_identifier);
    $app->render('words.php', ['datajs' => 'words.js', 'datagroupjs' => 'words-io.js', 'name' => 'Words', 'model' => $model, 'avatarURL' => $avatarUrl, 'identifier' => $session_identifier, 'scriptID' => 'i']);
});
$app->get('/bins/', $authenticate($app, $model), function () use($app, $model) {
    $session_identifier = Hybrid_Auth::storage()->get('user');
    $avatarUrl = $model->getAvatarUrl($session_identifier);
开发者ID:McMillanThomas,项目名称:wordbin,代码行数:31,代码来源:index.php

示例4: dirname

<?php

// config and whatnot
$config = dirname(__FILE__) . '/../../hybridauth/config.php';
require_once "../../hybridauth/Hybrid/Auth.php";
try {
    $hybridauth = new Hybrid_Auth($config);
    // logout the user from $provider
    $hybridauth->logoutAllProviders();
    // return to login page
    $hybridauth->redirect("login.php");
} catch (Exception $e) {
    echo "<br /><br /><b>Oh well, we got an error :</b> " . $e->getMessage();
    echo "<hr /><h3>Trace</h3> <pre>" . $e->getTraceAsString() . "</pre>";
}
开发者ID:DonaldNgai,项目名称:PHPAuthentication,代码行数:15,代码来源:logout_all.php

示例5: logout

 /**
  * Logout all providers
  *
  * @param \Cake\Event\Event $event Event.
  * @param array $user The user about to be logged out.
  * @return void
  */
 public function logout(Event $event, array $user)
 {
     $this->_init($this->_registry->getController()->request);
     $this->hybridAuth->logoutAllProviders();
 }
开发者ID:jamiefifty,项目名称:CakePHP-HybridAuth,代码行数:12,代码来源:HybridAuthAuthenticate.php

示例6: logoutwith

 function logoutwith($provider = NULL)
 {
     $this->autoRender = false;
     require_once WWW_ROOT . 'hybridauth/Hybrid/Auth.php';
     $hybridauth_config = array("base_url" => 'http://' . $_SERVER['HTTP_HOST'] . $this->base . "/hybridauth/", "providers" => array("Facebook" => array("enabled" => true, "keys" => array("id" => "your_fb_api_key", "secret" => "fb_api_secret"), "scope" => 'email'), "Twitter" => array("enabled" => true, "keys" => array("key" => "CSpbRJK5eAEod91O7js5Gg", "secret" => "8KGhKpPzYRDX6FYkPVXTzvELN1D7pXtA78SYSnq44"))));
     try {
         // create an instance for Hybridauth with the configuration file path as parameter
         $hybridauth = new Hybrid_Auth($hybridauth_config);
         // try to authenticate the selected $provider
         $adapter = $hybridauth->logoutAllProviders();
         // grab the user profile
     } catch (Exception $e) {
         // Display the recived error
         switch ($e->getCode()) {
             case 0:
                 $error = "Unspecified error.";
                 break;
             case 1:
                 $error = "Hybriauth configuration error.";
                 break;
             case 2:
                 $error = "Provider not properly configured.";
                 break;
             case 3:
                 $error = "Unknown or disabled provider.";
                 break;
             case 4:
                 $error = "Missing provider application credentials.";
                 break;
             case 5:
                 $error = "Authentification failed. The user has canceled the authentication or the provider refused the connection.";
                 break;
             case 6:
                 $error = "User profile request failed. Most likely the user is not connected to the provider and he should to authenticate again.";
                 $adapter->logout();
                 break;
             case 7:
                 $error = "User not connected to the provider.";
                 $adapter->logout();
                 break;
         }
         // well, basically you should not display this to the end user, just give him a hint and move on..
         $error .= "Original error message: " . $e->getMessage();
         $error .= "Trace: " . $e->getTraceAsString();
         $this->set('error', $error);
     }
 }
开发者ID:shivram2609,项目名称:e-leran,代码行数:47,代码来源:UsersController.php

示例7: logout

 public function logout(\Hybrid_Auth $hybridAuth)
 {
     $hybridAuth->logoutAllProviders();
     // TODO: Return to the index page
 }
开发者ID:JonTheNiceGuy,项目名称:cchits.laravel,代码行数:5,代码来源:LoginController.php

示例8: function

    $guzzle->delete($app->config['db_name'] . '/' . $id . '?rev=' . $rev);
    return $app->redirect($app["url_generator"]->generate('index') . '#manage');
})->before($authenticate);
// login handler
// check if authenticated against provider
// retrieve user email address and save to session
$app->get('/login', function () use($app, $auth) {
    $google = $auth->authenticate("Google");
    $currentUser = $google->getUserProfile();
    $_SESSION['uid'] = $currentUser->email;
    return $app->redirect($app["url_generator"]->generate('index') . '#search');
})->bind('login');
// logout handler
// log out and display logout information page
$app->get('/logout', function () use($app, $auth) {
    $auth->logoutAllProviders();
    session_destroy();
    return $app['twig']->render('logout.twig');
})->before($authenticate);
// OAuth callback handler
$app->get('/callback', function () {
    return Hybrid_Endpoint::process();
});
// legal page
$app->get('/legal', function () use($app) {
    return $app['twig']->render('legal.twig');
});
// delete-my-data handler
$app->get('/delete-my-data', function () use($app, $guzzle) {
    $uid = $_SESSION['uid'];
    // get all docs for user
开发者ID:vvaswani,项目名称:bluemix-portfolio-tracker,代码行数:31,代码来源:index.php

示例9: userLogOut

function userLogOut() {
	$GLOBALS['userIsLoggedIn'] = false;

	unset($_SESSION['authentication_info']);
	Hybrid_Auth::logoutAllProviders();

	Db_Users::logout();
}
开发者ID:alexchitoraga,项目名称:tunet_casti,代码行数:8,代码来源:functions.php

示例10: getLogout

 /**
  * Log the user out of the application.
  *
  */
 public function getLogout()
 {
     Confide::logout();
     try {
         // Logout all providers
         $socialAuth = new Hybrid_Auth(app_path() . '/config/hybridauth.php');
         $socialAuth->logoutAllProviders();
     } catch (Exception $err) {
         var_dump($err);
     }
     return Redirect::to('/');
 }
开发者ID:dileepxervmon,项目名称:Xdocker,代码行数:16,代码来源:UserController.php

示例11: logoutExternal

function logoutExternal()
{
    global $CFG;
    $hybridauth_config = $CFG->dirAddress . 'core/lib/hybridauth-2.4.1/hybridauth/config.php';
    require_once $CFG->dirAddress . 'core/lib/hybridauth-2.4.1/hybridauth/Hybrid/Auth.php';
    try {
        $hybridauth = new Hybrid_Auth($hybridauth_config);
        $hybridauth->logoutAllProviders();
    } catch (Exception $e) {
        //echo "<br /><br /><b>Oh well, we got an error :</b> " . $e->getMessage();
        //echo "<hr /><h3>Trace</h3> <pre>" . $e->getTraceAsString() . "</pre>";
    }
}
开发者ID:uniteddiversity,项目名称:LiteMap,代码行数:13,代码来源:accesslib.php

示例12: catch

    try {
        $hybridauth = new Hybrid_Auth($config);
        $adapter = $hybridauth->authenticate($mod);
        $user_profile = $adapter->getUserProfile();
        //?
        //			$adapter->disconnect();
        if ($mod == "tumblr") {
            $full_user_profile = $adapter->api()->api('user/info');
        }
    } catch (Exception $e) {
        $reclaim_error = "" . $e->getMessage();
    }
} elseif (isset($mod) && !$login) {
    try {
        $hybridauth = new Hybrid_Auth($config);
        $adapter = $hybridauth->logoutAllProviders($mod);
        $user_profile = '';
        $_SESSION['login'] = 0;
        $reclaim_error = 'logged out user from ' . $mod . '.';
    } catch (Exception $e) {
        $reclaim_error = "" . $e->getMessage();
    }
}
// logged in ?
if (!isset($user_profile) || empty($user_profile)) {
    // return error
    if (!isset($reclaim_error)) {
        $reclaim_error = 'got no user profile from ' . $mod . '.';
    }
    $_SESSION['e'] = $reclaim_error;
    //echo "".$reclaim_error;
开发者ID:sandeepone,项目名称:reclaim-social-media,代码行数:31,代码来源:hybridauth_helper.php

示例13: getLogout

 /**
  * Log the user out of the application.
  *
  */
 public function getLogout()
 {
     Confide::logout();
     try {
         // Logout all providers
         $socialAuth = new Hybrid_Auth(app_path() . '/config/hybridauth.php');
         $socialAuth->logoutAllProviders();
     } catch (Exception $err) {
         Log::error($err);
         return Redirect::to('/')->with('notice', $err->getMessage());
     }
     return Redirect::to('/');
 }
开发者ID:XDocker,项目名称:app,代码行数:17,代码来源:UserController.php

示例14: authorize

 /**
  * User authorization
  * Registers new user when authorizing via HybridAuth
  * Updates user details while logging via HybridAuth when email matches a registered user
  */
 public function authorize()
 {
     $this->iaCore->startHook('phpCoreBeforeAuth');
     $authorized = 0;
     if (isset($_POST['register'])) {
         $login = '';
     } elseif (isset($_POST['username'])) {
         $login = $_POST['username'];
         $authorized++;
     } else {
         $login = '';
     }
     if (isset($_POST['register'])) {
         $pass = '';
     } elseif (isset($_POST['password'])) {
         $pass = $_POST['password'];
         $authorized++;
     } else {
         $pass = '';
     }
     $isBackend = iaCore::ACCESS_ADMIN == $this->iaCore->getAccessType();
     if (IA_EXIT && $authorized != 2) {
         // use this hook to logout
         $this->iaCore->startHook('phpUserLogout', array('userInfo' => iaUsers::getIdentity(true)));
         if ($this->iaCore->get('hybrid_enabled')) {
             require_once IA_INCLUDES . 'hybrid/Auth.php';
             Hybrid_Auth::logoutAllProviders();
         }
         iaUsers::clearIdentity();
         unset($_SESSION['_achkych']);
         if (strpos($_SERVER['HTTP_REFERER'], $this->iaView->domainUrl) === 0) {
             if ($isBackend) {
                 $_SESSION['IA_EXIT'] = true;
             }
             $url = $isBackend ? IA_ADMIN_URL : IA_URL;
             header('Location: ' . $url);
         } else {
             header('Location: ' . $this->iaView->domainUrl . ($isBackend ? $this->iaCore->get('admin_page') . IA_URL_DELIMITER : ''));
         }
         exit;
     } elseif ($authorized == 2 && $login && $pass) {
         $auth = (bool) $this->getAuth(null, $login, $pass, isset($_POST['remember']));
         $this->iaCore->startHook('phpUserLogin', array('userInfo' => iaUsers::getIdentity(true), 'password' => $pass));
         if (!$auth) {
             if ($isBackend) {
                 $this->iaView->assign('error_login', true);
             } else {
                 $this->iaView->setMessages(iaLanguage::get('error_login'));
                 $this->iaView->name('login');
             }
         } else {
             unset($_SESSION['_achkych']);
             if (isset($_SESSION['referrer'])) {
                 header('Location: ' . $_SESSION['referrer']);
                 unset($_SESSION['referrer']);
                 exit;
             } else {
                 if ($isBackend) {
                     $this->iaCore->factory('log')->write(iaLog::ACTION_LOGIN, array('ip' => $this->iaCore->util()->getIp(false)));
                 }
             }
         }
     } elseif (2 == $authorized) {
         if ($isBackend) {
             $this->iaView->assign('empty_login', true);
         } else {
             $this->iaView->setMessages(iaLanguage::get('empty_login'));
             $this->iaView->name('login');
         }
     } elseif (isset($_COOKIE[self::AUTO_LOGIN_COOKIE_NAME])) {
         $this->_checkAutoLoginCookie();
     }
     $this->iaCore->getSecurityToken() || ($_SESSION[iaCore::SECURITY_TOKEN_MEMORY_KEY] = $this->iaCore->factory('util')->generateToken(92));
 }
开发者ID:kreativmind,项目名称:subrion,代码行数:79,代码来源:ia.core.users.php

示例15: logout

 /**
  * Log the user out with all providers.
  * 
  * @return void
  */
 public function logout()
 {
     $this->hybrid->logoutAllProviders();
 }
开发者ID:onlystar1991,项目名称:mtdb,代码行数:9,代码来源:Auth.php


注:本文中的Hybrid_Auth::logoutAllProviders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。