userapp.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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: userapp.php 33017 2013-04-08 07:28:47Z zhengqingpeng $
  7. */
  8. define('APPTYPEID', 5);
  9. define('CURSCRIPT', 'userapp');
  10. require_once './source/class/class_core.php';
  11. require_once './source/function/function_home.php';
  12. $discuz = C::app();
  13. $modarray = array('app', 'manage');
  14. $cachelist = array('userapp','usergroups', 'myapp');
  15. $mod = !in_array($discuz->var['mod'], $modarray) ? 'manage' : $discuz->var['mod'];
  16. $appid = empty($_GET['id']) ? '': intval($_GET['id']);
  17. if($appid) {
  18. $mod = 'app';
  19. }
  20. $discuz->cachelist = $cachelist;
  21. $discuz->init();
  22. if(empty($_G['uid']) && $mod == 'app') {
  23. if($_SERVER['REQUEST_METHOD'] == 'GET') {
  24. dsetcookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));
  25. } else {
  26. dsetcookie('_refer', rawurlencode('userapp.php?mod=app&id='.$appid));
  27. }
  28. showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
  29. }
  30. if(empty($_G['setting']['my_app_status'])) {
  31. showmessage('no_privilege_my_app_status', '', array(), array('return' => true));
  32. }
  33. if($mod == 'app' && !checkperm('allowmyop')) {
  34. showmessage('no_privilege_myop', '', array(), array('return' => true));
  35. }
  36. $space = $_G['uid']? getuserbyuid($_G['uid']) : array();
  37. define('CURMODULE', 'userapp');
  38. runhooks();
  39. getuserapp();
  40. $navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['userapp']);
  41. if(!$navtitle) {
  42. $navtitle = $_G['setting']['navs'][5]['navname'];
  43. } else {
  44. $nobbname = true;
  45. }
  46. require_once libfile('userapp/'.$mod, 'module');
  47. ?>