mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 10:44:20 +02:00
Merge branch 'develop' of git://github.com/phpbb/phpbb3 into ticket/8323
Conflicts: phpBB/viewtopic.php
This commit is contained in:
@@ -19,8 +19,8 @@ class ucp_profile_info
|
||||
'title' => 'UCP_PROFILE',
|
||||
'version' => '1.0.0',
|
||||
'modes' => array(
|
||||
'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => 'acl_u_chgprofileinfo', 'cat' => array('UCP_PROFILE')),
|
||||
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')),
|
||||
'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),
|
||||
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
|
@@ -170,9 +170,11 @@ class ucp_attachments
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$base_url = $this->u_action . "&sk=$sort_key&sd=$sort_dir";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $num_attachments, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGE_NUMBER' => on_page($num_attachments, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $num_attachments, $config['topics_per_page'], $start),
|
||||
'TOTAL_ATTACHMENTS' => $num_attachments,
|
||||
|
||||
'L_TITLE' => $user->lang['UCP_ATTACHMENTS'],
|
||||
|
@@ -513,7 +513,8 @@ class ucp_groups
|
||||
$data['height'] = request_var('height', '');
|
||||
$delete = request_var('delete', '');
|
||||
|
||||
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
||||
$uploadfile = $request->file('uploadfile');
|
||||
if (!empty($uploadfile['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
|
||||
{
|
||||
// Avatar stuff
|
||||
$var_ary = array(
|
||||
@@ -527,7 +528,7 @@ class ucp_groups
|
||||
{
|
||||
$data['user_id'] = "g$group_id";
|
||||
|
||||
if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
|
||||
if ((!empty($uploadfile['tmp_name']) || $data['uploadurl']) && $can_upload)
|
||||
{
|
||||
list($submit_ary['avatar_type'], $submit_ary['avatar'], $submit_ary['avatar_width'], $submit_ary['avatar_height']) = avatar_upload($data, $error);
|
||||
}
|
||||
@@ -844,11 +845,13 @@ class ucp_groups
|
||||
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
|
||||
}
|
||||
|
||||
$base_url = $this->u_action . "&action=$action&g=$group_id";
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_LIST' => true,
|
||||
'S_ACTION_OPTIONS' => $s_action_options,
|
||||
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
|
||||
'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start),
|
||||
'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $total_members, $config['topics_per_page'], $start),
|
||||
|
||||
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||
'S_UCP_ACTION' => $this->u_action . "&g=$group_id",
|
||||
@@ -1067,7 +1070,8 @@ class ucp_groups
|
||||
'mode' => $mode,
|
||||
'action' => $action
|
||||
);
|
||||
confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields));
|
||||
|
||||
confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields));
|
||||
}
|
||||
|
||||
trigger_error($user->lang['NO_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>'));
|
||||
|
@@ -69,17 +69,16 @@ class ucp_main
|
||||
// Get cleaned up list... return only those forums having the f_read permission
|
||||
$forum_ary = $auth->acl_getf('f_read', true);
|
||||
$forum_ary = array_unique(array_keys($forum_ary));
|
||||
|
||||
$sql = "SELECT t.* $sql_select
|
||||
FROM $sql_from
|
||||
WHERE t.topic_type = " . POST_GLOBAL . '
|
||||
AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . '
|
||||
ORDER BY t.topic_last_post_time DESC';
|
||||
|
||||
$topic_list = $rowset = array();
|
||||
|
||||
// If the user can't see any forums, he can't read any posts because fid of 0 is invalid
|
||||
if (!empty($forum_ary))
|
||||
{
|
||||
$sql = "SELECT t.* $sql_select
|
||||
FROM $sql_from
|
||||
WHERE t.topic_type = " . POST_GLOBAL . '
|
||||
AND ' . $db->sql_in_set('t.forum_id', $forum_ary) . '
|
||||
ORDER BY t.topic_last_post_time DESC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -670,9 +669,10 @@ class ucp_main
|
||||
|
||||
if ($topics_count)
|
||||
{
|
||||
phpbb_generate_template_pagination($template, $this->u_action, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGINATION' => generate_pagination($this->u_action, $topics_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $this->u_action, $topics_count, $config['topics_per_page'], $start),
|
||||
'TOTAL_TOPICS' => $user->lang('VIEW_FORUM_TOPICS', (int) $topics_count),
|
||||
));
|
||||
}
|
||||
@@ -813,7 +813,6 @@ class ucp_main
|
||||
|
||||
'S_DELETED_TOPIC' => (!$row['topic_id']) ? true : false,
|
||||
|
||||
'PAGINATION' => topic_generate_pagination($replies, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&t=$topic_id")),
|
||||
'REPLIES' => $replies,
|
||||
'VIEWS' => $row['topic_views'],
|
||||
'TOPIC_TITLE' => censor_text($row['topic_title']),
|
||||
@@ -837,6 +836,8 @@ class ucp_main
|
||||
'U_VIEW_TOPIC' => $view_topic_url,
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
|
||||
));
|
||||
|
||||
phpbb_generate_template_pagination($template, append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . "&t=$topic_id"), 'topicrow.pagination', 'start', $replies + 1, $config['posts_per_page'], 1, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -749,7 +749,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
|
||||
|
||||
|
||||
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
|
||||
$save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED'];
|
||||
$message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');
|
||||
|
||||
$last_click_type = 'CLICK_RETURN_FOLDER';
|
||||
if ($folder_url)
|
||||
@@ -837,11 +838,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$post_id = request_var('p', 0);
|
||||
if ($config['allow_post_links'])
|
||||
{
|
||||
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}: {$message_subject}[/url]\n\n";
|
||||
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$message_link = $user->lang['SUBJECT'] . ': ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n";
|
||||
$message_link = $user->lang['SUBJECT'] . $user->lang['COLON'] . ' ' . $message_subject . " (" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id})\n\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -874,7 +875,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||
$forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
|
||||
$forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
|
||||
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
|
||||
$forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
|
||||
$forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
|
||||
|
||||
$message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
|
||||
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
|
||||
|
@@ -176,7 +176,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url,
|
||||
'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '',
|
||||
'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $row['report_id']) : '',
|
||||
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '')
|
||||
'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '')
|
||||
);
|
||||
}
|
||||
unset($folder_info['rowset']);
|
||||
@@ -266,9 +266,9 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
}
|
||||
}
|
||||
|
||||
// There is the chance that all recipients of the message got deleted. To avoid creating
|
||||
// There is the chance that all recipients of the message got deleted. To avoid creating
|
||||
// exports without recipients, we add a bogus "undisclosed recipient".
|
||||
if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
|
||||
if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
|
||||
!(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
|
||||
{
|
||||
$address[$message_id]['u'] = array();
|
||||
@@ -277,7 +277,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
}
|
||||
|
||||
decode_message($message_row['message_text'], $message_row['bbcode_uid']);
|
||||
|
||||
|
||||
$data[] = array(
|
||||
'subject' => censor_text($row['message_subject']),
|
||||
'sender' => $row['username'],
|
||||
@@ -451,9 +451,11 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||
$sql_limit_time = '';
|
||||
}
|
||||
|
||||
$base_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param");
|
||||
phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id&$u_sort_param"), $pm_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => on_page($pm_count, $config['topics_per_page'], $start),
|
||||
'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $pm_count, $config['topics_per_page'], $start),
|
||||
'TOTAL_MESSAGES' => $user->lang('VIEW_PM_MESSAGES', (int) $pm_count),
|
||||
|
||||
'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),
|
||||
|
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
|
||||
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
{
|
||||
global $user, $template, $auth, $db, $cache;
|
||||
global $phpbb_root_path, $request, $phpEx, $config;
|
||||
global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang(array('viewtopic', 'memberlist'));
|
||||
|
||||
@@ -204,7 +204,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$msg_data = array(
|
||||
'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']),
|
||||
@@ -257,6 +257,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'],
|
||||
|
||||
'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false,
|
||||
'S_HAS_MULTIPLE_ATTACHMENTS' => (sizeof($attachments) > 1),
|
||||
'S_DISPLAY_NOTICE' => $display_notice && $message_row['message_attachment'],
|
||||
'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false,
|
||||
'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
|
||||
@@ -265,9 +266,28 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'S_CUSTOM_FIELDS' => (!empty($cp_row['row'])) ? true : false,
|
||||
|
||||
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
|
||||
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '')
|
||||
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify pm and sender data before it is assigned to the template
|
||||
*
|
||||
* @event core.ucp_pm_view_messsage
|
||||
* @var mixed id Active module category (can be int or string)
|
||||
* @var string mode Active module
|
||||
* @var int folder_id ID of the folder the message is in
|
||||
* @var int msg_id ID of the private message
|
||||
* var array folder Array with data of user's message folders
|
||||
* @var array message_row Array with message data
|
||||
* @var array cp_row Array with senders custom profile field data
|
||||
* @var array msg_data Template array with message data
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('id', 'mode', 'folder_id', 'msg_id', 'folder', 'message_row', 'cp_row', 'msg_data');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
|
||||
|
||||
$template->assign_vars($msg_data);
|
||||
|
||||
// Display the custom profile fields
|
||||
if (!empty($cp_row['row']))
|
||||
{
|
||||
@@ -282,6 +302,12 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
// Display not already displayed Attachments for this post, we already parsed them. ;)
|
||||
if (isset($attachments) && sizeof($attachments))
|
||||
{
|
||||
$methods = phpbb_gen_download_links('post_msg_id', $msg_id, $phpbb_root_path, $phpEx);
|
||||
foreach ($methods as $method)
|
||||
{
|
||||
$template->assign_block_vars('dl_method', $method);
|
||||
}
|
||||
|
||||
foreach ($attachments as $attachment)
|
||||
{
|
||||
$template->assign_block_vars('attachment', array(
|
||||
|
@@ -41,9 +41,8 @@ class ucp_prefs
|
||||
'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true),
|
||||
'lang' => basename(request_var('lang', $user->data['user_lang'])),
|
||||
'style' => request_var('style', (int) $user->data['user_style']),
|
||||
'tz' => request_var('tz', (float) $user->data['user_timezone']),
|
||||
'tz' => request_var('tz', $user->data['user_timezone']),
|
||||
|
||||
'dst' => request_var('dst', (bool) $user->data['user_dst']),
|
||||
'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']),
|
||||
'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']),
|
||||
'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']),
|
||||
@@ -72,7 +71,7 @@ class ucp_prefs
|
||||
$error = validate_data($data, array(
|
||||
'dateformat' => array('string', false, 1, 30),
|
||||
'lang' => array('language_iso_name'),
|
||||
'tz' => array('num', false, -14, 14),
|
||||
'tz' => array('timezone'),
|
||||
));
|
||||
|
||||
if (!check_form_key('ucp_prefs_personal'))
|
||||
@@ -93,7 +92,6 @@ class ucp_prefs
|
||||
'user_notify_pm' => $data['notifypm'],
|
||||
'user_options' => $user->data['user_options'],
|
||||
|
||||
'user_dst' => $data['dst'],
|
||||
'user_dateformat' => $data['dateformat'],
|
||||
'user_lang' => $data['lang'],
|
||||
'user_timezone' => $data['tz'],
|
||||
@@ -133,6 +131,37 @@ class ucp_prefs
|
||||
}
|
||||
$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>';
|
||||
|
||||
$timezone_selects = phpbb_timezone_select($user, $data['tz'], true);
|
||||
|
||||
// check if there are any user-selectable languages
|
||||
$sql = 'SELECT COUNT(lang_id) as languages_count
|
||||
FROM ' . LANG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
if ($db->sql_fetchfield('languages_count') > 1)
|
||||
{
|
||||
$s_more_languages = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_more_languages = false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// check if there are any user-selectable styles
|
||||
$sql = 'SELECT COUNT(style_id) as styles_count
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_active = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
if ($db->sql_fetchfield('styles_count') > 1)
|
||||
{
|
||||
$s_more_styles = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_more_styles = false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
@@ -145,7 +174,6 @@ class ucp_prefs
|
||||
'S_HIDE_ONLINE' => $data['hideonline'],
|
||||
'S_NOTIFY_PM' => $data['notifypm'],
|
||||
'S_POPUP_PM' => $data['popuppm'],
|
||||
'S_DST' => $data['dst'],
|
||||
|
||||
'DATE_FORMAT' => $data['dateformat'],
|
||||
'A_DATE_FORMAT' => addslashes($data['dateformat']),
|
||||
@@ -154,9 +182,13 @@ class ucp_prefs
|
||||
'DEFAULT_DATEFORMAT' => $config['default_dateformat'],
|
||||
'A_DEFAULT_DATEFORMAT' => addslashes($config['default_dateformat']),
|
||||
|
||||
'S_MORE_LANGUAGES' => $s_more_languages,
|
||||
'S_MORE_STYLES' => $s_more_styles,
|
||||
|
||||
'S_LANG_OPTIONS' => language_select($data['lang']),
|
||||
'S_STYLE_OPTIONS' => ($config['override_user_style']) ? '' : style_select($data['style']),
|
||||
'S_TZ_OPTIONS' => tz_select($data['tz'], true),
|
||||
'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
|
||||
'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
|
||||
'S_CAN_HIDE_ONLINE' => ($auth->acl_get('u_hideonline')) ? true : false,
|
||||
'S_SELECT_NOTIFY' => ($config['jab_enable'] && $user->data['user_jabber'] && @extension_loaded('xml')) ? true : false)
|
||||
);
|
||||
|
@@ -46,9 +46,9 @@ class ucp_profile
|
||||
$data = array(
|
||||
'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
|
||||
'email' => strtolower(request_var('email', $user->data['user_email'])),
|
||||
'new_password' => request_var('new_password', '', true),
|
||||
'cur_password' => request_var('cur_password', '', true),
|
||||
'password_confirm' => request_var('password_confirm', '', true),
|
||||
'new_password' => $request->variable('new_password', '', true),
|
||||
'cur_password' => $request->variable('cur_password', '', true),
|
||||
'password_confirm' => $request->variable('password_confirm', '', true),
|
||||
);
|
||||
|
||||
add_form_key('ucp_reg_details');
|
||||
@@ -251,6 +251,11 @@ class ucp_profile
|
||||
break;
|
||||
|
||||
case 'profile_info':
|
||||
// Do not display profile information panel if not authed to do so
|
||||
if (!$auth->acl_get('u_chgprofileinfo'))
|
||||
{
|
||||
trigger_error('NO_AUTH_PROFILEINFO');
|
||||
}
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||
|
||||
|
@@ -100,7 +100,7 @@ class ucp_register
|
||||
'username' => utf8_normalize_nfc(request_var('username', '', true)),
|
||||
'email' => strtolower(request_var('email', '')),
|
||||
'lang' => $user->lang_name,
|
||||
'tz' => request_var('tz', (float) $config['board_timezone']),
|
||||
'tz' => request_var('tz', $config['board_timezone']),
|
||||
));
|
||||
|
||||
}
|
||||
@@ -120,7 +120,10 @@ class ucp_register
|
||||
if ($coppa === false && $config['coppa_enable'])
|
||||
{
|
||||
$now = getdate();
|
||||
$coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
|
||||
$coppa_birthday = $user->create_datetime()
|
||||
->setDate($now['year'] - 13, $now['mon'], $now['mday'] - 1)
|
||||
->setTime(0, 0, 0)
|
||||
->format($user->lang['DATE_FORMAT'], true);
|
||||
unset($now);
|
||||
|
||||
$template->assign_vars(array(
|
||||
@@ -163,16 +166,15 @@ class ucp_register
|
||||
$captcha->init(CONFIRM_REG);
|
||||
}
|
||||
|
||||
$is_dst = $config['board_dst'];
|
||||
$timezone = $config['board_timezone'];
|
||||
|
||||
$data = array(
|
||||
'username' => utf8_normalize_nfc(request_var('username', '', true)),
|
||||
'new_password' => request_var('new_password', '', true),
|
||||
'password_confirm' => request_var('password_confirm', '', true),
|
||||
'new_password' => $request->variable('new_password', '', true),
|
||||
'password_confirm' => $request->variable('password_confirm', '', true),
|
||||
'email' => strtolower(request_var('email', '')),
|
||||
'lang' => basename(request_var('lang', $user->lang_name)),
|
||||
'tz' => request_var('tz', (float) $timezone),
|
||||
'tz' => request_var('tz', $timezone),
|
||||
);
|
||||
|
||||
// Check and initialize some variables if needed
|
||||
@@ -189,7 +191,7 @@ class ucp_register
|
||||
'email' => array(
|
||||
array('string', false, 6, 60),
|
||||
array('email')),
|
||||
'tz' => array('num', false, -14, 14),
|
||||
'tz' => array('timezone'),
|
||||
'lang' => array('language_iso_name'),
|
||||
));
|
||||
|
||||
@@ -279,8 +281,7 @@ class ucp_register
|
||||
'user_password' => phpbb_hash($data['new_password']),
|
||||
'user_email' => $data['email'],
|
||||
'group_id' => (int) $group_id,
|
||||
'user_timezone' => (float) $data['tz'],
|
||||
'user_dst' => $is_dst,
|
||||
'user_timezone' => $data['tz'],
|
||||
'user_lang' => $data['lang'],
|
||||
'user_type' => $user_type,
|
||||
'user_actkey' => $user_actkey,
|
||||
@@ -441,6 +442,7 @@ class ucp_register
|
||||
break;
|
||||
}
|
||||
|
||||
$timezone_selects = phpbb_timezone_select($user, $data['tz'], true);
|
||||
$template->assign_vars(array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'USERNAME' => $data['username'],
|
||||
@@ -453,7 +455,8 @@ class ucp_register
|
||||
'L_PASSWORD_EXPLAIN' => $user->lang($config['pass_complex'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_pass_chars']), $user->lang('CHARACTERS', (int) $config['max_pass_chars'])),
|
||||
|
||||
'S_LANG_OPTIONS' => language_select($data['lang']),
|
||||
'S_TZ_OPTIONS' => tz_select($data['tz']),
|
||||
'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
|
||||
'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
|
||||
'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
|
||||
'S_REGISTRATION' => true,
|
||||
'S_COPPA' => $coppa,
|
||||
|
@@ -25,7 +25,7 @@ class ucp_zebra
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request;
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher;
|
||||
|
||||
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
|
||||
$s_hidden_fields = '';
|
||||
@@ -54,9 +54,22 @@ class ucp_zebra
|
||||
// Remove users
|
||||
if (!empty($data['usernames']))
|
||||
{
|
||||
$user_ids = $data['usernames'];
|
||||
|
||||
/**
|
||||
* Remove users from friends/foes
|
||||
*
|
||||
* @event core.ucp_remove_zebra
|
||||
* @var string mode Zebra type: friends|foes
|
||||
* @var array user_ids User ids we remove
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('user_ids');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));
|
||||
|
||||
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
|
||||
WHERE user_id = ' . $user->data['user_id'] . '
|
||||
AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
|
||||
AND ' . $db->sql_in_set('zebra_id', $user_ids);
|
||||
$db->sql_query($sql);
|
||||
|
||||
$updated = true;
|
||||
@@ -186,6 +199,19 @@ class ucp_zebra
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add users to friends/foes
|
||||
*
|
||||
* @event core.ucp_add_zebra
|
||||
* @var string mode Zebra type:
|
||||
* friends|foes
|
||||
* @var array sql_ary Array of
|
||||
* entries we add
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('mode', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars)));
|
||||
|
||||
$db->sql_multi_insert(ZEBRA_TABLE, $sql_ary);
|
||||
|
||||
$updated = true;
|
||||
|
Reference in New Issue
Block a user