Skip to content

Commit

Permalink
Fixes ajax ability to handle requests when auth disabled (#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
efremovd committed Jan 25, 2023
1 parent 9c4d30d commit dd1ba67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tinyfilemanager.php
Expand Up @@ -423,7 +423,7 @@ function getClientIP() {
/*************************** ACTIONS ***************************/

// Handle all AJAX Request
if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']]) && isset($_POST['ajax'], $_POST['token']) && !FM_READONLY) {
if ((isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']]) || !FM_USE_AUTH) && isset($_POST['ajax'], $_POST['token']) && !FM_READONLY) {
if(!verifyToken($_POST['token'])) {
header('HTTP/1.0 401 Unauthorized');
die("Invalid Token.");
Expand Down

0 comments on commit dd1ba67

Please sign in to comment.