also, a better index.php that doesnt throw errors about seckey
PHP Code:
<?php
$cfg['xmpp_server'] = ''; //The XMPP server to connect to
$cfg['xmpp_port'] = 5222; //The XMPP port to use
$cfg['xmpp_user'] = ''; //The User of the XMPP server to connect with (do not include @domain.com)
$cfg['xmpp_pass'] = ''; //The Password to the User of the XMPP server to connect with
$cfg['xmpp_resource'] = 'xmpphp'; //The Resource base which (leave default if unsure, its only extra info)
$cfg['xmpp_domain'] = ''; //The Domain to which the User belongs (do not include @)
$cfg['seckey'] = ''; //Security Key set in caxmpp_seckey convar
$cfg['recipents'] = ''; //Comma Seperated list of recipients to message
if(isset($_POST['seckey'])) { $seckey = $_POST['seckey']; } else { $seckey = ''; }
if($seckey != $cfg['seckey'])
die("Unauthorized Access");
include 'XMPPHP/XMPP.php';
#Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
#If this doesn't work, are you running 64-bit PHP with < 5.2.6?
$conn = new XMPPHP_XMPP($cfg['xmpp_server'], $cfg['xmpp_port'], $cfg['xmpp_user'], $cfg['xmpp_pass'], $cfg['xmpp_resource'], $cfg['xmpp_domain'], $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);
$message = strip_tags(base64_decode($_POST['message']));
$recipents = explode(',', $cfg['recipents']);
try
{
$conn->connect();
$conn->processUntil('session_start');
$conn->presence();
foreach($recipents as $recipent)
{
$conn->message($recipent, $message);
}
$conn->disconnect();
}
catch(XMPPHP_Exception $e)
{
die($e->getMessage());
}
?>