mirror of
https://github.com/openwrt/luci.git
synced 2026-08-29 08:31:46 +04:00
luci-app-ocserv: protect disconnect action with csrf token
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user