Ejemplo n.º 1
0
 ////////////////////////////////////////////////////////////////////////////////////////////
 // sendmsg
 // Params: action, sid, rplayerid, message
 ////////////////////////////////////////////////////////////////////////////////////////////
 case "sendmsg":
     if (isSessionIDValid($config, $xsid)) {
         if ($_GET['rplayerid'] != "" && $_GET['message']) {
             $txtmsg = $_GET['message'];
             $session = base64_decode($xsid);
             list($uniq, $player_id) = preg_split("/\\|/", $session);
             //Instantiate theCR3DCQuery Class
             $oR3DCQuery = new CR3DCQuery($config);
             $aToReplace = array("<", ">", "\\'", "\\\"", "“", "”", "„", "‘", "’", "‚");
             $aReplaceWith = array("&lt;", "&gt;", "&#x27;", "&#x22;", "&#x201C;", "&#x201D;", "&#x201E;", "&#x2018;", "&#x2019;", "&#x201A;");
             $txtmsg = str_replace($aToReplace, $aReplaceWith, $txtmsg);
             $oR3DCQuery->SendMessage($_GET['rplayerid'], $xsid, $player_id, $txtmsg);
             $oR3DCQuery->Close();
             unset($oR3DCQuery);
             echo "<RESPONSE>\n";
             echo "<SENT>true</SENT>\n";
             echo "</RESPONSE>\n";
         } else {
             echo "<RESPONSE>\n";
             echo "<SENT>false</SENT>\n";
             echo "</RESPONSE>\n";
         }
     } else {
         echo "<RESPONSE>\n";
         echo "<ERROR>IDS_SESSION_ID_INVALID</ERROR>\n";
         echo "</RESPONSE>\n";
     }
Ejemplo n.º 2
0
    }
}
///////////////////////////////////////////////////////////////////////
$slctUsers = trim($_GET['slctUsers']);
if ($slctUsers == "") {
    $slctUsers = trim($_POST['slctUsers']);
}
$txtmsg = trim($_POST['txtmsg']);
$cmdSend = trim($_POST['cmdSend']);
$bMessageSent = false;
// Send message
if ($cmdSend != "" && $slctUsers != "-" && $txtmsg != "") {
    $aToReplace = array("<", ">", "\\'", "\\\"", "“", "”", "„", "‘", "’", "‚");
    $aReplaceWith = array("&lt;", "&gt;", "&#x27;", "&#x22;", "&#x201C;", "&#x201D;", "&#x201E;", "&#x2018;", "&#x2019;", "&#x201A;");
    $txtmsg = str_replace($aToReplace, $aReplaceWith, $txtmsg);
    $oR3DCQuery->SendMessage($slctUsers, $_SESSION['sid'], $_SESSION['id'], $txtmsg);
    $bMessageSent = true;
}
$cmdDelete = trim($_POST['cmdDelete']);
$cmdSave = trim($_POST['cmdSave']);
$txtIbID = trim($_POST['txtIbID']);
$achkID = $_POST['chkMessage'];
$cmdDeleteAll = $_POST['cmdDeleteAll'];
// Delete All Messages
if ($cmdDeleteAll != "" && $achkID != "") {
    $ncount = count($achkID);
    $i = 0;
    while ($i < $ncount) {
        $oR3DCQuery->DeleteMessageFromInbox($config, $achkID[$i]);
        $i++;
    }