文件zb_users\plugin\appcentre\include.php提供了一个官方接口,定义如下:
- define('APPCENTRE_API_URL','http://app.zblogcn.com/api/index.php?api=');define('APPCENTRE_API_APP_ISBUY','isbuy');//$appid是App在应用中心的发布后的文章ID数字号,非App的ID名称。function AppCentre_App_Check_ISBUY($appid){ global $zbp; $postdate = array( 'email'=>$zbp->Config('AppCentre')->shop_username, 'password'=>$zbp->Config('AppCentre')->shop_password, 'appid'=>$appid, ); $http_post = Network::Create(); $http_post->open('POST',APPCENTRE_API_URL.APPCENTRE_API_APP_ISBUY); $http_post->setRequestHeader('Referer',substr($zbp->host,0,-1) . $zbp->currenturl); $http_post->send($postdate); $result = json_decode($http_post->responseText,true); return $result;}
复制代码
大概就是向API_URL, post一组数据,模拟post的方法很多,不多说可以自己试试。
如果你直接打开API_URL 返回的是这样一组字符串: - {"ret":1,"errcode":2,"msg":"account is not available.","timestamp":1408465790}
复制代码
其中:
字段值 | 含义 | ret=0 | 返回正常 | ret=1 | 返回错误,具体错误请查看errcode错误代码 |
字段值 | 内容 | 含义 | errcode=0 | 0
| 返回正常
| errcode=1 | api mothod is wrong. | 无效接口,接口错误 | errcode=2 | account is not available. | 帐号错误(空帐号) | errcode=8 | account verify false. | 密码错误
| errcode=9 | account is not available. | 帐号错误
| errcode=11 | There is no order. | 订单列表为空 | errcode=21 | This order is not buy of you. | 订单购买者非本人 | errcode=30 | domain is not in white list. | 当前插件安装博客地址未在应用中心用户域名白名单内
|
字段值 | 含义 | buy=0 | 用户未购买本插件 | buy=1 | 用户已购买本插件 |
AppCentre_App_Check_ISBUY这个函数返回值只有两个,buy=0或者1。
你可以有两种方案去绕过验证,一个是删除插件或者主题安装包里的验证函数。
另一个是去修改appcenter这个插件里的api函数,不管买没买都返回1,就行了。
|