summaryrefslogtreecommitdiff
path: root/moe/api.php
diff options
context:
space:
mode:
Diffstat (limited to 'moe/api.php')
-rw-r--r--moe/api.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/moe/api.php b/moe/api.php
new file mode 100644
index 0000000..f9313f5
--- /dev/null
+++ b/moe/api.php
@@ -0,0 +1,28 @@
+<?php
+// This file will act as a APIish thing
+
+// Include core file
+require_once('core.php');
+
+// Decode incoming json
+$in = json_decode($_POST['in']);
+
+// Perform wanted function
+if($in['action']['0']=='register'){
+
+ // Check if reg is open
+ if(reg=='1'){
+
+ // Perform register function with data from json string
+ register($in['info']['0'], $in['info']['1'], $in['info']['2']);
+
+ }else{
+ // Re-direct to closed-reg info page?
+ $return = array('action' => 'closedreg');
+ json_encode($return);
+ }
+
+}elseif ($in['action']['0']=='login') {
+ login($in['info']['0'], $in['info']['1']);
+}
+?> \ No newline at end of file