diff --git a/frontend/api.local.php b/frontend/api.local.php new file mode 100644 index 0000000..8f7f5a0 --- /dev/null +++ b/frontend/api.local.php @@ -0,0 +1,75 @@ +VerifyPassword($_GET['password']) === true) + { + $return_object = true; + $return_success = true; + } + else + { + $return_object = false; + $return_success = true; + } + } + break; + + case "list_vps": + if(!empty($_GET['userid'])) + { + $sUserId = (is_numeric($_GET['userid'])) ? $_GET['userid'] : 0; + $query = "SELECT * FROM containers WHERE `UserId` = '{$sUserId}'"; + } + else + { + $query = "SELECT * FROM containers"; + } + + if($result = mysql_query_cached($query)) + { + // TODO: output results + } + break; + + case "vps_info": + // TODO: return VPS info + break; + } +} +else +{ + $return_object = "Authentication failure."; +} + +echo(json_encode(array( + 'status' => $return_success, + 'data' => $return_object +))); + +?> diff --git a/frontend/includes/.gitignore b/frontend/includes/.gitignore new file mode 100644 index 0000000..c6dc218 --- /dev/null +++ b/frontend/includes/.gitignore @@ -0,0 +1 @@ +include.config.api.php diff --git a/frontend/includes/include.config.api.sample.php b/frontend/includes/include.config.api.sample.php new file mode 100644 index 0000000..7379be7 --- /dev/null +++ b/frontend/includes/include.config.api.sample.php @@ -0,0 +1,14 @@ +