aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/adm
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-10-13 17:41:00 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-10-13 17:41:00 +0000
commit79469f244fc6c0c218ae6bef4e5191797b003027 (patch)
tree563ad4e1b7626b7cdadc1678e9e438c4a492e3f4 /phpBB/adm
parentbb9cd0f2ba5406249327495786a75b16ec788ac4 (diff)
downloadforums-79469f244fc6c0c218ae6bef4e5191797b003027.tar
forums-79469f244fc6c0c218ae6bef4e5191797b003027.tar.gz
forums-79469f244fc6c0c218ae6bef4e5191797b003027.tar.bz2
forums-79469f244fc6c0c218ae6bef4e5191797b003027.tar.xz
forums-79469f244fc6c0c218ae6bef4e5191797b003027.zip
Don't attempt to change the password unless jabber is enabled ...
git-svn-id: file:///svn/phpbb/trunk@4594 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
-rw-r--r--phpBB/adm/admin_jabber.php87
1 files changed, 45 insertions, 42 deletions
diff --git a/phpBB/adm/admin_jabber.php b/phpBB/adm/admin_jabber.php
index a0eb46c9bb..ecb9eb25d1 100644
--- a/phpBB/adm/admin_jabber.php
+++ b/phpBB/adm/admin_jabber.php
@@ -61,62 +61,65 @@ $jabber->resource = $jab_resource;
// Are changing (or initialising) a new host or username? If so run some checks and
// try to create account if it doesn't exist
-if ($jab_enable && ($jab_host != $config['jab_host'] || $jab_username != $config['jab_username']))
+if ($jab_enable)
{
- if (!$jabber->Connect())
+ if($jab_host != $config['jab_host'] || $jab_username != $config['jab_username']))
{
- trigger_error('Could not connect to Jabber server', E_USER_ERROR);
- }
-
- // First we'll try to authorise using this account, if that fails we'll
- // try to create it.
- if (!($result = $jabber->SendAuth()))
- {
- if (($result = $jabber->AccountRegistration($config['board_email'], $config['sitename'])) <> 2)
+ if (!$jabber->Connect())
{
+ trigger_error('Could not connect to Jabber server', E_USER_ERROR);
+ }
- $error[] = ($result == 1) ? $user->lang['ERR_JAB_USERNAME'] : sprintf($user->lang['ERR_JAB_REGISTER'], $result);
+ // First we'll try to authorise using this account, if that fails we'll
+ // try to create it.
+ if (!($result = $jabber->SendAuth()))
+ {
+ if (($result = $jabber->AccountRegistration($config['board_email'], $config['sitename'])) <> 2)
+ {
+
+ $error[] = ($result == 1) ? $user->lang['ERR_JAB_USERNAME'] : sprintf($user->lang['ERR_JAB_REGISTER'], $result);
+ }
+ else
+ {
+ $message = $user->lang['JAB_REGISTERED'];
+ $log = 'JAB_REGISTER';
+ }
}
else
{
- $message = $user->lang['JAB_REGISTERED'];
- $log = 'JAB_REGISTER';
+ $message = $user->lang['JAB_CHANGED'];
+ $log = 'JAB_CHANGED';
}
+
+ sleep(1);
+ $jabber->Disconnect();
}
- else
+ else if ($jab_password != $config['jab_password'])
{
- $message = $user->lang['JAB_CHANGED'];
- $log = 'JAB_CHANGED';
- }
+ if (!$jabber->Connect())
+ {
+ trigger_error('Could not connect to Jabber server', E_USER_ERROR);
+ }
- sleep(1);
- $jabber->Disconnect();
-}
-else if ($jab_password != $config['jab_password'])
-{
- if (!$jabber->Connect())
- {
- trigger_error('Could not connect to Jabber server', E_USER_ERROR);
- }
+ if (!$jabber->SendAuth())
+ {
+ trigger_error('Could not authorise on Jabber server', E_USER_ERROR);
+ }
+ $jabber->SendPresence(NULL, NULL, 'online');
- if (!$jabber->SendAuth())
- {
- trigger_error('Could not authorise on Jabber server', E_USER_ERROR);
- }
- $jabber->SendPresence(NULL, NULL, 'online');
+ if (($result = $jabber->ChangePassword($jab_password)) <> 2)
+ {
+ $error[] = ($result == 1) ? $user->lang['ERR_JAB_PASSCHG'] : sprintf($user->lang['ERR_JAB_PASSFAIL'], $result);
+ }
+ else
+ {
+ $message = $user->lang['JAB_PASS_CHANGED'];
+ $log = 'JAB_PASSCHG';
+ }
- if (($result = $jabber->ChangePassword($jab_password)) <> 2)
- {
- $error[] = ($result == 1) ? $user->lang['ERR_JAB_PASSCHG'] : sprintf($user->lang['ERR_JAB_PASSFAIL'], $result);
+ sleep(1);
+ $jabber->Disconnect();
}
- else
- {
- $message = $user->lang['JAB_PASS_CHANGED'];
- $log = 'JAB_PASSCHG';
- }
-
- sleep(1);
- $jabber->Disconnect();
}
// Pull relevant config data