index.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. }
  51. }
  52. ?>
  53. <!doctype html>
  54. <html>
  55. <head>
  56. <meta charset=utf-8>
  57. <title>Bugs</title>
  58. <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  59. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
  60. <script src="js/handlebars.js"></script>
  61. <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
  62. <script src="js/jquery.history.js"></script>
  63. <script src="js/jquery.cookie.js"></script>
  64. <script src="js/index.js"></script>
  65. <link href="http://code.jquery.com/ui/1.10.3/themes/black-tie/jquery-ui.css" rel="stylesheet" type="text/css"/>
  66. <link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css"/>
  67. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  68. </head>
  69. <body>
  70. <div id="topbar"></div>
  71. <div id="content"></div>
  72. <div id="loading"></div>
  73. </body>
  74. </html>