1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 09:16:55 +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:
Meik Sievertsen
2006-11-21 18:15:53 +00:00
parent 5be570b1f0
commit ab9ec8064a
39 changed files with 289 additions and 120 deletions

View File

@@ -582,7 +582,8 @@ class acp_modules
if (!$ignore_acl && $row['module_auth'])
{
if (!p_master::module_auth($row['module_auth']))
// We use zero as the forum id to check - global setting.
if (!p_master::module_auth($row['module_auth'], 0))
{
continue;
}

View File

@@ -140,7 +140,7 @@ class acp_users
// Prevent normal users/admins change/view founders if they are not a founder by themselves
if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER)
{
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING);
}
switch ($mode)
@@ -620,8 +620,8 @@ class acp_users
$data = array(
'username' => request_var('user', $user_row['username'], true),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => request_var('user_email', $user_row['user_email']),
'email_confirm' => request_var('email_confirm', ''),
'email' => strtolower(request_var('user_email', $user_row['user_email'])),
'email_confirm' => strtolower(request_var('email_confirm', '')),
'user_password' => request_var('user_password', '', true),
'password_confirm' => request_var('password_confirm', '', true),
'warnings' => request_var('warnings', $user_row['user_warnings']),
@@ -841,6 +841,31 @@ class acp_users
$last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
$inactive_reason = '';
if ($user_row['user_type'] == USER_INACTIVE)
{
$inactive_reason = $user->lang['INACTIVE_REASON_UNKNOWN'];
switch ($user_row['user_inactive_reason'])
{
case INACTIVE_REGISTER:
$inactive_reason = $user->lang['INACTIVE_REASON_REGISTER'];
break;
case INACTIVE_PROFILE:
$inactive_reason = $user->lang['INACTIVE_REASON_PROFILE'];
break;
case INACTIVE_MANUAL:
$inactive_reason = $user->lang['INACTIVE_REASON_MANUAL'];
break;
case INACTIVE_REMIND:
$inactive_reason = $user->lang['INACTIVE_REASON_REMIND'];
break;
}
}
$template->assign_vars(array(
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
@@ -865,6 +890,7 @@ class acp_users
'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'],
'USER_INACTIVE_REASON' => $inactive_reason,
)
);

View File

@@ -2433,8 +2433,8 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_
include("{$phpbb_root_path}includes/functions_display.$phpEx");
}
$attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true);
$tpl_size = sizeof($attachments);
$attachment_tpl = display_attachments($forum_id, NULL, $attachments, $update_count, false, true);
$tpl_size = sizeof($attachment_tpl);
$unset_tpl = array();
@@ -2447,7 +2447,7 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_
$index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
$replace['from'][] = $matches[0][$num];
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
$replace['to'][] = (isset($attachment_tpl[$index])) ? $attachment_tpl[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
$unset_tpl[] = $index;
}

View File

@@ -597,8 +597,8 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status)
$rules = array(
($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'],
($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'],
($auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
($auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
);
if ($config['allow_attachments'])
@@ -744,7 +744,17 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$attachment_data[$attach_ids[$row['attach_id']]] = $row;
}
$db->sql_freeresult($result);
}
// Sort correctly (please note that the attachment_data array itself get changed by this
if ($config['display_order'])
{
// Ascending sort
krsort($attachment_data);
}
else
{
// Descending sort
ksort($attachment_data);
}

View File

@@ -214,10 +214,10 @@ class p_master
/**
* Check module authorisation
*/
function module_auth($module_auth)
function module_auth($module_auth, $forum_id = false)
{
global $auth, $config;
$module_auth = trim($module_auth);
// Generally allowed to access module if module_auth is empty
@@ -261,8 +261,12 @@ class p_master
// Make sure $id seperation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
$test = preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']'), $module_auth);
$is_auth = false;
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $this->acl_forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']'), $module_auth) . ');');
eval('$is_auth = (int) (' . $test . ');');
return $is_auth;
}

View File

@@ -692,7 +692,7 @@ function posting_gen_inline_attachments(&$attachment_data)
/**
* Generate inline attachment entry
*/
function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
function posting_gen_attachment_entry($attachment_data, &$filename_data)
{
global $template, $config, $phpbb_root_path, $phpEx, $user;
@@ -706,8 +706,10 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
'S_HAS_ATTACHMENTS' => true)
);
$count = 0;
foreach ($attachment_data as $attach_row)
// We display the posted attachments within the desired order.
($config['display_order']) ? krsort($attachment_data) : ksort($attachment_data);
foreach ($attachment_data as $count => $attach_row)
{
$hidden = '';
$attach_row['real_filename'] = basename($attach_row['real_filename']);
@@ -729,8 +731,6 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
'U_VIEW_ATTACHMENT' => $download_link,
'S_HIDDEN' => $hidden)
);
$count++;
}
}

