Vergleich member.php - 1.6.0 - 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 5126 2010-07-27 07:48:04Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 14Zeile 14
define("ALLOWABLE_PAGE", "register,do_register,login,do_login,logout,lostpw,do_lostpw,activate,resendactivation,do_resendactivation,resetpassword");

$nosession['avatar'] = 1;

define("ALLOWABLE_PAGE", "register,do_register,login,do_login,logout,lostpw,do_lostpw,activate,resendactivation,do_resendactivation,resetpassword");

$nosession['avatar'] = 1;

$templatelist = "member_register,error_nousername,error_nopassword,error_passwordmismatch,error_invalidemail,error_usernametaken,error_emailmismatch,error_noemail,redirect_registered";

$templatelist = "member_register,error_nousername,error_nopassword,error_passwordmismatch,error_invalidemail,error_usernametaken,error_emailmismatch,error_noemail,redirect_registered,member_register_hiddencaptcha";

$templatelist .= ",redirect_loggedout,login,redirect_loggedin,error_invalidusername,error_invalidpassword,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_profile_modoptions,member_profile_signature,member_profile_groupimage,member_profile_referrals";
require_once "./global.php";


$templatelist .= ",redirect_loggedout,login,redirect_loggedin,error_invalidusername,error_invalidpassword,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_profile_modoptions,member_profile_signature,member_profile_groupimage,member_profile_referrals";
require_once "./global.php";


Zeile 80Zeile 80
if($mybb->input['action'] == "do_register" && $mybb->request_method == "post")
{
$plugins->run_hooks("member_do_register_start");

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

 

// If we have hidden CATPCHA enabled and it's filled, deny registration
if($mybb->settings['hiddencaptchaimage'])
{
$string = $mybb->settings['hiddencaptchaimagefield'];

if($mybb->input[$string] != '')
{
error($lang->error_spam_deny);
}
}


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


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

Zeile 154Zeile 165
		$errors = $userhandler->get_friendly_errors();
}


		$errors = $userhandler->get_friendly_errors();
}


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

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

	{

	{

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

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

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


		{

		{

			$errors[]  = $lang->error_regimageinvalid;





			// CAPTCHA validation failed
foreach($captcha->get_errors() as $error)
{
$errors[] = $error;
}

		}

		}

		$db->delete_query("captcha", "imagehash='$imagehash'");

 
	}

if(is_array($errors))

	}

if(is_array($errors))

Zeile 224Zeile 237
		else if($mybb->input['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

		else if($mybb->input['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

		}
else

		}
else

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

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

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

Zeile 276Zeile 303
		else if($mybb->settings['regtype'] == "randompass")
{
$emailsubject = $lang->sprintf($lang->emailsubject_randompassword, $mybb->settings['bbname']);

		else if($mybb->settings['regtype'] == "randompass")
{
$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);

$plugins->run_hooks("member_do_register_end");

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

$plugins->run_hooks("member_do_register_end");

Zeile 307Zeile 348
	if(!$mybb->settings['faxno'])
{
$mybb->settings['faxno'] = " ";

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

	}


	}


	eval("\$coppa_form = \"".$templates->get("member_coppa_form")."\";");
output_page($coppa_form);
}

	eval("\$coppa_form = \"".$templates->get("member_coppa_form")."\";");
output_page($coppa_form);
}





