Ejemplo n.º 1
0
<?php

define('IN_ECS', true);
error_reporting(0);
require dirname(__FILE__) . '/../includes/init.php';
require 'callback.php';
$wechatObj = new wechatCallbackapi();
$wechatObj->valid($db);
$base_url = 'http://' . $_SERVER['SERVER_NAME'] . '/';
$db->prefix = $ecs->prefix;
$wechatObj->responseMsg($db, $user, $base_url);
Ejemplo n.º 2
0
<?php

/*
 * ×÷ÕߣºÁÁ½£
 * ÁªÏµQQ:578933760
 *
 */
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$config = $_G['cache']['plugin']['aljwsq'];
define("TOKEN", $config['token']);
$wechatObj = new wechatCallbackapi();
if (isset($_GET['echostr'])) {
    $wechatObj->valid();
} else {
    $wechatObj->responsemsg();
}
class wechatCallbackapi
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            exit;
        }
    }
    public function responsemsg()
    {
Ejemplo n.º 3
0
<?php

/**
 * 
 * WeChat Interface for WeChat Subscribers Lite
 * 
 * 
 *   
 */
global $token;
define('IS_DEBUG', false);
$wechatObj = new wechatCallbackapi($token);
$valid = $wechatObj->valid();
if ($valid) {
    $wechatObj->responseMsg(get_data());
} else {
    header('Location: ' . home_url());
}
exit;
class wechatCallbackapi
{
    private $token;
    private $data;
    public function __construct($_token, $_data = null)
    {
        $this->token = $_token;
        if ($_data != null) {
            $this->load($_data);
        }
    }
    public function load($_data)
<?php

require_once "wechat.api.php";
$wechatObj = new wechatCallbackapi();
$signPackage = $wechatObj->GetSignPackage();
?>

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui">
        <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)" />
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta content="yes" name="apple-touch-fullscreen" />
        <meta content="telephone=no,email=no" name="format-detection" />
        <meta content="fullscreen=yes,preventMove=no" name="ML-Config" />

        <title>南邮官方微信平台</title>

        <link rel="Shortcut Icon" href="favicon.ico">
        <link rel="Bookmark" href="favicon.ico">

        <link href="./css/style.min.css?v=<?php 
echo VERSION;
?>
" rel="stylesheet">

<script>
Ejemplo n.º 5
0
<?php

/*
*
*微信插件token处理
*
*/
global $token;
$wechatObj = new wechatCallbackapi($token, get_data());
$valid = $wechatObj->valid();
if ($valid) {
    $wechatObj->saveMsgHistory();
    $wechatObj->responseMsg();
} else {
    header('Location: ' . home_url());
}
exit;
class wechatCallbackapi
{
    private $token;
    public function __construct($_token, $_data = null)
    {
        $this->token = $_token;
        if ($_data != null) {
            $this->data = $_data;
        }
    }
    //debug专用函数
    public function setField($data)
    {
        $messageRow = array("content" => $data);
Ejemplo n.º 6
0
<?php

//在微信公众平台测试号下的测试文件
define("TOKEN", "wx_renrenlie");
$method = $_SERVER['REQUEST_METHOD'];
if ($method == 'GET') {
    $wechatObj = new wechatCallbackapiTest();
    $wechatObj->valid();
} else {
    if ($method == 'POST') {
        $wechatObj = new wechatCallbackapi();
        $wechatObj->responseMsg();
    }
}
class wechatCallbackapiTest
{
    public function valid()
    {
        $echoStr = $_GET["echostr"];
        //valid signature , option
        if ($this->checkSignature()) {
            echo $echoStr;
            exit;
        }
    }
    private function checkSignature()
    {
        // you must define TOKEN by yourself
        if (!defined("TOKEN")) {
            throw new Exception('TOKEN is not defined!');
        }
Ejemplo n.º 7
0
<?php

require 'Wechat_Controll.php';
require 'wechat_check_signature.php';
// check signature
$wechatObj = new wechatCallbackapi();
$wechatObj->valid();
//$wechatObj->responseMsg();
// handle events
$data = file_get_contents("php://input");
$wechat->handleEvents($data);
Ejemplo n.º 8
0
<?php

define('IN_ECS', true);
if (isset($_GET['todo'])) {
    $todo = $_GET['todo'];
}
//$do = array('souho.net','souho.cc');
//$do99 = $_SERVER['SERVER_NAME'];
//if(!in_array($do99,$do)){
//    $todo = 'error';
//}
require dirname(__FILE__) . '/../includes/init.php';
require 'callback-ent.php';
$wechatObj = new wechatCallbackapi();
$base_url = 'http://' . $_SERVER['SERVER_NAME'] . '/';
$db->prefix = $ecs->prefix;
$wechatObj->valid($db);
if ($todo == 'create') {
    $wechatObj->create_menu($db);
    exit;
} elseif ($todo == 'delete') {
    $wechatObj->delete_menu($db);
    exit;
}
$wechatObj->responseMsg($db, $user, $base_url);