Make sure users still get notifications if they set to only be notified by Jabber, but Jabber service disabled. (Bug #29715 - Patch by Paul)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8990 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2008-10-09 15:41:19 +00:00
parent 94f0047a9b
commit c8cf5693b8
4 changed files with 34 additions and 4 deletions

View file

@ -133,6 +133,7 @@
<li>[Fix] Implemented strict check for cached user permissions and existing ACL options. This fix makes sure cached permissions are valid, even if they got already cached.</li> <li>[Fix] Implemented strict check for cached user permissions and existing ACL options. This fix makes sure cached permissions are valid, even if they got already cached.</li>
<li>[Fix] Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088)</li> <li>[Fix] Do not show link to user/group profiles if user has no permission to view the linked page and gets a denied message anyway. (Bug #15088)</li>
<li>[Fix] Do not display last post link and sort display options for search engines. (Bug #15088)</li> <li>[Fix] Do not display last post link and sort display options for search engines. (Bug #15088)</li>
<li>[Fix] Make sure users still get notifications if they set to only be notified by Jabber, but Jabber service disabled. (Bug #29715 - Patch by Paul)</li>
<li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li> <li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li>
<li>[Change] Display warning in ACP if config.php file is left writable.</li> <li>[Change] Display warning in ACP if config.php file is left writable.</li>

View file

@ -85,6 +85,19 @@ class acp_jabber
$jabber->disconnect(); $jabber->disconnect();
} }
else
{
// This feature is disabled.
// We update the user table to be sure all users that have IM as notify type are set to both as notify type
$sql_ary = array(
'user_notify_type' => NOTIFY_BOTH,
);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_notify_type = ' . NOTIFY_IM;
$db->sql_query($sql);
}
set_config('jab_enable', $jab_enable); set_config('jab_enable', $jab_enable);
set_config('jab_host', $jab_host); set_config('jab_host', $jab_host);

View file

@ -53,6 +53,12 @@ class ucp_prefs
'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']), 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']),
); );
if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml')))
{
// Jabber isnt enabled, or no jabber field filled in. Update the users table to be sure its correct.
$data['notifymethod'] = NOTIFY_BOTH;
}
if ($submit) if ($submit)
{ {
$data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style']; $data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style'];

View file

@ -347,6 +347,15 @@ class ucp_profile
if (!sizeof($error)) if (!sizeof($error))
{ {
$data['notify'] = $user->data['user_notify_type'];
if (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))
{
// User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled)
// Disable notify by Jabber now for this user.
$data['notify'] = NOTIFY_BOTH;
}
$sql_ary = array( $sql_ary = array(
'user_icq' => $data['icq'], 'user_icq' => $data['icq'],
'user_aim' => $data['aim'], 'user_aim' => $data['aim'],
@ -357,6 +366,7 @@ class ucp_profile
'user_from' => $data['location'], 'user_from' => $data['location'],
'user_occ' => $data['occupation'], 'user_occ' => $data['occupation'],
'user_interests'=> $data['interests'], 'user_interests'=> $data['interests'],
'user_notify_type' => $data['notify'],
); );
if ($config['allow_birthdays']) if ($config['allow_birthdays'])