if($mybb->input['action'] == "register")
{
$bdaysel = '';

if($mybb->input['action'] == "register")
{
$bdaysel = '';

Zeile 334Zeile 375

$bdaymonthsel[$mybb->input['bday2']] = "selected=\"selected\"";
$mybb->input['bday3'] = intval($mybb->input['bday3']);


$bdaymonthsel[$mybb->input['bday2']] = "selected=\"selected\"";
$mybb->input['bday3'] = intval($mybb->input['bday3']);





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

// Is COPPA checking enabled?

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

// Is COPPA checking enabled?

Zeile 414Zeile 455
			if(is_array($explodedtpp))
{
foreach($explodedtpp as $val)

			if(is_array($explodedtpp))
{
foreach($explodedtpp as $val)

				{
$val = trim($val);

				{
$val = trim($val);

					$tppoptions .= "<option value=\"$val\">".$lang->sprintf($lang->tpp_option, $val)."</option>\n";

					$tppoptions .= "<option value=\"$val\">".$lang->sprintf($lang->tpp_option, $val)."</option>\n";

				}

				}

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

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

		}

		}

		if($mybb->settings['userpppoptions'])
{
$pppoptions = '';
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))

		if($mybb->settings['userpppoptions'])
{
$pppoptions = '';
$explodedppp = explode(",", $mybb->settings['userpppoptions']);
if(is_array($explodedppp))

			{

			{

				foreach($explodedppp as $val)
{
$val = trim($val);

				foreach($explodedppp as $val)
{
$val = trim($val);

Zeile 440Zeile 481
			if($mybb->cookies['mybb']['referrer'])
{
$query = $db->simple_select("users", "uid,username", "uid='".$db->escape_string($mybb->cookies['mybb']['referrer'])."'");

			if($mybb->cookies['mybb']['referrer'])
{
$query = $db->simple_select("users", "uid,username", "uid='".$db->escape_string($mybb->cookies['mybb']['referrer'])."'");

				$ref = $db->fetch_array($query);
$referrername = $ref['username'];
}

				$ref = $db->fetch_array($query);
$referrername = $ref['username'];
}

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

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

Zeile 477Zeile 518
		}
// Custom profile fields baby!
$altbg = "trow1";

		}
// Custom profile fields baby!
$altbg = "trow1";

		$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder'));

		$query = $db->simple_select("profilefields", "*", "required=1", array('order_by' => 'disporder'));

		while($profilefield = $db->fetch_array($query))
{
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);

		while($profilefield = $db->fetch_array($query))
{
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);

Zeile 497Zeile 538
			if($type == "multiselect")
{
if($errors)

			if($type == "multiselect")
{
if($errors)

				{

				{

					$useropts = $userfield;
}
else

					$useropts = $userfield;
}
else

				{

				{

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

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

Zeile 525Zeile 566
							$sel = "selected=\"selected\"";
}
$select .= "<option value=\"$val\" $sel>$val</option>\n";

							$sel = "selected=\"selected\"";
}
$select .= "<option value=\"$val\" $sel>$val</option>\n";

					}
if(!$profilefield['length'])
{

					}
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 552Zeile 593
					if(!$profilefield['length'])
{
$profilefield['length'] = 1;

					if(!$profilefield['length'])
{
$profilefield['length'] = 1;

					}

					}

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

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

Zeile 624Zeile 665
				if($type == "checkbox" || $type == "radio")
{
$id = "{$field}0";

				if($type == "checkbox" || $type == "radio")
{
$id = "{$field}0";

				}

				}

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

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

Zeile 661Zeile 702
			
}
// Spambot registration image thingy

			
}
// Spambot registration image thingy

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

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

		{

		{

			$randomstr = random_str(5);
$imagehash = md5(random_str(12));
$regimagearray = array(
"imagehash" => $imagehash,
"imagestring" => $randomstr,
"dateline" => TIME_NOW
);
$db->insert_query("captcha", $regimagearray);
eval("\$regimage = \"".$templates->get("member_register_regimage")."\";");

			require_once MYBB_ROOT.'inc/class_captcha.php';
$captcha = new captcha(true, "member_register_regimage");












			// JS validator extra
$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";
















			if($captcha->html)
{
$regimage = $captcha->html;

if($mybb->settings['captchaimage'] == 1)
{
// 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'])
{
$captcha_field = $mybb->settings['hiddencaptchaimagefield'];

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

		}
if($mybb->settings['regtype'] != "randompass")
{

		}
if($mybb->settings['regtype'] != "randompass")
{

Zeile 706Zeile 755
		{
$language = htmlspecialchars_uni($language);
if($user['language'] == $lname)

		{
$language = htmlspecialchars_uni($language);
if($user['language'] == $lname)

			{

			{

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

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

			}

			}

		}

$plugins->run_hooks("member_register_end");

		}

$plugins->run_hooks("member_register_end");

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

Zeile 793Zeile 870
	{
error($lang->error_activated_by_admin);
}

	{
error($lang->error_activated_by_admin);
}







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


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

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

Zeile 801Zeile 882
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");





	if($mybb->settings['regtype'] == "admin")
{
error($lang->error_activated_by_admin);

	if($mybb->settings['regtype'] == "admin")
{
error($lang->error_activated_by_admin);

Zeile 813Zeile 894
		LEFT JOIN ".TABLE_PREFIX."awaitingactivation a ON (a.uid=u.uid AND a.type='r')
WHERE u.email='".$db->escape_string($mybb->input['email'])."'
");

		LEFT JOIN ".TABLE_PREFIX."awaitingactivation a ON (a.uid=u.uid AND a.type='r')
WHERE u.email='".$db->escape_string($mybb->input['email'])."'
");

	$numusers = $db->num_rows($query);
if($numusers < 1)
{

	$numusers = $db->num_rows($query);
if($numusers < 1)
{

		error($lang->error_invalidemail);
}
else

		error($lang->error_invalidemail);
}
else

Zeile 841Zeile 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 849Zeile 944

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


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

}

}


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


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

{

{

	$plugins->run_hooks("member_lostpw");

eval("\$lostpw = \"".$templates->get("member_lostpw")."\";");

	$plugins->run_hooks("member_lostpw");

eval("\$lostpw = \"".$templates->get("member_lostpw")."\";");

Zeile 862Zeile 957
if($mybb->input['action'] == "do_lostpw" && $mybb->request_method == "post")
{
$plugins->run_hooks("member_do_lostpw_start");

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





	$email = $db->escape_string($email);
$query = $db->simple_select("users", "*", "email='".$db->escape_string($mybb->input['email'])."'");
$numusers = $db->num_rows($query);

	$email = $db->escape_string($email);
$query = $db->simple_select("users", "*", "email='".$db->escape_string($mybb->input['email'])."'");
$numusers = $db->num_rows($query);

Zeile 889Zeile 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);
}
}
$plugins->run_hooks("member_do_lostpw_end");

			my_mail($email, $emailsubject, $emailmessage);
}
}
$plugins->run_hooks("member_do_lostpw_end");





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

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





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

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

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

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

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

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



		{

		{

			error($lang->error_invalidpworusername);












			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;

		}

		}

	}
else




















		$user = $db->fetch_array($query);
if(!$user['uid'])
{
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'])."'");
$user = $db->fetch_array($query);

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

Zeile 929Zeile 1066
		$username = $user['username'];

// Generate a new password, then update it

		$username = $user['username'];

// Generate a new password, then update it

		$password = random_str();








		$password_length = intval($mybb->settings['minpasswordlength']);

if($password_length < 8)
{
$password_length = 8;
}

$password = random_str($password_length);

		$logindetails = update_password($user['uid'], md5($password), $user['salt']);

$email = $user['email'];

$plugins->run_hooks("member_resetpassword_process");

		$logindetails = update_password($user['uid'], md5($password), $user['salt']);

$email = $user['email'];

$plugins->run_hooks("member_resetpassword_process");





		$emailsubject = $lang->sprintf($lang->emailsubject_passwordreset, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->email_passwordreset, $username, $mybb->settings['bbname'], $password);
my_mail($email, $emailsubject, $emailmessage);

$plugins->run_hooks("member_resetpassword_reset");

		$emailsubject = $lang->sprintf($lang->emailsubject_passwordreset, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->email_passwordreset, $username, $mybb->settings['bbname'], $password);
my_mail($email, $emailsubject, $emailmessage);

$plugins->run_hooks("member_resetpassword_reset");





		error($lang->redirect_passwordreset);
}
else
{
$plugins->run_hooks("member_resetpassword_form");

		error($lang->redirect_passwordreset);
}
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 958Zeile 1118
if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
{
$plugins->run_hooks("member_do_login_start");

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

	

	

	// Checks to make sure the user can login; they haven't had too many tries at logging in.
// Is a fatal call if user has had too many tries
$logins = login_attempt_check();

	// Checks to make sure the user can login; they haven't had too many tries at logging in.
// Is a fatal call if user has had too many tries
$logins = login_attempt_check();

Zeile 975Zeile 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'])

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



	{

	{

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

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

if($login_captcha->validate_captcha() == false)
{
$correct = true;
$do_captcha = true;

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


				{

				{

					$db->delete_query("captcha", "imagehash='{$imagehash}'");
$errors[] = $lang->error_regimageinvalid;

					$errors[] = $error;


				}

				}

			}
else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
{
$errors[] = $lang->error_regimagerequired;
}
else
{
$errors[] = $lang->error_regimagerequired;
}
}

$do_captcha = true;
}































			}
}
}

// 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'])
{
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;
}
}
else
{
$correct = true;
}
}


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

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

Zeile 1086Zeile 1267
			
// Redirect to the URL if it is not member.php
redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);

			
// Redirect to the URL if it is not member.php
redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);

		}
