Vergleich member.php - 1.8.0 - 1.8.5

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 15Zeile 15

$nosession['avatar'] = 1;
$templatelist = "member_register,member_register_hiddencaptcha,member_coppa_form,member_register_coppa,member_register_agreement_coppa,member_register_agreement,usercp_options_tppselect,usercp_options_pppselect,member_register_referrer,member_register_customfield,member_register_requiredfields";


$nosession['avatar'] = 1;
$templatelist = "member_register,member_register_hiddencaptcha,member_coppa_form,member_register_coppa,member_register_agreement_coppa,member_register_agreement,usercp_options_tppselect,usercp_options_pppselect,member_register_referrer,member_register_customfield,member_register_requiredfields";

$templatelist .= ",member_resetpassword,member_loggedin_notice,member_profile_away,member_emailuser,member_register_regimage,member_register_regimage_recaptcha,member_register_regimage_ayah,post_captcha_hidden,post_captcha,post_captcha_recaptcha,post_captcha_ayah,member_profile_addremove,member_emailuser_guest";

$templatelist .= ",member_resetpassword,member_loggedin_notice,member_profile_away,member_emailuser,member_register_regimage,member_register_regimage_recaptcha,member_register_regimage_nocaptcha,member_register_regimage_ayah,post_captcha_hidden,post_captcha,post_captcha_recaptcha,post_captcha_ayah,member_profile_addremove,member_emailuser_guest";

$templatelist .= ",member_profile_email,member_profile_offline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_customfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,member_profile_online,member_viewnotes";
$templatelist .= ",member_profile_signature,member_profile_avatar,member_profile_groupimage,member_profile_referrals,member_profile_website,member_profile_reputation_vote,member_activate,member_resendactivation,member_lostpw,member_register_additionalfields,member_register_password,usercp_options_pppselect_option";
$templatelist .= ",member_profile_modoptions_manageuser,member_profile_modoptions_editprofile,member_profile_modoptions_banuser,member_profile_modoptions_viewnotes,member_profile_modoptions,member_profile_modoptions_editnotes,member_profile_modoptions_purgespammer,postbit_reputation_formatted,postbit_warninglevel_formatted";
$templatelist .= ",usercp_profile_profilefields_select_option,usercp_profile_profilefields_multiselect,usercp_profile_profilefields_select,usercp_profile_profilefields_textarea,usercp_profile_profilefields_radio,usercp_profile_profilefields_checkbox,usercp_profile_profilefields_text,usercp_options_tppselect_option";
$templatelist .= ",member_register_question,member_register_question_refresh,usercp_options_timezone,usercp_options_timezone_option,usercp_options_language_option,member_register_language,member_profile_userstar,member_profile_customfields_field_multi_item,member_profile_customfields_field_multi,member_register_day";

$templatelist .= ",member_profile_email,member_profile_offline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_customfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,member_profile_online,member_viewnotes";
$templatelist .= ",member_profile_signature,member_profile_avatar,member_profile_groupimage,member_profile_referrals,member_profile_website,member_profile_reputation_vote,member_activate,member_resendactivation,member_lostpw,member_register_additionalfields,member_register_password,usercp_options_pppselect_option";
$templatelist .= ",member_profile_modoptions_manageuser,member_profile_modoptions_editprofile,member_profile_modoptions_banuser,member_profile_modoptions_viewnotes,member_profile_modoptions,member_profile_modoptions_editnotes,member_profile_modoptions_purgespammer,postbit_reputation_formatted,postbit_warninglevel_formatted";
$templatelist .= ",usercp_profile_profilefields_select_option,usercp_profile_profilefields_multiselect,usercp_profile_profilefields_select,usercp_profile_profilefields_textarea,usercp_profile_profilefields_radio,usercp_profile_profilefields_checkbox,usercp_profile_profilefields_text,usercp_options_tppselect_option";
$templatelist .= ",member_register_question,member_register_question_refresh,usercp_options_timezone,usercp_options_timezone_option,usercp_options_language_option,member_register_language,member_profile_userstar,member_profile_customfields_field_multi_item,member_profile_customfields_field_multi,member_register_day";

$templatelist .= ",member_profile_contact_fields_aim,member_profile_contact_fields_google,member_profile_contact_fields_icq,member_profile_contact_fields_skype,member_profile_contact_fields_yahoo,member_profile_pm,member_profile_contact_details,member_emailuser_hidden";

$templatelist .= ",member_profile_contact_fields_aim,member_profile_contact_fields_google,member_profile_contact_fields_icq,member_profile_contact_fields_skype,member_profile_contact_fields_yahoo,member_profile_pm,member_profile_contact_details,member_profile_banned";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";

Zeile 96Zeile 96
		if(isset($mybb->input['regtime']))
{
// Check how long it took for this person to register

		if(isset($mybb->input['regtime']))
{
// Check how long it took for this person to register

			$timetook = TIME_NOW - $mybb->get_input('regtime', 1);

			$timetook = TIME_NOW - $mybb->get_input('regtime', MyBB::INPUT_INT);


// See if they registered faster than normal
if($timetook < $mybb->settings['regtime'])


// See if they registered faster than normal
if($timetook < $mybb->settings['regtime'])

Zeile 129Zeile 129
		$mybb->input['password2'] = $mybb->input['password'];
}


		$mybb->input['password2'] = $mybb->input['password'];
}


	if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->settings['regtype'] == "both" || $mybb->get_input('coppa', 1) == 1)

	if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->settings['regtype'] == "both" || $mybb->get_input('coppa', MyBB::INPUT_INT) == 1)

	{
$usergroup = 5;
}

	{
$usergroup = 5;
}

Zeile 159Zeile 159
		"referrer" => $mybb->get_input('referrername'),
"timezone" => $mybb->get_input('timezoneoffset'),
"language" => $mybb->get_input('language'),

		"referrer" => $mybb->get_input('referrername'),
"timezone" => $mybb->get_input('timezoneoffset'),
"language" => $mybb->get_input('language'),

		"profile_fields" => $mybb->get_input('profile_fields', 2),

		"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY),

		"regip" => $session->packedip,
