Vergleich usercp.php - 1.4.5 - 1.4.11

  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: usercp.php 4314 2009-01-31 00:43:26Z Tikitiki $

 * $Id: usercp.php 4666 2009-12-28 23:03:01Z RyanGordon $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 73Zeile 73
	}
else if($mybb->settings['siglength'] > 0)
{

	}
else if($mybb->settings['siglength'] > 0)
{

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

		if($mybb->settings['sigcountmycode'] == 0)

		{
$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}

		{
$parsed_sig = $parser->text_parse_message($mybb->input['signature']);
}

Zeile 173Zeile 173
		$awaydate = TIME_NOW;
if($mybb->input['awayday'])
{

		$awaydate = TIME_NOW;
if($mybb->input['awayday'])
{

 
			// If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year

			if(!$mybb->input['awaymonth'])
{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}

			if(!$mybb->input['awaymonth'])
{
$mybb->input['awaymonth'] = my_date('n', $awaydate);
}



 
			if(!$mybb->input['awayyear'])
{
$mybb->input['awayyear'] = my_date('Y', $awaydate);
}

			if(!$mybb->input['awayyear'])
{
$mybb->input['awayyear'] = my_date('Y', $awaydate);
}

 
			
$return_month = intval(substr($mybb->input['awaymonth'], 0, 2));
$return_day = intval(substr($mybb->input['awayday'], 0, 2));
$return_year = min(intval($mybb->input['awayyear']), 9999);





			$returntimestamp = gmmktime(0, 0, 0, $mybb->input['awaymonth'], $mybb->input['awayday'], $mybb->input['awayyear']);


			// Check if return date is after the away date.
$returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);

			$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

			$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));

			if ($returntimestamp < $awaytimestamp && $mybb->input['awayyear'] < my_date("Y"))

			if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate)))

			{
error($lang->error_usercp_return_date_past);
}

			{
error($lang->error_usercp_return_date_past);
}

			$returndate = intval($mybb->input['awayday'])."-".intval($mybb->input['awaymonth'])."-".intval($mybb->input['awayyear']);


			
$returndate = "{$return_day}-{$return_month}-{$return_year}";

		}
else
{

		}
else
{

Zeile 200Zeile 206
			"date" => $awaydate,
"returndate" => $returndate,
"awayreason" => $mybb->input['awayreason']

			"date" => $awaydate,
"returndate" => $returndate,
"awayreason" => $mybb->input['awayreason']

		);
}
else
{

		);
}
else
{

		$away = array(
"away" => 0,
"date" => '',

		$away = array(
"away" => 0,
"date" => '',

Zeile 272Zeile 278
		$bday[0] = $mybb->input['bday1'];
$bday[1] = $mybb->input['bday2'];
$bday[2] = intval($mybb->input['bday3']);

		$bday[0] = $mybb->input['bday1'];
$bday[1] = $mybb->input['bday2'];
$bday[2] = intval($mybb->input['bday3']);

	}
else
{

	}
else
{

		$user = $mybb->user;
$bday = explode("-", $user['birthday']);
}

		$user = $mybb->user;
$bday = explode("-", $user['birthday']);
}

Zeile 322Zeile 328
	else
{
$user['website'] = htmlspecialchars_uni($user['website']);

	else
{
$user['website'] = htmlspecialchars_uni($user['website']);

	}

	}


if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);


if($user['icq'] != "0")
{
$user['icq'] = intval($user['icq']);

	}

	}

	if($user['icq'] == 0)

	if($user['icq'] == 0)

	{

	{

		$user['icq'] = "";
}
if($errors)

		$user['icq'] = "";
}
if($errors)

Zeile 344Zeile 350
		{
if($user['away'] == 1)
{

		{
if($user['away'] == 1)
{

				$awaycheck[1] = "checked=\"checked\"";
}
else
{

				$awaycheck[1] = "checked=\"checked\"";
}
else
{

				$awaycheck[0] = "checked=\"checked\"";
}
$returndate = array();

				$awaycheck[0] = "checked=\"checked\"";
}
$returndate = array();

Zeile 369Zeile 375
			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

			{
$awaynotice = $lang->away_notice;
$awaycheck[0] = "checked=\"checked\"";

			}

			}

			$returndate = explode("-", $mybb->user['returndate']);
}
$returndatesel = '';

			$returndate = explode("-", $mybb->user['returndate']);
}
$returndatesel = '';

