Vergleich member.php - 1.6.6 - 1.6.9

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: member.php 5616 2011-09-20 13:24:59Z Tomm $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 277Zeile 277
			);
$db->insert_query("awaitingactivation", $activationarray);
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);

			);
$db->insert_query("awaitingactivation", $activationarray);
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);

			$emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);















			switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_activateaccount2, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);
break;
default:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);
break;
}

			my_mail($user_info['email'], $emailsubject, $emailmessage);

$lang->redirect_registered_activation = $lang->sprintf($lang->redirect_registered_activation, $mybb->settings['bbname'], $user_info['username']);

			my_mail($user_info['email'], $emailsubject, $emailmessage);

$lang->redirect_registered_activation = $lang->sprintf($lang->redirect_registered_activation, $mybb->settings['bbname'], $user_info['username']);





			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_activation);
}
else if($mybb->settings['regtype'] == "randompass")

			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_activation);
}
else if($mybb->settings['regtype'] == "randompass")

		{

		{

			$emailsubject = $lang->sprintf($lang->emailsubject_randompassword, $mybb->settings['bbname']);

			$emailsubject = $lang->sprintf($lang->emailsubject_randompassword, $mybb->settings['bbname']);

			$emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);















			switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_randompassword1, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_randompassword2, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);
break;
default:
$emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);
break;
}

			my_mail($user_info['email'], $emailsubject, $emailmessage);

			my_mail($user_info['email'], $emailsubject, $emailmessage);





			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_passwordsent);

			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_passwordsent);

Zeile 303Zeile 331
			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_admin_activate);

			$plugins->run_hooks("member_do_register_end");

error($lang->redirect_registered_admin_activate);

		}
else

		}
else

		{
$lang->redirect_registered = $lang->sprintf($lang->redirect_registered, $mybb->settings['bbname'], $user_info['username']);


		{
$lang->redirect_registered = $lang->sprintf($lang->redirect_registered, $mybb->settings['bbname'], $user_info['username']);


Zeile 312Zeile 340

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


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

	}
}


	}
}