"coppa_user" => $coppauser,
"regcheck1" => $mybb->get_input('regcheck1'),

		"regip" => $session->packedip,
"coppa_user" => $coppauser,
"regcheck1" => $mybb->get_input('regcheck1'),

Zeile 179Zeile 179
	}

$user['options'] = array(

	}

$user['options'] = array(

		"allownotices" => $mybb->get_input('allownotices', 1),
"hideemail" => $mybb->get_input('hideemail', 1),
"subscriptionmethod" => $mybb->get_input('subscriptionmethod', 1),
"receivepms" => $mybb->get_input('receivepms', 1),
"pmnotice" => $mybb->get_input('pmnotice', 1),
"pmnotify" => $mybb->get_input('pmnotify', 1),
"invisible" => $mybb->get_input('invisible', 1),

		"allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),
"hideemail" => $mybb->get_input('hideemail', MyBB::INPUT_INT),
"subscriptionmethod" => $mybb->get_input('subscriptionmethod', MyBB::INPUT_INT),
"receivepms" => $mybb->get_input('receivepms', MyBB::INPUT_INT),
"pmnotice" => $mybb->get_input('pmnotice', MyBB::INPUT_INT),
"pmnotify" => $mybb->get_input('pmnotify', MyBB::INPUT_INT),
"invisible" => $mybb->get_input('invisible', MyBB::INPUT_INT),

		"dstcorrection" => $mybb->get_input('dstcorrection')
);


		"dstcorrection" => $mybb->get_input('dstcorrection')
);


Zeile 214Zeile 214
		try {
if($stop_forum_spam_checker->is_user_a_spammer($user['username'], $user['email'], get_ip()))
{

		try {
if($stop_forum_spam_checker->is_user_a_spammer($user['username'], $user['email'], get_ip()))
{

				error($lang->error_stop_forum_spam_spammer);






				error($lang->sprintf($lang->error_stop_forum_spam_spammer,
$stop_forum_spam_checker->getErrorText(array(
'stopforumspam_check_usernames',
'stopforumspam_check_emails',
'stopforumspam_check_ips'
))));

			}
}
catch (Exception $e)

			}
}
catch (Exception $e)

Zeile 244Zeile 249
	// If we have a security question, check to see if answer is correct
