summaryrefslogtreecommitdiffstats
path: root/ajax/chat.ajax.php
diff options
context:
space:
mode:
authorBlueRaja <BlueRaja.admin@gmail.com>2015-05-07 23:14:47 -0500
committerBlueRaja <BlueRaja.admin@gmail.com>2015-05-07 23:14:47 -0500
commit3dc3919ce1b5336861979cde56884842615c967b (patch)
treef0a2418290cecd15f20c834bb071ffa9f3694b09 /ajax/chat.ajax.php
parent29e872fbc6c552ef02208fe9fa5416b69773aa38 (diff)
parentc517b645c8723b5f4d20cbb91cbc4b9f45579cbb (diff)
downloadpathery-3dc3919ce1b5336861979cde56884842615c967b.tar.xz
Merge branch 'master' of git.raylu.net:pathery
Diffstat (limited to 'ajax/chat.ajax.php')
-rw-r--r--ajax/chat.ajax.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/ajax/chat.ajax.php b/ajax/chat.ajax.php
index 1574bde..036efad 100644
--- a/ajax/chat.ajax.php
+++ b/ajax/chat.ajax.php
@@ -6,6 +6,7 @@ session_start();
// exit;
// }
+header_remove();
//ini_set('display_errors',1);
//ini_set('display_startup_errors',1);
@@ -52,6 +53,9 @@ if (isset($_REQUEST['messages'])) {
}
}
//Don't lockout requests by holding the session file open!
+
+$isLoggedIn = ($_SESSION['accepted'] == 1);
+
session_write_close();
$userID = $_SESSION['userID'];
@@ -68,14 +72,23 @@ $use_psuedo_longpoll = true;
// }
require_once('../includes/chats.php');
-
-//exit;
-
enterChannel($userID);
+
$sent = false;
+//User is sending a message
if (isset($_REQUEST['messages'])) {
$date = isMuted($userID);
+ if ($isLoggedIn !== true) {
+ $r[0]['error'] = 'Logged out';
+ $r[0]['serverMessage'] = 'true';
+ $r[0]['message'] = "Whoops, your session has timed out. Please sign in again.";
+ $r[0]['secondsSince'] = 0;
+ $r[0]['displayName'] = 'SERVER';
+ $r[0]['userID'] = null;
+ echo json_encode($r);
+ exit;
+ }
if ($date !== false) {
$r[0]['error'] = 'Muted';
$r[0]['serverMessage'] = 'true';