View File

@@ -1166,15 +1166,30 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{
foreach ($adr_ary as $id => $row)
{
$template->assign_block_vars($check_type . '_recipient', array(
'NAME' => $row['name'],
'IS_GROUP' => ($type == 'group'),
'IS_USER' => ($type == 'user'),
'COLOUR' => ($row['colour']) ? $row['colour'] : '',
$tpl_ary = array(
'IS_GROUP' => ($type == 'group') ? true : false,
'IS_USER' => ($type == 'user') ? true : false,
'UG_ID' => $id,
'U_VIEW' => ($type == 'user') ? (($id != ANONYMOUS) ? 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' => $row['name'],
'COLOUR' => ($row['colour']) ? '#' . $row['colour'] : '',
'TYPE' => $type,
);
if ($type == 'user')
{
$tpl_ary = array_merge($tpl_ary, array(
'U_VIEW' => get_username_string('profile', $id, $row['name'], $row['colour']),
'NAME_FULL' => get_username_string('full', $id, $row['name'], $row['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($check_type . '_recipient', $tpl_ary);
}
}
}

View File

@@ -142,7 +142,7 @@ function user_add($user_row, $cp_data = false)
'username' => $user_row['username'],
'username_clean' => utf8_clean_string($user_row['username']),
'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
'user_email' => $user_row['user_email'],
'user_email' => strtolower($user_row['user_email']),
'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']),
'group_id' => $user_row['group_id'],
'user_type' => $user_row['user_type'],
@@ -1217,7 +1217,9 @@ function validate_email($email)
{
global $config, $db, $user;
if (strtolower($user->data['user_email']) == strtolower($email))
$email = strtolower($email);
if (strtolower($user->data['user_email']) == $email)
{
return false;
}
@@ -1248,7 +1250,7 @@ function validate_email($email)
{
$sql = 'SELECT user_email_hash
FROM ' . USERS_TABLE . "
WHERE user_email_hash = " . crc32(strtolower($email)) . strlen($email);
WHERE user_email_hash = " . crc32($email) . strlen($email);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);

View File

@@ -68,6 +68,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id),
'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id),
'S_CAN_FORK' => $auth->acl_get('m_', $forum_id),
@@ -127,7 +128,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids,
'U_MCP_QUEUE' => $u_mcp_queue,
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports'),
'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),

View File

@@ -81,10 +81,11 @@ function mcp_topic_view($id, $mode, $action)
$sql = 'SELECT u.username, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . "
p.topic_id = {$topic_id}
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . '
p.topic_id = ' . $topic_id . ' ' .
((!$auth->acl_get('m_approve', $topic_info['forum_id'])) ? ' AND p.post_approved = 1 ' : '') . '
AND p.poster_id = u.user_id
ORDER BY $sort_order_sql";
ORDER BY ' . $sort_order_sql;
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
$rowset = array();
@@ -141,8 +142,8 @@ function mcp_topic_view($id, $mode, $action)
'S_CHECKED' => ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? true : false,
'U_POST_DETAILS' => "$url&i=$id&p={$row['post_id']}&mode=post_details",
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']),
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']))
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '',
'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '')
);
unset($rowset[$i]);
@@ -198,6 +199,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false,
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
'S_REPORT_VIEW' => ($action == 'reports') ? true : false,
'S_MERGE_VIEW' => ($action == 'merge') ? true : false,

View File

@@ -1208,6 +1208,23 @@ class user extends session
$this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
// Disable board if the install/ directory is still present
// For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install'))
{
// Adjust the message slightly according to the permissions
if ($auth->acl_gets('a_', 'm_'))
{
$message = 'REMOVE_INSTALL';
}
else
{
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
}
trigger_error($message);
}
// Is board disabled and user not an admin or moderator?
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_'))
{

View File

@@ -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);
}
}
}

View File

@@ -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&amp;u=' . $row['author_id']) . '">' . $row['username'] . '</a>' : $row['username'];
$view_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=view&amp;f=$folder_id&amp;p=$message_id");
$remove_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;action=delete&amp;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

View File

@@ -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&amp;p=' . $message_row['msg_id'], true, $user->session_id) : '',
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $author_id) : '',
'U_EMAIL' => $user_info['email'],
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=$folder_id&amp;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&amp;mode=compose&amp;action=edit&amp;f=$folder_id&amp;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&amp;f=$folder_id&amp;p=" . $row['msg_id'],
'U_AUTHOR_PROFILE' => ($author_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u=$author_id") : '',
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $row['msg_id'] : '')
);

View File

@@ -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')),

View File

@@ -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&amp;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']);

View File

@@ -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&amp;u=$user_id",
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
);
$messenger->send($row['user_notify_type']);

View File

@@ -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)

View File

@@ -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&amp;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']);