1
0

stats.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /* $Id: stats.php 2886 2007-04-13 15:08:07Z b4rt $ */
  3. /*******************************************************************************
  4. LICENSE
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License (GPL)
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. To read the license please visit http://www.gnu.org/copyleft/gpl.html
  14. *******************************************************************************/
  15. // cache
  16. require_once('inc/main.cache.php');
  17. // core-classes
  18. require_once("inc/classes/CoreClasses.php");
  19. // core functions
  20. require_once('inc/functions/functions.core.php');
  21. // Stats-class
  22. require_once('inc/classes/Stats.php');
  23. // start session
  24. @session_start();
  25. // unregister globals
  26. if (@ini_get('register_globals')) {
  27. require_once('inc/functions/functions.compat.php');
  28. unregister_GLOBALS();
  29. }
  30. // config
  31. if ((isset($_SESSION['user'])) && (cacheIsSet($_SESSION['user']))) {
  32. // db-config
  33. require_once('inc/config/config.db.php');
  34. // initialize database
  35. dbInitialize();
  36. // init cache
  37. cacheInit($_SESSION['user']);
  38. // init transfers-cache
  39. cacheTransfersInit();
  40. } else {
  41. // main.core
  42. require_once('inc/main.core.php');
  43. // set transfers-cache
  44. cacheTransfersSet();
  45. }
  46. // public-stats-switch
  47. switch ($cfg['stats_enable_public']) {
  48. case 1:
  49. // load default-language and transfers if cache not set
  50. if ((!isset($_SESSION['user'])) || (!(cacheIsSet($_SESSION['user'])))) {
  51. // common functions
  52. require_once('inc/functions/functions.common.php');
  53. // lang file
  54. loadLanguageFile($cfg["default_language"]);
  55. }
  56. // Fluxd
  57. Fluxd::initialize();
  58. // Qmgr
  59. FluxdServiceMod::initializeServiceMod('Qmgr');
  60. // public stats... show all .. we set the user to superadmin
  61. $superAdm = GetSuperAdmin();
  62. if ((isset($superAdm)) && ($superAdm != "")) {
  63. $cfg["user"] = $superAdm;
  64. $cfg['isAdmin'] = true;
  65. } else {
  66. @ob_end_clean();
  67. exit();
  68. }
  69. break;
  70. case 0:
  71. default:
  72. // main.internal
  73. require_once("inc/main.internal.php");
  74. }
  75. // process request
  76. Stats::processRequest($_REQUEST);
  77. ?>