config.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. /**
  3. * PHP SDK for QQ登录 OpenAPI
  4. *
  5. * @version 1.2
  6. * @author connect@qq.com
  7. * @copyright © 2011, Tencent Corporation. All rights reserved.
  8. */
  9. /**
  10. * @brief 本文件作为demo的配置文件。
  11. */
  12. /**
  13. * 正式运营环境请关闭错误信息
  14. * ini_set("error_reporting", E_ALL);
  15. * ini_set("display_errors", TRUE);
  16. * QQDEBUG = true 开启错误提示
  17. * QQDEBUG = false 禁止错误提示
  18. * 默认禁止错误信息
  19. */
  20. define("QQDEBUG", false);
  21. if (defined("QQDEBUG") && QQDEBUG)
  22. {
  23. @ini_set("error_reporting", E_ALL);
  24. @ini_set("display_errors", TRUE);
  25. }
  26. /**
  27. * session
  28. */
  29. //require_once(PLUGINS_PATH.DIRECTORY_SEPARATOR.'login'.DIRECTORY_SEPARATOR.'qq'.DIRECTORY_SEPARATOR.'comm'.DIRECTORY_SEPARATOR."session.php");
  30. //包含配置信息
  31. $data = rkcache("config", true);
  32. //qq互联是否开启
  33. if($data['qq_isuse'] != 1){
  34. @header('location: index.php');
  35. exit;
  36. }
  37. //申请到的appid
  38. $qq_appid = trim($data['qq_appid']);
  39. //申请到的appkey
  40. $qq_appkey = trim($data['qq_appkey']);
  41. //QQ登录成功后回调的地址
  42. $callback = HTTP_TYPE.$_SERVER['HTTP_HOST']."/home/Api/oa_qq_callback.html";
  43. //调用的api接口(访问用户资料get_user_info)
  44. $scope = "get_user_info";
  45. //用session保存调用
  46. session('appid', $qq_appid);
  47. session('appkey', $qq_appkey);
  48. session('callback', $callback);
  49. session('scope', $scope);
  50. ?>