else
{

		}
else
{

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

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

Zeile 1117Zeile 1298
	login_attempt_check();

// Redirect to the page where the user came from, but not if that was the login page.

	login_attempt_check();

// Redirect to the page where the user came from, but not if that was the login page.

	if($mybb->input['url'] && !preg_match("/action=login/i", $mybb->input['url']))
{
$redirect_url = htmlentities($mybb->input['url']);
}
elseif($_SERVER['HTTP_REFERER'])
{
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
}


	if($_SERVER['HTTP_REFERER'] && strpos($_SERVER['HTTP_REFERER'], "action=login") === false)
{
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
}
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->input['username'] && $mybb->request_method == "post")








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

	{
$username = htmlspecialchars_uni($mybb->input['username']);

	}

	}

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

	
if($mybb->input['password'] && $mybb->request_method == "post")
{
$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 1252Zeile 1451
	
if($mybb->user['uid'] != $uid)
{

	
if($mybb->user['uid'] != $uid)
{

		$query = $db->simple_select("users", "*", "uid='$uid'");
$memprofile = $db->fetch_array($query);

		$memprofile = get_user($uid);


	}
else
{

	}
else
{

Zeile 1276Zeile 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 1304Zeile 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 1346Zeile 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 1354Zeile 1553
	}

$daysreg = (TIME_NOW - $memprofile['regdate']) / (24*3600);

	}

$daysreg = (TIME_NOW - $memprofile['regdate']) / (24*3600);

 

if($daysreg < 1)
{
$daysreg = 1;
}


	$ppd = $memprofile['postnum'] / $daysreg;
$ppd = round($ppd, 2);
if($ppd > $memprofile['postnum'])

	$ppd = $memprofile['postnum'] / $daysreg;
$ppd = round($ppd, 2);
if($ppd > $memprofile['postnum'])

Zeile 1375Zeile 1580
	if($percent > 100)
{
$percent = 100;

	if($percent > 100)
{
$percent = 100;

	}


	}


	if(!empty($memprofile['icq']))
{
$memprofile['icq'] = intval($memprofile['icq']);

	if(!empty($memprofile['icq']))
{
$memprofile['icq'] = intval($memprofile['icq']);

Zeile 1391Zeile 1596
		$lang->away_note = $lang->sprintf($lang->away_note, $memprofile['username']);
$awaydate = my_date($mybb->settings['dateformat'], $memprofile['awaydate']);
if(!empty($memprofile['awayreason']))

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

		else
{
$awayreason = $lang->away_no_reason;

Zeile 1405Zeile 1611
		else
{
$returnhome = explode("-", $memprofile['returndate']);

		else
{
$returnhome = explode("-", $memprofile['returndate']);

 
			
// PHP native date functions use integers so timestamps for years after 2038 will not work
// Thus we use adodb_mktime

			if($returnhome[2] >= 2038)
{
require_once MYBB_ROOT."inc/functions_time.php";

			if($returnhome[2] >= 2038)
{
require_once MYBB_ROOT."inc/functions_time.php";

Zeile 1416Zeile 1625
				$returnmkdate = mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]);
$returndate = my_date($mybb->settings['dateformat'], $returnmkdate);
}

				$returnmkdate = mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]);
$returndate = my_date($mybb->settings['dateformat'], $returnmkdate);
}

 
			
// If our away time has expired already, we should be back, right?
if($returnmkdate < TIME_NOW)
{
$db->update_query('users', array('away' => '0', 'awaydate' => '', 'returndate' => '', 'awayreason' => ''), 'uid=\''.intval($memprofile['uid']).'\'');

// Update our status to "not away"
$memprofile['away'] = 0;
}
}

// Check if our away status is set to 1, it may have been updated already (see a few lines above)
if($memprofile['away'] == 1)
{
eval("\$awaybit = \"".$templates->get("member_profile_away")."\";");

		}

		}

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

 
	}