if($mybb->input['action'] == "coppa_form")
{
if(!$mybb->settings['faxno'])

if($mybb->input['action'] == "coppa_form")
{
if(!$mybb->settings['faxno'])

Zeile 330Zeile 358
{
$bdaysel = '';
if($mybb->settings['coppa'] == "disabled")

{
$bdaysel = '';
if($mybb->settings['coppa'] == "disabled")

	{

	{

		$bdaysel = $bday2blank = "<option value=\"\">&nbsp;</option>";
}
for($i = 1; $i <= 31; ++$i)
{
if($mybb->input['bday1'] == $i)

		$bdaysel = $bday2blank = "<option value=\"\">&nbsp;</option>";
}
for($i = 1; $i <= 31; ++$i)
{
if($mybb->input['bday1'] == $i)

		{

		{

			$bdaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else

			$bdaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n";
}
else

Zeile 355Zeile 383
	{
// Just selected DOB, we check
if($mybb->input['bday1'] && $mybb->input['bday2'] && $mybb->input['bday3'])

	{
// Just selected DOB, we check
if($mybb->input['bday1'] && $mybb->input['bday2'] && $mybb->input['bday3'])

		{
my_unsetcookie("coppauser");

		{
my_unsetcookie("coppauser");

			
$bdaytime = @mktime(0, 0, 0, $mybb->input['bday2'], $mybb->input['bday1'], $mybb->input['bday3']);


			
$bdaytime = @mktime(0, 0, 0, $mybb->input['bday2'], $mybb->input['bday1'], $mybb->input['bday3']);


Zeile 375Zeile 403
		else
{
$plugins->run_hooks("member_register_coppa");

		else
{
$plugins->run_hooks("member_register_coppa");

			

			

			my_unsetcookie("coppauser");

eval("\$coppa = \"".$templates->get("member_register_coppa")."\";");
output_page($coppa);
exit;

			my_unsetcookie("coppauser");

eval("\$coppa = \"".$templates->get("member_register_coppa")."\";");
output_page($coppa);
exit;

		}

		}

	}

if((!isset($mybb->input['agree']) && !isset($mybb->input['regsubmit'])) || $mybb->request_method != "post")

	}

if((!isset($mybb->input['agree']) && !isset($mybb->input['regsubmit'])) || $mybb->request_method != "post")

	{

	{

		// Is this user a COPPA user? We need to show the COPPA agreement too
if($mybb->settings['coppa'] != "disabled" && ($mybb->cookies['coppauser'] == 1 || $under_thirteen))
{

		// Is this user a COPPA user? We need to show the COPPA agreement too
if($mybb->settings['coppa'] != "disabled" && ($mybb->cookies['coppauser'] == 1 || $under_thirteen))
{

Zeile 407Zeile 435
		$plugins->run_hooks("member_register_start");

$validator_extra = '';

		$plugins->run_hooks("member_register_start");

$validator_extra = '';





		if(isset($mybb->input['timezoneoffset']))
{
$timezoneoffset = $mybb->input['timezoneoffset'];

		if(isset($mybb->input['timezoneoffset']))
{
$timezoneoffset = $mybb->input['timezoneoffset'];

		}

		}

		else
{
$timezoneoffset = $mybb->settings['timezoneoffset'];
}
$tzselect = build_timezone_select("timezoneoffset", $timezoneoffset, true);

		else
{
$timezoneoffset = $mybb->settings['timezoneoffset'];
}
$tzselect = build_timezone_select("timezoneoffset", $timezoneoffset, true);





		$stylelist = build_theme_select("style");

if($mybb->settings['usertppoptions'])

		$stylelist = build_theme_select("style");

if($mybb->settings['usertppoptions'])

Zeile 433Zeile 461
				}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

				}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

		}

		}

		if($mybb->settings['userpppoptions'])
{
$pppoptions = '';

		if($mybb->settings['userpppoptions'])
{
$pppoptions = '';

Zeile 459Zeile 487
			elseif($referrer)
{
$query = $db->simple_select("users", "username", "uid='".intval($referrer['uid'])."'");

			elseif($referrer)
{
$query = $db->simple_select("users", "username", "uid='".intval($referrer['uid'])."'");

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

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

				$referrername = $ref['username'];

				$referrername = $ref['username'];

			}

			}

			elseif($referrername)
{
$query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string(my_strtolower($referrername))."'");

			elseif($referrername)
{
$query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string(my_strtolower($referrername))."'");

Zeile 470Zeile 498
				{
$errors[] = $lang->error_badreferrer;
}

				{
$errors[] = $lang->error_badreferrer;
}

			}

			}

			if($quickreg)
{
$refbg = "trow1";

			if($quickreg)
{
$refbg = "trow1";

Zeile 483Zeile 511
			$validator_extra .= "\tregValidator.register('referrer', 'ajax', {url:'xmlhttp.php?action=username_exists', loading_message:'{$lang->js_validator_checking_referrer}'});\n";

eval("\$referrer = \"".$templates->get("member_register_referrer")."\";");

			$validator_extra .= "\tregValidator.register('referrer', 'ajax', {url:'xmlhttp.php?action=username_exists', loading_message:'{$lang->js_validator_checking_referrer}'});\n";

eval("\$referrer = \"".$templates->get("member_register_referrer")."\";");

		}
else

		}
else

		{
$referrer = '';
}

		{
$referrer = '';
}

Zeile 502Zeile 530
			if($errors)
{
$userfield = $mybb->input['profile_fields'][$field];

			if($errors)
{
$userfield = $mybb->input['profile_fields'][$field];

			}

			}

			else
{
$userfield = '';
}
if($type == "multiselect")

			else
{
$userfield = '';
}
if($type == "multiselect")

			{

			{

				if($errors)

				if($errors)

				{

				{

					$useropts = $userfield;

					$useropts = $userfield;

				}

				}

				else

				else

				{

				{

					$useropts = explode("\n", $userfield);

					$useropts = explode("\n", $userfield);

				}

				}

				if(is_array($useropts))
{

				if(is_array($useropts))
{

					foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

$sel = "";
if($val == $seloptions[$val])

					foreach($useropts as $key => $val)
{
$seloptions[$val] = $val;
}
}
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$val = trim($val);
$val = str_replace("\n", "\\n", $val);

$sel = "";
if($val == $seloptions[$val])

						{
$sel = "selected=\"selected\"";
}
$select .= "<option value=\"$val\" $sel>$val</option>\n";
}
if(!$profilefield['length'])

						{
$sel = "selected=\"selected\"";
}
$select .= "<option value=\"$val\" $sel>$val</option>\n";
}
if(!$profilefield['length'])

					{

					{

						$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" id=\"{$field}\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

						$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" id=\"{$field}\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";

Zeile 556Zeile 584
						$val = trim($val);
$val = str_replace("\n", "\\n", $val);
$sel = "";

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

						if($val == $userfield)
{
$sel = "selected=\"selected\"";
}

						if($val == $userfield)
{
$sel = "selected=\"selected\"";
}

						$select .= "<option value=\"$val\" $sel>$val</option>";
}
if(!$profilefield['length'])

						$select .= "<option value=\"$val\" $sel>$val</option>";
}
if(!$profilefield['length'])

					{

					{

						$profilefield['length'] = 1;
}
$code = "<select name=\"profile_fields[$field]\" id=\"{$field}\" size=\"{$profilefield['length']}\">$select</select>";

						$profilefield['length'] = 1;
}
$code = "<select name=\"profile_fields[$field]\" id=\"{$field}\" size=\"{$profilefield['length']}\">$select</select>";

Zeile 582Zeile 610
							$checked = "checked=\"checked\"";
}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" id=\"{$field}{$key}\" value=\"$val\" $checked /> <span class=\"smalltext\">$val</span><br />";

							$checked = "checked=\"checked\"";
}
$code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" id=\"{$field}{$key}\" value=\"$val\" $checked /> <span class=\"smalltext\">$val</span><br />";

					}
}
}

					}
}
}

			elseif($type == "checkbox")
{
if($errors)

			elseif($type == "checkbox")
{
if($errors)

Zeile 635Zeile 663
			{
// JS validator extra
if($type == "checkbox" || $type == "radio")

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

				{

				{

					$id = "{$field}0";
}
else

					$id = "{$field}0";
}
else

Zeile 687Zeile 715
				{
// JS validator extra for our default CAPTCHA
$validator_extra .= "\tregValidator.register('imagestring', 'ajax', { url: 'xmlhttp.php?action=validate_captcha', extra_body: 'imagehash', loading_message: '{$lang->js_validator_captcha_valid}', failure_message: '{$lang->js_validator_no_image_text}'} );\n";

				{
// JS validator extra for our default CAPTCHA
$validator_extra .= "\tregValidator.register('imagestring', 'ajax', { url: 'xmlhttp.php?action=validate_captcha', extra_body: 'imagehash', loading_message: '{$lang->js_validator_captcha_valid}', failure_message: '{$lang->js_validator_no_image_text}'} );\n";

				}
}
}

				}
}
}

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

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

Zeile 733Zeile 761
			else
{
$langoptions .= "<option value=\"$lname\">$language</option>\n";

			else
{
$langoptions .= "<option value=\"$lname\">$language</option>\n";

			}

			}

		}

