1<? 2/* 3 * licqweb. Copyright 2005, Philip Nelson 4 * 5 * This file is part of licqweb. 6 * 7 * licqweb is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * licqweb is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with licqweb; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21require_once('config.php'); 22require_once('rms.php'); 23 24session_start(); 25$uin = $_SESSION['uin']; 26$password = $_SESSION['password']; 27session_write_close(); 28 29if (!rmsLogin("$uin\r\n", "$password\r\n")) { 30 $message = "<response><method>loginFailed</method><result>Couldn't log in to rms plugin!</result></response>"; 31 push($message); 32 exit; 33} 34 35$res = rmsSendMessage($_POST['id'], $_POST['pp'], stripslashes($_POST['msg'])); 36 37header('Content-Type: text/xml'); 38echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"; 39echo " 40<response> 41 <method>ackSendMessage</method> 42 <uid>" . $_POST['uid'] . "</uid> 43 <result>$res</result> 44 <datetime>" . date('Y-m-d H:i:s') . "</datetime> 45</response> 46"; 47 48socket_shutdown($sock); 49socket_close($sock); 50?> 51