if($memprofile['dst'] == 1)
{

	}
if($memprofile['dst'] == 1)
{

Zeile 1452Zeile 1675
		
if($memprofile['birthdayprivacy'] != 'none')
{

		
if($memprofile['birthdayprivacy'] != 'none')
{

			if($membday[2])

			if($membday[0] && $membday[1] && $membday[2])

			{
$lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday']));


			{
$lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday']));


Zeile 1468Zeile 1691
					$membday = date($bdayformat, $membday);
}
$membdayage = $lang->membdayage;

					$membday = date($bdayformat, $membday);
}
$membdayage = $lang->membdayage;

 
			}
elseif($membday[2])
{
$membday = mktime(0, 0, 0, 1, 1, $membday[2]);
$membday = date("Y", $membday);
$membdayage = '';

			}
else
{

			}
else
{

Zeile 1478Zeile 1707
		}

if($memprofile['birthdayprivacy'] == 'age')

		}

if($memprofile['birthdayprivacy'] == 'age')

		{
$membday = $lang->birthdayhidden;
}

		{
$membday = $lang->birthdayhidden;
}

		else if($memprofile['birthdayprivacy'] == 'none')
{
$membday = $lang->birthdayhidden;
$membdayage = '';

		else if($memprofile['birthdayprivacy'] == 'none')
{
$membday = $lang->birthdayhidden;
$membdayage = '';

		}
}
else

		}
}
else

	{
$membday = $lang->not_specified;
$membdayage = '';

	{
$membday = $lang->not_specified;
$membdayage = '';

Zeile 1496Zeile 1725
	if(!$memprofile['displaygroup'])
{
$memprofile['displaygroup'] = $memprofile['usergroup'];

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

	}

	}


// Grab the following fields from the user's displaygroup
$displaygroupfields = array(


// Grab the following fields from the user's displaygroup
$displaygroupfields = array(

Zeile 1525Zeile 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'])

	{

	{

		// Set the number of stars if display group has constant number of stars
$stars = $displaygroup['stars'];
}
elseif(!$stars)
{

		// Set the number of stars if display group has constant number of stars
$stars = $displaygroup['stars'];
}
elseif(!$stars)
{

 
		if(!is_array($usertitles))
{
$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)

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

			foreach($usertitles as $title)

			{

			{

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




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

			}
}
}

			}
}
}

Zeile 1626Zeile 1867
	}

