summaryrefslogtreecommitdiff
path: root/moe/includes/api.php
blob: cc4dcb6a324dea149bb801992db2933a7234ae00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
// This file will act as a APIish thing
// Include core file
require_once('core.php');

if(isset($_GET['do'])){

	$butt = $_GET['do'];

	switch($butt){

		case "login":
			login($_POST['email'], $_POST['pass']);
		break;

		case "register":
			register($_POST['email'], $_POST['pass'], $_POST['code']);
		break;

		case "invite-generate":
			generate($_GET['email'], $_GET['level']);
		break;

		case "mod":
			mod($_GET['action'], $_GET['date'], $_GET['count'], $_GET['why'], $_GET['file'], $_GET['keyword'], $_GET['fileid'], $_GET['hash'], $_GET['orginalname']);
		break;

		case "cp":
			header('Location: ../panel');
		break;

		case "search":
			search($_GET['q']);
		break;
		
		case "delete":
			delete($_GET['f'],$_GET['delid']);
		break;

		case "logout":
			session_unset();
			session_destroy();
			session_write_close();
			header('Location: ../login');
		break;

	default: echo "We could call this a 404 not found... Or what are you doing here?";
	}
}
?>