* added "authed"
* fixed issue #8 git-svn-id: svn://netflint.net/xmpphp@19 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
parent
e36fc08eb0
commit
40dd33844c
5
xmpp.php
5
xmpp.php
@ -28,6 +28,7 @@ class XMPP extends XMLStream {
|
|||||||
var $password;
|
var $password;
|
||||||
var $resource;
|
var $resource;
|
||||||
var $fulljid;
|
var $fulljid;
|
||||||
|
var $authed;
|
||||||
|
|
||||||
function XMPP($host, $port, $user, $password, $resource, $server=Null, $printlog=False, $loglevel=Null) {
|
function XMPP($host, $port, $user, $password, $resource, $server=Null, $printlog=False, $loglevel=Null) {
|
||||||
$this->XMLStream($host, $port, $printlog, $loglevel);
|
$this->XMLStream($host, $port, $printlog, $loglevel);
|
||||||
@ -44,6 +45,7 @@ class XMPP extends XMLStream {
|
|||||||
$this->default_ns = 'jabber:client';
|
$this->default_ns = 'jabber:client';
|
||||||
$this->addHandler('message', 'jabber:client', 'message_handler');
|
$this->addHandler('message', 'jabber:client', 'message_handler');
|
||||||
$this->addHandler('presence', 'jabber:client', 'presence_handler');
|
$this->addHandler('presence', 'jabber:client', 'presence_handler');
|
||||||
|
$this->authed = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
function message_handler($xml) {
|
function message_handler($xml) {
|
||||||
@ -109,6 +111,7 @@ class XMPP extends XMLStream {
|
|||||||
|
|
||||||
function sasl_success_handler($xml) {
|
function sasl_success_handler($xml) {
|
||||||
$this->log->log("Auth success!");
|
$this->log->log("Auth success!");
|
||||||
|
$this->authed = True;
|
||||||
$this->reset();
|
$this->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +137,7 @@ class XMPP extends XMLStream {
|
|||||||
|
|
||||||
function tls_proceed_handler($xml) {
|
function tls_proceed_handler($xml) {
|
||||||
$this->log->log("Starting TLS encryption");
|
$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();
|
$this->reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user