luci-base: switch to POST action for service reload

Switches the service reload calls to CSRF token protected POST action.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2015-10-06 22:37:23 +02:00
parent e440144d56
commit ada4a0ea98
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ module("luci.controller.admin.servicectl", package.seeall)
function index()
entry({"servicectl"}, alias("servicectl", "status")).sysauth = "root"
entry({"servicectl", "status"}, call("action_status")).leaf = true
entry({"servicectl", "restart"}, call("action_restart")).leaf = true
entry({"servicectl", "restart"}, post("action_restart")).leaf = true
end
function action_status()

View file

@ -4,7 +4,7 @@
<script type="text/javascript">//<![CDATA[
var apply_xhr = new XHR();
apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', null,
apply_xhr.post('<%=luci.dispatcher.build_url("servicectl", "restart", table.concat(configs, ","))%>', { token: '<%=token%>' },
function() {
var checkfinish = function() {
apply_xhr.get('<%=luci.dispatcher.build_url("servicectl", "status")%>', null,