aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_jabber.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-06 10:55:31 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-06 10:55:31 +0000
commit281ed483de292f1d7d3f350a273c402bae1744e6 (patch)
treec62e6060d5bba5f2f98111f17d01a254e4c4da67 /phpBB/includes/functions_jabber.php
parentd3468832bb07b535d679b067f2567621721f8769 (diff)
downloadforums-281ed483de292f1d7d3f350a273c402bae1744e6.tar
forums-281ed483de292f1d7d3f350a273c402bae1744e6.tar.gz
forums-281ed483de292f1d7d3f350a273c402bae1744e6.tar.bz2
forums-281ed483de292f1d7d3f350a273c402bae1744e6.tar.xz
forums-281ed483de292f1d7d3f350a273c402bae1744e6.zip
some fixes. :)
git-svn-id: file:///svn/phpbb/trunk@7836 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_jabber.php')
-rw-r--r--phpBB/includes/functions_jabber.php27
1 files changed, 21 insertions, 6 deletions
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index eb2a7245a5..def15c67c7 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -12,7 +12,7 @@
*
* Jabber class from Flyspray project
*
-* @version class.jabber2.php 1244 2007-05-28
+* @version class.jabber2.php 1306 2007-06-21
* @copyright 2006 Flyspray.org
* @author: Florian Schmitz (floele)
*
@@ -31,6 +31,7 @@ class jabber
var $username;
var $password;
var $use_ssl;
+ var $resource = 'functions_jabber.phpbb.php';
var $enable_logging;
var $log_array;
@@ -76,18 +77,32 @@ class jabber
return false;
}
- // Make sure the encryption stream is supported
+ /**
+ * Make sure the encryption stream is supported
+ * Also seem to work without the crypto stream if correctly compiled
+
$streams = stream_get_wrappers();
if (!in_array('streams.crypto', $streams))
{
return false;
}
+ */
return true;
}
/**
+ * Sets the resource which is used. No validation is done here, only escaping.
+ * @param string $name
+ * @access public
+ */
+ function set_resource($name)
+ {
+ $this->resource = $name;
+ }
+
+ /**
* Connect
*/
function connect()
@@ -126,7 +141,7 @@ class jabber
// disconnect gracefully
if (isset($this->session['sent_presence']))
{
- $this->presence('offline', '', true);
+ $this->send_presence('offline', '', true);
}
$this->send('</stream:stream>');
@@ -379,7 +394,7 @@ class jabber
}
// go on with authentication?
- if (isset($this->features['stream:features'][0]['#']['bind']))
+ if (isset($this->features['stream:features'][0]['#']['bind']) || $this->session['tls'])
{
return $this->response($this->features);
}
@@ -394,9 +409,9 @@ class jabber
$this->send("<iq type='set' id='bind_1'>
<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'>
- <resource>functions_jabber.phpbb.php</resource>
+ <resource>" . utf8_htmlspecialchars($this->resource) . '</resource>
</bind>
- </iq>");
+ </iq>');
return $this->response($this->listen());
}