Zeile 11 | Zeile 11 |
---|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'contact.php');
|
define("IN_MYBB", 1); define('THIS_SCRIPT', 'contact.php');
|
$templatelist = "contact,post_captcha";
| $templatelist = "contact,post_captcha,post_captcha_recaptcha,post_captcha_nocaptcha,post_captcha_ayah";
|
require_once "./global.php"; require_once MYBB_ROOT.'inc/class_captcha.php';
| require_once "./global.php"; require_once MYBB_ROOT.'inc/class_captcha.php';
|
Zeile 27 | Zeile 27 |
---|
if($mybb->settings['contact'] != 1 || (!$mybb->user['uid'] && $mybb->settings['contact_guests'] == 1)) { error_no_permission();
|
if($mybb->settings['contact'] != 1 || (!$mybb->user['uid'] && $mybb->settings['contact_guests'] == 1)) { error_no_permission();
|
| }
if($mybb->settings['contactemail']) { $contactemail = $mybb->settings['contactemail']; } else { $contactemail = $mybb->settings['adminemail'];
|
}
// Check group limits if($mybb->usergroup['maxemails'] > 0)
|
}
// Check group limits if($mybb->usergroup['maxemails'] > 0)
|
{ if($mybb->user['uid'] > 0) { $user_check = "fromuid='{$mybb->user['uid']}'"; }
| { if($mybb->user['uid'] > 0) { $user_check = "fromuid='{$mybb->user['uid']}'"; }
|
else { $user_check = "ipaddress=".$db->escape_binary($session->packedip);
|
else { $user_check = "ipaddress=".$db->escape_binary($session->packedip);
|
}
| }
|
|
|
$query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "{$user_check} AND dateline >= '".(TIME_NOW - (60*60*24))."'");
| $query = $db->simple_select("maillogs", "COUNT(mid) AS sent_count", "{$user_check} AND dateline >= ".(TIME_NOW - (60*60*24)));
|
$sent_count = $db->fetch_field($query, "sent_count"); if($sent_count >= $mybb->usergroup['maxemails']) {
| $sent_count = $db->fetch_field($query, "sent_count"); if($sent_count >= $mybb->usergroup['maxemails']) {
|
Zeile 56 | Zeile 65 |
---|
if($mybb->user['uid'] > 0) { $user_check = "fromuid='{$mybb->user['uid']}'";
|
if($mybb->user['uid'] > 0) { $user_check = "fromuid='{$mybb->user['uid']}'";
|
} else
| } else
|
{ $user_check = "ipaddress=".$db->escape_binary($session->packedip); }
| { $user_check = "ipaddress=".$db->escape_binary($session->packedip); }
|
Zeile 66 | Zeile 75 |
---|
$query = $db->simple_select("maillogs", "mid, dateline", "{$user_check} AND dateline > '{$timecut}'", array('order_by' => "dateline", 'order_dir' => "DESC")); $last_email = $db->fetch_array($query);
|
$query = $db->simple_select("maillogs", "mid, dateline", "{$user_check} AND dateline > '{$timecut}'", array('order_by' => "dateline", 'order_dir' => "DESC")); $last_email = $db->fetch_array($query);
|
|
|
// Users last email was within the flood time, show the error if($last_email['mid']) {
| // Users last email was within the flood time, show the error if($last_email['mid']) {
|
Zeile 79 | Zeile 88 |
---|
elseif($remaining_time < 60) { $lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_seconds, $mybb->usergroup['emailfloodtime'], $remaining_time);
|
elseif($remaining_time < 60) { $lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_seconds, $mybb->usergroup['emailfloodtime'], $remaining_time);
|
}
| }
|
elseif($remaining_time > 60 && $remaining_time < 120)
|
elseif($remaining_time > 60 && $remaining_time < 120)
|
{
| {
|
$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_minute, $mybb->usergroup['emailfloodtime']);
|
$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_minute, $mybb->usergroup['emailfloodtime']);
|
} else {
| } else {
|
$remaining_time_minutes = ceil($remaining_time/60); $lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_minutes, $mybb->usergroup['emailfloodtime'], $remaining_time_minutes); }
| $remaining_time_minutes = ceil($remaining_time/60); $lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_minutes, $mybb->usergroup['emailfloodtime'], $remaining_time_minutes); }
|
Zeile 141 | Zeile 150 |
---|
{ // Validate email if(!validate_email_format($mybb->input['email']))
|
{ // Validate email if(!validate_email_format($mybb->input['email']))
|
{
| {
|
$errors[] = $lang->contact_no_email; } }
|
$errors[] = $lang->contact_no_email; } }
|
// Should we have a CAPTCHA? Perhaps yes... if($mybb->settings['captchaimage'])
| // Should we have a CAPTCHA? Perhaps yes, but only for guests like in other pages... if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{ $captcha = new captcha;
| { $captcha = new captcha;
|
Zeile 177 | Zeile 186 |
---|
try { if($stop_forum_spam_checker->is_user_a_spammer('', $mybb->input['email'], get_ip())) {
|
try { if($stop_forum_spam_checker->is_user_a_spammer('', $mybb->input['email'], get_ip())) {
|
$errors[] = $lang->error_stop_forum_spam_spammer;
| $errors[] = $lang->sprintf($lang->error_stop_forum_spam_spammer, $stop_forum_spam_checker->getErrorText(array( 'stopforumspam_check_emails', 'stopforumspam_check_ips')));
|
} } catch (Exception $e)
| } } catch (Exception $e)
|
Zeile 199 | Zeile 211 |
---|
$parser_options = array( 'filter_badwords' => 1
|
$parser_options = array( 'filter_badwords' => 1
|
);
| );
|
$mybb->input['subject'] = $parser->parse_message($mybb->input['subject'], $parser_options); $mybb->input['message'] = $parser->parse_message($mybb->input['message'], $parser_options); }
| $mybb->input['subject'] = $parser->parse_message($mybb->input['subject'], $parser_options); $mybb->input['message'] = $parser->parse_message($mybb->input['message'], $parser_options); }
|
Zeile 212 | Zeile 224 |
---|
}
$subject = $lang->sprintf($lang->email_contact_subject, $mybb->input['subject']);
|
}
$subject = $lang->sprintf($lang->email_contact_subject, $mybb->input['subject']);
|
$message = $lang->sprintf($lang->email_contact, $user, $session->ipaddress, $mybb->input['message']);
| $message = $lang->sprintf($lang->email_contact, $mybb->input['email'], $user, $session->ipaddress, $mybb->input['message']);
|
// Email the administrator
|
// Email the administrator
|
my_mail($mybb->settings['adminemail'], $subject, $message, $mybb->input['email']);
| my_mail($contactemail, $subject, $message, $mybb->input['email']);
|
$plugins->run_hooks('contact_do_end');
| $plugins->run_hooks('contact_do_end');
|
Zeile 229 | Zeile 241 |
---|
"fromuid" => $mybb->user['uid'], "fromemail" => $db->escape_string($mybb->input['email']), "touid" => 0,
|
"fromuid" => $mybb->user['uid'], "fromemail" => $db->escape_string($mybb->input['email']), "touid" => 0,
|
"toemail" => $db->escape_string($mybb->settings['adminemail']),
| "toemail" => $db->escape_string($contactemail),
|
"tid" => 0, "ipaddress" => $db->escape_binary($session->packedip), "type" => 3
| "tid" => 0, "ipaddress" => $db->escape_binary($session->packedip), "type" => 3
|
Zeile 237 | Zeile 249 |
---|
$db->insert_query("maillogs", $log_entry); }
|
$db->insert_query("maillogs", $log_entry); }
|
// Redirect redirect('contact.php', $lang->contact_success_message);
| if($mybb->usergroup['emailfloodtime'] > 0 || (isset($sent_count) && $sent_count + 1 >= $mybb->usergroup['maxemails'])) { redirect('index.php', $lang->contact_success_message, '', true); } else { redirect('contact.php', $lang->contact_success_message, '', true); }
|
} else
|
} else
|
{
| {
|
$errors = inline_error($errors);
|
$errors = inline_error($errors);
|
} }
| } }
|
if(empty($errors))
|
if(empty($errors))
|
{
| {
|
$errors = ''; }
|
$errors = ''; }
|
|
|
// Generate CAPTCHA?
|
// Generate CAPTCHA?
|
if($mybb->settings['captchaimage'])
| $captcha = '';
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
|
{ $post_captcha = new captcha(true, "post_captcha");
| { $post_captcha = new captcha(true, "post_captcha");
|
Zeile 260 | Zeile 280 |
---|
{ $captcha = $post_captcha->html; }
|
{ $captcha = $post_captcha->html; }
|
} else { $captcha = '';
| |
}
$mybb->input['subject'] = htmlspecialchars_uni($mybb->input['subject']);
| }
$mybb->input['subject'] = htmlspecialchars_uni($mybb->input['subject']);
|