Example #1
0
<?php

/* Page setup
	------------------------------*/
$PHPZevelop->OverrideObjectData("CFG", array("PageTitle" => "Login", "Template" => "style2/fullwidth"));
if (count($_POST) > 0) {
    $MSG = Administrator::AttemptLogin($Administrator, $_POST["username"], $_POST["password"]);
    if ($MSG === true) {
        AppendLog("Successful login");
    } else {
        AppendLog("Failed login with username '" . $_POST["username"] . "'");
    }
}
if (isset($_GET["param_0"])) {
    $Split = explode("-", $_GET["param_0"]);
    if ($Split[0] == "activated") {
        $ActivatedUser = Administrator::GetSingle(array("id", "=", $Split[1]));
        $_POST["username"] = $ActivatedUser->Data["username"];
    }
}
if ($Administrator->LoggedIn()) {
    $PHPZevelop->Location("home");
}
?>

<style type="text/css">
	#loginForm {width: 50%; margin: auto; background: #EEEEEE; border: 1px solid #009ACD; box-sizing: border-box; padding-bottom: 15px;}
	#loginForm h2 {margin: 0px; padding: 15px;}
	#loginForm h3 {margin: 0px; padding: 9px 13px;}
	#loginForm table.FormGen {width: 95%; margin: auto;}