|
@@ -1,22 +1,13 @@
|
1
|
1
|
<?php
|
2
|
|
-function status_confirm($id)
|
3
|
|
-{
|
4
|
|
-}
|
5
|
|
-
|
6
|
|
-function status_create()
|
7
|
|
-{
|
8
|
|
-}
|
9
|
|
-
|
10
|
|
-function status_feed()
|
11
|
|
-{
|
12
|
|
-}
|
13
|
|
-
|
14
|
|
-function user_create()
|
15
|
|
-{
|
16
|
|
-}
|
|
2
|
+require_once "utils.php";
|
|
3
|
+require_once "status.php";
|
|
4
|
+require_once "user.php";
|
17
|
5
|
|
18
|
|
-function user_login()
|
|
6
|
+function check_api_key()
|
19
|
7
|
{
|
|
8
|
+ $headers = apache_request_headers();
|
|
9
|
+ if (!isset($header["Authorization"]))
|
|
10
|
+ error(401, "Bad API Key");
|
20
|
11
|
}
|
21
|
12
|
|
22
|
13
|
function main()
|
|
@@ -28,7 +19,6 @@ function main()
|
28
|
19
|
$path = rtrim($_GET['_url'], "/");
|
29
|
20
|
if ($path === "")
|
30
|
21
|
$path = "/";
|
31
|
|
- echo hash_pbkdf2(
|
32
|
22
|
if (preg_match($path, "^/status/([0-9]+)/confirm$", $matches) && $m_post)
|
33
|
23
|
status_confirm($matches[1]);
|
34
|
24
|
else if ($path === "/status" && $m_post)
|
|
@@ -43,5 +33,6 @@ function main()
|
43
|
33
|
error(501, "Not Implemented");
|
44
|
34
|
}
|
45
|
35
|
|
|
36
|
+check_api_key();
|
46
|
37
|
main();
|
47
|
38
|
?>
|