$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp'; // add translations $_SERVER['REQUEST_URI'] = 'settings'; require_once "$docroot/webGui/include/Translations.php"; require_once "$docroot/webGui/include/Helpers.php"; $file = unscript($_GET['file']??''); $path = realpath('/etc/wireguard'.unscript($_GET['path']??'')); $csrf = exec("grep -Pom1 '^csrf_token=\"\K.[^\"]+' /var/local/emhttp/var.ini"); if (!$path || strpos($path,'/boot/config/wireguard')!==0 || empty($_GET['csrf_token']) || $_GET['csrf_token']!=$csrf) return; ?> "> ">