39 lines
828 B
PHP
Executable File
39 lines
828 B
PHP
Executable File
<?php
|
|
namespace App\Filters;
|
|
|
|
use CodeIgniter\Filters\FilterInterface;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
|
|
use App\Libraries\AuthLogout;
|
|
|
|
class AuthMVC implements FilterInterface
|
|
{
|
|
public function before(RequestInterface $request, $arguments = null)
|
|
{
|
|
if (!check_session())
|
|
{
|
|
return AuthLogout::logout();
|
|
}
|
|
|
|
// if (!check_cookie())
|
|
// {
|
|
// return AuthLogout::logout();
|
|
// }
|
|
|
|
// Fingerprint validation
|
|
$fp = generateFingerprint();
|
|
|
|
if (session()->get('fingerprint') !== $fp) {
|
|
return AuthLogout::logout();
|
|
}
|
|
|
|
}
|
|
|
|
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
|
|
{
|
|
// Do something here
|
|
}
|
|
}
|
|
|