mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-23 10:01:55 +02:00
Fix non-sending of email notifications ... user_active hadn't been added to the SQL query yet was being checked before email was sent
git-svn-id: file:///svn/phpbb/trunk@2429 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -292,7 +292,7 @@ else if( $mode == "read" )
|
||||
FROM " . PRIVMSGS_TABLE . "
|
||||
WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . "
|
||||
AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid'];
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
@@ -309,7 +309,7 @@ else if( $mode == "read" )
|
||||
WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . "
|
||||
AND privmsgs_date = " . $sent_info['oldest_post_time'] . "
|
||||
AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid'];
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
@@ -800,7 +800,7 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
|
||||
AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " )
|
||||
OR ( privmsgs_from_userid = " . $userdata['user_id'] . "
|
||||
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )";
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
@@ -817,7 +817,7 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox")
|
||||
OR ( privmsgs_from_userid = " . $userdata['user_id'] . "
|
||||
AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )
|
||||
AND privmsgs_date = " . $saved_info['oldest_post_time'];
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
@@ -948,11 +948,11 @@ else if( $submit || $refresh || $mode != "" )
|
||||
{
|
||||
$to_username = $HTTP_POST_VARS['username'];
|
||||
|
||||
$sql = "SELECT user_id, user_notify_pm, user_email, user_lang
|
||||
$sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE username = '" . str_replace("\'", "''", $to_username) . "'
|
||||
AND user_id <> " . ANONYMOUS;
|
||||
if(!$result = $db->sql_query($sql))
|
||||
if (!($result = $db->sql_query($sql)))
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = $lang['No_such_user'];
|
||||
@@ -965,22 +965,14 @@ else if( $submit || $refresh || $mode != "" )
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
if(isset($error_msg))
|
||||
{
|
||||
$error_msg .= "<br />";
|
||||
}
|
||||
$error_msg .= $lang['No_to_user'];
|
||||
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['No_to_user'];
|
||||
}
|
||||
|
||||
$privmsg_subject = trim(strip_tags($HTTP_POST_VARS['subject']));
|
||||
if ( empty($privmsg_subject) )
|
||||
{
|
||||
$error = TRUE;
|
||||
if( !empty($error_msg) )
|
||||
{
|
||||
$error_msg .= "<br />";
|
||||
}
|
||||
$error_msg .= $lang['Empty_subject'];
|
||||
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject'];
|
||||
}
|
||||
|
||||
if ( !empty($HTTP_POST_VARS['message']) )
|
||||
@@ -999,11 +991,7 @@ else if( $submit || $refresh || $mode != "" )
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
if(!empty($error_msg))
|
||||
{
|
||||
$error_msg .= "<br />";
|
||||
}
|
||||
$error_msg .= $lang['Empty_message'];
|
||||
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1031,17 +1019,15 @@ else if( $submit || $refresh || $mode != "" )
|
||||
OR privmsgs_type = " . PRIVMSGS_READ_MAIL . "
|
||||
OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )
|
||||
AND privmsgs_to_userid = " . $to_userdata['user_id'];
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['No_such_user']);
|
||||
}
|
||||
|
||||
$sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : "";
|
||||
|
||||
if( $db->sql_numrows($result) )
|
||||
if ( $inbox_info = $db->sql_fetchrow($result) )
|
||||
{
|
||||
$inbox_info = $db->sql_fetchrow($result);
|
||||
|
||||
if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] )
|
||||
{
|
||||
$sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . "
|
||||
@@ -1050,7 +1036,7 @@ else if( $submit || $refresh || $mode != "" )
|
||||
OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )
|
||||
AND privmsgs_date = " . $inbox_info['oldest_post_time'] . "
|
||||
AND privmsgs_to_userid = " . $to_userdata['user_id'];
|
||||
if( !$result = $db->sql_query($sql) )
|
||||
if ( !($result = $db->sql_query($sql)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
@@ -1095,13 +1081,12 @@ else if( $submit || $refresh || $mode != "" )
|
||||
WHERE privmsgs_text_id = $privmsg_id";
|
||||
}
|
||||
|
||||
if( !$pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION) )
|
||||
if ( !($pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION)) )
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
|
||||
}
|
||||
else if ( $mode != "edit" )
|
||||
{
|
||||
|
||||
//
|
||||
// Add to the users new pm counter
|
||||
//
|
||||
@@ -1113,7 +1098,7 @@ else if( $submit || $refresh || $mode != "" )
|
||||
message_die(GENERAL_ERROR, "Could not update private message new/read status for user.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
if( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] == 1)
|
||||
if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] )
|
||||
{
|
||||
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
|
||||
|
||||
@@ -1230,7 +1215,7 @@ else if( $submit || $refresh || $mode != "" )
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id = $user_id
|
||||
AND user_id <> " . ANONYMOUS;
|
||||
if(!$result = $db->sql_query($sql))
|
||||
if (!($result = $db->sql_query($sql)))
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = $lang['No_such_user'];
|
||||
|
Reference in New Issue
Block a user