// Fetch the reputation for this user

	}

// Fetch the reputation for this user

	if($memperms['usereputationsystem'] == 1 && $displaygroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)

	if($memperms['usereputationsystem'] == 1 && $displaygroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1 && ($mybb->settings['posrep'] || $mybb->settings['neurep'] || $mybb->settings['negrep']))

	{
$bg_color = alt_trow();
$reputation = get_reputation($memprofile['reputation']);

	{
$bg_color = alt_trow();
$reputation = get_reputation($memprofile['reputation']);

Zeile 1700Zeile 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]));

			}

			}

			else
{
$customfieldval = htmlspecialchars_uni($userfields[$field]);
}
}

			else
{
$customfieldval = htmlspecialchars_uni($userfields[$field]);
}
}

 

$customfield['name'] = htmlspecialchars_uni($customfield['name']);

		eval("\$customfields .= \"".$templates->get("member_profile_customfields_field")."\";");
$bgcolor = alt_trow();
}
if($customfields)

		eval("\$customfields .= \"".$templates->get("member_profile_customfields_field")."\";");
$bgcolor = alt_trow();
}
if($customfields)

	{

	{

		eval("\$profilefields = \"".$templates->get("member_profile_customfields")."\";");
}
$memprofile['postnum'] = my_number_format($memprofile['postnum']);
$lang->ppd_percent_total = $lang->sprintf($lang->ppd_percent_total, my_number_format($ppd), $percent);
$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
if($memprofile['timeonline'] > 0)

		eval("\$profilefields = \"".$templates->get("member_profile_customfields")."\";");
}
$memprofile['postnum'] = my_number_format($memprofile['postnum']);
$lang->ppd_percent_total = $lang->sprintf($lang->ppd_percent_total, my_number_format($ppd), $percent);
$formattedname = format_name($memprofile['username'], $memprofile['usergroup'], $memprofile['displaygroup']);
if($memprofile['timeonline'] > 0)

	{

	{

		$timeonline = nice_time($memprofile['timeonline']);
}
else
{
$timeonline = $lang->none_registered;

		$timeonline = nice_time($memprofile['timeonline']);
}
else
{
$timeonline = $lang->none_registered;

	}

	}

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

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

	{

	{

		eval("\$adminoptions = \"".$templates->get("member_profile_adminoptions")."\";");
}
else

		eval("\$adminoptions = \"".$templates->get("member_profile_adminoptions")."\";");
}
else

