-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.php
59 lines (47 loc) · 1.39 KB
/
api.php
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/*
* Server functions to proxy out the database
*/
$debug = false;
if($debug) {
error_reporting(E_ALL);
ini_set("display_errors", 1);
error_log("Login is running in debug mode!");
}
if (!(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) {
$data = array('status' => false,'error' => 'This application only accepts SSL connections');
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
print @json_encode($data, JSON_FORCE_OBJECT);
exit();
}
parse_str($_SERVER['QUERY_STRING'], $_GET);
/***
* The login handler will take care of the basic login checks.
***/
$print_login_state = false;
# Enable the next line for Braintree billing
# require_once("./braintree_billing.php");
require_once 'async_login_handler.php';
// $email = $_GET["email"];
// $u = new UserFunctions();
// returnAjax($u->examineEmailDeep($email));
// returnAjax(UserFunctions::examineEmail($email));
require_once 'app_handlers.php';
/*******************
* The functions that actually do stuff
* Called by the "action" key through verifyApp
*******************/
function syncUserData($data_array)
{
return $data_array['user_data'];
}
function authenticateWebRequest()
{
/*
* Check the authentication credentials using the stored server secrets for
* hashes.
*/
return false;
}