Guess ...

git-svn-id: file:///svn/phpbb/trunk@2827 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-08-06 15:40:25 +00:00
parent 67182dac72
commit 685c8b0669
4 changed files with 54 additions and 60 deletions

View file

@ -8,7 +8,6 @@
*
* $Id$
*
*
***************************************************************************/
/***************************************************************************
@ -18,7 +17,6 @@
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
@ -27,28 +25,28 @@ if ( !defined('IN_PHPBB') )
exit;
}
if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
if ( !empty($HTTP_GET_VARS['u']) || !empty($HTTP_POST_VARS['u']) )
{
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
$user_id = ( !empty($HTTP_GET_VARS['u']) ) ? intval($HTTP_GET_VARS['u']) : intval($HTTP_POST_VARS['u']);
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
message_die(MESSAGE, $lang['No_user_specified']);
}
if ( $userdata['user_id'] == ANONYMOUS )
{
header('Location: ' . "login.$phpEx$SID&redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id");
header('Location: ' . "login.$phpEx$SID&redirect=profile.$phpEx&mode=email&u=$user_id");
exit;
}
$sql = "SELECT username, user_email, user_viewemail, user_lang
FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
if ( $result = $db->sql_query($sql) )
{
$row = $db->sql_fetchrow($result);
$result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) )
{
$username = $row['username'];
$user_email = $row['user_email'];
$user_lang = $row['user_lang'];
@ -57,7 +55,7 @@ if ( $result = $db->sql_query($sql) )
{
if ( time() - $userdata['user_emailtime'] < $board_config['flood_interval'] )
{
message_die(GENERAL_MESSAGE, $lang['Flood_email_limit']);
message_die(MESSAGE, $lang['Flood_email_limit']);
}
if ( isset($HTTP_POST_VARS['submit']) )
@ -89,8 +87,8 @@ if ( $result = $db->sql_query($sql) )
$sql = "UPDATE " . USERS_TABLE . "
SET user_emailtime = " . time() . "
WHERE user_id = " . $userdata['user_id'];
if ( $result = $db->sql_query($sql) )
{
$result = $db->sql_query($sql);
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
@ -126,26 +124,21 @@ if ( $result = $db->sql_query($sql) )
$message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
else
{
message_die(GENERAL_ERROR, 'Could not update last email time', '', __LINE__, __FILE__, $sql);
}
message_die(MESSAGE, $message);
}
}
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'profile_send_email.tpl')
'body' => 'profile_send_email.html')
);
make_jumpbox('viewforum.'.$phpEx);
if ( $error )
{
$template->set_filenames(array(
'reg_header' => 'error_body.tpl')
'reg_header' => 'error_body.html')
);
$template->assign_vars(array(
'ERROR_MESSAGE' => $error_msg)
@ -156,7 +149,7 @@ if ( $result = $db->sql_query($sql) )
$template->assign_vars(array(
'USERNAME' => $username,
'S_POST_ACTION' => "profile.$phpEx$SID&amp;mode=email&amp;" . POST_USERS_URL . "=$user_id",
'S_POST_ACTION' => "profile.$phpEx$SID&amp;mode=email&amp;u=$user_id",
'L_SEND_EMAIL_MSG' => $lang['Send_email_msg'],
'L_RECIPIENT' => $lang['Recipient'],
@ -171,18 +164,16 @@ if ( $result = $db->sql_query($sql) )
'L_SEND_EMAIL' => $lang['Send_email'])
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{
message_die(GENERAL_MESSAGE, $lang['User_prevent_email']);
message_die(MESSAGE, $lang['User_prevent_email']);
}
}
else
{
message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
message_die(MESSAGE, $lang['User_not_exist']);
}
?>

View file

@ -115,7 +115,7 @@ else
if ( $profiledata['user_viewemail'] || $acl->get_acl_admin() )
{
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $user_id : 'mailto:' . $profiledata['user_email'];
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $profiledata['user_id'] : 'mailto:' . $profiledata['user_email'];
$email_img = '<a href="' . $email_uri . '">' . create_img($theme['icon_email'], $lang['Send_email']) . '</a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';

View file

@ -1,3 +1,4 @@
<!-- INCLUDE overall_header.html -->
<script language="JavaScript" type="text/javascript">
<!--
@ -72,3 +73,5 @@ function checkForm(formObj) {
<td valign="top" align="right">{JUMPBOX}</td>
</tr>
</table>
<!-- INCLUDE overall_footer.html -->

View file

@ -5,7 +5,7 @@
<!--
function insert_user(user)
{
opener.document.forms[0].{S_FIELD_NAME}.value = ( opener.document.forms[0].{S_FIELD_NAME}.value.length && opener.document.forms[0].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms[0].{S_FIELD_NAME}.value + "\n" + user : user;
opener.document.forms[{S_FORM_NAME}].{S_FIELD_NAME}.value = ( opener.document.forms[{S_FORM_NAME}].{S_FIELD_NAME}.value.length && opener.document.forms[{S_FORM_NAME}].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms[{S_FORM_NAME}].{S_FIELD_NAME}.value + "\n" + user : user;
}
function insert_marked(users)