Merge pull request #2664 from rosysong/file-server
authorHannu Nyman <hannu.nyman@iki.fi>
Sun, 7 Apr 2019 13:32:58 +0000 (16:32 +0300)
committerGitHub <noreply@github.com>
Sun, 7 Apr 2019 13:32:58 +0000 (16:32 +0300)
rosy-file-server: remove unused lines and typo fix

applications/luci-app-rosy-file-server/luasrc/controller/rosy-file-server/rosy-file-server.lua

index 6c7c4920895caa50a80cc7e55a4af5a0a02d61de..dd5598a689699758dc3d7165bbfe760ae66370d2 100644 (file)
@@ -21,7 +21,7 @@ function index()
        page.index    = false
 
        page          = node("httpfs")
-       page.title    = _("File-server")
+       page.title    = _("Rosy File Server")
        page.target   = alias("httpfs", "rosy-file-server")
        page.order    = 5
        page.setuser  = "root"
@@ -30,23 +30,8 @@ function index()
 
        entry({"httpfs", "rosy-file-server"},
                form("rosy-file-server/rosy-file-server"), _("Rosy File Server"), 10)
-       entry({"httpfs", "file-server-download"},
-               post("action_download"), nil)
 
        entry({"admin", "services", "rosyfs"},
                cbi("rosy-file-server/rosyfs"), _("Rosy File Server"), 61)
 end
 
-function action_download()
-       local p = luci.http.formvalue("path") or ""
-       local n = luci.http.formvalue("name") or ""
-
-       if not p or not n then
-               luci.http.status(400, "Bad Request")
-               return
-       end
-
-       luci.http.header('Content-Disposition', 'attachment; filename="%s"' % n)
-       luci.http.prepare_content("application/octet-stream")
-       luci.sys.process.exec({ "/bin/dd", "if=%s%s" % { p, n }, "conv=fsync,notrunc" }, luci.http.write)
-end