mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Updated the various "users of emailer", fixed issue(!) of jabber using the email address as the uid, blah fixes, blah, blah di blah yakety smackety
git-svn-id: file:///svn/phpbb/trunk@4583 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
90ad130d48
commit
9da094fec2
13 changed files with 217 additions and 193 deletions
|
@ -111,6 +111,7 @@ if (isset($_POST['submit']))
|
|||
|
||||
$messenger->replyto($config['board_email']);
|
||||
$messenger->to($to['email'], $to['name']);
|
||||
$messenger->im($to['jabber'], $to['name']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
|
|
|
@ -132,37 +132,31 @@ else if ($pane == 'left')
|
|||
}
|
||||
elseif ($pane == 'right')
|
||||
{
|
||||
if ((isset($_POST['activate']) || isset($_POST['delete'])) && !empty($_POST['mark']))
|
||||
$activate = (isset($_POST['activate'])) ? true : false;
|
||||
$delete = (isset($_POST['delete'])) ? true : false;
|
||||
$remind = (isset($_POST['remind'])) ? true : false;
|
||||
|
||||
$mark = implode(', ', request_var('mark', 0));
|
||||
|
||||
if (($activate || $delete) && $mark)
|
||||
{
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
if (is_array($_POST['mark']))
|
||||
$sql = ($activate) ? 'UPDATE ' . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!$delete)
|
||||
{
|
||||
$in_sql = '';
|
||||
foreach ($_POST['mark'] as $user_id)
|
||||
{
|
||||
$in_sql .= (($in_sql != '') ? ', ' : '') . intval($user_id);
|
||||
}
|
||||
|
||||
if ($in_sql != '')
|
||||
{
|
||||
$sql = (isset($_POST['activate'])) ? 'UPDATE ' . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($in_sql)" : "DELETE FROM " . USERS_TABLE . " WHERE user_id IN ($in_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!isset($_POST['delete']))
|
||||
{
|
||||
set_config('num_users', $config['num_users'] + sizeof($mark));
|
||||
}
|
||||
|
||||
$log_action = (isset($_POST['activate'])) ? 'log_index_activate' : 'log_index_delete';
|
||||
add_log('admin', $log_action, sizeof($_POST['mark']));
|
||||
}
|
||||
set_config('num_users', $config['num_users'] + $db->affected_rows());
|
||||
}
|
||||
|
||||
$log_action = ($activate) ? 'log_index_activate' : 'log_index_delete';
|
||||
add_log('admin', $log_action, $db->affected_rows());
|
||||
}
|
||||
else if (isset($_POST['remind']))
|
||||
else if ($remind && $mark)
|
||||
{
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
|
@ -174,55 +168,52 @@ elseif ($pane == 'right')
|
|||
trigger_error($user->lang['EMAIL_DISABLED']);
|
||||
}
|
||||
|
||||
if (is_array($_POST['mark']))
|
||||
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_method, user_regdate, user_actkey
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_id IN ($mark)";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$in_sql = '';
|
||||
foreach ($_POST['mark'] as $user_id)
|
||||
// Send the messages
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
$board_url = generate_board_url() . "/ucp.$phpEx?mode=activate";
|
||||
$sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
|
||||
|
||||
$usernames = array();
|
||||
do
|
||||
{
|
||||
$in_sql .= (($in_sql != '') ? ', ' : '') . intval($user_id);
|
||||
}
|
||||
$messenger->template('user_remind_inactive', $row['user_lang']);
|
||||
|
||||
if ($in_sql != '')
|
||||
{
|
||||
$sql = "SELECT user_id, username, user_email, user_lang, user_regdate, user_actkey
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id IN ($in_sql)";
|
||||
$result = $db->sql_query($sql);
|
||||
$messenger->replyto($config['board_email']);
|
||||
$messenger->to($row['user_email'], $row['username']);
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer();
|
||||
|
||||
$board_url = generate_board_url() . '/ucp.' . $phpEx;
|
||||
$usernames = '';
|
||||
|
||||
do
|
||||
{
|
||||
$emailer->use_template('user_remind_inactive', $row['user_lang']);
|
||||
$emailer->to($row['user_email'], $row['username']);
|
||||
$messenger->assign_vars(array(
|
||||
'EMAIL_SIG' => $sig,
|
||||
'USERNAME' => $row['username'],
|
||||
'SITENAME' => $config['sitename'],
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||
'USERNAME' => $row['username'],
|
||||
'SITENAME' => $config['sitename'],
|
||||
'REGISTER_DATE' => $user->format_date($row['user_regdate']),
|
||||
|
||||
'U_ACTIVATE' => $board_url . '&mode=activate&u=' . $row['user_id'] . '&k=' . $row['user_actkey'])
|
||||
);
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
|
||||
);
|
||||
|
||||
$usernames .= (($usernames != '') ? ', ' : '') . $row['username'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
$messenger->send($row['user_notify_type']);
|
||||
|
||||
add_log('admin', 'LOG_INDEX_REMIND', $usernames);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$usernames[] = $row['username'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$messenger->queue->save();
|
||||
unset($email_list);
|
||||
|
||||
add_log('admin', 'LOG_INDEX_REMIND', implode(', ', $usernames));
|
||||
unset($usernames);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
else if (isset($_POST['online']))
|
||||
{
|
||||
|
@ -242,27 +233,27 @@ elseif ($pane == 'right')
|
|||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
$sql = "SELECT COUNT(post_id) AS stat
|
||||
FROM " . POSTS_TABLE . "
|
||||
WHERE post_approved = 1";
|
||||
$sql = 'SELECT COUNT(post_id) AS stat
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_approved = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
set_config('num_posts', $row['stat']);
|
||||
|
||||
$sql = "SELECT COUNT(topic_id) AS stat
|
||||
FROM " . TOPICS_TABLE . "
|
||||
WHERE topic_approved = 1";
|
||||
$sql = 'SELECT COUNT(topic_id) AS stat
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_approved = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
set_config('num_topics', $row['stat']);
|
||||
|
||||
$sql = "SELECT COUNT(user_id) AS stat
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_active = 1";
|
||||
$sql = 'SELECT COUNT(user_id) AS stat
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_active = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
@ -349,7 +340,7 @@ elseif ($pane == 'right')
|
|||
// DB size ... MySQL only
|
||||
// This code is heavily influenced by a similar routine
|
||||
// in phpMyAdmin 2.2.0
|
||||
if (preg_match('/^mysql/', SQL_LAYER))
|
||||
if (preg_match('#^mysql#', SQL_LAYER))
|
||||
{
|
||||
$result = $db->sql_query('SELECT VERSION() AS mysql_version');
|
||||
|
||||
|
@ -396,8 +387,8 @@ elseif ($pane == 'right')
|
|||
}
|
||||
else if (preg_match('#^mssql#', SQL_LAYER))
|
||||
{
|
||||
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||
FROM sysfiles";
|
||||
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||
FROM sysfiles';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$dbsize = ($row = $db->sql_fetchrow($result)) ? intval($row['dbsize']) : $user->lang['NOT_AVAILABLE'];
|
||||
|
|
|
@ -20,8 +20,8 @@ function login_apache(&$username, &$password)
|
|||
|
||||
if ($php_auth_user && $php_auth_pw)
|
||||
{
|
||||
$sql = "SELECT user_id, username, user_password, user_email, user_active
|
||||
FROM " . USERS_TABLE . "
|
||||
$sql = ' user_id, username, user_password, user_passchg, user_email, user_active
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ function login_db(&$username, &$password)
|
|||
{
|
||||
global $db, $config;
|
||||
|
||||
$sql = "SELECT user_id, username, user_password, user_email, user_active
|
||||
FROM " . USERS_TABLE . "
|
||||
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_active
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ function login_ldap(&$username, &$password)
|
|||
{
|
||||
@ldap_close($ldap);
|
||||
|
||||
$sql = "SELECT user_id, username, user_password, user_email, user_active
|
||||
FROM " . USERS_TABLE . "
|
||||
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_active
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
|
|
@ -19,6 +19,18 @@ class messenger
|
|||
|
||||
var $tpl_msg = array();
|
||||
|
||||
function messenger()
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (preg_match('#^[c-z]:\\\#i', getenv('PATH')) && !$config['smtp_delivery'] && phpversion() < '4.3')
|
||||
{
|
||||
// We are running on windows, force delivery to use our smtp functions since php's are broken by default
|
||||
$config['smtp_delivery'] = 1;
|
||||
$config['smtp_host'] = @ini_get('SMTP');
|
||||
}
|
||||
}
|
||||
|
||||
// Resets all the data (address, template file, etc etc to default
|
||||
function reset()
|
||||
{
|
||||
|
@ -47,6 +59,13 @@ class messenger
|
|||
// $this->addresses['bcc'][$pos]['name'] = trim($realname);
|
||||
}
|
||||
|
||||
function im($address, $realname = '')
|
||||
{
|
||||
$pos = sizeof($this->addresses['im']);
|
||||
$this->addresses['im'][$pos]['uid'] = trim($address);
|
||||
$this->addresses['im'][$pos]['name'] = trim($realname);
|
||||
}
|
||||
|
||||
function replyto($address)
|
||||
{
|
||||
$this->replyto = trim($address);
|
||||
|
@ -305,17 +324,12 @@ class messenger
|
|||
}
|
||||
|
||||
$addresses = array();
|
||||
foreach ($this->addresses as $type => $address_ary)
|
||||
foreach ($this->addresses['im'] as $type => $uid_ary)
|
||||
{
|
||||
foreach ($address_ary as $which_ary)
|
||||
{
|
||||
$addresses[] = $which_ary['email'];
|
||||
}
|
||||
$addresses[] = $uid_ary['uid'];
|
||||
}
|
||||
$addresses = array_unique($addresses);
|
||||
|
||||
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
|
||||
|
||||
if (!$use_queue)
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx);
|
||||
|
|
|
@ -23,10 +23,12 @@ class ucp_register extends module
|
|||
trigger_error($user->lang['UCP_REGISTER_DISABLE']);
|
||||
}
|
||||
|
||||
$coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
|
||||
$agreed = (!empty($_POST['agreed'])) ? 1 : 0;
|
||||
$confirm_id = (!empty($_POST['confirm_id'])) ? $_POST['confirm_id'] : 0;
|
||||
$coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
|
||||
$agreed = (!empty($_POST['agreed'])) ? 1 : 0;
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
$confirm_id = (!empty($_POST['confirm_id'])) ? $_POST['confirm_id'] : 0;
|
||||
|
||||
$error = $data = array();
|
||||
|
||||
//
|
||||
|
@ -215,14 +217,22 @@ class ucp_register extends module
|
|||
|
||||
if ($config['email_enable'])
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer();
|
||||
|
||||
$emailer->template($email_template, $lang);
|
||||
$emailer->replyto($config['board_contact']);
|
||||
$emailer->to($email, $username);
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
$messenger = new messenger();
|
||||
|
||||
$messenger->template($email_template, $lang);
|
||||
$messenger->subject($subject);
|
||||
|
||||
$messenger->replyto($user->data['board_contact']);
|
||||
$messenger->to($email, $username);
|
||||
|
||||
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
|
||||
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
|
||||
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
|
||||
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
'WELCOME_MSG' => sprintf($user->lang['Welcome_subject'], $config['sitename']),
|
||||
'USERNAME' => $username,
|
||||
|
@ -234,7 +244,7 @@ class ucp_register extends module
|
|||
|
||||
if ($coppa)
|
||||
{
|
||||
$emailer->assign_vars(array(
|
||||
$messenger->assign_vars(array(
|
||||
'FAX_INFO' => $config['coppa_fax'],
|
||||
'MAIL_INFO' => $config['coppa_mail'],
|
||||
'EMAIL_ADDRESS' => $email,
|
||||
|
@ -242,27 +252,27 @@ class ucp_register extends module
|
|||
);
|
||||
}
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
$messenger->send(NOTIFY_EMAIL);
|
||||
|
||||
// TODO
|
||||
// Email admins with user management permissions
|
||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
|
||||
{
|
||||
$emailer->use_template('admin_activate', $config['default_lang']);
|
||||
$emailer->replyto($config['board_contact']);
|
||||
$emailer->to($config['board_contact']);
|
||||
$messenger->use_template('admin_activate', $config['default_lang']);
|
||||
$messenger->replyto($config['board_contact']);
|
||||
$messenger->to($config['board_contact']);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
$messenger->assign_vars(array(
|
||||
'USERNAME' => $username,
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||
|
||||
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&k=$user_actkey")
|
||||
);
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
$messenger->send(NOTIFY_EMAIL);
|
||||
}
|
||||
|
||||
$messenger->queue->save();
|
||||
}
|
||||
|
||||
if ($config['require_activation'] == USER_ACTIVATION_NONE || !$config['email_enable'])
|
||||
|
|
|
@ -21,68 +21,69 @@ class ucp_remind extends module
|
|||
|
||||
if ($submit)
|
||||
{
|
||||
$username = (!empty($_POST['username'])) ? trim($_POST['username']) : '';
|
||||
$email = (!empty($_POST['email'])) ? trim($_POST['email']) : '';
|
||||
$username = request_var('username', '');
|
||||
$email = request_var('email', '');
|
||||
|
||||
$sql = 'SELECT user_id, username, user_email, user_active, user_lang
|
||||
$sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_active, user_lang
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_email = '" . $db->sql_escape($email) . "'
|
||||
AND username = '" . . $db->sql_escape($username) . "'";
|
||||
if ($result = $db->sql_query($sql))
|
||||
AND username = '" . $db->sql_escape($username) . "'";
|
||||
if (!($result = $db->sql_query($sql)))
|
||||
{
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['user_active'])
|
||||
{
|
||||
trigger_error($lang['ACCOUNT_INACTIVE']);
|
||||
}
|
||||
|
||||
$server_url = generate_board_url();
|
||||
$username = $row['username'];
|
||||
|
||||
$user_actkey = gen_rand_string(10);
|
||||
$key_len = 54 - strlen($server_url);
|
||||
$key_len = ($str_len > 6) ? $key_len : 6;
|
||||
$user_actkey = substr($user_actkey, 0, $key_len);
|
||||
$user_password = gen_rand_string(false);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_newpasswd = '" . md5($user_password) . "', user_actkey = '$user_actkey'
|
||||
WHERE user_id = " . $row['user_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
$emailer = new emailer();
|
||||
|
||||
$emailer->use_template('user_activate_passwd', $row['user_lang']);
|
||||
$emailer->to($row['user_email']);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
'USERNAME' => $username,
|
||||
'PASSWORD' => $user_password,
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||
|
||||
'U_ACTIVATE' => $server_url . "/ucp.$phpEx?mode=activate&k=$user_actkey")
|
||||
);
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
meta_refresh(3, "index.$phpEx$SID");
|
||||
|
||||
$message = $lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>');
|
||||
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($lang['NO_EMAIL']);
|
||||
}
|
||||
trigger_error($user->lang['NO_USER']);
|
||||
}
|
||||
else
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error('Could not obtain user information for sendpassword', E_USER_ERROR);
|
||||
trigger_error($lang['NO_EMAIL']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$row['user_active'])
|
||||
{
|
||||
trigger_error($lang['ACCOUNT_INACTIVE']);
|
||||
}
|
||||
|
||||
$server_url = generate_board_url();
|
||||
$username = $row['username'];
|
||||
|
||||
$key_len = 54 - strlen($server_url);
|
||||
$key_len = ($str_len > 6) ? $key_len : 6;
|
||||
$user_actkey = substr(gen_rand_string(10), 0, $key_len);
|
||||
$user_password = gen_rand_string(8);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_newpasswd = '" . $db->sql_escape(md5($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
|
||||
WHERE user_id = " . $row['user_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
$messenger->template('user_activate_passwd', $row['user_lang']);
|
||||
$messenger->subject($subject);
|
||||
|
||||
$messenger->replyto($user->data['user_email']);
|
||||
$messenger->to($row['user_email'], $row['username']);
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
'USERNAME' => $username,
|
||||
'PASSWORD' => $user_password,
|
||||
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
|
||||
|
||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&k=$user_actkey")
|
||||
);
|
||||
|
||||
$messenger->send($row['user_notify_type']);
|
||||
$messenger->queue->save();
|
||||
|
||||
meta_refresh(3, "index.$phpEx$SID");
|
||||
|
||||
$message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -93,6 +94,8 @@ class ucp_remind extends module
|
|||
'USERNAME' => $username,
|
||||
'EMAIL' => $email)
|
||||
);
|
||||
|
||||
$this->display($user->lang['UCP_REMIND'], 'ucp_remind.html');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -878,6 +878,14 @@ $lang += array(
|
|||
'Wrong_activation' => 'The activation key you supplied does not match any in the database',
|
||||
);
|
||||
|
||||
// ucp_remind
|
||||
$lang += array(
|
||||
'SEND_PASSWORD' => 'Send password',
|
||||
'EMAIL_REMIND' => 'This must be the email address you supplied when registering.',
|
||||
|
||||
'PASSWORD_UPDATED' => 'Your password has been sent successfully to your original email address.',
|
||||
);
|
||||
|
||||
// ucp_prefs
|
||||
$lang += array(
|
||||
'UCP_PREFS' => 'Preferences',
|
||||
|
|
|
@ -140,7 +140,7 @@ switch ($mode)
|
|||
$messenger->subject($subject);
|
||||
|
||||
$messenger->replyto($user->data['user_email']);
|
||||
$messenger->to($row['user_jabber'], $row['username']);
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
|
@ -407,7 +407,7 @@ switch ($mode)
|
|||
if (!$topic_id)
|
||||
{
|
||||
// Get the appropriate username, etc.
|
||||
$sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber
|
||||
$sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_method
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_id = $user_id
|
||||
AND user_active = 1";
|
||||
|
@ -487,9 +487,9 @@ switch ($mode)
|
|||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
||||
|
||||
$email_tpl = (!$topic_id) ? 'profile_send_email' : 'email_notify';
|
||||
$email_tpl = (!$topic_id) ? 'profile_send_email' : 'email_notify';
|
||||
$email_lang = (!$topic_id) ? $row['user_lang'] : $email_lang;
|
||||
$email = (!$topic_id) ? $row['user_email'] : $email;
|
||||
$email = (!$topic_id) ? $row['user_email'] : $email;
|
||||
|
||||
$messenger = new messenger();
|
||||
|
||||
|
@ -499,6 +499,11 @@ switch ($mode)
|
|||
$messenger->replyto($user->data['user_email']);
|
||||
$messenger->to($email, $row['username']);
|
||||
|
||||
if (!$topic_id)
|
||||
{
|
||||
$messenger->im($row['user_jabber'], $row['username']);
|
||||
}
|
||||
|
||||
if ($cc)
|
||||
{
|
||||
$messenger->cc($user->data['user_email'], $user->data['username']);
|
||||
|
@ -520,7 +525,7 @@ switch ($mode)
|
|||
'U_TOPIC' => ($topic_id) ? generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id" : '')
|
||||
);
|
||||
|
||||
$messenger->send(NOTIFY_EMAIL);
|
||||
$messenger->send($row['user_notify_method']);
|
||||
$messenger->queue->save();
|
||||
|
||||
meta_refresh(3, "index.$phpEx$SID");
|
||||
|
|
|
@ -1246,7 +1246,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
|||
|
||||
$msg_list_ary[$row['template']][$pos]['method'] = $row['method'];
|
||||
$msg_list_ary[$row['template']][$pos]['email'] = $row['user_email'];
|
||||
$msg_list_ary[$row['template']][$pos]['user_jabber'] = $row['user_jabber'];
|
||||
$msg_list_ary[$row['template']][$pos]['jabber'] = $row['user_jabber'];
|
||||
$msg_list_ary[$row['template']][$pos]['name'] = $row['username'];
|
||||
$msg_list_ary[$row['template']][$pos]['lang'] = $row['user_lang'];
|
||||
}
|
||||
|
@ -1260,6 +1260,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
|
|||
|
||||
$messenger->replyto($config['board_email']);
|
||||
$messenger->to($addr['email'], $addr['name']);
|
||||
$messenger->im($addr['jabber'], $addr['name']);
|
||||
|
||||
$messenger->assign_vars(array(
|
||||
'EMAIL_SIG' => $email_sig,
|
||||
|
|
|
@ -1,35 +1,26 @@
|
|||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<form action="{S_PROFILE_ACTION}" method="post">
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
|
||||
</tr>
|
||||
<form action="{S_PROFILE_ACTION}" method="post"><table width="50%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td class="nav" align="left"><a href="{U_INDEX}">{L_INDEX}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
|
||||
|
||||
<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2" height="28" valign="middle">{L_SEND_PASSWORD}</th>
|
||||
<th colspan="2">{L_SEND_PASSWORD}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
|
||||
<td class="row1" width="38%"><b class="genmed">{L_USERNAME}: </b></td>
|
||||
<td class="row2"><input type="text" class="post" name="username" size="25" maxlength="60" value="{USERNAME}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="38%"><span class="gen">{L_USERNAME}: *</span></td>
|
||||
<td class="row2">
|
||||
<input type="text" class="post" style="width: 200px" name="username" size="25" maxlength="40" value="{USERNAME}" />
|
||||
</td>
|
||||
<td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}: </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
|
||||
<td class="row2"><input type="text" class="post" name="email" size="25" maxlength="255" value="{EMAIL}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><span class="gen">{L_EMAIL_ADDRESS}: *</span></td>
|
||||
<td class="row2">
|
||||
<input type="text" class="post" style="width: 200px" name="email" size="25" maxlength="255" value="{EMAIL}" />
|
||||
</td>
|
||||
<td class="cat" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}
|
||||
<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" />
|
||||
|
||||
<input type="reset" value="{L_RESET}" name="reset" class="btnlite" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</table></form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
|
@ -249,7 +249,7 @@ switch ($mode)
|
|||
$ucp->module->ucp_activate();
|
||||
break;
|
||||
|
||||
case 'remind':
|
||||
case 'sendpassword':
|
||||
$ucp->load('ucp', 'remind');
|
||||
$ucp->module->ucp_remind();
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue