luci-app-ocserv: protect disconnect action with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
Jo-Philipp Wich 2015-10-21 00:00:55 +02:00
parent b9ed03c5a9
commit 0f1f5140e3
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ function index()
call("ocserv_status")).leaf = true
entry({"admin", "services", "ocserv", "disconnect"},
call("ocserv_disconnect")).leaf = true
post("ocserv_disconnect")).leaf = true
end

View file

@ -1,7 +1,7 @@
<script type="text/javascript">//<![CDATA[
function ocserv_disconnect(idx) {
XHR.get('<%=url('admin/services/ocserv/disconnect')%>/' + idx, null,
(new XHR()).post('<%=url('admin/services/ocserv/disconnect')%>/' + idx, { token: '<%=token%>' },
function(x)
{
var tb = document.getElementById('ocserv_status_table');