Vergleich member.php - 1.4.4 - 1.4.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.4

<?php
/**
* MyBB 1.4

 * Copyright � 2008 MyBB Group, All Rights Reserved

 * Copyright © 2008 MyBB Group, All Rights Reserved

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 *
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: member.php 4274 2008-11-19 03:22:50Z Tikitiki $

 * $Id: member.php 4811 2010-03-12 17:17:23Z Huji $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 610Zeile 610
			else
{
$value = htmlspecialchars_uni($userfield);

			else
{
$value = htmlspecialchars_uni($userfield);

				$code = "<input type=\"text\" name=\"profile_fields[$field]\" id=\"{$field}\" class=\"textbox\" size=\"{$profilefield['length']}\" maxlength=\"{$profilefield['maxlength']}\" value=\"$value\" />";






				$maxlength = "";
if($profilefield['maxlength'] > 0)
{
$maxlength = " maxlength=\"{$profilefield['maxlength']}\"";
}
$code = "<input type=\"text\" name=\"profile_fields[$field]\" id=\"{$field}\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";

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

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

Zeile 677Zeile 682
			// JS validator extra
$lang->js_validator_password_length = $lang->sprintf($lang->js_validator_password_length, $mybb->settings['minpasswordlength']);
$validator_extra .= "\tregValidator.register('password', 'length', {match_field:'password2', min: {$mybb->settings['minpasswordlength']}, failure_message:'{$lang->js_validator_password_length}'});\n";

			// JS validator extra
$lang->js_validator_password_length = $lang->sprintf($lang->js_validator_password_length, $mybb->settings['minpasswordlength']);
$validator_extra .= "\tregValidator.register('password', 'length', {match_field:'password2', min: {$mybb->settings['minpasswordlength']}, failure_message:'{$lang->js_validator_password_length}'});\n";





			// See if the board has "require complex passwords" enabled.
if($mybb->settings['requirecomplexpasswords'] == 1)
{

			// See if the board has "require complex passwords" enabled.
if($mybb->settings['requirecomplexpasswords'] == 1)
{

Zeile 742Zeile 747
		if(!$activation['uid'])
{
error($lang->error_alreadyactivated);

		if(!$activation['uid'])
{
error($lang->error_alreadyactivated);

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

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

		{
error($lang->error_badactivationcode);
}

		{
error($lang->error_badactivationcode);
}

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


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


		if($mybb->settings['failedlogintext'] == 1)

		if($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1)

		{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}

		{
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
}

Zeile 1053Zeile 1058
		$db->update_query("sessions", $newsession, "sid='".$session->sid."'");

$db->update_query("users", array("loginattempts" => 1), "uid='{$user['uid']}'");

		$db->update_query("sessions", $newsession, "sid='".$session->sid."'");

$db->update_query("users", array("loginattempts" => 1), "uid='{$user['uid']}'");

	

		

		// Temporarily set the cookie remember option for the login cookies
$mybb->user['remember'] = $user['remember'];


		// Temporarily set the cookie remember option for the login cookies
$mybb->user['remember'] = $user['remember'];


Zeile 1102Zeile 1107
	// 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
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
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 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']);

		$redirect_url = htmlentities($mybb->input['url']);

	}

	}

	elseif($_SERVER['HTTP_REFERER'])
{
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);

	elseif($_SERVER['HTTP_REFERER'])
{
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);

	}


	}


	$captcha = "";
// Show captcha image for guests if enabled
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && $do_captcha == true)

	$captcha = "";
// Show captcha image for guests if enabled
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && $do_captcha == true)

	{
if(!$correct)
{
$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")."\";");
}

	{	
$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")

	}

$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")
{

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

Zeile 1145Zeile 1147

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


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

}

}


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


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

Zeile 1301Zeile 1303
	}
else
{

	}
else
{

 
		$alttrow = "trow1"; // To properly sort the contact details below

		$sendemail = '';

		$sendemail = '';

 
	}

// Clean alt_trow for the contact details
$cat_array = array(
"pm",
"icq",
"aim",
"yahoo",
"msn",
);

$bgcolors = array();
foreach($cat_array as $cat)
{
$bgcolors[$cat] = alt_trow();

	}

if($memprofile['website'])
{
$memprofile['website'] = htmlspecialchars_uni($memprofile['website']);
$website = "<a href=\"{$memprofile['website']}\" target=\"_blank\">{$memprofile['website']}</a>";

	}

if($memprofile['website'])
{
$memprofile['website'] = htmlspecialchars_uni($memprofile['website']);
$website = "<a href=\"{$memprofile['website']}\" target=\"_blank\">{$memprofile['website']}</a>";

	}
else

	}
else

	{
$website = '';
}

if($memprofile['signature'])

	{
$website = '';
}

if($memprofile['signature'])

	{

	{

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

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

Zeile 1345Zeile 1363
	{
$percent = $memprofile['postnum']*100/$numposts;
$percent = round($percent, 2);

	{
$percent = $memprofile['postnum']*100/$numposts;
$percent = round($percent, 2);

	}

	}

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

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


$query = $db->simple_select("users", "COUNT(uid) AS referrals", "referrer='{$memprofile['uid']}'");
$referrals = $db->fetch_field($query, "referrals");

 

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


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

Zeile 1475Zeile 1490
	{
$memprofile['displaygroup'] = $memprofile['usergroup'];
}

	{
$memprofile['displaygroup'] = $memprofile['usergroup'];
}

 

// Grab the following fields from the user's displaygroup
$displaygroupfields = array(
"title",
"usertitle",
"stars",
"starimage",
"image",
"usereputationsystem"
);

	$displaygroup = usergroup_displaygroup($memprofile['displaygroup']);

// Get the user title for this user

	$displaygroup = usergroup_displaygroup($memprofile['displaygroup']);

// Get the user title for this user

Zeile 1499Zeile 1524
			if($memprofile['postnum'] >= $title['posts'])
{
$usertitle = $title['title'];

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

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

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

				break;
}
}
}


				break;
}
}
}


	if($displaygroup['stars'])

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

	{
// Set the number of stars if display group has constant number of stars

	{
// Set the number of stars if display group has constant number of stars

		$stars = $displaygroup['stars'];
}

		$stars = $displaygroup['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)

	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)

Zeile 1527Zeile 1552
	}

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

	}

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

	{

	{

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

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

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

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

	}

	}

	$starimage = str_replace("{theme}", $theme['imgdir'], $starimage);
$userstars = '';
for($i = 0; $i < $stars; ++$i)
{
$userstars .= "<img src=\"$starimage\" border=\"0\" alt=\"*\" />";
}

	$starimage = str_replace("{theme}", $theme['imgdir'], $starimage);
$userstars = '';
for($i = 0; $i < $stars; ++$i)
{
$userstars .= "<img src=\"$starimage\" border=\"0\" alt=\"*\" />";
}

	

	

	// User is currently online and this user has permissions to view the user on the WOL
$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins']*60;

	// User is currently online and this user has permissions to view the user on the WOL
$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins']*60;

	$query = $db->simple_select("sessions", "location", "uid='$uid' AND time>'{$timesearch}'", array('order_by' => 'time', 'order_dir' => 'DESC', 'limit' => 1));
$location = $db->fetch_field($query, 'location');

	$query = $db->simple_select("sessions", "location,nopermission", "uid='$uid' AND time>'{$timesearch}'", array('order_by' => 'time', 'order_dir' => 'DESC', 'limit' => 1));
$session = $db->fetch_array($query);

	

	

	if(($memprofile['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $memprofile['uid'] == $mybb->user['uid']) && $location)

	if(($memprofile['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $memprofile['uid'] == $mybb->user['uid']) && !empty($session))

	{
// Fetch their current location
$lang->load("online");
require_once MYBB_ROOT."inc/functions_online.php";

	{
// Fetch their current location
$lang->load("online");
require_once MYBB_ROOT."inc/functions_online.php";

		$activity = fetch_wol_activity($location);

		$activity = fetch_wol_activity($session['location'], $session['nopermission']);

		$location = build_friendly_wol_location($activity);
$location_time = my_date($mybb->settings['timeformat'], $memprofile['lastactive']);

		$location = build_friendly_wol_location($activity);
$location_time = my_date($mybb->settings['timeformat'], $memprofile['lastactive']);





		eval("\$online_status = \"".$templates->get("member_profile_online")."\";");
}
// User is offline

		eval("\$online_status = \"".$templates->get("member_profile_online")."\";");
}
// User is offline

Zeile 1575Zeile 1600
	}

// Fetch the reputation for this user

	}

// Fetch the reputation for this user

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

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

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


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


Zeile 1612Zeile 1637
	$userfields = $db->fetch_array($query);
$customfields = '';
$bgcolor = "trow1";

	$userfields = $db->fetch_array($query);
$customfields = '';
$bgcolor = "trow1";

 
	$alttrow = "trow1";

	// If this user is an Administrator or a Moderator then we wish to show all profile fields

	// If this user is an Administrator or a Moderator then we wish to show all profile fields

	if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['gid'] == 6)

	if($mybb->usergroup['cancp'] == 1 || $mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['canmodcp'] == 1)

	{
$field_hidden = '1=1';

	{
$field_hidden = '1=1';

	}

	}

	else
{
$field_hidden = "hidden=0";

	else
{
$field_hidden = "hidden=0";

Zeile 1633Zeile 1659
		if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))
{
foreach($useropts as $val)

		if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))
{
foreach($useropts as $val)

			{

			{

				if($val != '')
{
$customfieldval .= "<li style=\"margin-left: 0;\">{$val}</li>";

				if($val != '')
{
$customfieldval .= "<li style=\"margin-left: 0;\">{$val}</li>";

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

Zeile 1666Zeile 1692
	$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)

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

		$timeonline = nice_time($memprofile['timeonline']);
}

	else
{
$timeonline = $lang->none_registered;
}

	else
{
$timeonline = $lang->none_registered;
}


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


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

Zeile 1682Zeile 1708
	{
$modoptions = '';
}

	{
$modoptions = '';
}

	



	$plugins->run_hooks("member_profile_end");

eval("\$profile = \"".$templates->get("member_profile")."\";");

	$plugins->run_hooks("member_profile_end");

eval("\$profile = \"".$templates->get("member_profile")."\";");

Zeile 1707Zeile 1733
	{
$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");

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

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

		{
$lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']);
error($lang->error_max_emails_day);