Skip to content

Commit

Permalink
FIX #16096 #16085 Any call of ajax pages must provide the token
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 23, 2021
1 parent 34dcebe commit d2e1f9f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions htdocs/core/js/lib_head.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ function hideMessage(fieldId,message) {
* Used by button to set on/off.
* Call url then make complementary action (like show/hide, enable/disable or set another option).
*
* @param string url Url
* @param string url Url (warning: as any url called in ajax mode, the url called here must not renew the token)
* @param string code Code
* @param string intput Input
* @param string intput Array of complementary actions to do if success
* @param int entity Entity
* @param int strict Strict
* @param int forcereload Force reload
Expand Down Expand Up @@ -574,11 +574,12 @@ function() { /* handler for success of post */
$.each(data, function(key, value) {
$("#set_" + key).hide();
$("#del_" + key).show();
$.get( url, {
$.post( url, {
action: "set",
name: key,
value: value,
entity: entity
entity: entity,
token: token
});
});
}
Expand All @@ -593,9 +594,9 @@ function() { /* handler for success of post */
* Used by button to set on/off
* Call url then make complementary action (like show/hide, enable/disable or set another option).
*
* @param string url Url
* @param string url Url (warning: as any url called in ajax mode, the url called here must not renew the token)
* @param string code Code
* @param string intput Input
* @param string intput Array of complementary actions to do if success
* @param int entity Entity
* @param int strict Strict
* @param int forcereload Force reload
Expand Down Expand Up @@ -644,10 +645,11 @@ function() {
$.each(data, function(key, value) {
$("#del_" + value).hide();
$("#set_" + value).show();
$.get( url, {
$.post( url, {
action: "del",
name: value,
entity: entity
entity: entity,
token: token
});
});
}
Expand Down

0 comments on commit d2e1f9f

Please sign in to comment.