aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-10-11 23:52:46 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-10-11 23:52:46 +0000
commit19f03aa6b73ee23ce4caa732e5c19fb7604d383e (patch)
tree80a8326565d62021591110acf0c679116be7fd28
parentdd39be7f511a067639be75153401346f4263fc83 (diff)
downloadforums-19f03aa6b73ee23ce4caa732e5c19fb7604d383e.tar
forums-19f03aa6b73ee23ce4caa732e5c19fb7604d383e.tar.gz
forums-19f03aa6b73ee23ce4caa732e5c19fb7604d383e.tar.bz2
forums-19f03aa6b73ee23ce4caa732e5c19fb7604d383e.tar.xz
forums-19f03aa6b73ee23ce4caa732e5c19fb7604d383e.zip
Removed duplicate methods, tidied some code
git-svn-id: file:///svn/phpbb/trunk@4554 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions_jabber.php86
1 files changed, 6 insertions, 80 deletions
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 6ed843878a..30e628f66f 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -181,7 +181,6 @@ class Jabber
{
$this->auth_id = 'auth_' . md5(time() . $_SERVER['REMOTE_ADDR']);
-// $this->resource = 'Class.Jabber.PHP ' . md5($this->auth_id);
$this->jid = "{$this->username}@{$this->server}/{$this->resource}";
// request available authentication methods
@@ -191,19 +190,19 @@ class Jabber
// was a result returned?
if ($this->GetInfoFromIqType($packet) == 'result' && $this->GetInfoFromIqId($packet) == $this->auth_id)
{
- // auth_0k
- if (@function_exists(mhash) && isset($packet['iq']['#']['query'][0]['#']['sequence'][0]["#"]) && isset($packet['iq']['#']['query'][0]['#']['token'][0]["#"]))
+ if (@function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['sequence'][0]['#']) && isset($packet['iq']['#']['query'][0]['#']['token'][0]['#']))
{
- return $this->_sendauth_0k($packet['iq']['#']['query'][0]['#']['token'][0]["#"], $packet['iq']['#']['query'][0]['#']['sequence'][0]["#"]);
+ // auth_0k
+ return $this->_sendauth_0k($packet['iq']['#']['query'][0]['#']['token'][0]['#'], $packet['iq']['#']['query'][0]['#']['sequence'][0]['#']);
}
- // digest
- elseif (@function_exists(mhash) && isset($packet['iq']['#']['query'][0]['#']['digest']))
+ elseif (@function_exists('mhash') && isset($packet['iq']['#']['query'][0]['#']['digest']))
{
+ // digest
return $this->_sendauth_digest();
}
- // plain text
elseif ($packet['iq']['#']['query'][0]['#']['password'])
{
+ // plain text
return $this->_sendauth_plaintext();
}
}
@@ -536,79 +535,6 @@ class Jabber
}
}
- // get the transport registration fields
- // method written by Steve Blinch, http://www.blitzaffe.com
- function TransportRegistrationDetails($transport)
- {
- $this->txnid++;
- $packet = $this->SendIq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid);
-
- if ($packet)
- {
- $res = array();
-
- foreach ($packet['iq']['#']['query'][0]['#'] as $element => $data)
- {
- if ($element != 'instructions' && $element != 'key')
- {
- $res[] = $element;
- }
- }
-
- return $res;
- }
- else
- {
- return 3;
- }
- }
-
- // register with the transport
- // method written by Steve Blinch, http://www.blitzaffe.com
- function TransportRegistration($transport, $details)
- {
- $this->txnid++;
- $packet = $this->SendIq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid);
-
- if ($packet)
- {
- $key = $this->GetInfoFromIqKey($packet); // just in case a key was passed back from the server
- unset($packet);
-
- $payload = ($key) ? "<key>$key</key>\n" : '';
- foreach ($details as $element => $value)
- {
- $payload .= "<$element>$value</$element>\n";
- }
-
- $packet = $this->SendIq($transport, 'set', "reg_{$this->txnid}", 'jabber:iq:register', $payload);
-
- if ($this->GetInfoFromIqType($packet) == 'result')
- {
- if (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#']))
- {
- $return_code = 1;
- }
- else
- {
- $return_code = 2;
- }
- }
- elseif ($this->GetInfoFromIqType($packet) == 'error')
- {
- if (isset($packet['iq']['#']['error'][0]['#']))
- {
- $return_code = "Error " . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#'];
- }
- }
-
- return $return_code;
- }
- else
- {
- return 3;
- }
- }
// ======================================================================
// private methods