mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
Merge branch '3.1.x' into ticket/15011
This commit is contained in:
@@ -421,23 +421,33 @@ class acp_main
|
||||
// Version check
|
||||
$user->add_lang('install');
|
||||
|
||||
if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<'))
|
||||
if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.4.0', '<'))
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'S_PHP_VERSION_OLD' => true,
|
||||
'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="https://www.phpbb.com/community/viewtopic.php?f=14&t=2152375">', '</a>'),
|
||||
'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], PHP_VERSION, '5.4.0', '<a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/requirements">', '</a>'),
|
||||
));
|
||||
}
|
||||
|
||||
if ($auth->acl_get('a_board'))
|
||||
{
|
||||
/** @var \phpbb\version_helper $version_helper */
|
||||
$version_helper = $phpbb_container->get('version_helper');
|
||||
try
|
||||
{
|
||||
$recheck = $request->variable('versioncheck_force', false);
|
||||
$updates_available = $version_helper->get_suggested_updates($recheck);
|
||||
$updates_available = $version_helper->get_update_on_branch($recheck);
|
||||
$upgrades_available = $version_helper->get_suggested_updates();
|
||||
if (!empty($upgrades_available))
|
||||
{
|
||||
$upgrades_available = array_pop($upgrades_available);
|
||||
}
|
||||
|
||||
$template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
|
||||
$template->assign_vars(array(
|
||||
'S_VERSION_UP_TO_DATE' => empty($updates_available),
|
||||
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
|
||||
'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
|
||||
));
|
||||
}
|
||||
catch (\RuntimeException $e)
|
||||
{
|
||||
|
@@ -37,7 +37,12 @@ class acp_update
|
||||
try
|
||||
{
|
||||
$recheck = $request->variable('versioncheck_force', false);
|
||||
$updates_available = $version_helper->get_suggested_updates($recheck);
|
||||
$updates_available = $version_helper->get_update_on_branch($recheck);
|
||||
$upgrades_available = $version_helper->get_suggested_updates();
|
||||
if (!empty($upgrades_available))
|
||||
{
|
||||
$upgrades_available = array_pop($upgrades_available);
|
||||
}
|
||||
}
|
||||
catch (\RuntimeException $e)
|
||||
{
|
||||
@@ -51,7 +56,7 @@ class acp_update
|
||||
$template->assign_block_vars('updates_available', $version_data);
|
||||
}
|
||||
|
||||
$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
|
||||
$update_link = append_sid($phpbb_root_path . 'install/');
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_UP_TO_DATE' => empty($updates_available),
|
||||
@@ -61,6 +66,8 @@ class acp_update
|
||||
'CURRENT_VERSION' => $config['version'],
|
||||
|
||||
'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link),
|
||||
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
|
||||
'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
|
||||
));
|
||||
|
||||
// Incomplete update?
|
||||
|
@@ -641,8 +641,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||
*
|
||||
* @event core.move_posts_before
|
||||
* @var array post_ids Array of post ids to move
|
||||
* @var string topic_id The topic id the posts are moved to
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var int topic_id The topic id the posts are moved to
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var array forum_ids Array of the forum ids the posts are moved from
|
||||
* @var array topic_ids Array of the topic ids the posts are moved from
|
||||
* @var array forum_row Array with the forum id of the topic the posts are moved to
|
||||
@@ -673,8 +673,8 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||
*
|
||||
* @event core.move_posts_after
|
||||
* @var array post_ids Array of the moved post ids
|
||||
* @var string topic_id The topic id the posts are moved to
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var int topic_id The topic id the posts are moved to
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var array forum_ids Array of the forum ids the posts are moved from
|
||||
* @var array topic_ids Array of the topic ids the posts are moved from
|
||||
* @var array forum_row Array with the forum id of the topic the posts are moved to
|
||||
@@ -698,6 +698,28 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||
sync('topic_attachment', 'topic_id', $topic_ids);
|
||||
sync('topic', 'topic_id', $topic_ids, true);
|
||||
sync('forum', 'forum_id', $forum_ids, true, true);
|
||||
|
||||
/**
|
||||
* Perform additional actions after move post sync
|
||||
*
|
||||
* @event core.move_posts_sync_after
|
||||
* @var array post_ids Array of the moved post ids
|
||||
* @var int topic_id The topic id the posts are moved to
|
||||
* @var bool auto_sync Whether or not to perform auto sync
|
||||
* @var array forum_ids Array of the forum ids the posts are moved from
|
||||
* @var array topic_ids Array of the topic ids the posts are moved from
|
||||
* @var array forum_row Array with the forum id of the topic the posts are moved to
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'post_ids',
|
||||
'topic_id',
|
||||
'auto_sync',
|
||||
'forum_ids',
|
||||
'topic_ids',
|
||||
'forum_row',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.move_posts_sync_after', compact($vars)));
|
||||
}
|
||||
|
||||
// Update posted information
|
||||
|
@@ -646,7 +646,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
* @var array row The data of the forum
|
||||
* @var array subforums_row Template data of subforums
|
||||
* @since 3.1.0-a1
|
||||
* @change 3.1.0-b5 Added var subforums_row
|
||||
* @changed 3.1.0-b5 Added var subforums_row
|
||||
*/
|
||||
$vars = array('forum_row', 'row', 'subforums_row');
|
||||
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));
|
||||
@@ -1554,6 +1554,23 @@ function phpbb_get_user_rank($user_data, $user_posts)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a user's rank before displaying
|
||||
*
|
||||
* @event core.get_user_rank_after
|
||||
* @var array user_data Array with user's data
|
||||
* @var int user_posts User_posts to change
|
||||
* @var array user_rank_data User rank data
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
|
||||
$vars = array(
|
||||
'user_data',
|
||||
'user_posts',
|
||||
'user_rank_data',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.get_user_rank_after', compact($vars)));
|
||||
|
||||
return $user_rank_data;
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,7 @@ function wrap_img_in_html($src, $title)
|
||||
*/
|
||||
function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
{
|
||||
global $user, $db, $config, $phpbb_root_path;
|
||||
global $user, $db, $config, $phpbb_dispatcher, $phpbb_root_path;
|
||||
|
||||
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
|
||||
|
||||
@@ -149,6 +149,26 @@ function send_file_to_browser($attachment, $upload_dir, $category)
|
||||
// Now send the File Contents to the Browser
|
||||
$size = @filesize($filename);
|
||||
|
||||
/**
|
||||
* Event to alter attachment before it is sent to browser.
|
||||
*
|
||||
* @event core.send_file_to_browser_before
|
||||
* @var array attachment Attachment data
|
||||
* @var string upload_dir Relative path of upload directory
|
||||
* @var int category Attachment category
|
||||
* @var string filename Path to file, including filename
|
||||
* @var int size File size
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'attachment',
|
||||
'upload_dir',
|
||||
'category',
|
||||
'filename',
|
||||
'size',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.send_file_to_browser_before', compact($vars)));
|
||||
|
||||
// To correctly display further errors we need to make sure we are using the correct headers for both (unsetting content-length may not work)
|
||||
|
||||
// Check if headers already sent or not able to get the file contents.
|
||||
|
@@ -2514,7 +2514,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
||||
* @var string url The "Return to topic" URL
|
||||
*
|
||||
* @since 3.1.0-a3
|
||||
* @change 3.1.0-RC3 Added vars mode, subject, username, topic_type,
|
||||
* @changed 3.1.0-RC3 Added vars mode, subject, username, topic_type,
|
||||
* poll, update_message, update_search_index
|
||||
*/
|
||||
$vars = array(
|
||||
|
@@ -276,7 +276,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
|
||||
* @var array cp_data Array of Custom profile fields submited to user_add
|
||||
* @var array sql_ary Array of data to be inserted when a user is added
|
||||
* @since 3.1.0-a1
|
||||
* @change 3.1.0-b5
|
||||
* @changed 3.1.0-b5 Added user_row and cp_data
|
||||
*/
|
||||
$vars = array('user_row', 'cp_data', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
|
||||
@@ -1291,7 +1291,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
*/
|
||||
function user_unban($mode, $ban)
|
||||
{
|
||||
global $db, $user, $auth, $cache;
|
||||
global $db, $user, $auth, $cache, $phpbb_dispatcher;
|
||||
|
||||
// Delete stale bans
|
||||
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
|
||||
@@ -1358,6 +1358,20 @@ function user_unban($mode, $ban)
|
||||
add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this event to perform actions after the unban has been performed
|
||||
*
|
||||
* @event core.user_unban
|
||||
* @var string mode One of the following: user, ip, email
|
||||
* @var array user_ids_ary Array with user_ids
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'mode',
|
||||
'user_ids_ary',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.user_unban', compact($vars)));
|
||||
}
|
||||
|
||||
$cache->destroy('sql', BANLIST_TABLE);
|
||||
|
@@ -458,7 +458,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
|
||||
return;
|
||||
}
|
||||
|
||||
$redirect = request_var('redirect', build_url(array('quickmod')));
|
||||
$redirect = request_var('redirect', "{$phpbb_root_path}mcp.$phpEx?f=$forum_id&i=main&mode=forum_view");
|
||||
|
||||
$s_hidden_fields = build_hidden_fields(array(
|
||||
'i' => 'main',
|
||||
|
@@ -164,7 +164,7 @@ class mcp_main
|
||||
* @var string action Topic quick moderation action name
|
||||
* @var bool quickmod Flag indicating whether MCP is in quick moderation mode
|
||||
* @since 3.1.0-a4
|
||||
* @change 3.1.0-RC4 Added variables: action, quickmod
|
||||
* @changed 3.1.0-RC4 Added variables: action, quickmod
|
||||
*/
|
||||
$vars = array('action', 'quickmod');
|
||||
extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars)));
|
||||
@@ -463,7 +463,7 @@ function change_topic_type($action, $topic_ids)
|
||||
*/
|
||||
function mcp_move_topic($topic_ids)
|
||||
{
|
||||
global $auth, $user, $db, $template, $phpbb_log, $request;
|
||||
global $auth, $user, $db, $template, $phpbb_log, $request, $phpbb_dispatcher;
|
||||
global $phpEx, $phpbb_root_path;
|
||||
|
||||
// Here we limit the operation to one forum only
|
||||
@@ -625,6 +625,18 @@ function mcp_move_topic($topic_ids)
|
||||
'poll_last_vote' => (int) $row['poll_last_vote']
|
||||
);
|
||||
|
||||
/**
|
||||
* Perform actions before shadow topic is created.
|
||||
*
|
||||
* @event core.mcp_main_modify_shadow_sql
|
||||
* @var array shadow SQL array to be used by $db->sql_build_array
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'shadow',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_shadow_sql', compact($vars)));
|
||||
|
||||
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
|
||||
|
||||
// Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts
|
||||
@@ -1281,6 +1293,18 @@ function mcp_fork_topic($topic_ids)
|
||||
'poll_vote_change' => (int) $topic_row['poll_vote_change'],
|
||||
);
|
||||
|
||||
/**
|
||||
* Perform actions before forked topic is created.
|
||||
*
|
||||
* @event core.mcp_main_modify_fork_sql
|
||||
* @var array sql_ary SQL array to be used by $db->sql_build_array
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'sql_ary',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_sql', compact($vars)));
|
||||
|
||||
$db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
|
||||
$new_topic_id = $db->sql_nextid();
|
||||
$new_topic_id_list[$topic_id] = $new_topic_id;
|
||||
|
@@ -1171,7 +1171,7 @@ class parse_message extends bbcode_firstpass
|
||||
* @var bool return Do we return after the event is triggered if $warn_msg is not empty
|
||||
* @var array warn_msg Array of the warning messages
|
||||
* @since 3.1.2-RC1
|
||||
* @change 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
|
||||
* @changed 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
|
||||
*/
|
||||
$message = $this->message;
|
||||
$warn_msg = $this->warn_msg;
|
||||
|
@@ -397,7 +397,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
*/
|
||||
function get_pm_from($folder_id, $folder, $user_id)
|
||||
{
|
||||
global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx;
|
||||
global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx, $phpbb_dispatcher;
|
||||
|
||||
$start = request_var('start', 0);
|
||||
|
||||
@@ -461,7 +461,7 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||
$start = $pagination->validate_start($start, $config['topics_per_page'], $pm_count);
|
||||
$pagination->generate_template_pagination($base_url, 'pagination', 'start', $pm_count, $config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template_vars = array(
|
||||
'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'),
|
||||
@@ -475,7 +475,33 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||
|
||||
'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '',
|
||||
'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')),
|
||||
));
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify template variables before they are assigned
|
||||
*
|
||||
* @event core.ucp_pm_view_folder_get_pm_from_template
|
||||
* @var int folder_id Folder ID
|
||||
* @var array folder Folder data
|
||||
* @var int user_id User ID
|
||||
* @var string base_url Pagination base URL
|
||||
* @var int start Pagination start
|
||||
* @var int pm_count Count of PMs
|
||||
* @var array template_vars Template variables to be assigned
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'folder_id',
|
||||
'folder',
|
||||
'user_id',
|
||||
'base_url',
|
||||
'start',
|
||||
'pm_count',
|
||||
'template_vars',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_template', compact($vars)));
|
||||
|
||||
$template->assign_vars($template_vars);
|
||||
|
||||
// Grab all pm data
|
||||
$rowset = $pm_list = array();
|
||||
@@ -509,15 +535,38 @@ function get_pm_from($folder_id, $folder, $user_id)
|
||||
$sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
|
||||
}
|
||||
|
||||
$sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported
|
||||
FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||
WHERE t.user_id = $user_id
|
||||
$sql_ary = array(
|
||||
'SELECT' => 't.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour, p.message_reported',
|
||||
'FROM' => array(
|
||||
PRIVMSGS_TO_TABLE => 't',
|
||||
PRIVMSGS_TABLE => 'p',
|
||||
USERS_TABLE => 'u',
|
||||
),
|
||||
'WHERE' => "t.user_id = $user_id
|
||||
AND p.author_id = u.user_id
|
||||
AND $folder_sql
|
||||
AND t.msg_id = p.msg_id
|
||||
$sql_limit_time
|
||||
ORDER BY $sql_sort_order";
|
||||
$result = $db->sql_query_limit($sql, $sql_limit, $sql_start);
|
||||
$sql_limit_time",
|
||||
'ORDER_BY' => $sql_sort_order,
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify SQL before it is executed
|
||||
*
|
||||
* @event core.ucp_pm_view_folder_get_pm_from_sql
|
||||
* @var array sql_ary SQL array
|
||||
* @var int sql_limit SQL limit
|
||||
* @var int sql_start SQL start
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'sql_ary',
|
||||
'sql_limit',
|
||||
'sql_start',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_folder_get_pm_from_sql', compact($vars)));
|
||||
|
||||
$result = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_ary), $sql_limit, $sql_start);
|
||||
|
||||
$pm_reported = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
|
@@ -633,10 +633,19 @@ class ucp_profile
|
||||
'user_avatar_height' => $result['avatar_height'],
|
||||
);
|
||||
|
||||
/**
|
||||
* Trigger events on successfull avatar change
|
||||
*
|
||||
* @event core.ucp_profile_avatar_sql
|
||||
* @var array result Array with data to be stored in DB
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array('result');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_avatar_sql', compact($vars)));
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $result) . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'];
|
||||
|
||||
$db->sql_query($sql);
|
||||
|
||||
meta_refresh(3, $this->u_action);
|
||||
|
@@ -45,6 +45,28 @@ class ucp_register
|
||||
$change_lang = request_var('change_lang', '');
|
||||
$user_lang = request_var('lang', $user->lang_name);
|
||||
|
||||
/**
|
||||
* Add UCP register data before they are assigned to the template or submitted
|
||||
*
|
||||
* To assign data to the template, use $template->assign_vars()
|
||||
*
|
||||
* @event core.ucp_register_requests_after
|
||||
* @var bool coppa Is set coppa
|
||||
* @var bool agreed Did user agree to coppa?
|
||||
* @var bool submit Is set post submit?
|
||||
* @var string change_lang Change language request
|
||||
* @var string user_lang User language request
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'coppa',
|
||||
'agreed',
|
||||
'submit',
|
||||
'change_lang',
|
||||
'user_lang',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_register_requests_after', compact($vars)));
|
||||
|
||||
if ($agreed)
|
||||
{
|
||||
add_form_key('ucp_register');
|
||||
|
@@ -30,7 +30,7 @@ class ucp_remind
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $phpbb_root_path, $phpEx;
|
||||
global $db, $user, $auth, $template, $phpbb_container;
|
||||
global $db, $user, $auth, $template, $phpbb_container, $phpbb_dispatcher;
|
||||
|
||||
if (!$config['allow_password_reset'])
|
||||
{
|
||||
@@ -43,10 +43,30 @@ class ucp_remind
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
|
||||
AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
|
||||
$sql_array = array(
|
||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason',
|
||||
'FROM' => array(USERS_TABLE => 'u'),
|
||||
'WHERE' => "user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
|
||||
AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"
|
||||
);
|
||||
|
||||
/**
|
||||
* Change SQL query for fetching user data
|
||||
*
|
||||
* @event core.ucp_remind_modify_select_sql
|
||||
* @var string email User's email from the form
|
||||
* @var string username User's username from the form
|
||||
* @var array sql_array Fully assembled SQL query with keys SELECT, FROM, WHERE
|
||||
* @since 3.1.11-RC1
|
||||
*/
|
||||
$vars = array(
|
||||
'email',
|
||||
'username',
|
||||
'sql_array',
|
||||
);
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_remind_modify_select_sql', compact($vars)));
|
||||
|
||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||
$result = $db->sql_query($sql);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
Reference in New Issue
Block a user