mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 02:36:38 +02:00
- fixing a bunch of bugs
- moved the install trigger error to sessions and also disabled it for those having DEBUG_EXTRA enabled. i hope not having introduced too many new bugs. git-svn-id: file:///svn/phpbb/trunk@6628 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -345,7 +345,7 @@ function compose_pm($id, $mode, $action)
|
||||
WHERE post_msg_id = $msg_id
|
||||
AND in_message = 1
|
||||
AND is_orphan = 0
|
||||
ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC');
|
||||
ORDER BY filetime DESC";
|
||||
$result = $db->sql_query($sql);
|
||||
$message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
|
||||
$db->sql_freeresult($result);
|
||||
@@ -750,15 +750,30 @@ function compose_pm($id, $mode, $action)
|
||||
$type = ($type == 'u') ? 'u' : 'g';
|
||||
$id = (int) $id;
|
||||
|
||||
$template->assign_block_vars($field . '_recipient', array(
|
||||
'NAME' => ${$type}[$id]['name'],
|
||||
'IS_GROUP' => ($type == 'g'),
|
||||
'IS_USER' => ($type == 'u'),
|
||||
'COLOUR' => (${$type}[$id]['colour']) ? ${$type}[$id]['colour'] : '',
|
||||
$tpl_ary = array(
|
||||
'IS_GROUP' => ($type == 'g') ? true : false,
|
||||
'IS_USER' => ($type == 'u') ? true : false,
|
||||
'UG_ID' => $id,
|
||||
'U_VIEW' => ($type == 'u') ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $id) : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id),
|
||||
'TYPE' => $type)
|
||||
'NAME' => ${$type}[$id]['name'],
|
||||
'COLOUR' => (${$type}[$id]['colour']) ? '#' . ${$type}[$id]['colour'] : '',
|
||||
'TYPE' => $type,
|
||||
);
|
||||
|
||||
if ($type == 'u')
|
||||
{
|
||||
$tpl_ary = array_merge($tpl_ary, array(
|
||||
'U_VIEW' => get_username_string('profile', $id, ${$type}[$id]['name'], ${$type}[$id]['colour']),
|
||||
'NAME_FULL' => get_username_string('full', $id, ${$type}[$id]['name'], ${$type}[$id]['colour']),
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl_ary = array_merge($tpl_ary, array(
|
||||
'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $id),
|
||||
));
|
||||
}
|
||||
|
||||
$template->assign_block_vars($field . '_recipient', $tpl_ary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -191,7 +191,6 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
$folder_alt = ($row['pm_unread']) ? 'NEW_MESSAGES' : 'NO_NEW_MESSAGES';
|
||||
|
||||
// Generate all URIs ...
|
||||
$message_author = ($row['author_id'] != ANONYMOUS) ? '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['author_id']) . '">' . $row['username'] . '</a>' : $row['username'];
|
||||
$view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=view&f=$folder_id&p=$message_id");
|
||||
$remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&action=delete&p=$message_id");
|
||||
|
||||
@@ -211,9 +210,13 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
$template->assign_block_vars('messagerow', array(
|
||||
'PM_CLASS' => ($row_indicator) ? 'pm_' . $row_indicator . '_colour' : '',
|
||||
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $row['author_id'], $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $row['author_id'], $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR' => get_username_string('username', $row['author_id'], $row['username'], $row['user_colour'], $row['username']),
|
||||
'U_MESSAGE_AUTHOR' => get_username_string('profile', $row['author_id'], $row['username'], $row['user_colour'], $row['username']),
|
||||
|
||||
'FOLDER_ID' => $folder_id,
|
||||
'MESSAGE_ID' => $message_id,
|
||||
'MESSAGE_AUTHOR' => $message_author,
|
||||
'SENT_TIME' => $user->format_date($row['message_time']),
|
||||
'SUBJECT' => censor_text($row['message_subject']),
|
||||
'FOLDER' => (isset($folder[$row['folder_id']])) ? $folder[$row['folder_id']]['folder_name'] : '',
|
||||
@@ -516,7 +519,7 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||
$sql_start = $start;
|
||||
}
|
||||
|
||||
$sql = 'SELECT t.*, p.author_id, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username
|
||||
$sql = 'SELECT t.*, p.author_id, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.user_colour
|
||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||
WHERE t.user_id = $user_id
|
||||
AND p.author_id = u.user_id
|
||||
|
@@ -92,7 +92,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
FROM ' . ATTACHMENTS_TABLE . "
|
||||
WHERE post_msg_id = $msg_id
|
||||
AND in_message = 1
|
||||
ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC';
|
||||
ORDER BY filetime DESC, post_msg_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -165,7 +165,11 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'AUTHOR_NAME' => ($user_info['user_colour']) ? '<span style="color:#' . $user_info['user_colour'] . '">' . $user_info['username'] . '</span>' : $user_info['username'],
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
|
||||
'AUTHOR_RANK' => $user_info['rank_title'],
|
||||
'RANK_IMAGE' => $user_info['rank_image'],
|
||||
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
|
||||
@@ -192,7 +196,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
|
||||
'U_INFO' => ($auth->acl_get('m_info') && $message_row['pm_forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&p=' . $message_row['msg_id'], true, $user->session_id) : '',
|
||||
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $author_id) : '',
|
||||
'U_EMAIL' => $user_info['email'],
|
||||
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
'U_EDIT' => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
@@ -314,7 +317,6 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||
foreach ($rowset as $id => $row)
|
||||
{
|
||||
$author_id = $row['author_id'];
|
||||
$author = $row['username'];
|
||||
$folder_id = (int) $row['folder_id'];
|
||||
|
||||
$subject = $row['message_subject'];
|
||||
@@ -340,7 +342,11 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||
}
|
||||
|
||||
$template->assign_block_vars('history_row', array(
|
||||
'AUTHOR_NAME' => $author,
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $row['username'], $row['user_colour'], $row['username']),
|
||||
|
||||
'SUBJECT' => $subject,
|
||||
'SENT_DATE' => $user->format_date($row['message_time']),
|
||||
'MESSAGE' => $message,
|
||||
@@ -351,7 +357,6 @@ function message_history($msg_id, $user_id, $message_row, $folder)
|
||||
|
||||
'U_MSG_ID' => $row['msg_id'],
|
||||
'U_VIEW_MESSAGE' => "$url&f=$folder_id&p=" . $row['msg_id'],
|
||||
'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&u=$author_id") : '',
|
||||
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '',
|
||||
'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '')
|
||||
);
|
||||
|
@@ -140,13 +140,13 @@ class ucp_prefs
|
||||
case 'view':
|
||||
|
||||
$data = array(
|
||||
'topic_sk' => (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't',
|
||||
'topic_sd' => (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd',
|
||||
'topic_st' => (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0,
|
||||
'topic_sk' => request_var('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'),
|
||||
'topic_sd' => request_var('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'),
|
||||
'topic_st' => request_var('topic_st', (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0),
|
||||
|
||||
'post_sk' => (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't',
|
||||
'post_sd' => (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a',
|
||||
'post_st' => (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0,
|
||||
'post_sk' => request_var('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'),
|
||||
'post_sd' => request_var('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'),
|
||||
'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0),
|
||||
|
||||
'images' => request_var('images', (bool) $user->optionget('viewimg')),
|
||||
'flash' => request_var('flash', (bool) $user->optionget('viewflash')),
|
||||
|
@@ -35,8 +35,8 @@ class ucp_profile
|
||||
|
||||
$data = array(
|
||||
'username' => request_var('username', $user->data['username'], true),
|
||||
'email' => request_var('email', $user->data['user_email']),
|
||||
'email_confirm' => request_var('email_confirm', ''),
|
||||
'email' => strtolower(request_var('email', $user->data['user_email'])),
|
||||
'email_confirm' => strtolower(request_var('email_confirm', '')),
|
||||
'new_password' => request_var('new_password', '', true),
|
||||
'cur_password' => request_var('cur_password', '', true),
|
||||
'password_confirm' => request_var('password_confirm', '', true),
|
||||
@@ -93,7 +93,7 @@ class ucp_profile
|
||||
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
|
||||
'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
|
||||
'user_email' => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
|
||||
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? crc32(strtolower($data['email'])) . strlen($data['email']) : $user->data['user_email_hash'],
|
||||
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? crc32($data['email']) . strlen($data['email']) : $user->data['user_email_hash'],
|
||||
'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? md5($data['new_password']) : $user->data['user_password'],
|
||||
'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
|
||||
);
|
||||
@@ -172,8 +172,9 @@ class ucp_profile
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($username),
|
||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
|
||||
'USERNAME' => htmlspecialchars_decode($username),
|
||||
'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
|
||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
|
@@ -115,8 +115,8 @@ class ucp_register
|
||||
'password_confirm' => request_var('password_confirm', '', true),
|
||||
'new_password' => request_var('new_password', '', true),
|
||||
'cur_password' => request_var('cur_password', '', true),
|
||||
'email' => request_var('email', ''),
|
||||
'email_confirm' => request_var('email_confirm', ''),
|
||||
'email' => strtolower(request_var('email', '')),
|
||||
'email_confirm' => strtolower(request_var('email_confirm', '')),
|
||||
'confirm_code' => request_var('confirm_code', ''),
|
||||
'lang' => request_var('lang', $user->lang_name),
|
||||
'tz' => request_var('tz', (float) $timezone),
|
||||
@@ -364,8 +364,9 @@ class ucp_register
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($data['username']),
|
||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
|
||||
'USERNAME' => htmlspecialchars_decode($data['username']),
|
||||
'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u=$user_id",
|
||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
|
@@ -23,7 +23,7 @@ class ucp_remind
|
||||
global $db, $user, $auth, $template;
|
||||
|
||||
$username = request_var('username', '', true);
|
||||
$email = request_var('email', '');
|
||||
$email = strtolower(request_var('email', ''));
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
if ($submit)
|
||||
|
@@ -23,7 +23,7 @@ class ucp_resend
|
||||
global $db, $user, $auth, $template;
|
||||
|
||||
$username = request_var('username', '', true);
|
||||
$email = request_var('email', '');
|
||||
$email = strtolower(request_var('email', ''));
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
if ($submit)
|
||||
@@ -112,8 +112,9 @@ class ucp_resend
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => htmlspecialchars_decode($user_row['username']),
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
|
||||
'USERNAME' => htmlspecialchars_decode($user_row['username']),
|
||||
'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
|
Reference in New Issue
Block a user