secure.php 960 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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: secure.php 34236 2013-11-21 01:13:12Z nemohou $
  7. */
  8. if(!defined('IN_MOBILE_API')) {
  9. exit('Access Denied');
  10. }
  11. include_once 'misc.php';
  12. class mobile_api {
  13. function common() {
  14. global $_G;
  15. if(!empty($_GET['force'])) {
  16. $_G['setting']['seccodedata']['rule'][$_GET['type']]['allow'] = 1;
  17. }
  18. list($seccodecheck, $secqaacheck) = seccheck($_GET['type']);
  19. $sechash = random(8);
  20. if($seccodecheck || $secqaacheck) {
  21. $variable = array('sechash' => $sechash);
  22. if($seccodecheck) {
  23. $variable['seccode'] = $_G['siteurl'].'api/mobile/index.php?module=seccode&sechash='.$sechash.'&version='.(empty($_GET['secversion']) ? '1' : $_GET['secversion']);
  24. }
  25. if($secqaacheck) {
  26. $variable['secqaa'] = make_secqaa();
  27. }
  28. }
  29. mobile_core::result(mobile_core::variable($variable));
  30. }
  31. function output() {}
  32. }
  33. ?>