luci-mod-admin-full: restructure and fix backup, restore and sysuprade (#517)
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 22 Oct 2015 06:35:34 +0000 (08:35 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 22 Oct 2015 06:48:06 +0000 (08:48 +0200)
commit94ab57f48c9a8704a0a7da87bfa6ced9e73ca9be
treea4e362c10f884766fe0ba3b0aa3399d2ad191921
parentd32c68503994d46aa71473a647118b431119ae2a
luci-mod-admin-full: restructure and fix backup, restore and sysuprade (#517)

Do not use standard post security checking for actions that require file upload
since reading the token value will trigger parsing of the http message body
before the file upload handler has been set, which causes LuCI to buffer the
entire request body in memory.

In order to simplify the code and logic flow, split action_flashops() into
separate handlers for reset, backup, restore and sysupgrade.

Let the backup restore and sysupgrade handlers use the new test_post_security()
method in luci.dispatcher to perform token checking *after* setting the upload
handler.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
modules/luci-mod-admin-full/luasrc/view/admin_system/flashops.htm
modules/luci-mod-admin-full/luasrc/view/admin_system/upgrade.htm