Vergleich usercp.php - 1.4.4 - 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 4254 2008-10-29 21:52:31Z 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'])

			if(!$mybb->input['awayyear'])

			{

			{

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

				$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 199Zeile 205
			"away" => 1,
"date" => $awaydate,
"returndate" => $returndate,

			"away" => 1,
"date" => $awaydate,
"returndate" => $returndate,

			"awayreason" => $db->escape_string($mybb->input['awayreason'])

			"awayreason" => $mybb->input['awayreason']

		);
}
else

		);
}
else

Zeile 299Zeile 305
	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$bdayprivacysel .= "<option value=\"all\" selected=\"selected\">{$lang->birthdayprivacyall}</option>\n";

	if($user['birthdayprivacy'] == 'all' || !$user['birthdayprivacy'])
{
$bdayprivacysel .= "<option value=\"all\" selected=\"selected\">{$lang->birthdayprivacyall}</option>\n";

		$bdayprivacysel .= "<option value=\"none\">{$lang->birthdayprivacynone}</option>\n";

		$bdayprivacysel .= "<option value=\"none\">{$lang->birthdayprivacynone}</option>\n";

		$bdayprivacysel .= "<option value=\"age\">{$lang->birthdayprivacyage}</option>";
}
else if($user['birthdayprivacy'] == 'none')

		$bdayprivacysel .= "<option value=\"age\">{$lang->birthdayprivacyage}</option>";
}
else if($user['birthdayprivacy'] == 'none')

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

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

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 527Zeile 533
		else
{
$value = htmlspecialchars_uni($userfield);

		else
{
$value = htmlspecialchars_uni($userfield);

			$code = "<input type=\"text\" name=\"profile_fields[$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]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";

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

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

Zeile 558Zeile 569
			$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'];
}

Zeile 929Zeile 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
{
// Set up user handler.
require_once "inc/datahandlers/user.php";

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

$user = array(

		$userhandler = new UserDataHandler("update");

$user = array(

Zeile 983Zeile 994
				$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);
}

				$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);
}

		}
}

		}
}

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

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

Zeile 1053Zeile 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
{
// Set up user handler.

	else
{
// Set up user handler.

Zeile 1124Zeile 1135
}

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

}

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

{
// Verify incoming POST request

{
// Verify incoming POST request

	verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("usercp_do_subscriptions_start");

	verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("usercp_do_subscriptions_start");

Zeile 1244Zeile 1255
				SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0

				SELECT fid
FROM ".TABLE_PREFIX."forums
WHERE active != 0

				ORDER BY pid, disporder

				ORDER BY pid, disporder

			");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

			");

$forumsread = unserialize($mybb->cookies['mybb']['forumread']);

Zeile 1291Zeile 1302
				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}

				$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
}
}






$icon_cache = $cache->read("posticons");


		// Now we can build our subscription list
foreach($subscriptions as $thread)
{

		// Now we can build our subscription list
foreach($subscriptions as $thread)
{

Zeile 1303Zeile 1316
			// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);

			// Sanitize
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);





			// Build our links
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

			// Build our links
$thread['threadlink'] = get_thread_link($thread['tid']);
$thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");

Zeile 1313Zeile 1326
			{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			{
$icon = $icon_cache[$thread['icon']];
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";

			}
else

			}
else

			{
$icon = "&nbsp;";
}

			{
$icon = "&nbsp;";
}

Zeile 1691Zeile 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 2223Zeile 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 2251Zeile 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 2598Zeile 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'])
{