Add security checks to generator.php