Zeile 411Zeile 417
			$userfield = $user[$field];
}
if($type == "multiselect")

			$userfield = $user[$field];
}
if($type == "multiselect")

		{
if($errors)
{
$useropts = $userfield;
}
else
{

		{
if($errors)
{
$useropts = $userfield;
}
else
{

				$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)

				$useropts = explode("\n", $userfield);
}
if(is_array($useropts))
{
foreach($useropts as $key => $val)

				{

				{

					$seloptions[$val] = $val;
}
}

					$seloptions[$val] = $val;
}
}

Zeile 441Zeile 447
						$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'])
{
$profilefield['length'] = 3;

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

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

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

				}

				}

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

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

Zeile 559Zeile 565
	if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->usergroup['usertitle'] == "")

	if($mybb->usergroup['cancustomtitle'] == 1)
{
if($mybb->usergroup['usertitle'] == "")

		{

		{

			$query = $db->simple_select("usertitles", "*", "posts <='".$mybb->user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];

			$query = $db->simple_select("usertitles", "*", "posts <='".$mybb->user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$utitle = $db->fetch_array($query);
$defaulttitle = $utitle['title'];

		}
else

		}
else

		{
$defaulttitle = $mybb->usergroup['usertitle'];

		{
$defaulttitle = $mybb->usergroup['usertitle'];

		}

		}

		if(empty($user['usertitle']))

		if(empty($user['usertitle']))

		{

		{

			$lang->current_custom_usertitle = '';
}
else

			$lang->current_custom_usertitle = '';
}
else

Zeile 581Zeile 587
			}
}
eval("\$customtitle = \"".$templates->get("usercp_profile_customtitle")."\";");

			}
}
eval("\$customtitle = \"".$templates->get("usercp_profile_customtitle")."\";");

	}
else
{

	}
else
{

		$customtitle = "";
}
eval("\$editprofile = \"".$templates->get("usercp_profile")."\";");

		$customtitle = "";
}
eval("\$editprofile = \"".$templates->get("usercp_profile")."\";");

Zeile 749Zeile 755
	else
{
$showsigscheck = "";

	else
{
$showsigscheck = "";

	}

	}


if($user['showavatars'] == 1)


if($user['showavatars'] == 1)

	{

	{

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

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

	}
else

	}
else

	{
$showavatarscheck = "";

	{
$showavatarscheck = "";

	}

	}


if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";


if($user['showquickreply'] == 1)
{
$showquickreplycheck = "checked=\"checked\"";

	}

	}

	else
{
$showquickreplycheck = "";

	else
{
$showquickreplycheck = "";

Zeile 772Zeile 778
	if($user['remember'] == 1)
{
$remembercheck = "checked=\"checked\"";

	if($user['remember'] == 1)
{
$remembercheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$remembercheck = "";

		$remembercheck = "";

	}


	}


	if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";

	if($user['receivepms'] == 1)
{
$receivepmscheck = "checked=\"checked\"";

	}
else

	}
else

	{
$receivepmscheck = "";

	{
$receivepmscheck = "";

	}

	}


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)


if($user['pmnotice'] == 1 || $user['pmnotice'] == 2)

	{

	{

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

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

	}


	}


	if($user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";

	if($user['dstcorrection'] == 2)
{
$dst_auto_selected = "selected=\"selected\"";

	}

	}

	else if($user['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

	else if($user['dstcorrection'] == 1)
{
$dst_enabled_selected = "selected=\"selected\"";

	}
else

	}
else

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

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

	}

	}


if($user['showcodebuttons'] == 1)


if($user['showcodebuttons'] == 1)

	{

	{

		$showcodebuttonscheck = "checked=\"checked\"";
}
else
{
$showcodebuttonscheck = "";

		$showcodebuttonscheck = "checked=\"checked\"";
}
else
{
$showcodebuttonscheck = "";

	}

if($user['showredirect'] != 0)

	}

