summaryrefslogtreecommitdiff
path: root/moe/includes/api.php
blob: b85cbbf27dc4e8e8fff79fe4019d52b6f477d076 (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
<?php
// This file will act as a APIish thing
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?';
    }
}