From d9794b981d56c0e0f6e23d33a421e64378fd78a6 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 27 Jan 2014 15:55:08 -0800 Subject: In order to provide ajax chat accessible by remote visitors (xchans), we need to remove any core assumptions that userID is an int (which is a common centralised site assumption). Additionally we won't be able to provide guest logins, as this also assumes integer ID's; so that ability needs to be disabled by configuration. --- library/ajaxchat/chat/lib/class/AJAXChat.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'library/ajaxchat') diff --git a/library/ajaxchat/chat/lib/class/AJAXChat.php b/library/ajaxchat/chat/lib/class/AJAXChat.php index 2cf7aa11f..215b2c4e1 100644 --- a/library/ajaxchat/chat/lib/class/AJAXChat.php +++ b/library/ajaxchat/chat/lib/class/AJAXChat.php @@ -60,12 +60,12 @@ class AJAXChat { function initRequestVars() { $this->_requestVars = array(); $this->_requestVars['ajax'] = isset($_REQUEST['ajax']) ? true : false; - $this->_requestVars['userID'] = isset($_REQUEST['userID']) ? (int)$_REQUEST['userID'] : null; + $this->_requestVars['userID'] = isset($_REQUEST['userID']) ? $_REQUEST['userID'] : null; $this->_requestVars['userName'] = isset($_REQUEST['userName']) ? $_REQUEST['userName'] : null; - $this->_requestVars['channelID'] = isset($_REQUEST['channelID']) ? (int)$_REQUEST['channelID'] : null; + $this->_requestVars['channelID'] = isset($_REQUEST['channelID']) ? $_REQUEST['channelID'] : null; $this->_requestVars['channelName'] = isset($_REQUEST['channelName']) ? $_REQUEST['channelName'] : null; $this->_requestVars['text'] = isset($_POST['text']) ? $_POST['text'] : null; - $this->_requestVars['lastID'] = isset($_REQUEST['lastID']) ? (int)$_REQUEST['lastID'] : 0; + $this->_requestVars['lastID'] = isset($_REQUEST['lastID']) ? $_REQUEST['lastID'] : ''; $this->_requestVars['login'] = isset($_REQUEST['login']) ? true : false; $this->_requestVars['logout'] = isset($_REQUEST['logout']) ? true : false; $this->_requestVars['password'] = isset($_REQUEST['password']) ? $_REQUEST['password'] : null; @@ -3052,14 +3052,14 @@ class AJAXChat { if($userID === null) { $userID = $this->getUserID(); } - return $userID + $this->getConfig('privateChannelDiff'); + return $userID . '.' . $this->getConfig('privateChannelDiff'); } function getPrivateMessageID($userID=null) { if($userID === null) { $userID = $this->getUserID(); } - return $userID + $this->getConfig('privateMessageDiff'); + return $userID . '.' . $this->getConfig('privateMessageDiff'); } function isAllowedToSendPrivateMessage() { -- cgit v1.2.3