diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-10-12 19:58:01 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-10-12 19:58:01 +0000 |
commit | a82d2e4eddb230fde220d4565353ed0ce37761f8 (patch) | |
tree | 690ff069648882fa45206ffddbf9a4ff963bf410 /phpBB/includes/functions_jabber.php | |
parent | 0cca5430d881906e461b65420f7aebf479185d68 (diff) | |
download | forums-a82d2e4eddb230fde220d4565353ed0ce37761f8.tar forums-a82d2e4eddb230fde220d4565353ed0ce37761f8.tar.gz forums-a82d2e4eddb230fde220d4565353ed0ce37761f8.tar.bz2 forums-a82d2e4eddb230fde220d4565353ed0ce37761f8.tar.xz forums-a82d2e4eddb230fde220d4565353ed0ce37761f8.zip |
account registration/changing, password changing
git-svn-id: file:///svn/phpbb/trunk@4588 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_jabber.php')
-rw-r--r-- | phpBB/includes/functions_jabber.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 30e628f66f..fdc76c03da 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -250,7 +250,46 @@ class Jabber } return $return_code; + } + else + { + return 3; + } + } + + function ChangePassword($new_password) + { + $packet = $this->SendIq($this->server, 'get', 'A0', '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>{$new_password}</password>\n"; + $payload .= ($key) ? "<key>$key</key>\n" : ''; + + $packet = $this->SendIq($this->server, 'set', 'A0', 'jabber:iq:register', $payload); + + if ($this->GetInfoFromIqType($packet) == 'result') + { + $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2; + } + 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 { |