connect.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: connect.php 34240 2013-11-21 08:32:04Z nemohou $
  7. */
  8. if(!defined('IN_MOBILE_API')) {
  9. exit('Access Denied');
  10. }
  11. $_GET['mod'] = 'connect';
  12. include_once 'member.php';
  13. class mobile_api {
  14. function common() {
  15. global $_G, $seccodecheck, $secqaacheck, $connect_guest;
  16. if($_G['uid'] && $_G['member']['conisbind']) {
  17. dheader('location: '.$_G['siteurl'].'index.php');
  18. }
  19. $connect_guest = array();
  20. if($_G['connectguest'] && (submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck) || submitcheck('loginsubmit', 1, $seccodestatus))) {
  21. if(!$_GET['auth_hash']) {
  22. $_GET['auth_hash'] = $_G['cookie']['con_auth_hash'];
  23. }
  24. $conopenid = authcode($_GET['auth_hash']);
  25. $connect_guest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid);
  26. if(!$connect_guest) {
  27. dsetcookie('con_auth_hash');
  28. showmessage('qqconnect:connect_login_first');
  29. }
  30. }
  31. }
  32. function output() {
  33. if(!empty($_POST)) {
  34. mobile_core::result(mobile_core::variable());
  35. } else {
  36. global $_G;
  37. $bbrulehash = $_G['setting']['bbrules'] ? substr(md5(FORMHASH), 0, 8) : '';
  38. $isconnect = $_G['qc']['connect_app_id'] && $_G['qc']['connect_openid'];
  39. include template('mobile:register');
  40. exit;
  41. }
  42. }
  43. }
  44. ?>