* added "authed"

* fixed issue #8


git-svn-id: svn://netflint.net/xmpphp@19 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
fritzy 2008-04-16 21:55:30 +00:00
parent e36fc08eb0
commit 40dd33844c

View File

@ -28,6 +28,7 @@ class XMPP extends XMLStream {
var $password;
var $resource;
var $fulljid;
var $authed;
function XMPP($host, $port, $user, $password, $resource, $server=Null, $printlog=False, $loglevel=Null) {
$this->XMLStream($host, $port, $printlog, $loglevel);
@ -44,6 +45,7 @@ class XMPP extends XMLStream {
$this->default_ns = 'jabber:client';
$this->addHandler('message', 'jabber:client', 'message_handler');
$this->addHandler('presence', 'jabber:client', 'presence_handler');
$this->authed = False;
}
function message_handler($xml) {
@ -109,6 +111,7 @@ class XMPP extends XMLStream {
function sasl_success_handler($xml) {
$this->log->log("Auth success!");
$this->authed = True;
$this->reset();
}
@ -134,7 +137,7 @@ class XMPP extends XMLStream {
function tls_proceed_handler($xml) {
$this->log->log("Starting TLS encryption");
stream_socket_enable_crypto($this->socket, True, STREAM_CRYPTO_METHOD_TLS_CLIENT);
stream_socket_enable_crypto($this->socket, True, STREAM_CRYPTO_METHOD_SSLv23_CLIENT);
$this->reset();
}
}