aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_jabber.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-06-19 16:19:59 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-06-19 16:19:59 +0000
commitc0a013053a127270a1b9498d847b63ae3a6a25c9 (patch)
tree7619d776a02ada3c4b99c4c4deec9e9e7688a72a /phpBB/includes/functions_jabber.php
parenteb6c2c54dfaafa5705d11fce82a70859684fb2f2 (diff)
downloadforums-c0a013053a127270a1b9498d847b63ae3a6a25c9.tar
forums-c0a013053a127270a1b9498d847b63ae3a6a25c9.tar.gz
forums-c0a013053a127270a1b9498d847b63ae3a6a25c9.tar.bz2
forums-c0a013053a127270a1b9498d847b63ae3a6a25c9.tar.xz
forums-c0a013053a127270a1b9498d847b63ae3a6a25c9.zip
Yet more updates, topic marking works again ... still intend (optional) checking of "forum read" status on return to index (rather than just the current fudge of visiting the forum), obtain_ranks as a function (used in at least three scripts), removed jabber method that was needed, oops
git-svn-id: file:///svn/phpbb/trunk@4147 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_jabber.php')
-rw-r--r--phpBB/includes/functions_jabber.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index 5417f47bdf..aca7d39473 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -172,6 +172,51 @@ class Jabber
}
}
+ function AccountRegistration($reg_email = NULL, $reg_name = NULL)
+ {
+ $packet = $this->SendIq($this->server, 'get', 'reg_01', 'jabber:iq:register');
+
+ if ($packet)
+ {
+ $key = $this->GetInfoFromIqKey($packet); // just in case a key was passed back from the server
+ unset($packet);
+
+ $payload = "<username>{$this->username}</username>
+ <password>{$this->password}</password>
+ <email>$reg_email</email>
+ <name>$reg_name</name>\n";
+
+ $payload .= ($key) ? "<key>$key</key>\n" : '';
+
+ $packet = $this->SendIq($this->server, 'set', 'reg_01', 'jabber:iq:register', $payload);
+
+ if ($this->GetInfoFromIqType($packet) == 'result')
+ {
+ $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2;
+ $this->jid = ($this->resource) ? "{$this->username}@{$this->server}/{$this->resource}" : "{$this->username}@{$this->server}";
+ }
+ elseif ($this->GetInfoFromIqType($packet) == 'error' && isset($packet['iq']['#']['error'][0]['#']))
+ {
+ // "conflict" error, i.e. already registered
+ if ($packet['iq']['#']['error'][0]['@']['code'] == '409')
+ {
+ $return_code = 1;
+ }
+ else
+ {
+ $return_code = 'Error ' . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#'];
+ }
+ }
+
+ return $return_code;
+
+ }
+ else
+ {
+ return 3;
+ }
+ }
+
function SendPacket($xml)
{
$xml = trim($xml);