summaryrefslogtreecommitdiff
path: root/moe/includes/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'moe/includes/api.php')
-rw-r--r--moe/includes/api.php84
1 files changed, 36 insertions, 48 deletions
diff --git a/moe/includes/api.php b/moe/includes/api.php
index 123c9a8..b85cbbf 100644
--- a/moe/includes/api.php
+++ b/moe/includes/api.php
@@ -1,51 +1,39 @@
<?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['originalname']);
- 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?";
- }
+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['originalname']);
+ 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?';
+ }
}
-?>