Просмотр исходного кода

Require token for ajax (thanks to @cdnmall).

Raphael Schneeberger 7 лет назад
Родитель
Сommit
e20d7416c5
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      web/js/events.js
  2. 1 1
      web/list/notifications/index.php

+ 1 - 1
web/js/events.js

@@ -387,7 +387,7 @@ VE.navigation.switch_menu = function(position){
 VE.notifications.get_list = function(){
 VE.notifications.get_list = function(){
 /// TODO get notifications only once
 /// TODO get notifications only once
     $.ajax({
     $.ajax({
-        url: "/list/notifications/?ajax=1",
+        url: "/list/notifications/?ajax=1&token="+$('#token').attr('token'),
         dataType: "json"
         dataType: "json"
     }).done(function(data) {
     }).done(function(data) {
         var acc = [];
         var acc = [];

+ 1 - 1
web/list/notifications/index.php

@@ -5,7 +5,7 @@ error_reporting(NULL);
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
 
 
 
-if($_REQUEST['ajax'] == 1){
+if($_REQUEST['ajax'] == 1 && $_REQUEST['token'] == $_SESSION['token']){
     // Data
     // Data
     exec (HESTIA_CMD."v-list-user-notifications $user json", $output, $return_var);
     exec (HESTIA_CMD."v-list-user-notifications $user json", $output, $return_var);
     $data = json_decode(implode('', $output), true);
     $data = json_decode(implode('', $output), true);