root/trunk/licqweb/changeStatus.php

Revision 4526, 1.6 kB (checked in by erijo, 2 years ago)

Removed svn:keywords from all files that don't need it. May make your
checkout a tiny bit faster :)

  • Property svn:eol-style set to native
Line 
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$statusMap = array(
36    "Online" => "online",
37    "Away" => "away",
38    "Occupied" => "occupied",
39    "NotAvailable" => "na",
40    "DoNotDisturb" => "dnd",
41    "Offline" => "offline"
42);
43
44$ret = rmsChangeStatus($_POST['pp'], $statusMap[$_POST['status']]);
45
46header('Content-Type: text/xml');
47echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
48echo "
49<response>
50  <method>ackChangeStatus</method>
51  <result>$ret</result>
52</response>
53";
54
55socket_shutdown($sock);
56socket_close($sock);
57?>
Note: See TracBrowser for help on using the browser.