<?php defined('BLUDIT') or die('Bludit CMS.');

// ============================================================================
// Check role
// ============================================================================

// ============================================================================
// Functions
// ============================================================================

// ============================================================================
// Main before POST
// ============================================================================

// ============================================================================
// POST Method
// ============================================================================

if( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
	$username = Sanitize::html($_POST['username']);
	$password = Sanitize::html($_POST['password']);

	if( $Login->verifyUser($username, $password) )
	{
		Redirect::page('admin', 'dashboard');
	}
	else
	{
		Alert::set($Language->g('Username or password incorrect'));
	}
}

// ============================================================================
// Main after POST
// ============================================================================