Tinyfilemanager | 2.4.3

?> </div>

// Simple auth check function auth($users, $read_only_users = array()) if (!isset($_SESSION['loggedin'])) if (isset($_SERVER['PHP_AUTH_USER']) && isset($users[$_SERVER['PHP_AUTH_USER']])) $pass = $_SERVER['PHP_AUTH_PW']; $hash = $users[$_SERVER['PHP_AUTH_USER']]; if (password_verify($pass, $hash)) $_SESSION['loggedin'] = $_SERVER['PHP_AUTH_USER']; $_SESSION['readonly'] = in_array($_SERVER['PHP_AUTH_USER'], $read_only_users); return true;

header('WWW-Authenticate: Basic realm="TinyFileManager"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authentication required'; exit; tinyfilemanager 2.4.3

// ============================================= // CONFIGURATION // ============================================= $auth_users = array( 'admin' => '$2y$10$YourHashHere', // password: admin (generate with password_hash()) 'user' => '$2y$10$AnotherHash' );

<?php // TinyFileManager 2.4.3 // https://github.com/prasathmani/tinyfilemanager // Released under MIT License session_name('filemanager'); session_start(); // Upload file size limit (in bytes) $upload_max_size

if (!$readonly) if ($action === 'mkdir' && isset($_POST['name'])) $newdir = $full_path . '/' . basename($_POST['name']); if (!file_exists($newdir)) mkdir($newdir, 0755);

You can save this as tinyfilemanager.php and place it in your web root. // Simple auth check function auth($users

// Upload file size limit (in bytes) $upload_max_size = 50 * 1024 * 1024; // 50MB

// Actions $action = isset($_POST['action']) ? $_POST['action'] : (isset($_GET['action']) ? $_GET['action'] : '');