if($mybb->settings['securityquestion'])
{

	// If we have a security question, check to see if answer is correct
if($mybb->settings['securityquestion'])
{

		$question_id = $mybb->get_input('question_id');

		$question_id = $db->escape_string($mybb->get_input('question_id'));

		$answer = $db->escape_string($mybb->get_input('answer'));

$query = $db->query("

		$answer = $db->escape_string($mybb->get_input('answer'));

$query = $db->query("

Zeile 298Zeile 303
		$allownoticescheck = $hideemailcheck = $no_auto_subscribe_selected = $instant_email_subscribe_selected = $instant_pm_subscribe_selected = $no_subscribe_selected = '';
$receivepmscheck = $pmnoticecheck = $pmnotifycheck = $invisiblecheck = $dst_auto_selected = $dst_enabled_selected = $dst_disabled_selected = '';


		$allownoticescheck = $hideemailcheck = $no_auto_subscribe_selected = $instant_email_subscribe_selected = $instant_pm_subscribe_selected = $no_subscribe_selected = '';
$receivepmscheck = $pmnoticecheck = $pmnotifycheck = $invisiblecheck = $dst_auto_selected = $dst_enabled_selected = $dst_disabled_selected = '';


		if($mybb->get_input('allownotices', 1) == 1)

		if($mybb->get_input('allownotices', MyBB::INPUT_INT) == 1)

		{
$allownoticescheck = "checked=\"checked\"";
}


		{
$allownoticescheck = "checked=\"checked\"";
}


		if($mybb->get_input('hideemail', 1) == 1)

		if($mybb->get_input('hideemail', MyBB::INPUT_INT) == 1)

		{
$hideemailcheck = "checked=\"checked\"";
}


		{
$hideemailcheck = "checked=\"checked\"";
}


		if($mybb->get_input('subscriptionmethod', 1) == 1)

		if($mybb->get_input('subscriptionmethod', MyBB::INPUT_INT) == 1)

		{
$no_subscribe_selected = "selected=\"selected\"";
}

		{
$no_subscribe_selected = "selected=\"selected\"";
}

		else if($mybb->get_input('subscriptionmethod', 1) == 2)

		else if($mybb->get_input('subscriptionmethod', MyBB::INPUT_INT) == 2)

		{
$instant_email_subscribe_selected = "selected=\"selected\"";
}

		{
$instant_email_subscribe_selected = "selected=\"selected\"";
}

		else if($mybb->get_input('subscriptionmethod', 1) == 3)

		else if($mybb->get_input('subscriptionmethod', MyBB::INPUT_INT) == 3)

		{
$instant_pm_subscribe_selected = "selected=\"selected\"";
}

		{
$instant_pm_subscribe_selected = "selected=\"selected\"";
}

Zeile 325Zeile 330
			$no_auto_subscribe_selected = "selected=\"selected\"";
}


			$no_auto_subscribe_selected = "selected=\"selected\"";
}


		if($mybb->get_input('receivepms', 1) == 1)

		if($mybb->get_input('receivepms', MyBB::INPUT_INT) == 1)

		{
$receivepmscheck = "checked=\"checked\"";
}


		{
$receivepmscheck = "checked=\"checked\"";
}


		if($mybb->get_input('pmnotice', 1) == 1)

		if($mybb->get_input('pmnotice', MyBB::INPUT_INT) == 1)

		{
$pmnoticecheck = " checked=\"checked\"";
}


		{
$pmnoticecheck = " checked=\"checked\"";
}


		if($mybb->get_input('pmnotify', 1) == 1)

		if($mybb->get_input('pmnotify', MyBB::INPUT_INT) == 1)

		{
$pmnotifycheck = "checked=\"checked\"";
}


		{
$pmnotifycheck = "checked=\"checked\"";
}


		if($mybb->get_input('invisible', 1) == 1)

		if($mybb->get_input('invisible', MyBB::INPUT_INT) == 1)

		{
$invisiblecheck = "checked=\"checked\"";
}


		{
$invisiblecheck = "checked=\"checked\"";
}


		if($mybb->get_input('dstcorrection', 1) == 2)

		if($mybb->get_input('dstcorrection', MyBB::INPUT_INT) == 2)

		{
$dst_auto_selected = "selected=\"selected\"";
}

		{
$dst_auto_selected = "selected=\"selected\"";
}

		else if($mybb->get_input('dstcorrection', 1) == 1)

		else if($mybb->get_input('dstcorrection', MyBB::INPUT_INT) == 1)

		{
$dst_enabled_selected = "selected=\"selected\"";
}

		{
$dst_enabled_selected = "selected=\"selected\"";
}

Zeile 678Zeile 683
	{
$bdaysel = $bday2blank = '';
}

	{
$bdaysel = $bday2blank = '';
}

	$mybb->input['bday1'] = $mybb->get_input('bday1', 1);

	$mybb->input['bday1'] = $mybb->get_input('bday1', MyBB::INPUT_INT);

	for($day = 1; $day <= 31; ++$day)
{
$selected = '';

	for($day = 1; $day <= 31; ++$day)
{
$selected = '';

Zeile 690Zeile 695
		eval("\$bdaysel .= \"".$templates->get("member_register_day")."\";");
}


		eval("\$bdaysel .= \"".$templates->get("member_register_day")."\";");
}


	$mybb->input['bday2'] = $mybb->get_input('bday2', 1);

	$mybb->input['bday2'] = $mybb->get_input('bday2', MyBB::INPUT_INT);

	$bdaymonthsel = array();
foreach(range(1, 12) as $number)
{
$bdaymonthsel[$number] = '';
}
$bdaymonthsel[$mybb->input['bday2']] = "selected=\"selected\"";

	$bdaymonthsel = array();
foreach(range(1, 12) as $number)
{
$bdaymonthsel[$number] = '';
}
$bdaymonthsel[$mybb->input['bday2']] = "selected=\"selected\"";

	$mybb->input['bday3'] = $mybb->get_input('bday3', 1);

	$mybb->input['bday3'] = $mybb->get_input('bday3', MyBB::INPUT_INT);


if($mybb->input['bday3'] == 0)
{


if($mybb->input['bday3'] == 0)
{

Zeile 851Zeile 856
		{
$referrer = '';
}

		{
$referrer = '';
}

		$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', 2);

		$mybb->input['profile_fields'] = $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY);

		// Custom profile fields baby!
$altbg = "trow1";
$requiredfields = $customfields = '';


		// Custom profile fields baby!
$altbg = "trow1";
$requiredfields = $customfields = '';


		if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->settings['regtype'] == "both" || $mybb->get_input('coppa', 1) == 1)

		if($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "admin" || $mybb->settings['regtype'] == "both" || $mybb->get_input('coppa', MyBB::INPUT_INT) == 1)

		{
$usergroup = 5;
}

		{
$usergroup = 5;
}

Zeile 871Zeile 876
		{
foreach($pfcache as $profilefield)
{

		{
foreach($pfcache as $profilefield)
{

				if($profilefield['required'] != 1 && $profilefield['registration'] != 1 || $profilefield['editableby'] == '' || $profilefield['editableby'] && $profilefield['editableby'] != -1 && !is_member($profilefield['editableby'], array('usergroup' => $mybb->user['usergroup'], 'additionalgroups' => $usergroup)))

				if($profilefield['required'] != 1 && $profilefield['registration'] != 1 || !is_member($profilefield['editableby'], array('usergroup' => $mybb->user['usergroup'], 'additionalgroups' => $usergroup)))

				{
continue;
}


				{
continue;
}


 
				$code = $select = $val = $options = $expoptions = $useropts = $seloptions = '';

				$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$thing = explode("\n", $profilefield['type'], "2");
$type = trim($thing[0]);

				$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
$thing = explode("\n", $profilefield['type'], "2");
$type = trim($thing[0]);

Zeile 916Zeile 922
							$val = str_replace("\n", "\\n", $val);

$sel = "";

							$val = str_replace("\n", "\\n", $val);

$sel = "";

							if($val == $seloptions[$val])

							if(isset($seloptions[$val]) && $val == $seloptions[$val])

							{

							{

								$sel = " selected=\"selected\"";

								$sel = ' selected="selected"';

							}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

							}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

Zeile 943Zeile 949
							$sel = "";
if($val == $userfield)
{

							$sel = "";
if($val == $userfield)
{

								$sel = " selected=\"selected\"";

								$sel = ' selected="selected"';

							}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

							}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

Zeile 966Zeile 972
							$checked = "";
if($val == $userfield)
{

							$checked = "";
if($val == $userfield)
{

								$checked = "checked=\"checked\"";

								$checked = 'checked="checked"';

							}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");

							}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");

Zeile 996Zeile 1002
						foreach($expoptions as $key => $val)
{
$checked = "";

						foreach($expoptions as $key => $val)
{
$checked = "";

							if($val == $seloptions[$val])

							if(isset($seloptions[$val]) && $val == $seloptions[$val])

							{

							{

								$checked = "checked=\"checked\"";

								$checked = 'checked="checked"';

							}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");

							}

eval("\$code .= \"".$templates->get("usercp_profile_profilefields_checkbox")."\";");

Zeile 1024Zeile 1030

if($profilefield['required'] == 1)
{


if($profilefield['required'] == 1)
{

					// JS validator extra
if($type == "checkbox" || $type == "radio")

					// JS validator extra, choose correct selectors for everything except single select which always has value
if($type != 'select')

					{

					{

						$id = "{$field}0";
}
else
{
$id = "fid{$profilefield['fid']}";
}

$validator_extra .= "
$(\"#{$id}\").rules(\"add\", {
required: true,
minlength: 1,
messages: {
required: \"{$lang->js_validator_not_empty}\"



						if($type == "textarea")
{
$inp_selector = "$('textarea[name=\"profile_fields[{$field}]\"]')";
}
elseif($type == "multiselect")
{
$inp_selector = "$('select[name=\"profile_fields[{$field}][]\"]')";
}
elseif($type == "checkbox")
{
$inp_selector = "$('input[name=\"profile_fields[{$field}][]\"]')";
}
else
{
$inp_selector = "$('input[name=\"profile_fields[{$field}]\"]')";

						}

						}

					});\n";










						
$validator_extra .= "
{$inp_selector}.rules('add', {
required: true,
messages: {
required: '{$lang->js_validator_not_empty}'
}
});\n";
}


					eval("\$requiredfields .= \"".$templates->get("member_register_customfield")."\";");
}
else
{
eval("\$customfields .= \"".$templates->get("member_register_customfield")."\";");
}

					eval("\$requiredfields .= \"".$templates->get("member_register_customfield")."\";");
}
else
{
eval("\$customfields .= \"".$templates->get("member_register_customfield")."\";");
}

 
			}

if($requiredfields)
{
eval("\$requiredfields = \"".$templates->get("member_register_requiredfields")."\";");
}





				$code = '';
$select = '';
$val = '';
$options = '';
$expoptions = '';
$useropts = '';
$seloptions = '';

			if($customfields)
{
eval("\$customfields = \"".$templates->get("member_register_additionalfields")."\";");





			}
}


			}
}


		if(!empty($requiredfields))
{
eval("\$requiredfields = \"".$templates->get("member_register_requiredfields")."\";");
}
if(!empty($customfields))
{
eval("\$customfields = \"".$templates->get("member_register_additionalfields")."\";");
}

 
		if(!isset($fromreg))
{
$allownoticescheck = "checked=\"checked\"";

		if(!isset($fromreg))
{
$allownoticescheck = "checked=\"checked\"";

Zeile 1100Zeile 1110
				{
// JS validator extra for our default CAPTCHA
$validator_extra .= "

				{
// JS validator extra for our default CAPTCHA
$validator_extra .= "

					$(\"#imagestring\").rules(\"add\", {

					$('#imagestring').rules('add', {

						required: true,
remote:{

						required: true,
remote:{

							url: \"xmlhttp.php?action=validate_captcha\",
type: \"post\",
dataType: \"json\",

							url: 'xmlhttp.php?action=validate_captcha',
type: 'post',
dataType: 'json',

							data:
{

							data:
{

								imagehash: $('#imagehash').val(),



								imagehash: function () {
return $('#imagehash').val();
},

								my_post_key: my_post_key
},
},
messages: {

								my_post_key: my_post_key
},
},
messages: {

							remote: \"{$lang->js_validator_no_image_text}\"

							remote: '{$lang->js_validator_no_image_text}'

						}
});\n";
}

						}
});\n";
}

Zeile 1147Zeile 1159
				eval("\$questionbox = \"".$templates->get("member_register_question")."\";");

$validator_extra .= "

				eval("\$questionbox = \"".$templates->get("member_register_question")."\";");

$validator_extra .= "

				$(\"#answer\").rules(\"add\", {

				$('#answer').rules('add', {

					required: true,
remote:{

					required: true,
remote:{

						url: \"xmlhttp.php?action=validate_question\",
type: \"post\",
dataType: \"json\",

						url: 'xmlhttp.php?action=validate_question',
type: 'post',
dataType: 'json',

						data:
{

						data:
{

							question: $('#question_id').val(),



							question: function () {
return $('#question_id').val();
},

							my_post_key: my_post_key
},
},
messages: {

							my_post_key: my_post_key
},
},
messages: {

						remote: \"{$lang->js_validator_no_security_question}\"

						remote: '{$lang->js_validator_no_security_question}'

					}
});\n";
}

					}
});\n";
}

Zeile 1169Zeile 1183
		$hiddencaptcha = '';
// Hidden CAPTCHA for Spambots
if($mybb->settings['hiddencaptchaimage'])

		$hiddencaptcha = '';
// Hidden CAPTCHA for Spambots
if($mybb->settings['hiddencaptchaimage'])

		{

		{

			$captcha_field = $mybb->settings['hiddencaptchaimagefield'];

eval("\$hiddencaptcha = \"".$templates->get("member_register_hiddencaptcha")."\";");

			$captcha_field = $mybb->settings['hiddencaptchaimagefield'];

eval("\$hiddencaptcha = \"".$templates->get("member_register_hiddencaptcha")."\";");

Zeile 1185Zeile 1199
				$lang->password = $lang->complex_password = $lang->sprintf($lang->complex_password, $mybb->settings['minpasswordlength']);

$validator_extra .= "

				$lang->password = $lang->complex_password = $lang->sprintf($lang->complex_password, $mybb->settings['minpasswordlength']);

$validator_extra .= "

				$(\"#password\").rules(\"add\", {

				$('#password').rules('add', {

					required: true,
minlength: {$mybb->settings['minpasswordlength']},
remote:{

					required: true,
minlength: {$mybb->settings['minpasswordlength']},
remote:{

						url: \"xmlhttp.php?action=complex_password\",
type: \"post\",
dataType: \"json\",

						url: 'xmlhttp.php?action=complex_password',
type: 'post',
dataType: 'json',

						data:
{
my_post_key: my_post_key
},
},
messages: {

						data:
{
my_post_key: my_post_key
},
},
messages: {

						minlength: \"{$lang->js_validator_password_length}\",
required: \"{$lang->js_validator_password_length}\",
remote: \"{$lang->js_validator_no_image_text}\"

						minlength: '{$lang->js_validator_password_length}',
required: '{$lang->js_validator_password_length}',
remote: '{$lang->js_validator_no_image_text}'

					}
});\n";
}
else

					}
});\n";
}
else

			{

			{

				$validator_extra .= "

				$validator_extra .= "

				$(\"#password\").rules(\"add\", {

				$('#password').rules('add', {

					required: true,
minlength: {$mybb->settings['minpasswordlength']},
messages: {

					required: true,
minlength: {$mybb->settings['minpasswordlength']},
messages: {

						minlength: \"{$lang->js_validator_password_length}\",
required: \"{$lang->js_validator_password_length}\"

						minlength: '{$lang->js_validator_password_length}',
required: '{$lang->js_validator_password_length}'

					}
});\n";
}

$validator_extra .= "

					}
});\n";
}

