old htb folders
This commit is contained in:
2023-08-29 21:53:22 +02:00
parent 62ab804867
commit 82b0759f1e
21891 changed files with 6277643 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
use app\models\User;
$user = new User;
if(is_auth())
{
die(redirect('/home'));
}
if(isset($_POST['username']) && !empty($_POST['username']) && isset($_POST['password']) && !empty($_POST['password']))
{
if(!preg_match('/^[A-Za-z0-9]{1,20}$/',$_POST['username'])){
set_flash('User with invalid characters');
die(redirect('/login'));
}
$find = $user->find("username", $_POST['username']);
if($find->username == $_POST['username'] && $find->password == md5($_POST['password']))
{
set_session($find->username, $find->role);
die(redirect('/home'));
}
set_flash('Invalid credentials');
die(redirect('/login'));
}
require '../app/views/login.php';