コード例 #1
0
    unset($account);
    if ($result['error'] === false) {
        $account = new account($dbo);
        $account->setState(ACCOUNT_STATE_ENABLED);
        $account->setLastActive();
        $result = $account->signin($username, $password);
        unset($account);
        if ($result['error'] === false) {
            $auth = new auth($dbo);
            $result = $auth->create($result['accountId'], $clientId);
            if ($result['error'] === false) {
                $account = new account($dbo, $result['accountId']);
                if (strlen($facebookId) != 0) {
                    $helper = new helper($dbo);
                    if ($helper->getUserIdByFacebook($facebookId) == 0) {
                        $account->setFacebookId($facebookId);
                    }
                } else {
                    $account->setFacebookId("");
                }
                if (strlen($gcm_regId) != 0) {
                    $account->setGCM_regId($gcm_regId);
                }
                $result['account'] = array();
                array_push($result['account'], $account->get());
            }
        }
    }
    echo json_encode($result);
    exit;
}
コード例 #2
0
 * ifsoft.co.uk engine v1.0
 *
 * 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'] : '';
    $accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
    $clientId = helper::clearInt($clientId);
    $accountId = helper::clearInt($accountId);
    $accessToken = helper::clearText($accessToken);
    $accessToken = helper::escapeText($accessToken);
    if ($clientId != CLIENT_ID) {
        api::printError(ERROR_UNKNOWN, "Error client Id.");
    }
    $result = array("error" => true, "error_code" => ERROR_UNKNOWN);
    $auth = new auth($dbo);
    if (!$auth->authorize($accountId, $accessToken)) {
        api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
    }
    $account = new account($dbo, $accountId);
    $account->setFacebookId("");
    $result = array("error" => false, "error_code" => ERROR_SUCCESS);
    echo json_encode($result);
    exit;
}
コード例 #3
0
ファイル: profile.php プロジェクト: JohnWilliamsMSU/Steady
    header("Location: /admin/login.php");
}
$accountInfo = array();
if (isset($_GET['id'])) {
    $accountId = isset($_GET['id']) ? $_GET['id'] : 0;
    $accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : 0;
    $act = isset($_GET['act']) ? $_GET['act'] : '';
    $accountId = helper::clearInt($accountId);
    $account = new account($dbo, $accountId);
    $accountInfo = $account->get();
    $messages = new messages($dbo);
    $messages->setRequestFrom($accountId);
    if ($accessToken === admin::getAccessToken() && !APP_DEMO) {
        switch ($act) {
            case "disconnect":
                $account->setFacebookId('');
                header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
                break;
            case "showAdmob":
                $account->setAdmob(1);
                header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
                break;
            case "hideAdmob":
                $account->setAdmob(0);
                header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
                break;
            case "close":
                $auth->removeAll($accountId);
                header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
                break;
            case "block":