$validator_extra .= "

				$(\"#password2\").rules(\"add\", {

				$('#password2').rules('add', {

					required: true,
minlength: {$mybb->settings['minpasswordlength']},

					required: true,
minlength: {$mybb->settings['minpasswordlength']},

					equalTo: \"#password\",

					equalTo: '#password',

					messages: {

					messages: {

						minlength: \"{$lang->js_validator_password_length}\",
required: \"{$lang->js_validator_password_length}\",
equalTo: \"{$lang->js_validator_password_matches}\"

						minlength: '{$lang->js_validator_password_length}',
required: '{$lang->js_validator_password_length}',
equalTo: '{$lang->js_validator_password_matches}'

					}
});\n";


					}
});\n";


Zeile 1299Zeile 1313
			}
}
$uid = $user['uid'];

			}
}
$uid = $user['uid'];

	}

	}

	else
{

	else
{

		$user = get_user($mybb->get_input('uid', 1));

		$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	}
if(isset($mybb->input['code']) && $user)
{

	}
if(isset($mybb->input['code']) && $user)
{

Zeile 1565Zeile 1579
	}
else
{

	}
else
{

		$user = get_user($mybb->get_input('uid', 1));

		$user = get_user($mybb->get_input('uid', MyBB::INPUT_INT));

	}
if(isset($mybb->input['code']) && $user)
{

	}
if(isset($mybb->input['code']) && $user)
{

		$query = $db->simple_select("awaitingactivation", "*", "uid='".$user['uid']."' AND type='p'");
$activation = $db->fetch_array($query);

		$query = $db->simple_select("awaitingactivation", "code", "uid='".$user['uid']."' AND type='p'");
$activationcode = $db->fetch_field($query, 'code');

		$now = TIME_NOW;

		$now = TIME_NOW;

		if($activation['code'] != $mybb->get_input('code'))

		if(!$activationcode || $activationcode != $mybb->get_input('code'))

		{
error($lang->error_badlostpwcode);
}

		{
error($lang->error_badlostpwcode);
}

Zeile 1643Zeile 1657
	// Is a fatal call if user has had too many tries
$errors = array();
$logins = login_attempt_check();

	// Is a fatal call if user has had too many tries
$errors = array();
$logins = login_attempt_check();





	require_once MYBB_ROOT."inc/datahandlers/login.php";
$loginhandler = new LoginDataHandler("get");

	require_once MYBB_ROOT."inc/datahandlers/login.php";
$loginhandler = new LoginDataHandler("get");





	if($mybb->get_input('quick_password') && $mybb->get_input('quick_username'))
{
$mybb->input['password'] = $mybb->get_input('quick_password');

	if($mybb->get_input('quick_password') && $mybb->get_input('quick_username'))
{
$mybb->input['password'] = $mybb->get_input('quick_password');

Zeile 1661Zeile 1675
		'imagestring' => $mybb->get_input('imagestring')
);


		'imagestring' => $mybb->get_input('imagestring')
);


	$user_loginattempts = get_user_by_username($user['username'], array('fields' => 'loginattempts'));






	$options = array(
'fields' => 'loginattempts',
'username_method' => (int)$mybb->settings['username_method'],
);

$user_loginattempts = get_user_by_username($user['username'], $options);

	$user['loginattempts'] = (int)$user_loginattempts['loginattempts'];

$loginhandler->set_data($user);

	$user['loginattempts'] = (int)$user_loginattempts['loginattempts'];

$loginhandler->set_data($user);

Zeile 1673Zeile 1692
		$mybb->request_method = "get";

my_setcookie('loginattempts', $logins + 1);

		$mybb->request_method = "get";

my_setcookie('loginattempts', $logins + 1);

		$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($user['username']))."'", 1, true);

		$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "uid='".(int)$loginhandler->login_data['uid']."'", 1, true);


