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


PHP account::logout方法代码示例

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


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

示例1: header

    header("Location: login.php?origin=" . urlencode('account.php'));
}
if ($common->postBack()) {
    // Check that the user supplied a password matching the one currently stored in administrators.xml.
    $authenticated = $account->authenticate($_SESSION['login'], $_POST['password'], FALSE, FALSE);
    if (!$authenticated) {
        $passwordIncorrect = TRUE;
    }
    if ($_POST['password1'] != $_POST['password2']) {
        $didNotMatch = TRUE;
    }
    if ($authenticated && $_POST['password1'] == $_POST['password2']) {
        // Change the password stored in administrators.xml related to this users login.
        $account->changePassword($_SESSION['login'], $_POST['password1']);
        // Since the password has changed we will log the user out to clear older session variables.
        $account->logout();
    }
}
require_once 'includes/header.inc.php';
/////////////////////
// BEGIN HTML BODY //
if ($_SESSION['firstLogin'] && !$common->postBack()) {
    ?>
            <div id="first-login-modal" class="modal fade in" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-body">
                            <strong>First time login detected.</strong><br />
                            You must change the default password before continuing.
                        </div>
                    </div>
开发者ID:mgunther68,项目名称:adsb-feeder,代码行数:31,代码来源:account.php

示例2: isset

 *
 * http://ifsoft.com.ua, http://ifsoft.co.uk
 * qascript@ifsoft.co.uk
 *
 * Copyright 2012-2015 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
 */
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
    $clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
    $accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $clientId = helper::clearInt($clientId);
    $accountId = helper::clearInt($accountId);
    $accessToken = helper::clearText($accessToken);
    $accessToken = helper::escapeText($accessToken);
    $result = array("error" => true);
    if ($clientId != CLIENT_ID) {
        api::printError(ERROR_UNKNOWN, "Error client Id.");
    }
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $account = new account($dbo, $accountId);
    $account->setLastActive();
    $account->logout($accountId, $accessToken);
    $result = array("error" => false, "error_code" => ERROR_SUCCESS);
    echo json_encode($result);
    exit;
}
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:31,代码来源:account.logOut.inc.php


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