You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
426 B
PHTML
24 lines
426 B
PHTML
8 years ago
|
<?php
|
||
|
|
||
|
require 'required.php';
|
||
|
|
||
|
//$_POST = $_GET;
|
||
|
|
||
|
$user = $_POST['user'];
|
||
|
$pass = $_POST['pass'];
|
||
|
|
||
|
if (is_empty($user)) {
|
||
|
sendError("Missing username or email.");
|
||
|
}
|
||
|
|
||
|
if (is_empty($pass)) {
|
||
|
sendError("Missing password.");
|
||
|
}
|
||
|
|
||
|
if (authenticate_user($user, $pass)) {
|
||
|
$_SESSION['user'] = $user;
|
||
|
$_SESSION['loggedin'] = true;
|
||
|
sendOK("Login successful.");
|
||
|
} else {
|
||
|
sendError("Login incorrect, try again.");
|
||
|
}
|