$errors = $loginhandler->get_friendly_errors();



$errors = $loginhandler->get_friendly_errors();


		$user_loginattempts = get_user_by_username($user['username'], array('fields' => 'loginattempts'));
$user['loginattempts'] = (int)$user_loginattempts['loginattempts'];

		$user['loginattempts'] = (int)$loginhandler->login_data['loginattempts'];



// If we need a captcha set it here
if($mybb->settings['failedcaptchalogincount'] > 0 && ($user['loginattempts'] > $mybb->settings['failedcaptchalogincount'] || (int)$mybb->cookies['loginattempts'] > $mybb->settings['failedcaptchalogincount']))


// If we need a captcha set it here
if($mybb->settings['failedcaptchalogincount'] > 0 && ($user['loginattempts'] > $mybb->settings['failedcaptchalogincount'] || (int)$mybb->cookies['loginattempts'] > $mybb->settings['failedcaptchalogincount']))

Zeile 1740Zeile 1758

// Redirect to the page where the user came from, but not if that was the login page.
if(isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], "action=login") === false)


// Redirect to the page where the user came from, but not if that was the login page.
if(isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], "action=login") === false)

	{

	{

		$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
}
else

		$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
}
else

Zeile 1758Zeile 1776
		if($login_captcha->type == 1)
{
if(!$correct)

		if($login_captcha->type == 1)
{
if(!$correct)

			{

			{

				$login_captcha->build_captcha();
}
else
{
$captcha = $login_captcha->build_hidden_captcha();

				$login_captcha->build_captcha();
}
else
{
$captcha = $login_captcha->build_hidden_captcha();

			}
}
elseif($login_captcha->type == 2)

			}
}
elseif($login_captcha->type == 2 || $login_captcha->type == 4)

		{
$login_captcha->build_recaptcha();
}

		{
$login_captcha->build_recaptcha();
}

Zeile 1848Zeile 1866
		// Run this after the shutdown query from session system
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
$db->delete_query("sessions", "sid = '{$session->sid}'");

		// Run this after the shutdown query from session system
$db->shutdown_query("UPDATE ".TABLE_PREFIX."users SET lastvisit='{$time}', lastactive='{$time}' WHERE uid='{$mybb->user['uid']}'");
$db->delete_query("sessions", "sid = '{$session->sid}'");

	}

$plugins->run_hooks("member_logout_end");

	}

