forked from berwinter/uvr1611
-
Notifications
You must be signed in to change notification settings - Fork 2
/
login.php
26 lines (24 loc) · 633 Bytes
/
login.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
<?php
/**
* Basic functions for user
*
* @copyright Copyright (c) Bertram Winter [email protected]
* @license GPLv3 License
*/
include_once("lib/login/session.inc.php");
include_once("lib/error.inc.php");
try {
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json; charset=utf-8');
if(isset($_POST["user"], $_POST["password"]) && login($_POST["user"], $_POST["password"])) {
echo "{\"status\": \"successful\"}";
}
else
{
echo "{\"status\": \"password incorrect\"}";
}
}
catch(Exception $e) {
sendAjaxError($e);
}