Skip to content

Commit

Permalink
CSRF minor fixes (#1726)
Browse files Browse the repository at this point in the history
* CSRF minor fixes
  • Loading branch information
remdex committed Dec 15, 2021
1 parent fe72be2 commit 2a98c69
Show file tree
Hide file tree
Showing 41 changed files with 102 additions and 135 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions lhc_web/design/defaulttheme/js/lh.js
Expand Up @@ -3394,11 +3394,11 @@ function lh(){
}

if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
$.post(this.wwwDir + 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_admin_enabled = 1;
inst.text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/0');
$.post(this.wwwDir + 'user/setsettingajax/chat_message/0');
confLH.new_message_sound_admin_enabled = 0;
inst.text('volume_off');
}
Expand All @@ -3412,23 +3412,23 @@ function lh(){
}

if (inst.text() == 'volume_off'){
$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/1');
$.post(this.wwwDir+ 'user/setsettingajax/new_chat_sound/1');
confLH.new_chat_sound_enabled = 1;
inst.text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingajax/new_chat_sound/0');
$.post(this.wwwDir+ 'user/setsettingajax/new_chat_sound/0');
confLH.new_chat_sound_enabled = 0;
inst.text('volume_off');
}
return false;
};

this.changeUserSettings = function(attr,value){
$.get(this.wwwDir+ 'user/setsettingajax/'+attr+'/'+value);
$.post(this.wwwDir+ 'user/setsettingajax/'+attr+'/'+value);
};

this.changeUserSettingsIndifferent = function(attr,value){
$.get(this.wwwDir+ 'user/setsettingajax/'+attr+'/'+encodeURIComponent(value)+'/(indifferent)/true');
this.changeUserSettingsIndifferent = function(attr,value) {
$.post(this.wwwDir+ 'user/setsettingajax/'+attr+'/'+encodeURIComponent(value)+'/(indifferent)/true');
};

this.switchToOfflineForm = function(){
Expand Down Expand Up @@ -3468,11 +3468,11 @@ function lh(){
this.disableChatSoundUser = function(inst)
{
if (inst.find('> i').text() == 'volume_off') {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/1');
$.post(this.wwwDir+ 'user/setsettingajax/chat_message/1');
confLH.new_message_sound_user_enabled = 1;
inst.find('> i').text('volume_up');
} else {
$.get(this.wwwDir+ 'user/setsettingajax/chat_message/0');
$.post(this.wwwDir+ 'user/setsettingajax/chat_message/0');
confLH.new_message_sound_user_enabled = 0;
inst.find('> i').text('volume_off');
};
Expand Down Expand Up @@ -4561,6 +4561,10 @@ window.onfocus = window.onblur = function(e) {

window.lhcSelector = null;

$( document ).ready(function() {
lhinst.protectCSFR();
})

/*Helper functions*/
function chatsyncuser()
{
Expand Down
2 changes: 1 addition & 1 deletion lhc_web/design/defaulttheme/js/lh.min.js

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 2a98c69

Please sign in to comment.