$plugins->run_hooks("member_logout_end");


redirect("index.php", $lang->redirect_loggedout);
}

if($mybb->input['action'] == "viewnotes")
{


redirect("index.php", $lang->redirect_loggedout);
}

if($mybb->input['action'] == "viewnotes")
{

	$uid = $mybb->get_input('uid', 1);

	$uid = $mybb->get_input('uid', MyBB::INPUT_INT);

	$user = get_user($uid);

// Make sure we are looking at a real user here.

	$user = get_user($uid);

// Make sure we are looking at a real user here.

Zeile 1874Zeile 1892
	$lang->view_notes_for = $lang->sprintf($lang->view_notes_for, $user['username']);

$user['usernotes'] = nl2br(htmlspecialchars_uni($user['usernotes']));

	$lang->view_notes_for = $lang->sprintf($lang->view_notes_for, $user['username']);

$user['usernotes'] = nl2br(htmlspecialchars_uni($user['usernotes']));

 

$plugins->run_hooks('member_viewnotes');


eval("\$viewnotes = \"".$templates->get("member_viewnotes", 1, 0)."\";");
echo $viewnotes;


eval("\$viewnotes = \"".$templates->get("member_viewnotes", 1, 0)."\";");
echo $viewnotes;

Zeile 1889Zeile 1909
		error_no_permission();
}


		error_no_permission();
}


	$uid = $mybb->get_input('uid', 1);

	$uid = $mybb->get_input('uid', MyBB::INPUT_INT);

	if($uid)
{
$memprofile = get_user($uid);

	if($uid)
{
$memprofile = get_user($uid);

Zeile 1906Zeile 1926
	if(!$memprofile)
{
error($lang->error_nomember);

	if(!$memprofile)
{
error($lang->error_nomember);

	}

$uid = $memprofile['uid'];

	}

$uid = $memprofile['uid'];


$lang->profile = $lang->sprintf($lang->profile, $memprofile['username']);



$lang->profile = $lang->sprintf($lang->profile, $memprofile['username']);


Zeile 1922Zeile 1942
	$lang->users_contact_details = $lang->sprintf($lang->users_contact_details, $memprofile['username']);

if($mybb->settings['enablepms'] != 0 && (($memprofile['receivepms'] != 0 && $memperms['canusepms'] != 0 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false) || $mybb->usergroup['canoverridepm'] == 1))

	$lang->users_contact_details = $lang->sprintf($lang->users_contact_details, $memprofile['username']);

if($mybb->settings['enablepms'] != 0 && (($memprofile['receivepms'] != 0 && $memperms['canusepms'] != 0 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false) || $mybb->usergroup['canoverridepm'] == 1))

	{

	{

		$lang->send_pm = $lang->sprintf($lang->send_pm, $memprofile['username']);
}
else

		$lang->send_pm = $lang->sprintf($lang->send_pm, $memprofile['username']);
}
else

Zeile 1936Zeile 1956

$useravatar = format_avatar($memprofile['avatar'], $memprofile['avatardimensions']);
eval("\$avatar = \"".$templates->get("member_profile_avatar")."\";");


$useravatar = format_avatar($memprofile['avatar'], $memprofile['avatardimensions']);
eval("\$avatar = \"".$templates->get("member_profile_avatar")."\";");





	$website = $sendemail = $sendpm = $contact_details = '';


	$website = $sendemail = $sendpm = $contact_details = '';


	if($memprofile['website'] && $mybb->settings['hidewebsite'] != -1 && !is_member($mybb->settings['hidewebsite']) && $memperms['canchangewebsite'] == 1)

	if($memprofile['website'] && !is_member($mybb->settings['hidewebsite']) && $memperms['canchangewebsite'] == 1)

	{
$memprofile['website'] = htmlspecialchars_uni($memprofile['website']);
$bgcolor = alt_trow();
eval("\$website = \"".$templates->get("member_profile_website")."\";");

	{
$memprofile['website'] = htmlspecialchars_uni($memprofile['website']);
$bgcolor = alt_trow();
eval("\$website = \"".$templates->get("member_profile_website")."\";");

	}

	}

	
if($memprofile['hideemail'] != 1 && (my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false || $mybb->usergroup['cansendemailoverride'] != 0))

	
if($memprofile['hideemail'] != 1 && (my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false || $mybb->usergroup['cansendemailoverride'] != 0))

	{
$bgcolor = alt_trow();

	{
$bgcolor = alt_trow();

		eval("\$sendemail = \"".$templates->get("member_profile_email")."\";");

		eval("\$sendemail = \"".$templates->get("member_profile_email")."\";");

	}


	}


	if($mybb->settings['enablepms'] == 1 && $memprofile['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
{
$bgcolor = alt_trow();

	if($mybb->settings['enablepms'] == 1 && $memprofile['receivepms'] != 0 && $mybb->usergroup['cansendpms'] == 1 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
{
$bgcolor = alt_trow();

Zeile 1959Zeile 1979
	}

$contact_fields = array();

	}

$contact_fields = array();

 
	$any_contact_field = false;

	foreach(array('icq', 'aim', 'yahoo', 'skype', 'google') as $field)
{
$contact_fields[$field] = '';

	foreach(array('icq', 'aim', 'yahoo', 'skype', 'google') as $field)
{
$contact_fields[$field] = '';



 
		$settingkey = 'allow'.$field.'field';


		$settingkey = 'allow'.$field.'field';


		if(!empty($memprofile[$field]) && ($mybb->settings[$settingkey] == -1 || $mybb->settings[$settingkey] != '' && is_member($mybb->settings[$settingkey], array('usergroup' => $memprofile['usergroup'], 'additionalgroups' => $memprofile['additionalgroups']))))

		if(!empty($memprofile[$field]) && is_member($mybb->settings[$settingkey], array('usergroup' => $memprofile['usergroup'], 'additionalgroups' => $memprofile['additionalgroups'])))

		{

		{

 
			$any_contact_field = true;


			if($field == 'icq')
{
$memprofile[$field] = (int)$memprofile[$field];

			if($field == 'icq')
{
$memprofile[$field] = (int)$memprofile[$field];

Zeile 1979Zeile 2001

$bgcolors[$field] = alt_trow();
eval('$contact_fields[\''.$field.'\'] = "'.$templates->get($tmpl).'";');


$bgcolors[$field] = alt_trow();
eval('$contact_fields[\''.$field.'\'] = "'.$templates->get($tmpl).'";');

		}
else
{
$memprofile[$field] = '';

 
		}
}


		}
}


	if(!empty($contact_fields) || $sendemail || $sendpm || $website)

	if($any_contact_field || $sendemail || $sendpm || $website)

	{
eval('$contact_details = "'.$templates->get("member_profile_contact_details").'";');
}

	{
eval('$contact_details = "'.$templates->get("member_profile_contact_details").'";');
}





	$signature = '';

	$signature = '';

	if($memprofile['signature'] && ($memprofile['suspendsignature'] == 0 || $memprofile['suspendsigtime'] < TIME_NOW) && $mybb->settings['hidesignatures'] != -1 && !is_member($mybb->settings['hidesignatures']) && $memperms['canusesig'] && $memperms['canusesigxposts'] <= $memprofile['postnum'])

	if($memprofile['signature'] && ($memprofile['suspendsignature'] == 0 || $memprofile['suspendsigtime'] < TIME_NOW) && !is_member($mybb->settings['hidesignatures']) && $memperms['canusesig'] && $memperms['canusesigxposts'] <= $memprofile['postnum'])

	{
$sig_parser = array(
"allow_html" => $mybb->settings['sightml'],

	{
$sig_parser = array(
"allow_html" => $mybb->settings['sightml'],

Zeile 2002Zeile 2020
			"me_username" => $memprofile['username'],
"filter_badwords" => 1
);

			"me_username" => $memprofile['username'],
"filter_badwords" => 1
);





		if($memperms['signofollow'])
{
$sig_parser['nofollow_on'] = 1;

		if($memperms['signofollow'])
{
$sig_parser['nofollow_on'] = 1;

Zeile 2409Zeile 2427
	if($mybb->settings['enablewarningsystem'] != 0 && $memperms['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || ($mybb->user['uid'] == $memprofile['uid'] && $mybb->settings['canviewownwarning'] != 0)))
{
$bg_color = alt_trow();

	if($mybb->settings['enablewarningsystem'] != 0 && $memperms['canreceivewarnings'] != 0 && ($mybb->usergroup['canwarnusers'] != 0 || ($mybb->user['uid'] == $memprofile['uid'] && $mybb->settings['canviewownwarning'] != 0)))
{
$bg_color = alt_trow();

 

if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;
}


		$warning_level = round($memprofile['warningpoints']/$mybb->settings['maxwarningpoints']*100);

if($warning_level > 100)

		$warning_level = round($memprofile['warningpoints']/$mybb->settings['maxwarningpoints']*100);

if($warning_level > 100)

Zeile 2441Zeile 2465
	{
foreach($pfcache as $customfield)
{

	{
foreach($pfcache as $customfield)
{

			if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canmodcp'] != 1 && ($customfield['viewableby'] == '' || ($customfield['viewableby'] != -1 && !is_member($customfield['viewableby']))))

			if($mybb->usergroup['cancp'] != 1 && $mybb->usergroup['issupermod'] != 1 && $mybb->usergroup['canmodcp'] != 1 && !is_member($customfield['viewableby']))

			{
continue;
}

			{
continue;
}

Zeile 2521Zeile 2545
	$lang->tpd_percent_total = $lang->sprintf($lang->tpd_percent_total, my_number_format($tpd), $thread_percent);

$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);

	$lang->tpd_percent_total = $lang->sprintf($lang->tpd_percent_total, my_number_format($tpd), $thread_percent);

$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);

 

$bannedbit = '';
if($memperms['isbannedgroup'] == 1 && $mybb->usergroup['canbanusers'] == 1)
{
// Fetch details on their ban
$query = $db->simple_select('banned b LEFT JOIN '.TABLE_PREFIX.'users a ON (b.admin=a.uid)', 'b.*, a.username AS adminuser', "b.uid='{$uid}'", array('limit' => 1));
$memban = $db->fetch_array($query);

if($memban['reason'])
{
$memban['reason'] = htmlspecialchars_uni($parser->parse_badwords($memban['reason']));
}
else
{
$memban['reason'] = $lang->na;
}

if($memban['lifted'] == 'perm' || $memban['lifted'] == '' || $memban['bantime'] == 'perm' || $memban['bantime'] == '---')
{
$banlength = $lang->permanent;
$timeremaining = $lang->na;
}
else
{
// Set up the array of ban times.
$bantimes = fetch_ban_times();

$banlength = $bantimes[$memban['bantime']];
$remaining = $memban['lifted']-TIME_NOW;

$timeremaining = nice_time($remaining, array('short' => 1, 'seconds' => false))."";

if($remaining < 3600)
{
$timeremaining = "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 86400)
{
$timeremaining = "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else if($remaining < 604800)
{
$timeremaining = "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>";
}
else
{
$timeremaining = "({$timeremaining} {$lang->ban_remaining})";
}
}

$memban['adminuser'] = build_profile_link($memban['adminuser'], $memban['admin']);

// Display a nice warning to the user
eval('$bannedbit = "'.$templates->get('member_profile_banned').'";');
}


$adminoptions = '';
if($mybb->usergroup['cancp'] == 1 && $mybb->config['hide_admin_links'] != 1)


$adminoptions = '';
if($mybb->usergroup['cancp'] == 1 && $mybb->config['hide_admin_links'] != 1)

Zeile 2540Zeile 2619
			{
eval("\$viewnotes = \"".$templates->get("member_profile_modoptions_viewnotes")."\";");
$memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100)."... {$viewnotes}";

			{
eval("\$viewnotes = \"".$templates->get("member_profile_modoptions_viewnotes")."\";");
$memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100)."... {$viewnotes}";

			}
}
else

			}
}
else

		{
$memprofile['usernotes'] = $lang->no_usernotes;

		{
$memprofile['usernotes'] = $lang->no_usernotes;

		}


		}


		if($mybb->usergroup['caneditprofiles'] == 1)

		if($mybb->usergroup['caneditprofiles'] == 1)

		{

		{

			eval("\$editprofile = \"".$templates->get("member_profile_modoptions_editprofile")."\";");
eval("\$editnotes = \"".$templates->get("member_profile_modoptions_editnotes")."\";");

			eval("\$editprofile = \"".$templates->get("member_profile_modoptions_editprofile")."\";");
eval("\$editnotes = \"".$templates->get("member_profile_modoptions_editnotes")."\";");

		}

if($mybb->usergroup['canbanusers'] == 1)

		}

if($mybb->usergroup['canbanusers'] == 1 && (!$memban['uid'] || $memban['uid'] && ($mybb->user['uid'] == $memban['admin']) || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['cancp'] == 1))

		{
eval("\$banuser = \"".$templates->get("member_profile_modoptions_banuser")."\";");
}

if($can_purge_spammer)

		{
eval("\$banuser = \"".$templates->get("member_profile_modoptions_banuser")."\";");
}

if($can_purge_spammer)

		{

		{

			eval("\$purgespammer = \"".$templates->get('member_profile_modoptions_purgespammer')."\";");
}


			eval("\$purgespammer = \"".$templates->get('member_profile_modoptions_purgespammer')."\";");
}


Zeile 2625Zeile 2704
	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("member_do_emailuser_start");

	verify_post_check($mybb->get_input('my_post_key'));

$plugins->run_hooks("member_do_emailuser_start");


// Guests or those without permission can't email other users
if($mybb->usergroup['cansendemail'] == 0)
{
error_no_permission();
}

// Check group limits
if($mybb->usergroup['maxemails'] > 0)
{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
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))."'");
$sent_count = $db->fetch_field($query, "sent_count");
if($sent_count >= $mybb->usergroup['maxemails'])
{
$lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']);
error($lang->error_max_emails_day);
}
}

// Check email flood control
if($mybb->usergroup['emailfloodtime'] > 0)
{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
else
{
$user_check = "ipaddress=".$db->escape_binary($session->packedip);
}

$timecut = TIME_NOW-$mybb->usergroup['emailfloodtime']*60;

$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)
{
$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_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);
}



// Guests or those without permission can't email other users
if($mybb->usergroup['cansendemail'] == 0)
{
error_no_permission();
}

// Check group limits
if($mybb->usergroup['maxemails'] > 0)
{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
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))."'");
$sent_count = $db->fetch_field($query, "sent_count");
if($sent_count >= $mybb->usergroup['maxemails'])
{
$lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']);
error($lang->error_max_emails_day);
}
}

// Check email flood control
if($mybb->usergroup['emailfloodtime'] > 0)
{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
else
{
$user_check = "ipaddress=".$db->escape_binary($session->packedip);
}

$timecut = TIME_NOW-$mybb->usergroup['emailfloodtime']*60;

$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)
{
$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_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);
}

	}

	}





	$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".$mybb->get_input('uid', 1)."'");

	$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'");

	$to_user = $db->fetch_array($query);

if(!$to_user['username'])
{
error($lang->error_invalidusername);

	$to_user = $db->fetch_array($query);

if(!$to_user['username'])
{
error($lang->error_invalidusername);

	}


	}


	if($to_user['hideemail'] != 0)

	if($to_user['hideemail'] != 0)

	{

	{

		error($lang->error_hideemail);

		error($lang->error_hideemail);

	}


	}


	$errors = array();

	$errors = array();

 

if($mybb->user['uid'])
{
$mybb->input['fromemail'] = $mybb->user['email'];
$mybb->input['fromname'] = $mybb->user['username'];
}


if(!validate_email_format($mybb->input['fromemail']))
{


if(!validate_email_format($mybb->input['fromemail']))
{

Zeile 2777Zeile 2862
				"type" => 1
);
$db->insert_query("maillogs", $log_entry);

				"type" => 1
);
$db->insert_query("maillogs", $log_entry);

		}

$plugins->run_hooks("member_do_emailuser_end");

		}

$plugins->run_hooks("member_do_emailuser_end");


redirect(get_profile_link($to_user['uid']), $lang->redirect_emailsent);


redirect(get_profile_link($to_user['uid']), $lang->redirect_emailsent);

	}

	}

	else
{
$mybb->input['action'] = "emailuser";
}
}

	else
{
$mybb->input['action'] = "emailuser";
}
}





