Skip to content

Commit

Permalink
Update ajax post data w/ csrf_token
Browse files Browse the repository at this point in the history
  • Loading branch information
billz committed Sep 14, 2023
1 parent 8ff2a89 commit 66b3b20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function createNetmaskAddr(bitCount) {
}

function loadSummary(strInterface) {
$.post('ajax/networking/get_ip_summary.php',{interface:strInterface},function(data){
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/networking/get_ip_summary.php',{'interface': strInterface, 'csrf_token': csrfToken},function(data){
jsonData = JSON.parse(data);
if(jsonData['return'] == 0) {
$('#'+strInterface+'-summary').html(jsonData['output'].join('<br />'));
Expand Down Expand Up @@ -419,11 +420,12 @@ function loadChannelSelect(selected) {
function setHardwareModeTooltip() {
var iface = $('#cbxinterface').val();
var hwmodeText = '';
var csrfToken = $('meta[name=csrf_token]').attr('content');
// Explanatory text if 802.11ac is disabled
if ($('#cbxhwmode').find('option[value="ac"]').prop('disabled') == true ) {
var hwmodeText = $('#hwmode').attr('data-tooltip');
}
$.post('ajax/networking/get_frequencies.php?',{'interface': iface},function(data){
$.post('ajax/networking/get_frequencies.php?',{'interface': iface, 'csrf_token': csrfToken},function(data){
var responseText = JSON.parse(data);
$('#tiphwmode').attr('data-original-title', responseText + '\n' + hwmodeText );
});
Expand Down

0 comments on commit 66b3b20

Please sign in to comment.