$plugins->run_hooks("member_register_end");

		}

$plugins->run_hooks("member_register_end");

Zeile 742Zeile 770
		output_page($registration);
}
}

		output_page($registration);
}
}





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

if($mybb->input['username'])
{

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

if($mybb->input['username'])
{

		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));















		switch($mybb->settings['username'])
{
case 0:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
break;
case 1:
$query = $db->simple_select("users", "*", "LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
break;
case 2:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
break;
default:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
break;
}

		$user = $db->fetch_array($query);
if(!$user['username'])
{

		$user = $db->fetch_array($query);
if(!$user['username'])
{

			error($lang->error_invalidpworusername);















			switch($mybb->settings['username_method'])
{
case 0:
error($lang->error_invalidpworusername);
break;
case 1:
error($lang->error_invalidpworusername1);
break;
case 2:
error($lang->error_invalidpworusername2);
break;
default:
error($lang->error_invalidpworusername);
break;
}

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

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

	}
else

	}
else

	{
$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);

	{
$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
$user = $db->fetch_array($query);

Zeile 800Zeile 856
	else
{
$plugins->run_hooks("member_activate_form");

	else
{
$plugins->run_hooks("member_activate_form");





		eval("\$activate = \"".$templates->get("member_activate")."\";");
output_page($activate);

		eval("\$activate = \"".$templates->get("member_activate")."\";");
output_page($activate);

	}

	}

}

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

}

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

