mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-21 16:10:38 +01:00
Merge pull request #4526 from senky/ticket/14239
[ticket/14239] Add core.ucp_remind_modify_select_sql
This commit is contained in:
commit
3c223b3a5d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user