From 40dd33844c98ea17921d5e73cf207f0abac65368 Mon Sep 17 00:00:00 2001 From: fritzy Date: Wed, 16 Apr 2008 21:55:30 +0000 Subject: [PATCH] * added "authed" * fixed issue #8 git-svn-id: svn://netflint.net/xmpphp@19 ef36c318-a008-4979-b6e8-6b496270793b --- xmpp.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmpp.php b/xmpp.php index 0a187f7..da56b9c 100644 --- a/xmpp.php +++ b/xmpp.php @@ -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(); } }