Zeile 811Zeile 867
	$plugins->run_hooks("member_resendactivation");

if($mybb->settings['regtype'] == "admin")

	$plugins->run_hooks("member_resendactivation");

if($mybb->settings['regtype'] == "admin")

	{

	{

		error($lang->error_activated_by_admin);
}
if($mybb->user['uid'] && $mybb->user['usergroup'] != 5)

		error($lang->error_activated_by_admin);
}
if($mybb->user['uid'] && $mybb->user['usergroup'] != 5)

Zeile 822Zeile 878
	eval("\$activate = \"".$templates->get("member_resendactivation")."\";");
output_page($activate);
}

	eval("\$activate = \"".$templates->get("member_resendactivation")."\";");
output_page($activate);
}





if($mybb->input['action'] == "do_resendactivation" && $mybb->request_method == "post")
{
$plugins->run_hooks("member_do_resendactivation_start");

if($mybb->input['action'] == "do_resendactivation" && $mybb->request_method == "post")
{
$plugins->run_hooks("member_do_resendactivation_start");

Zeile 866Zeile 922
				$email = $user['email'];
$activationcode = $user['code'];
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);

				$email = $user['email'];
$activationcode = $user['code'];
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);

				$emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);















				switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_activateaccount2, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);
break;
default:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);
break;
}

				my_mail($email, $emailsubject, $emailmessage);
}
}

				my_mail($email, $emailsubject, $emailmessage);
}
}

Zeile 914Zeile 984
			$email = $user['email'];
$activationcode = $user['activationcode'];
$emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']);

			$email = $user['email'];
$activationcode = $user['activationcode'];
$emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']);

			$emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);















			switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_lostpw1, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_lostpw2, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
break;
default:
$emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
break;
}

			my_mail($email, $emailsubject, $emailmessage);

			my_mail($email, $emailsubject, $emailmessage);

		}
}

		}
}

	$plugins->run_hooks("member_do_lostpw_end");

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

	$plugins->run_hooks("member_do_lostpw_end");

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

Zeile 929Zeile 1013

if($mybb->input['username'])
{


if($mybb->input['username'])
{

		$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");















		switch($mybb->settings['username_method'])
{
case 0:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");
break;
case 1:
$query = $db->simple_select("users", "*", "LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");
break;
case 2:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");
break;
default:
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");
break;
}

		$user = $db->fetch_array($query);
if(!$user['uid'])
{

		$user = $db->fetch_array($query);
if(!$user['uid'])
{

			error($lang->error_invalidpworusername);















			switch($mybb->settings['username_method'])
{
case 0:
error($lang->error_invalidpworusername);
break;
case 1:
error($lang->error_invalidpworusername1);
break;
case 2:
error($lang->error_invalidpworusername2);
break;
default:
error($lang->error_invalidpworusername);
break;
}

		}
}
else
{
$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");

		}
}
else
{
$query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");

		$user = $db->fetch_array($query);
}

		$user = $db->fetch_array($query);
}

	if($mybb->input['code'] && $user['uid'])
{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$user['uid']."' AND type='p'");

	if($mybb->input['code'] && $user['uid'])
{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$user['uid']."' AND type='p'");