if($user['showredirect'] != 0)

	{
$showredirectcheck = "checked=\"checked\"";

	{
$showredirectcheck = "checked=\"checked\"";

	}

	}

	else
{
$showredirectcheck = "";

	else
{
$showredirectcheck = "";

Zeile 830Zeile 836
	if($user['pmnotify'] != 0)
{
$pmnotifycheck = "checked=\"checked\"";

	if($user['pmnotify'] != 0)
{
$pmnotifycheck = "checked=\"checked\"";

	}

	}

	else
{
$pmnotifycheck = '';

	else
{
$pmnotifycheck = '';

Zeile 840Zeile 846
	if($user['threadmode'] != "threaded" && $user['threadmode'] != "linear")
{
$user['threadmode'] = ''; // Leave blank to show default

	if($user['threadmode'] != "threaded" && $user['threadmode'] != "linear")
{
$user['threadmode'] = ''; // Leave blank to show default

	}


	}


	if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";

	if($user['classicpostbit'] != 0)
{
$classicpostbitcheck = "checked=\"checked\"";

	}

	}

	else
{
$classicpostbitcheck = '';

	else
{
$classicpostbitcheck = '';

	}


	}



$date_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($date_formats as $key => $format)
{
if($user['dateformat'] == $key)


$date_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($date_formats as $key => $format)
{
if($user['dateformat'] == $key)

		{

		{

			$date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";
}
else
{
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";

			$date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";
}
else
{
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";

		}
}


		}
}


	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{

	$time_format_options = "<option value=\"0\">{$lang->use_default}</option>";
foreach($time_formats as $key => $format)
{

Zeile 934Zeile 940
	$errors = array();

$plugins->run_hooks("usercp_do_email_start");

	$errors = array();

$plugins->run_hooks("usercp_do_email_start");

	if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;
}
else
{

	if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;
}
else
{

		// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");

		// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");

Zeile 1025Zeile 1031

$plugins->run_hooks("usercp_do_password_start");
if(validate_password_from_uid($mybb->user['uid'], $mybb->input['oldpassword']) == false)


$plugins->run_hooks("usercp_do_password_start");
if(validate_password_from_uid($mybb->user['uid'], $mybb->input['oldpassword']) == false)

	{
$errors[] = $lang->error_invalidpassword;
}
else
{
// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");

$user = array(

	{
$errors[] = $lang->error_invalidpassword;
}
else
{
// Set up user handler.
require_once "inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");

$user = array(

			"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2']

			"uid" => $mybb->user['uid'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2']

Zeile 1043Zeile 1049
		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		{

		{

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

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

Zeile 1058Zeile 1064
	{
$mybb->input['action'] = "password";
$errors = inline_error($errors);

	{
$mybb->input['action'] = "password";
$errors = inline_error($errors);

	}
}


	}
}


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

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

{

{

	$plugins->run_hooks("usercp_password_start");
eval("\$editpassword = \"".$templates->get("usercp_password")."\";");
$plugins->run_hooks("usercp_password_end");
output_page($editpassword);
}

	$plugins->run_hooks("usercp_password_start");
eval("\$editpassword = \"".$templates->get("usercp_password")."\";");
$plugins->run_hooks("usercp_password_end");
output_page($editpassword);
}





if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("usercp_do_changename_start");

if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("usercp_do_changename_start");

	if($mybb->usergroup['canchangename'] != 1)
{
error_no_permission();
}

if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;

	if($mybb->usergroup['canchangename'] != 1)
{
error_no_permission();
}

if(validate_password_from_uid($mybb->user['uid'], $mybb->input['password']) == false)
{
$errors[] = $lang->error_invalidpassword;

	}
else
{

	}
else
{

Zeile 1094Zeile 1100
			"uid" => $mybb->user['uid'],
"username" => $mybb->input['username']
);

			"uid" => $mybb->user['uid'],
"username" => $mybb->input['username']
);





		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

Zeile 1106Zeile 1112
			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);

			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);





		}
}
if(count($errors) > 0)
{
$errors = inline_error($errors);
$mybb->input['action'] = "changename";

		}
}
if(count($errors) > 0)
{
$errors = inline_error($errors);
$mybb->input['action'] = "changename";

	}
}


	}
}


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

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

Zeile 1129Zeile 1135
}

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

}

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

{

{

	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


	// Verify incoming POST request
verify_post_check($mybb->input['my_post_key']);


Zeile 1698Zeile 1704
		{
$avatar_error = $lang->error_noavatar;
}

		{
$avatar_error = $lang->error_noavatar;
}






		
$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']);
$mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);


		if(empty($avatar_error))
{
if($mybb->input['gallery'] == "default")

		if(empty($avatar_error))
{
if($mybb->input['gallery'] == "default")

Zeile 2230Zeile 2239
		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])

			{
$status = "online";
}

			{
$status = "online";
}

Zeile 2258Zeile 2267
		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

		while($user = $db->fetch_array($query))
{
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])

			if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])

			{
$status = "online";
}

			{
$status = "online";
}

Zeile 2605Zeile 2614
			}
else
{

			}
else
{

				$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";

				$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&amp;leavegroup=".$usergroup['gid']."&amp;my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";

			}
if($usergroup['description'])
{

			}
if($usergroup['description'])
{