Vergleich contact.php - 1.8.4 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 27Zeile 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']}'";
}
else

{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
else

	{
$user_check = "ipaddress=".$db->escape_binary($session->packedip);

	{
$user_check = "ipaddress=".$db->escape_binary($session->packedip);

	}


	}


	$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'])

	$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'])

Zeile 56Zeile 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 66Zeile 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'])
{
$remaining_time = ($mybb->usergroup['emailfloodtime']*60)-(TIME_NOW-$last_email['dateline']);

if($remaining_time == 1)

	// Users last email was within the flood time, show the error
if($last_email['mid'])
{
$remaining_time = ($mybb->usergroup['emailfloodtime']*60)-(TIME_NOW-$last_email['dateline']);

if($remaining_time == 1)

		{

		{

			$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_second, $mybb->usergroup['emailfloodtime']);
}
elseif($remaining_time < 60)

			$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_second, $mybb->usergroup['emailfloodtime']);
}
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)

			$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_seconds, $mybb->usergroup['emailfloodtime'], $remaining_time);
}
elseif($remaining_time > 60 && $remaining_time < 120)

		{

		{

			$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_minute, $mybb->usergroup['emailfloodtime']);
}
else
{
$remaining_time_minutes = ceil($remaining_time/60);
$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_minutes, $mybb->usergroup['emailfloodtime'], $remaining_time_minutes);

			$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_1_minute, $mybb->usergroup['emailfloodtime']);
}
else
{
$remaining_time_minutes = ceil($remaining_time/60);
$lang->error_emailflooding = $lang->sprintf($lang->error_emailflooding_minutes, $mybb->usergroup['emailfloodtime'], $remaining_time_minutes);

		}

		}


error($lang->error_emailflooding);
}


error($lang->error_emailflooding);
}

Zeile 143Zeile 152
		if(!validate_email_format($mybb->input['email']))
{
$errors[] = $lang->contact_no_email;

		if(!validate_email_format($mybb->input['email']))
{
$errors[] = $lang->contact_no_email;

		}
}

// Should we have a CAPTCHA? Perhaps yes...
if($mybb->settings['captchaimage'])
{
$captcha = new captcha;

		}
}

// 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;


if($captcha->validate_captcha() == false)
{


if($captcha->validate_captcha() == false)
{

Zeile 218Zeile 227
		$message = $lang->sprintf($lang->email_contact, $mybb->input['email'], $user, $session->ipaddress, $mybb->input['message']);

// Email the administrator

		$message = $lang->sprintf($lang->email_contact, $mybb->input['email'], $user, $session->ipaddress, $mybb->input['message']);

// 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 232Zeile 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 241Zeile 250
		}

if($mybb->usergroup['emailfloodtime'] > 0 || (isset($sent_count) && $sent_count + 1 >= $mybb->usergroup['maxemails']))

		}

if($mybb->usergroup['emailfloodtime'] > 0 || (isset($sent_count) && $sent_count + 1 >= $mybb->usergroup['maxemails']))

		{

		{

			redirect('index.php', $lang->contact_success_message, '', true);
}
else

			redirect('index.php', $lang->contact_success_message, '', true);
}
else

Zeile 252Zeile 261
	else
{
$errors = inline_error($errors);

	else
{
$errors = inline_error($errors);

	}
}


	}
}


if(empty($errors))
{
$errors = '';

if(empty($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 269Zeile 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']);