luci-app-ddns: protect start/stop actions with csrf token
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
parent
d4666757b7
commit
b9ed03c5a9
2 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ function index()
|
||||||
{hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}), nil ).leaf = true
|
{hideapplybtn=true, hidesavebtn=true, hideresetbtn=true}), nil ).leaf = true
|
||||||
entry( {"admin", "services", "ddns", "global"}, cbi("ddns/global"), nil ).leaf = true
|
entry( {"admin", "services", "ddns", "global"}, cbi("ddns/global"), nil ).leaf = true
|
||||||
entry( {"admin", "services", "ddns", "logview"}, call("logread") ).leaf = true
|
entry( {"admin", "services", "ddns", "logview"}, call("logread") ).leaf = true
|
||||||
entry( {"admin", "services", "ddns", "startstop"}, call("startstop") ).leaf = true
|
entry( {"admin", "services", "ddns", "startstop"}, post("startstop") ).leaf = true
|
||||||
entry( {"admin", "services", "ddns", "status"}, call("status") ).leaf = true
|
entry( {"admin", "services", "ddns", "status"}, call("status") ).leaf = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
|
|
||||||
// do start/stop
|
// do start/stop
|
||||||
var btnXHR = new XHR();
|
var btnXHR = new XHR();
|
||||||
btnXHR.get('<%=url('admin/services/ddns/startstop')%>/' + section + '/' + cbx.checked, null,
|
btnXHR.post('<%=url('admin/services/ddns/startstop')%>/' + section + '/' + cbx.checked, { token: '<%=token%>' },
|
||||||
function(x, data) {
|
function(x, data) {
|
||||||
if (x.responseText == "_uncommitted_") {
|
if (x.responseText == "_uncommitted_") {
|
||||||
// we need a trick to display Ampersand "&" in stead of "&" or "&"
|
// we need a trick to display Ampersand "&" in stead of "&" or "&"
|
||||||
|
|
Loading…
Reference in a new issue