diff --git a/web/app/controllers/tinyfilemanager/tinyfilemanager.php b/web/app/controllers/tinyfilemanager/tinyfilemanager.php
index f12507f..672f3cd 100644
--- a/web/app/controllers/tinyfilemanager/tinyfilemanager.php
+++ b/web/app/controllers/tinyfilemanager/tinyfilemanager.php
@@ -98,11 +98,6 @@ if (defined('FM_EMBED')) {
restore_error_handler();
}
-//Genrating CSRF Token
-if (empty($_SESSION['token'])) {
- $_SESSION['token'] = bin2hex(random_bytes(32));
-}
-
if (empty($auth_users)) {
$use_auth = false;
}
@@ -124,7 +119,6 @@ defined('FM_SELF_URL') || define('FM_SELF_URL', HTML::url('?'));
// logout
if (isset($_GET['logout'])) {
unset($_SESSION[FM_SESSION_ID]['logged']);
- unset( $_SESSION['token']);
fm_redirect(FM_SELF_URL);
}
@@ -175,11 +169,11 @@ if ($ip_ruleset != 'OFF') {
if ($use_auth) {
if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']])) {
// Logged
- } elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['token'])) {
+ } elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['_token'])) {
// Logging In
sleep(1);
if(function_exists('password_verify')) {
- if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) {
+ if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) && crsf_check()) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg(lng('You are logged in'));
fm_redirect(FM_ROOT_URL);
@@ -230,7 +224,7 @@ if ($use_auth) {
-
+ = HTML::hiddenToken() ?>