30 lines
566 B
PHP
30 lines
566 B
PHP
<?php
|
|
|
|
use Sealandia\Core\Template;
|
|
use Sealandia\Core\Auth;
|
|
|
|
class Login{
|
|
|
|
/**
|
|
* Authenticate the given credentials
|
|
*/
|
|
|
|
public function authenticate($username, $password){
|
|
$auth = new Auth();
|
|
$auth->login($username, $password);
|
|
}
|
|
|
|
/**
|
|
* Show the application login page.
|
|
*/
|
|
|
|
public function index(){
|
|
if(isset($_POST['submit'])){
|
|
$this->authenticate($_POST['email'], $_POST['password']);
|
|
}
|
|
|
|
$template = new Template();
|
|
return $template->render('login', []);
|
|
}
|
|
|
|
} |