mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
lets pm working again.
git-svn-id: file:///svn/phpbb/trunk@4979 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -688,15 +688,21 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers
|
||||
$mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>';
|
||||
}
|
||||
|
||||
foreach ($addresses['bcc'] as $which_ary)
|
||||
if (isset($addresses['bcc']) && sizeof($addresses['bcc']))
|
||||
{
|
||||
$mail_rcpt['bcc'][] = '<' . trim($which_ary['email']) . '>';
|
||||
foreach ($addresses['bcc'] as $which_ary)
|
||||
{
|
||||
$mail_rcpt['bcc'][] = '<' . trim($which_ary['email']) . '>';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($addresses['cc'] as $which_ary)
|
||||
if (isset($addresses['cc']) && sizeof($addresses['cc']))
|
||||
{
|
||||
$mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
|
||||
$mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>';
|
||||
foreach ($addresses['cc'] as $which_ary)
|
||||
{
|
||||
$mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>';
|
||||
$mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>';
|
||||
}
|
||||
}
|
||||
|
||||
$smtp = new smtp_class;
|
||||
|
@@ -1058,7 +1058,7 @@ function submit_pm($mode, $subject, $data, $update_message, $put_in_outbox = tru
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
print_r($data);
|
||||
$current_time = time();
|
||||
|
||||
// Collect some basic informations about which tables and which rows to update/insert
|
||||
@@ -1074,7 +1074,7 @@ function submit_pm($mode, $subject, $data, $update_message, $put_in_outbox = tru
|
||||
// u|g => array($user_id => 'to'|'bcc')
|
||||
foreach (array('u', 'g') as $ug_type)
|
||||
{
|
||||
if (sizeof($data['address_list'][$ug_type]))
|
||||
if (isset($data['address_list'][$ug_type]) && sizeof($data['address_list'][$ug_type]))
|
||||
{
|
||||
foreach ($data['address_list'][$ug_type] as $id => $field)
|
||||
{
|
||||
@@ -1088,7 +1088,7 @@ function submit_pm($mode, $subject, $data, $update_message, $put_in_outbox = tru
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($data['address_list']['g']))
|
||||
if (isset($data['address_list']['g']) && sizeof($data['address_list']['g']))
|
||||
{
|
||||
$sql = 'SELECT group_id, user_id
|
||||
FROM ' . USER_GROUP_TABLE . '
|
||||
@@ -1141,7 +1141,7 @@ function submit_pm($mode, $subject, $data, $update_message, $put_in_outbox = tru
|
||||
'message_text' => $data['message'],
|
||||
'message_checksum' => $data['message_md5'],
|
||||
'message_encoding' => $user->lang['ENCODING'],
|
||||
'message_attachment'=> (sizeof($data['filename_data']['physical_filename'])) ? 1 : 0,
|
||||
'message_attachment'=> (isset($data['filename_data']['physical_filename']) && sizeof($data['filename_data']['physical_filename'])) ? 1 : 0,
|
||||
'bbcode_bitfield' => $data['bbcode_bitfield'],
|
||||
'bbcode_uid' => $data['bbcode_uid'],
|
||||
'to_address' => implode(':', $to),
|
||||
@@ -1360,7 +1360,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||
if (trim($row['user_email']))
|
||||
{
|
||||
$msg_list_ary[] = array(
|
||||
'method' => $row['method'],
|
||||
'method' => $row['user_notify_type'],
|
||||
'email' => $row['user_email'],
|
||||
'jabber' => $row['user_jabber'],
|
||||
'name' => $row['username'],
|
||||
@@ -1393,6 +1393,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
|
||||
'SITENAME' => $config['sitename'],
|
||||
'SUBJECT' => $subject,
|
||||
'AUTHOR_NAME' => $author,
|
||||
'USERNAME' => $addr['name'],
|
||||
|
||||
'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&mode=unread")
|
||||
);
|
||||
|
@@ -333,6 +333,11 @@ class ucp_pm extends module
|
||||
'MSG_ID' => $msg_id)
|
||||
);
|
||||
|
||||
if (!$msg_id)
|
||||
{
|
||||
trigger_error('NO_MESSAGE');
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_viewmessage.'.$phpEx);
|
||||
view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row);
|
||||
|
||||
|
@@ -212,11 +212,14 @@ function compose_pm($id, $mode, $action)
|
||||
{
|
||||
$address_list['g'][$to_group_id] = 'to';
|
||||
}
|
||||
unset($to_user_id, $to_group_id);
|
||||
|
||||
$check_value = 0;
|
||||
}
|
||||
|
||||
if (($to_group_id || isset($address_list['g'])) && !$config['allow_mass_pm'])
|
||||
{
|
||||
trigger_error('NOT_ALLOWED_MASS_PM');
|
||||
}
|
||||
|
||||
if ($action == 'edit' && !$refresh && !$preview && !$submit)
|
||||
{
|
||||
if (!($message_time > time() - $config['pm_edit_time'] || !$config['pm_edit_time']))
|
||||
@@ -458,7 +461,7 @@ function compose_pm($id, $mode, $action)
|
||||
}
|
||||
|
||||
// Subject defined
|
||||
if (!$subject)
|
||||
if (!$subject && !($remove_u || $remove_g || $add_to || $add_bcc))
|
||||
{
|
||||
$error[] = $user->lang['EMPTY_SUBJECT'];
|
||||
}
|
||||
@@ -468,7 +471,7 @@ function compose_pm($id, $mode, $action)
|
||||
$error[] = $user->lang['NO_RECIPIENT'];
|
||||
}
|
||||
|
||||
if (sizeof($message_parser->warn_msg))
|
||||
if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc))
|
||||
{
|
||||
$error[] = implode('<br />', $message_parser->warn_msg);
|
||||
}
|
||||
@@ -477,22 +480,16 @@ function compose_pm($id, $mode, $action)
|
||||
if (!sizeof($error) && $submit)
|
||||
{
|
||||
$pm_data = array(
|
||||
'subject' => (!$message_subject) ? $subject : $message_subject,
|
||||
'msg_id' => (int) $msg_id,
|
||||
'reply_from_root_level' => (int) $root_level,
|
||||
'reply_from_root_level' => (isset($root_level)) ? (int) $root_level : 0,
|
||||
'reply_from_msg_id' => (int) $msg_id,
|
||||
'icon_id' => (int) $icon_id,
|
||||
'author_id' => (int) $author_id,
|
||||
'enable_sig' => (bool) $enable_sig,
|
||||
'enable_bbcode' => (bool) $enable_bbcode,
|
||||
'enable_html' => (bool) $enable_html,
|
||||
'enable_smilies' => (bool) $enable_smilies,
|
||||
'enable_urls' => (bool) $enable_urls,
|
||||
'message_md5' => (int) $message_md5,
|
||||
'post_checksum' => (int) $post_checksum,
|
||||
'post_edit_reason' => $post_edit_reason,
|
||||
'post_edit_user' => ($action == 'edit') ? $user->data['user_id'] : (int) $post_edit_user,
|
||||
'author_ip' => (int) $author_ip,
|
||||
'bbcode_bitfield' => (int) $message_parser->bbcode_bitfield,
|
||||
'bbcode_uid' => $message_parser->bbcode_uid,
|
||||
'message' => $message_parser->message,
|
||||
@@ -502,13 +499,14 @@ function compose_pm($id, $mode, $action)
|
||||
);
|
||||
unset($message_parser);
|
||||
|
||||
$msg_id = submit_pm($action, $subject, $username, $pm_data, $update_message);
|
||||
// ((!$message_subject) ? $subject : $message_subject)
|
||||
$msg_id = submit_pm($action, $subject, $pm_data, $update_message);
|
||||
|
||||
$return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view_messages&action=view_message&p=" . $data['msg_id'];
|
||||
$return_message_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=view_messages&action=view_message&p=" . $msg_id;
|
||||
$return_folder_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&folder=outbox";
|
||||
meta_refresh(3, $return_message_url);
|
||||
|
||||
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>');
|
||||
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
@@ -634,7 +632,7 @@ function compose_pm($id, $mode, $action)
|
||||
{
|
||||
$result['g'] = $db->sql_query('SELECT group_id as id, group_name as name, group_colour as colour
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_id IN (' . implode(', ', array_map('intval', array_keys($address_list['g']))) . ')');
|
||||
WHERE group_receive_pm = 1 AND group_id IN (' . implode(', ', array_map('intval', array_keys($address_list['g']))) . ')');
|
||||
}
|
||||
|
||||
$u = $g = array();
|
||||
@@ -656,6 +654,12 @@ function compose_pm($id, $mode, $action)
|
||||
{
|
||||
foreach ($adr_ary as $id => $field)
|
||||
{
|
||||
if (!isset(${$type}[$id]))
|
||||
{
|
||||
unset($address_list[$type][$id]);
|
||||
break;
|
||||
}
|
||||
|
||||
$field = ($field == 'to') ? 'to' : 'bcc';
|
||||
$type = ($type == 'u') ? 'u' : 'g';
|
||||
$id = (int) $id;
|
||||
|
Reference in New Issue
Block a user