2011-03-28 14:21:28 +00:00
|
|
|
<?
|
|
|
|
/*
|
|
|
|
AJAX Switch Center
|
|
|
|
|
|
|
|
This page acts as an AJAX "switch" - it's called by scripts, and it includes the required pages.
|
|
|
|
|
|
|
|
The required page is determined by $_GET['action'].
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
enforce_login();
|
|
|
|
|
2011-10-27 08:00:15 +00:00
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
|
2011-03-28 14:21:28 +00:00
|
|
|
switch ($_GET['action']){
|
2011-08-25 08:00:11 +00:00
|
|
|
// things that (may be) used on the site
|
2011-03-28 14:21:28 +00:00
|
|
|
case 'upload_section':
|
|
|
|
// Gets one of the upload forms
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/upload.php');
|
|
|
|
break;
|
|
|
|
case 'preview':
|
|
|
|
require('preview.php');
|
|
|
|
break;
|
|
|
|
case 'torrent_info':
|
|
|
|
require('torrent_info.php');
|
|
|
|
break;
|
|
|
|
case 'giveback_report':
|
|
|
|
require('giveback_report.php');
|
|
|
|
break;
|
|
|
|
case 'grab_report':
|
|
|
|
require('grab_report.php');
|
|
|
|
break;
|
|
|
|
case 'stats':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/stats.php');
|
|
|
|
break;
|
|
|
|
|
2011-08-25 08:00:11 +00:00
|
|
|
// things not yet used on the site
|
|
|
|
case 'torrentgroup':
|
|
|
|
require('torrentgroup.php');
|
|
|
|
break;
|
2011-10-31 08:00:12 +00:00
|
|
|
case 'user':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/user.php');
|
|
|
|
break;
|
|
|
|
case 'forum':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/forum/index.php');
|
|
|
|
break;
|
2011-09-16 08:00:13 +00:00
|
|
|
case 'top10':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/top10/index.php');
|
|
|
|
break;
|
2012-01-30 08:00:24 +00:00
|
|
|
case 'browse':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/browse.php');
|
2012-02-04 08:00:25 +00:00
|
|
|
break;
|
2012-01-28 08:00:29 +00:00
|
|
|
case 'usersearch':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/usersearch.php');
|
|
|
|
break;
|
2012-01-27 08:00:19 +00:00
|
|
|
case 'requests':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/requests.php');
|
2012-02-04 08:00:25 +00:00
|
|
|
break;
|
2011-10-27 08:00:15 +00:00
|
|
|
case 'artist':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/artist.php');
|
|
|
|
break;
|
|
|
|
case 'inbox':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/inbox/index.php');
|
|
|
|
break;
|
|
|
|
case 'subscriptions':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/subscriptions.php');
|
|
|
|
break;
|
|
|
|
case 'index':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/info.php');
|
|
|
|
break;
|
2011-10-31 08:00:12 +00:00
|
|
|
case 'bookmarks':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/bookmarks.php');
|
|
|
|
break;
|
2011-11-26 08:00:20 +00:00
|
|
|
case 'notifications':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/notifications.php');
|
|
|
|
break;
|
2012-01-30 08:00:24 +00:00
|
|
|
case 'request':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/request.php');
|
|
|
|
break;
|
2012-03-01 08:00:25 +00:00
|
|
|
case 'loadavg':
|
|
|
|
require(SERVER_ROOT.'/sections/ajax/loadavg.php');
|
|
|
|
break;
|
2011-03-28 14:21:28 +00:00
|
|
|
default:
|
|
|
|
// If they're screwing around with the query string
|
2011-11-26 08:00:20 +00:00
|
|
|
print json_encode(array('status' => 'failure'));
|
2011-03-28 14:21:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|