Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add missing applicaiton/json header where missing
  • Loading branch information
remdex committed Apr 5, 2022
1 parent abc9599 commit a09aa0d
Show file tree
Hide file tree
Showing 19 changed files with 42 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lhc_web/modules/lhcannedmsg/showsuggester.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$tpl = erLhcoreClassTemplate::getInstance('lhcannedmsg/showsuggester.tpl.php');

$chat = erLhcoreClassChat::getSession()->load( 'erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
Expand Down
1 change: 1 addition & 0 deletions lhc_web/modules/lhcannedmsg/subject.php
Expand Up @@ -42,6 +42,7 @@
}

$db->commit();
header('Content-type: application/json');
echo json_encode($response);
exit;
}
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhchat/blockuser.php
Expand Up @@ -85,10 +85,12 @@
erLhcoreClassModelChatBlockedUser::blockChat($params);
$tpl = erLhcoreClassTemplate::getInstance('lhkernel/alert_success.tpl.php');
$tpl->set('msg', erTranslationClassLhTranslation::getInstance()->getTranslation('chat/blockedusers', 'Visitor was blocked!'));
header('Content-type: application/json');
echo json_encode(array('error' => false, 'result' => $tpl->fetch()));
} else {
$tpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php');
$tpl->set('errors', $Errors);
header('Content-type: application/json');
echo json_encode(array('error' => true, 'result' => $tpl->fetch()));
}

Expand Down
6 changes: 5 additions & 1 deletion lhc_web/modules/lhchat/changestatus.php
Expand Up @@ -13,6 +13,7 @@
$changeStatus = (int) $_POST['ChatStatus'];

if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
header('Content-type: application/json');
echo json_encode(array(
'error' => 'true',
'result' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Invalid CSRF token!')
Expand All @@ -37,13 +38,16 @@
));

erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.data_changed',array('chat' => & $chat, 'user' => $currentUser));


header('Content-type: application/json');
echo json_encode(array(
'error' => 'false',
'is_owner' => $chat->user_id == $userData->id
));
exit();
} else {

header('Content-type: application/json');
echo json_encode(array(
'error' => 'true',
'result' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Invalid chat status')
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhchat/checkchatstatus.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$activated = 'false';
$result = 'false';
$ott = '';
Expand Down
4 changes: 3 additions & 1 deletion lhc_web/modules/lhchat/editprevious.php
@@ -1,4 +1,6 @@
<?php
<?php

header('Content-type: application/json');

try {
$chat = erLhcoreClassChat::getSession()->load( 'erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhchat/getmessageadmin.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

try {
$Chat = erLhcoreClassChat::getSession ()->load ( 'erLhcoreClassModelChat', $Params ['user_parameters'] ['chat_id'] );

Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhchat/holdaction.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$db = ezcDbInstance::get();

$db->beginTransaction();
Expand Down
3 changes: 2 additions & 1 deletion lhc_web/modules/lhcobrowse/checkinitializer.php
@@ -1,4 +1,5 @@
<?php
<?php
header('Content-type: application/json');

if (is_numeric($Params['user_parameters']['chat_id']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhcobrowse/checkmirrorchanges.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

if (is_numeric($Params['user_parameters']['chat_id'])) {
/*
* If online user mode we have to make different check
Expand Down
1 change: 1 addition & 0 deletions lhc_web/modules/lhuser/setinactive.php
@@ -1,4 +1,5 @@
<?php
header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
$userData = $currentUser->getUserData(true);
Expand Down
3 changes: 3 additions & 0 deletions lhc_web/modules/lhxml/accepttransfer.php
@@ -1,4 +1,7 @@
<?php

header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/accepttransferbychat.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
3 changes: 3 additions & 0 deletions lhc_web/modules/lhxml/chatdata.php
@@ -1,4 +1,7 @@
<?php

header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/chatssynchro.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/checklogin.php
Expand Up @@ -3,6 +3,8 @@
// Debug
//erLhcoreClassLog::write(print_r($_POST,true));

header('Content-type: application/json');

@ini_set('session.cookie_samesite', 'None');
@ini_set('session.cookie_secure', true);

Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/getuseronlinestatus.php
@@ -1,4 +1,6 @@
<?php
header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/transferchat.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$currentUser = erLhcoreClassUser::instance();
if (!$currentUser->isLogged() && !$currentUser->authenticate($_POST['username'],$_POST['password']))
{
Expand Down
2 changes: 2 additions & 0 deletions lhc_web/modules/lhxml/userinfo.php
@@ -1,5 +1,7 @@
<?php

header('Content-type: application/json');

$tpl = erLhcoreClassTemplate::getInstance( 'lhxml/userinfo.tpl.php' );

try {
Expand Down

0 comments on commit a09aa0d

Please sign in to comment.