index.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. if(!file_exists('config.default.json')){
  3. header('Location: install');
  4. die();
  5. }elseif(file_exists('install')){
  6. $files = scandir('install');
  7. if(empty($files)){
  8. @rmdir('install');
  9. }
  10. }
  11. require_once('php/include.php');
  12. $salt = salt();
  13. if(isset($_GET['get'])){
  14. $get = $_GET['get'];
  15. unset($_GET['get']);
  16. if(!isset($_GET['type']) || !isset($_GET['id'])){
  17. $type = 'page';
  18. $id = 'index';
  19. }else{
  20. $type = $_GET['type'];
  21. $id = $_GET['id'];
  22. }
  23. switch($get){
  24. case 'state':
  25. $json = Array();
  26. $json['state'] = Array();
  27. $json['state']['data'] = $_GET;
  28. switch($type){
  29. case 'user':$url='~'.$id;break;
  30. case 'group':$url='+'.$id;break;
  31. case 'issue':$url='!'.$id;break;
  32. case 'page':$url='page-'.$id;break;
  33. default:$url=$type.'-'.$id;
  34. }
  35. $json['state']['url'] = $url;
  36. $json['state']['title'] = ucwords($type.' - '.$id);
  37. die(json_encode($json));
  38. break;
  39. case 'api':
  40. require_once('api.php');
  41. break;
  42. case 'settings':
  43. $settings = Array();
  44. $keys = Array('timeout');
  45. foreach($keys as $key){
  46. $settings[$key] = get($key);
  47. }
  48. die(json_encode($settings));
  49. break;
  50. case 'captcha':
  51. generate_captcha();
  52. break;
  53. }
  54. }
  55. ?>
  56. <!doctype html>
  57. <html>
  58. <head>
  59. <meta charset=utf-8>
  60. <meta name="viewport" content="width=device-width, user-scalable=false, initial-scale=1, maximum-scale=1.0, user-scalable=0, user-scalable=no">
  61. <meta name="apple-mobile-web-app-capable" content="yes" />
  62. <title>Bugs</title>
  63. <script src="js/modernizr.js"></script>
  64. <script>
  65. (function(window,Modernizr){
  66. Modernizr.mediaquery = Modernizr.mq('only all');
  67. var checks = [
  68. 'csscalc',
  69. 'cookies',
  70. 'localstorage',
  71. 'history',
  72. 'rgba',
  73. 'applicationcache',
  74. //'mediaquery',
  75. 'fontface'
  76. ],i,
  77. msg = '';
  78. for(i in checks){
  79. if(!Modernizr[checks[i]]){
  80. msg += (', ')+checks[i];
  81. }
  82. }
  83. if(msg != ''){
  84. alert("Your browser is unable to support all the features this site needs.\nChecks failed: "+msg);
  85. }
  86. })(window,Modernizr);
  87. </script>
  88. <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  89. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
  90. <script src="js/handlebars.js"></script>
  91. <script src="js/jquery.history.js"></script>
  92. <script src="js/jquery.storage.js"></script>
  93. <script src="js/jquery.cookie.js"></script>
  94. <script src="js/jquery.nicescroll.js"></script>
  95. <script src="js/shortcut.js"></script>
  96. <script src="js/index.js"></script>
  97. <link href="http://code.jquery.com/ui/1.10.3/themes/black-tie/jquery-ui.css" rel="stylesheet" type="text/css"/>
  98. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  99. </head>
  100. <body>
  101. <div id="topbar"></div>
  102. <div id="content" class="container"></div>
  103. <div id="loading"></div>
  104. </body>
  105. </html>