Zeile 979Zeile 1091
	else
{
$plugins->run_hooks("member_resetpassword_form");

	else
{
$plugins->run_hooks("member_resetpassword_form");

 
		
switch($mybb->settings['username_method'])
{
case 0:
$lang_username = $lang->username;
break;
case 1:
$lang_username = $lang->username1;
break;
case 2:
$lang_username = $lang->username2;
break;
default:
$lang_username = $lang->username;
break;
}


eval("\$activate = \"".$templates->get("member_resetpassword")."\";");
output_page($activate);


eval("\$activate = \"".$templates->get("member_resetpassword")."\";");
output_page($activate);

Zeile 1007Zeile 1135
	if(!username_exists($mybb->input['username']))
{
my_setcookie('loginattempts', $logins + 1);

	if(!username_exists($mybb->input['username']))
{
my_setcookie('loginattempts', $logins + 1);

		error($lang->error_invalidpworusername.$login_text);















		switch($mybb->settings['username_method'])
{
case 0:
error($lang->error_invalidpworusername.$login_text);
break;
case 1:
error($lang->error_invalidpworusername1.$login_text);
break;
case 2:
error($lang->error_invalidpworusername2.$login_text);
break;
default:
error($lang->error_invalidpworusername.$login_text);
break;
}

	}

	}

	
$query = $db->simple_select("users", "loginattempts", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));


$query = $db->simple_select("users", "loginattempts", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));

	$loginattempts = $db->fetch_field($query, "loginattempts");

	$loginattempts = $db->fetch_field($query, "loginattempts");

	



	$errors = array();

	$errors = array();

	
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$user['uid'])
{
my_setcookie('loginattempts', $logins + 1);
$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true);

$mybb->input['action'] = "login";
$mybb->input['request_method'] = "get";

if($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}

$errors[] = $lang->error_invalidpworusername.$login_text;
}
else

	if($mybb->settings['failedcaptchalogincount'] > 0 && ($loginattempts > $mybb->settings['failedcaptchalogincount'] || intval($mybb->cookies['loginattempts']) > $mybb->settings['failedcaptchalogincount']))


















	{

	{

		$correct = true;
}

if($mybb->settings['failedcaptchalogincount'] > 0 && ($loginattempts > $mybb->settings['failedcaptchalogincount'] || intval($mybb->cookies['loginattempts']) > $mybb->settings['failedcaptchalogincount']))
{

 
		// Show captcha image if enabled

		// Show captcha image if enabled

		if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng"))

		if($mybb->settings['captchaimage'])

		{

		{

 
			$do_captcha = false;


			// Check their current captcha input - if correct, hide the captcha input area

			// Check their current captcha input - if correct, hide the captcha input area

			if($mybb->input['imagestring'])




			require_once MYBB_ROOT.'inc/class_captcha.php';
$login_captcha = new captcha;

if($login_captcha->validate_captcha() == false)

			{

			{

				$imagehash = $db->escape_string($mybb->input['imagehash']);
$imagestring = $db->escape_string($mybb->input['imagestring']);
$query = $db->simple_select("captcha", "*", "imagehash='{$imagehash}' AND imagestring='{$imagestring}'");
$imgcheck = $db->fetch_array($query);
if($imgcheck['dateline'] > 0)

				$correct = true;
$do_captcha = true;

// CAPTCHA validation failed
foreach($login_captcha->get_errors() as $error)

				{

				{

					$correct = true;

					$errors[] = $error;

				}

				}

				else
{
$db->delete_query("captcha", "imagehash='{$imagehash}'");
$errors[] = $lang->error_regimageinvalid;
}
}
else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
















			}
}
}

// Don't check password when captcha isn't solved
if(empty($errors))
{
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
if(!$user['uid'])
{
my_setcookie('loginattempts', $logins + 1);
$db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true);

$mybb->input['action'] = "login";
$mybb->input['request_method'] = "get";

if($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1)
{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}

switch($mybb->settings['username_method'])

			{

			{

				$errors[] = $lang->error_regimagerequired;
}
else
{
$errors[] = $lang->error_regimagerequired;








				case 0:
$errors[] = $lang->error_invalidpworusername.$login_text;
break;
case 1:
$errors[] = $lang->error_invalidpworusername1.$login_text;
break;
case 2:
$errors[] = $lang->error_invalidpworusername2.$login_text;
break;
default:
$errors[] = $lang->error_invalidpworusername.$login_text;
break;

			}
}

			}
}

		
$do_captcha = true;
}




		else
{
$correct = true;
}
}


	if(!empty($errors))
{
$mybb->input['action'] = "login";

	if(!empty($errors))
{
$mybb->input['action'] = "login";

Zeile 1081Zeile 1230
	else if($correct)
{
if($user['coppauser'])

	else if($correct)
{
if($user['coppauser'])

		{

		{

			error($lang->error_awaitingcoppa);
}


			error($lang->error_awaitingcoppa);
}


Zeile 1127Zeile 1276
	else
{
$mybb->input['action'] = "login";

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

		$mybb->input['request_method'] = "get";
}

		$mybb->input['request_method'] = "get";
}

	
$plugins->run_hooks("member_do_login_end");
}

	
$plugins->run_hooks("member_do_login_end");
}

Zeile 1156Zeile 1305
	else
{
$redirect_url = '';

	else
{
$redirect_url = '';

	}


	}


	$captcha = "";
// Show captcha image for guests if enabled

	$captcha = "";
// Show captcha image for guests if enabled

	if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && $do_captcha == true)
{
$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$imagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $imagearray);
eval("\$captcha = \"".$templates->get("post_captcha")."\";");
}

