mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-29 14:28:13 +02:00
enable/disable CSRF
This commit is contained in:
parent
7fb08eb76f
commit
8908f4bdc3
1 changed files with 13 additions and 9 deletions
|
@ -22,6 +22,8 @@ class Csrf
|
|||
|
||||
public static function check($token)
|
||||
{
|
||||
global $config;
|
||||
if($config['csrf_enabled'] == 'yes') {
|
||||
if (isset($_SESSION['csrf_token'], $_SESSION['csrf_token_time'], $token)) {
|
||||
$storedToken = $_SESSION['csrf_token'];
|
||||
$tokenTime = $_SESSION['csrf_token_time'];
|
||||
|
@ -35,6 +37,8 @@ class Csrf
|
|||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function generateAndStoreToken()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue