Example #1
0
<?php

include '../includes/config.php';
include '../includes/classes.php';
$session = new Session();
$database = new Database();
if ($_SESSION['authorized'] == true && $_GET['action'] == "logout") {
    session_destroy();
    header("Location: http://gotospeakup.com/admin");
}
if ($_SESSION['authorized'] == true && $_GET['action'] == "purge") {
    $database->purgeOldApps();
    header("Location: http://gotospeakup.com/admin");
}
if ($_POST['username'] && $_POST['password']) {
    $user = new User();
    if ($user->authorize()) {
        $_SESSION['authorized'] = 1;
    }
    unset($_POST['username']);
    unset($_POST['password']);
    if ($_SESSION['authorized'] == true) {
        Header("Location: index.php");
    }
}
// echo "<p>POST Data:<br />\n"; print_r($_POST);
// echo "\n</p>\n<p>SESSION Data: </br >\n"; print_r($_SESSION); echo "</p>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>