member_connect.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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: member_connect.php 34239 2013-11-21 08:31:14Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. define('NOROBOT', TRUE);
  12. if(!$_G['setting']['connect']['allow']) {
  13. showmessage('qqconnect:qqconnect_closed');
  14. }
  15. if($_GET['action'] == 'login') { // debug 已有账号,绑定我的账号走此分支
  16. $ctl_obj = new logging_ctl();
  17. $_G['setting']['seccodestatus'] = 0;
  18. $ctl_obj->connect_guest = $connect_guest;
  19. $ctl_obj->extrafile = libfile('member/connect_logging', 'module');
  20. $ctl_obj->template = 'member/login';
  21. $ctl_obj->on_login();
  22. } else { // debug 完善我的资料,即添加个新的论坛账号走此分支
  23. $_G['qc']['connect_auth_hash'] = $_GET['con_auth_hash'];
  24. if(!$_G['qc']['connect_auth_hash']) {
  25. $_G['qc']['connect_auth_hash'] = $_G['cookie']['con_auth_hash'];
  26. }
  27. $conopenid = authcode($_G['qc']['connect_auth_hash']);
  28. $ctl_obj = new register_ctl();
  29. $ctl_obj->setting = $_G['setting'];
  30. if($_G['setting']['regconnect']) {
  31. $ctl_obj->setting['regstatus'] = $ctl_obj->setting['regstatus'] ? $ctl_obj->setting['regstatus'] : 1;
  32. }
  33. $_G['setting']['regclosed'] = $_G['setting']['regconnect'] && !$_G['setting']['regstatus'];
  34. loadcache('connect_blacklist');
  35. if(in_array($conopenid, $_G['cache']['connect_blacklist'])) {
  36. showmessage('qqconnect:connect_uin_in_blacklist', $referer, array('changeqqurl' => $_G['connect']['discuz_change_qq_url']));
  37. }
  38. $_G['qc']['uinlimit'] = $_G['setting']['connect']['register_uinlimit'] && C::t('#qqconnect#connect_memberbindlog')->count_uid_by_openid_type($conopenid, '1') >= $_G['setting']['connect']['register_uinlimit'];
  39. if($_G['qc']['uinlimit']) {
  40. $_G['setting']['regconnect'] = false;
  41. }
  42. if(!$_G['setting']['regconnect']) {
  43. $ctl_obj->showregisterform = 0;
  44. $ctl_obj->setting['sitemessage']['register'] = array();
  45. }
  46. if($_G['qc']['uinlimit']) {
  47. $ctl_obj->showregisterform = 0;
  48. $ctl_obj->setting['sitemessage']['register'] = array();
  49. $ctl_obj->setting['regconnect'] = false;
  50. }
  51. if($_G['setting']['connect']['register_regverify']) {
  52. $ctl_obj->setting['regverify'] = 0;
  53. }
  54. $_G['setting']['seccodestatus'] = 0;
  55. $_G['setting']['secqaa']['status'] = 0;
  56. $ctl_obj->setting['sendregisterurl'] = false;
  57. $ctl_obj->connect_guest = $connect_guest;
  58. loadcache(array('fields_connect_register', 'profilesetting'));
  59. foreach($_G['cache']['fields_connect_register'] as $field => $data) {
  60. unset($_G['cache']['fields_register'][$field]);
  61. }
  62. $_G['cache']['profilesetting']['gender']['unchangeable'] = 0;
  63. $_G['cache']['profilesetting']['birthyear']['unchangeable'] = 0;
  64. $_G['cache']['profilesetting']['birthmonth']['unchangeable'] = 0;
  65. $_G['cache']['profilesetting']['birthday']['unchangeable'] = 0;
  66. $_G['cache']['fields_register'] = array_merge($_G['cache']['fields_connect_register'], $_G['cache']['fields_register']);
  67. if($_G['setting']['connect']['register_invite']) {
  68. $ctl_obj->setting['regstatus'] = 1;
  69. }
  70. if(!$_G['setting']['connect']['register_regverify']) {
  71. $ctl_obj->setting['seccodestatus'] = $_G['setting']['seccodestatus'];
  72. $ctl_obj->setting['secqaa']['status'] = $_G['setting']['secqaa']['status'];
  73. }
  74. $ctl_obj->setting['ignorepassword'] = 1;
  75. $ctl_obj->setting['checkuinlimit'] = 1;
  76. $ctl_obj->setting['strongpw'] = 0;
  77. $ctl_obj->setting['pwlength'] = 0;
  78. if($_GET['ac'] == 'bind') {
  79. $ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_bind');
  80. } else {
  81. $ctl_obj->setting['reglinkname'] = lang('plugin/qqconnect', 'connect_register_profile');
  82. }
  83. $ctl_obj->extrafile = libfile('member/connect_register', 'module');
  84. $ctl_obj->template = 'member/register';
  85. $ctl_obj->on_register();
  86. }
  87. ?>