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


PHP CheckOpenID函数代码示例

本文整理汇总了PHP中CheckOpenID函数的典型用法代码示例。如果您正苦于以下问题:PHP CheckOpenID函数的具体用法?PHP CheckOpenID怎么用?PHP CheckOpenID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: CheckOpenID

    $OauthObject->GetUserInfo();
    CheckOpenID();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    if (!ReferCheck(Request('Post', 'FormHash')) || empty($_SESSION[$Prefix . 'OauthAccessToken']) || !$State || empty($_SESSION[$Prefix . 'OauthState']) || $State != $_SESSION[$Prefix . 'OauthState']) {
        AlertMsg($Lang['Error_Unknown_Referer'], $Lang['Error_Unknown_Referer'], 403);
    }
    // 读入Access Token
    $OauthObject->AccessToken = $_SESSION[$Prefix . 'OauthAccessToken'];
    // 释放session防止阻塞
    session_write_close();
    if (!$OauthObject->GetOpenID()) {
        AlertMsg('400 Bad Request', '400 Bad Request', 400);
    }
    $OauthUserInfo = $OauthObject->GetUserInfo();
    CheckOpenID();
    $UserName = strtolower(Request('Post', 'UserName'));
    if ($UserName && IsName($UserName)) {
        $UserExist = $DB->single("SELECT ID FROM " . $Prefix . "users WHERE UserName = :UserName", array('UserName' => $UserName));
        if (!$UserExist) {
            $NewUserSalt = mt_rand(100000, 999999);
            $NewUserPassword = 'zzz' . substr(md5(md5(mt_rand(1000000000, 2147483647)) . $NewUserSalt), 0, -3);
            $NewUserData = array('ID' => null, 'UserName' => $UserName, 'Salt' => $NewUserSalt, 'Password' => $NewUserPassword, 'UserMail' => '', 'UserHomepage' => '', 'PasswordQuestion' => '', 'PasswordAnswer' => '', 'UserSex' => 0, 'NumFavUsers' => 0, 'NumFavTags' => 0, 'NumFavTopics' => 0, 'NewMessage' => 0, 'Topics' => 0, 'Replies' => 0, 'Followers' => 0, 'DelTopic' => 0, 'GoodTopic' => 0, 'UserPhoto' => '', 'UserMobile' => '', 'UserLastIP' => $CurIP, 'UserRegTime' => $TimeStamp, 'LastLoginTime' => $TimeStamp, 'LastPostTime' => $TimeStamp, 'BlackLists' => '', 'UserFriend' => '', 'UserInfo' => '', 'UserIntro' => '', 'UserIM' => '', 'UserRoleID' => 1, 'UserAccountStatus' => 1, 'Birthday' => date("Y-m-d", $TimeStamp));
            $DB->query('INSERT INTO `' . $Prefix . 'users`
				(`ID`, `UserName`, `Salt`, `Password`, `UserMail`, `UserHomepage`, `PasswordQuestion`, `PasswordAnswer`, `UserSex`, `NumFavUsers`, `NumFavTags`, `NumFavTopics`, `NewMessage`, `Topics`, `Replies`, `Followers`, `DelTopic`, `GoodTopic`, `UserPhoto`, `UserMobile`, `UserLastIP`, `UserRegTime`, `LastLoginTime`, `LastPostTime`, `BlackLists`, `UserFriend`, `UserInfo`, `UserIntro`, `UserIM`, `UserRoleID`, `UserAccountStatus`, `Birthday`) 
				VALUES (:ID, :UserName, :Salt, :Password, :UserMail, :UserHomepage, :PasswordQuestion, :PasswordAnswer, :UserSex, :NumFavUsers, :NumFavTags, :NumFavTopics, :NewMessage, :Topics, :Replies, :Followers, :DelTopic, :GoodTopic, :UserPhoto, :UserMobile, :UserLastIP, :UserRegTime, :LastLoginTime, :LastPostTime, :BlackLists, :UserFriend, :UserInfo, :UserIntro, :UserIM, :UserRoleID, :UserAccountStatus, :Birthday)', $NewUserData);
            $CurUserID = $DB->lastInsertId();
            //Insert App user
            $DB->query('INSERT INTO `' . $Prefix . 'app_users`
				 (`ID`, `AppID`, `OpenID`, `AppUserName`, `UserID`, `Time`) 
				VALUES (:ID, :AppID, :OpenID, :AppUserName, :UserID, :Time)', array('ID' => null, 'AppID' => $AppID, 'OpenID' => $OauthObject->OpenID, 'AppUserName' => htmlspecialchars($OauthObject->NickName), 'UserID' => $CurUserID, 'Time' => $TimeStamp));
开发者ID:MrMoDoor,项目名称:Carbon-Forum,代码行数:31,代码来源:oauth.php

示例2: die

<?php

// Copyright 2015 The Haohaoxiuche Team Authors. All right reserved.
// Use of this source that is governed by a Apache-style
// license that can be found in the LICENSE file.
//
// 技術版API編號098 綁定手機號 ##參考015和096
//
// @authors hjboss <hongjiangproject@yahoo.com> 2015-12-18#
// @version 1.0.0
// @package hhxc
if (!defined('HHXC')) {
    die('Permission denied');
}
if (CheckOpenID($params['openid'], $params['uid']) == FALSE) {
    $result['msg'] = '电话号码已注册!';
} else {
    $fields = array('username_d' => Assign($params[KEY_PHONE]), 'password' => Assign($params['pwd']));
    $num = StorageEditByID('hh_techuser', $fields, $params['uid']);
    if ($num <= 0) {
        $result['msg'] = '绑定失败!';
    } else {
        $result = array('code' => '101', 'msg' => '绑定成功!');
    }
}
开发者ID:yangqingboss,项目名称:hhxc-api,代码行数:25,代码来源:API098.php

示例3: StorageRows

## 統計查詢總數
$count = StorageRows($condition);
## 截獲最新20條數據
$condition['others'] .= ' LIMIT 20';
$recordset = StorageFind($condition);
if (is_array($recordset) and empty($recordset) == FALSE) {
    $result = array('code' => '101', 'data' => array());
    $item = array('total' => $count, 'list' => array(), 'keys' => array());
    foreach ($recordset as $index => $row) {
        $item['list'][] = array('id' => $row['id'], 'title' => fmtstr($row['title']), 'lable' => fmtstr($row['lable']), 'miaoshu' => fmtstr($row['miaoshu']));
    }
    $condition_buf = array('schema' => 'car_word', 'filter' => array('id' => array('IN', $word_id)));
    $buf = StorageFind($condition_buf);
    if (is_array($buf) and empty($buf) == FALSE) {
        foreach ($buf as $row) {
            $item['keys'][] = $row['keyword'];
            for ($index = 1; $index <= 9; $index++) {
                if (empty($row['keyword' . $index]) == FALSE) {
                    $item['keys'][] = $row['keyword' . $index];
                }
            }
        }
    }
    $result['data'][] = $item;
    ## 積累積分
    if (CheckOpenID($params['openid'], $params['uid']) == TRUE) {
        if (empty($params['uid']) == FALSE) {
            Techuser_setScore(Assign($params['uid'], 0), 2);
        }
    }
}
开发者ID:yangqingboss,项目名称:hhxc-api,代码行数:31,代码来源:API021.php


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