Exemplo n.º 1
0
session_start();
require_once __DIR__ . '/core/Membership.php';
// If the user clicks the "Logout" link on the index page.
if (isset($_GET['action']) && $_GET['action'] == 'logout') {
    Membership::logout();
    header('Location: index.php');
}
if (isset($_GET['expired'])) {
    $message = 'Your session has expired, please log in again.';
}
if (isset($_POST['email'], $_POST['pwd'])) {
    require_once __DIR__ . '/core/index.php';
    require_once __DIR__ . '/core/functions.php';
    require_once __DIR__ . '/tools.php';
    $entityManager = initDoctrine();
    $validated = Membership::validate($entityManager, $_POST['email'], $_POST['pwd']);
    if ($validated) {
        header('Location: index.php');
    } else {
        $message = 'invalid login and/or password';
    }
}
?>
<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Run This App | Login</title>
	<link href="css/style-0001.css" media="screen" type="text/css" rel="stylesheet">
</head>
<body>