if($mybb->input['action'] == "emailuser")
{
$plugins->run_hooks("member_emailuser_start");

if($mybb->input['action'] == "emailuser")
{
$plugins->run_hooks("member_emailuser_start");

Zeile 2801Zeile 2886

// 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
{
$user_check = "ipaddress=".$db->escape_binary($session->packedip);

	{
if($mybb->user['uid'] > 0)
{
$user_check = "fromuid='{$mybb->user['uid']}'";
}
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(*) AS sent_count", "{$user_check} AND dateline >= '".(TIME_NOW - (60*60*24))."'");

Zeile 2861Zeile 2946
			}

error($lang->error_emailflooding);

			}

error($lang->error_emailflooding);

		}
}

$query = $db->simple_select("users", "uid, username, email, hideemail, ignorelist", "uid='".$mybb->get_input('uid', 1)."'");
$to_user = $db->fetch_array($query);


		}
}

$query = $db->simple_select("users", "uid, username, email, hideemail, ignorelist", "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'");
$to_user = $db->fetch_array($query);


	$lang->email_user = $lang->sprintf($lang->email_user, $to_user['username']);

if(!$to_user['uid'])

	$lang->email_user = $lang->sprintf($lang->email_user, $to_user['username']);

if(!$to_user['uid'])

Zeile 2921Zeile 3006
	if($mybb->user['uid'] == 0)
{
eval("\$from_email = \"".$templates->get("member_emailuser_guest")."\";");

	if($mybb->user['uid'] == 0)
{
eval("\$from_email = \"".$templates->get("member_emailuser_guest")."\";");

	}
else
{
eval("\$from_email = \"".$templates->get("member_emailuser_hidden")."\";");

 
	}

$plugins->run_hooks("member_emailuser_end");

	}

$plugins->run_hooks("member_emailuser_end");