Zeile 1747Zeile 1992
			{
$memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100).'...';
}

			{
$memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100).'...';
}

		}

		}

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

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

		}


		}


		eval("\$modoptions = \"".$templates->get("member_profile_modoptions")."\";");
}
else

		eval("\$modoptions = \"".$templates->get("member_profile_modoptions")."\";");
}
else

	{

	{

		$modoptions = '';

		$modoptions = '';

	}


	}


	$buddy_options = '';


	$buddy_options = '';


	if($mybb->user['uid'] != $mybb->input['uid'] && $mybb->user['uid'] != 0)

	if($mybb->user['uid'] != $memprofile['uid'] && $mybb->user['uid'] != 0)

	{
$buddy_list = explode(',', $mybb->user['buddylist']);
if(in_array($mybb->input['uid'], $buddy_list))
{

	{
$buddy_list = explode(',', $mybb->user['buddylist']);
if(in_array($mybb->input['uid'], $buddy_list))
{

			$buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&amp;delete={$mybb->input['uid']}&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_buddy.gif\" /> {$lang->remove_from_buddy_list}</a>";
}
else
{
$buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&amp;add_username=".urlencode($memprofile['username'])."&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_buddy.gif\" /> {$lang->add_to_buddy_list}</a>";
}

$ignore_list = explode(',', $mybb->user['ignorelist']);
if(in_array($mybb->input['uid'], $ignore_list))
{
$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&amp;manage=ignored&amp;delete={$mybb->input['uid']}&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_ignore.gif\" /> {$lang->remove_from_ignore_list}</a>";

			$buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&amp;delete={$mybb->input['uid']}&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_buddy.gif\" alt=\"{$lang->remove_from_buddy_list}\" /> {$lang->remove_from_buddy_list}</a>";











		}
else
{

		}
else
{

			$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&amp;manage=ignored&amp;add_username=".urlencode($memprofile['username'])."&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_ignore.gif\" /> {$lang->add_to_ignore_list}</a>";

			$buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&amp;add_username=".urlencode($memprofile['username'])."&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_buddy.gif\" alt=\"{$lang->add_to_buddy_list}\" /> {$lang->add_to_buddy_list}</a>";

		}

		}

	}












$ignore_list = explode(',', $mybb->user['ignorelist']);
if(in_array($mybb->input['uid'], $ignore_list))
{
$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&amp;manage=ignored&amp;delete={$mybb->input['uid']}&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_ignore.gif\" alt=\"{$lang->remove_from_ignore_list}\" /> {$lang->remove_from_ignore_list}</a>";
}
else
{
$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&amp;manage=ignored&amp;add_username=".urlencode($memprofile['username'])."&amp;my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_ignore.gif\" alt=\"{$lang->add_to_ignore_list}\" /> {$lang->add_to_ignore_list}</a>";
}
}


$plugins->run_hooks("member_profile_end");



$plugins->run_hooks("member_profile_end");


Zeile 1886Zeile 2131

// Guests or those without permission can't email other users
if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid'])


// Guests or those without permission can't email other users
if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid'])

	{
error_no_permission();
}

	{
error_no_permission();
}

	
// Check group limits
if($mybb->usergroup['maxemails'] > 0)

	
// Check group limits
if($mybb->usergroup['maxemails'] > 0)

	{

	{

		$query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "fromuid='{$mybb->user['uid']}' 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(*) AS sent_count", "fromuid='{$mybb->user['uid']}' AND dateline >= '".(TIME_NOW - (60*60*24))."'");
$sent_count = $db->fetch_field($query, "sent_count");
if($sent_count > $mybb->usergroup['maxemails'])

Zeile 1901Zeile 2146
			error($lang->error_max_emails_day);
}
}

			error($lang->error_max_emails_day);
}
}

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

if(!$to_user['uid'])

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

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

if(!$to_user['uid'])

	{

	{

		error($lang->error_invaliduser);
}

if($to_user['hideemail'] != 0)
{
error($lang->error_hideemail);

		error($lang->error_invaliduser);
}

if($to_user['hideemail'] != 0)
{
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)