$username = "";
$password = "";








	if($mybb->settings['captchaimage'])
{
require_once MYBB_ROOT.'inc/class_captcha.php';

if($do_captcha == true)
{
$login_captcha = new captcha(true, "post_captcha");

if($login_captcha->html)
{
$captcha = $login_captcha->html;
}
}
else
{
$login_captcha = new captcha;
$captcha = $login_captcha->build_hidden_captcha();
}
}

$username = '';
$password = '';

	if($mybb->input['username'] && $mybb->request_method == "post")
{
$username = htmlspecialchars_uni($mybb->input['username']);

	if($mybb->input['username'] && $mybb->request_method == "post")
{
$username = htmlspecialchars_uni($mybb->input['username']);

	}


	}


	if($mybb->input['password'] && $mybb->request_method == "post")

	if($mybb->input['password'] && $mybb->request_method == "post")

	{

	{

		$password = htmlspecialchars_uni($mybb->input['password']);
}

		$password = htmlspecialchars_uni($mybb->input['password']);
}














	
switch($mybb->settings['username_method'])
{
case 1:
$lang->username = $lang->username1;
break;
case 2:
$lang->username = $lang->username2;
break;
default:
break;
}

	eval("\$login = \"".$templates->get("member_login")."\";");
output_page($login);
}

	eval("\$login = \"".$templates->get("member_login")."\";");
output_page($login);
}

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


	$lang->users_forum_info = $lang->sprintf($lang->users_forum_info, $memprofile['username']);
$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)

	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']);
}

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

Zeile 1335Zeile 1502
		$avatar = '';
}


		$avatar = '';
}


	if($memprofile['hideemail'] != 1)

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

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

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

Zeile 1377Zeile 1544
			"allow_mycode" => $mybb->settings['sigmycode'],
"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],

			"allow_mycode" => $mybb->settings['sigmycode'],
"allow_smilies" => $mybb->settings['sigsmilies'],
"allow_imgcode" => $mybb->settings['sigimgcode'],

			"me_username" => $memprofile['username']


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

		);

$memprofile['signature'] = $parser->parse_message($memprofile['signature'], $sig_parser);

		);

$memprofile['signature'] = $parser->parse_message($memprofile['signature'], $sig_parser);

Zeile 1429Zeile 1597
		$awaydate = my_date($mybb->settings['dateformat'], $memprofile['awaydate']);
if(!empty($memprofile['awayreason']))
{

		$awaydate = my_date($mybb->settings['dateformat'], $memprofile['awaydate']);
if(!empty($memprofile['awayreason']))
{

			$awayreason = htmlspecialchars_uni($memprofile['awayreason']);


			$reason = $parser->parse_badwords($memprofile['awayreason']);
$awayreason = htmlspecialchars_uni($reason);

		}
else
{

		}
else
{

Zeile 1458Zeile 1627
			}

// If our away time has expired already, we should be back, right?

			}

// If our away time has expired already, we should be back, right?

			if ($returnmkdate < TIME_NOW)

			if($returnmkdate < TIME_NOW)

			{
$db->update_query('users', array('away' => '0', 'awaydate' => '', 'returndate' => '', 'awayreason' => ''), 'uid=\''.intval($memprofile['uid']).'\'');


			{
$db->update_query('users', array('away' => '0', 'awaydate' => '', 'returndate' => '', 'awayreason' => ''), 'uid=\''.intval($memprofile['uid']).'\'');


Zeile 1468Zeile 1637
		}

// Check if our away status is set to 1, it may have been updated already (see a few lines above)

		}

// Check if our away status is set to 1, it may have been updated already (see a few lines above)

		if ($memprofile['away'] == 1)

		if($memprofile['away'] == 1)

		{
eval("\$awaybit = \"".$templates->get("member_profile_away")."\";");
}

		{
eval("\$awaybit = \"".$templates->get("member_profile_away")."\";");
}

Zeile 1585Zeile 1754
	else
{
// No usergroup title so get a default one

	else
{
// No usergroup title so get a default one

		$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
while($title = $db->fetch_array($query))


		$usertitles = $cache->read('usertitles');

if(is_array($usertitles))

		{

		{

			if($memprofile['postnum'] >= $title['posts'])

			foreach($usertitles as $title)

			{

			{

				$usertitle = $title['title'];
$stars = $title['stars'];
$starimage = $title['starimage'];
break;





				if($memprofile['postnum'] >= $title['posts'])
{
$usertitle = $title['title'];
$stars = $title['stars'];
$starimage = $title['starimage'];

break;
}

			}

			}

		}
}

		}
}

	
if($displaygroup['stars'] || $displaygroup['usertitle'])
{

	
if($displaygroup['stars'] || $displaygroup['usertitle'])
{

Zeile 1605Zeile 1779
	}
elseif(!$stars)
{

	}
elseif(!$stars)
{

		// This is for cases where the user has a title, but the group has no defined number of stars (use number of stars as per default usergroups)
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC'));
while($title = $db->fetch_array($query))

		if(!is_array($usertitles))



		{

		{

			if($memprofile['postnum'] >= $title['posts'])
{
$stars = $title['stars'];
$starimage = $title['starimage'];
break;
}

			$usertitles = $cache->read('usertitles');






		}

		}

	}
















// This is for cases where the user has a title, but the group has no defined number of stars (use number of stars as per default usergroups)
if(is_array($usertitles))
{
foreach($usertitles as $title)
{
if($memprofile['postnum'] >= $title['posts'])
{
$stars = $title['stars'];
$starimage = $title['starimage'];
break;
}
}
}
}


if(!empty($displaygroup['image']))


if(!empty($displaygroup['image']))

	{

	{

		if(!empty($mybb->user['language']))

		if(!empty($mybb->user['language']))

		{

		{

			$language = $mybb->user['language'];
}
else

			$language = $mybb->user['language'];
}
else

Zeile 1636Zeile 1817
	if(!$starimage)
{
$starimage = $displaygroup['starimage'];

	if(!$starimage)
{
$starimage = $displaygroup['starimage'];

	}

	}


if($starimage)
{


if($starimage)
{

Zeile 1698Zeile 1879
		}

eval("\$reputation = \"".$templates->get("member_profile_reputation")."\";");

		}

eval("\$reputation = \"".$templates->get("member_profile_reputation")."\";");

	}

	}


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


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

Zeile 1760Zeile 1941
		}
else
{

		}
else
{

 
			$userfields[$field] = $parser->parse_badwords($userfields[$field]);


			if($customfield['type'] == "textarea")
{
$customfieldval = nl2br(htmlspecialchars_uni($userfields[$field]));

			if($customfield['type'] == "textarea")
{
$customfieldval = nl2br(htmlspecialchars_uni($userfields[$field]));

Zeile 1964Zeile 2147
		}
}


		}
}


	$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".intval($mybb->input['uid'])."'");

	$query = $db->simple_select("users", "uid, username, email, hideemail, ignorelist", "uid='".intval($mybb->input['uid'])."'");

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

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

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

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

	

	

	if(!$to_user['uid'])

	if(!$to_user['uid'])

	{

	{

		error($lang->error_invaliduser);

		error($lang->error_invaliduser);

	}

	}

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

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

	{

	{

		error($lang->error_hideemail);

		error($lang->error_hideemail);

 
	}

if($to_user['ignorelist'] && (my_strpos(",".$to_user['ignorelist'].",", ",".$mybb->user['uid'].",") !== false && $mybb->usergroup['cansendemailoverride'] != 1))
{
error_no_permission();

	}

if(count($errors) > 0)

	}

if(count($errors) > 0)