Vergleich usercp.php - 1.8.16 - 1.8.25

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 42Zeile 42
if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0)
{
error_no_permission();

if($mybb->user['uid'] == 0 || $mybb->usergroup['canusercp'] == 0)
{
error_no_permission();

}

if(!$mybb->user['pmfolders'])
{
$mybb->user['pmfolders'] = '1**$%%$2**$%%$3**$%%$4**';
$db->update_query('users', array('pmfolders' => $mybb->user['pmfolders']), "uid = {$mybb->user['uid']}");

 
}

$errors = '';


}

$errors = '';


$mybb->input['action'] = $mybb->get_input('action');


$mybb->input['action'] = $mybb->get_input('action');


usercp_menu();

usercp_menu();





$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

$server_http_referer = htmlentities($_SERVER['HTTP_REFERER']);

 

if(my_strpos($server_http_referer, $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($server_http_referer, '/') === 0)
{
$server_http_referer = my_substr($server_http_referer, 1);
}
$url_segments = explode('/', $server_http_referer);
$server_http_referer = $mybb->settings['bburl'].'/'.end($url_segments);
}


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


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

Zeile 144Zeile 148
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

 

$user = array();


$plugins->run_hooks("usercp_do_profile_start");



$plugins->run_hooks("usercp_do_profile_start");


Zeile 207Zeile 213
	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


	$user = array(

	$user = array_merge($user, array(

		"uid" => $mybb->user['uid'],
"postnum" => $mybb->user['postnum'],
"usergroup" => $mybb->user['usergroup'],

		"uid" => $mybb->user['uid'],
"postnum" => $mybb->user['postnum'],
"usergroup" => $mybb->user['usergroup'],

Zeile 216Zeile 222
		"birthdayprivacy" => $mybb->get_input('birthdayprivacy'),
"away" => $away,
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)

		"birthdayprivacy" => $mybb->get_input('birthdayprivacy'),
"away" => $away,
"profile_fields" => $mybb->get_input('profile_fields', MyBB::INPUT_ARRAY)

	);
foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield)
{
$csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '')
{
continue;
}

if(!is_member($mybb->settings[$csetting]))
{
continue;
}

	));
foreach(array('icq', 'skype', 'google') as $cfield)
{
$csetting = 'allow'.$cfield.'field';
if($mybb->settings[$csetting] == '')
{
continue;
}

if(!is_member($mybb->settings[$csetting]))
{
continue;
}


if($cfield == 'icq')
{
$user[$cfield] = $mybb->get_input($cfield, 1);


if($cfield == 'icq')
{
$user[$cfield] = $mybb->get_input($cfield, 1);

 

if(my_strlen($user[$cfield]) > 10)
{
error($lang->contact_field_icqerror);
}

		}
else
{
$user[$cfield] = $mybb->get_input($cfield);

		}
else
{
$user[$cfield] = $mybb->get_input($cfield);

 

if(my_strlen($user[$cfield]) > 75)
{
error($lang->contact_field_error);
}

		}
}


		}
}


Zeile 366Zeile 382
	{
$user['skype'] = htmlspecialchars_uni($user['skype']);
$user['google'] = htmlspecialchars_uni($user['google']);

	{
$user['skype'] = htmlspecialchars_uni($user['skype']);
$user['google'] = htmlspecialchars_uni($user['google']);

		$user['yahoo'] = htmlspecialchars_uni($user['yahoo']);

 
	}

$contact_fields = array();
$contactfields = '';
$cfieldsshow = false;


	}

$contact_fields = array();
$contactfields = '';
$cfieldsshow = false;


	foreach(array('icq', 'yahoo', 'skype', 'google') as $cfield)

	foreach(array('icq', 'skype', 'google') as $cfield)

	{
$contact_fields[$cfield] = '';
$csetting = 'allow'.$cfield.'field';

	{
$contact_fields[$cfield] = '';
$csetting = 'allow'.$cfield.'field';

Zeile 528Zeile 543
					foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);

					foreach($useropts as $key => $val)
{
$val = htmlspecialchars_uni($val);

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

$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

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

$sel = "";
if(isset($seloptions[$val]) && $val == $seloptions[$val])
{
$sel = " selected=\"selected\"";
}

eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");

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

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

Zeile 582Zeile 597
			}
elseif($type == "radio")
{

			}
elseif($type == "radio")
{

 
				$userfield = htmlspecialchars_uni($userfield);

				$expoptions = explode("\n", $options);
if(is_array($expoptions))
{

				$expoptions = explode("\n", $options);
if(is_array($expoptions))
{

Zeile 599Zeile 615
			}
elseif($type == "checkbox")
{

			}
elseif($type == "checkbox")
{

 
				$userfield = htmlspecialchars_uni($userfield);

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

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

Zeile 649Zeile 666
			if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

			if($profilefield['required'] == 1)
{
eval("\$requiredfields .= \"".$templates->get("usercp_profile_customfield")."\";");

			}

			}

			else
{
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");

			else
{
eval("\$customfields .= \"".$templates->get("usercp_profile_customfield")."\";");

Zeile 683Zeile 700
					$defaulttitle = htmlspecialchars_uni($title['title']);
break;
}

					$defaulttitle = htmlspecialchars_uni($title['title']);
break;
}

			}

			}

		}
else
{

		}
else
{

Zeile 739Zeile 756
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

 

$user = array();


$plugins->run_hooks("usercp_do_options_start");



$plugins->run_hooks("usercp_do_options_start");


Zeile 746Zeile 765
	require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


	$user = array(

	$user = array_merge($user, array(

		"uid" => $mybb->user['uid'],
"style" => $mybb->get_input('style', MyBB::INPUT_INT),
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),

		"uid" => $mybb->user['uid'],
"style" => $mybb->get_input('style', MyBB::INPUT_INT),
"dateformat" => $mybb->get_input('dateformat', MyBB::INPUT_INT),

Zeile 755Zeile 774
		"language" => $mybb->get_input('language'),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']

		"language" => $mybb->get_input('language'),
'usergroup' => $mybb->user['usergroup'],
'additionalgroups' => $mybb->user['additionalgroups']

	);

	));


$user['options'] = array(
"allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),


$user['options'] = array(
"allownotices" => $mybb->get_input('allownotices', MyBB::INPUT_INT),

Zeile 812Zeile 831

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


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

	$plugins->run_hooks("usercp_options_start");


 
	if($errors != '')

	if($errors != '')

	{

	{

		$user = $mybb->input;
}
else
{
$user = $mybb->user;
}

		$user = $mybb->input;
}
else
{
$user = $mybb->user;
}

 

$plugins->run_hooks("usercp_options_start");


$languages = $lang->get_languages();
$board_language = $langoptions = '';


$languages = $lang->get_languages();
$board_language = $langoptions = '';

Zeile 1195Zeile 1214
		}
else
{

		}
else
{

			if($mybb->user['usergroup'] != "5" && $mybb->usergroup['cancp'] != 1 && $mybb->settings['regtype'] != "verify")












































			$activation = false;
// Checking for pending activations for non-activated accounts
if($mybb->user['usergroup'] == 5 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))
{
$query = $db->simple_select("awaitingactivation", "*", "uid='".$mybb->user['uid']."' AND (type='r' OR type='b')");
$activation = $db->fetch_array($query);
}
if($activation)
{
$userhandler->update_user();

$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");

// Send new activation mail for non-activated accounts
$activationcode = random_str();
$activationarray = array(
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"code" => $activationcode,
"type" => $activation['type']
);
$db->insert_query("awaitingactivation", $activationarray);
$emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
switch($mybb->settings['username_method'])
{
case 0:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
case 1:
$emailmessage = $lang->sprintf($lang->email_activateaccount1, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
case 2:
$emailmessage = $lang->sprintf($lang->email_activateaccount2, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
default:
$emailmessage = $lang->sprintf($lang->email_activateaccount, $mybb->user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $mybb->user['uid'], $activationcode);
break;
}
my_mail($mybb->user['email'], $emailsubject, $emailmessage);

$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php?action=email", $lang->redirect_emailupdated);
}
elseif($mybb->usergroup['cancp'] != 1 && ($mybb->settings['regtype'] == "verify" || $mybb->settings['regtype'] == "both"))

			{
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

			{
$uid = $mybb->user['uid'];
$username = $mybb->user['username'];

Zeile 1213Zeile 1275
				);

$db->insert_query("awaitingactivation", $newactivation);

				);

$db->insert_query("awaitingactivation", $newactivation);





				$mail_message = $lang->sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->get_input('email'), $mybb->settings['bburl'], $activationcode, $mybb->user['username'], $mybb->user['uid']);

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

				$mail_message = $lang->sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->get_input('email'), $mybb->settings['bburl'], $activationcode, $mybb->user['username'], $mybb->user['uid']);

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

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

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

		$errors = inline_error($errors);
}
}


		$errors = inline_error($errors);
}
}


if($mybb->input['action'] == "email")
{
// Coming back to this page after one or more errors were experienced, show fields the user previously entered (with the exception of the password)

if($mybb->input['action'] == "email")
{
// Coming back to this page after one or more errors were experienced, show fields the user previously entered (with the exception of the password)

Zeile 1264Zeile 1326
	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


 
	$user = array();

	$errors = array();

$plugins->run_hooks("usercp_do_password_start");

	$errors = array();

$plugins->run_hooks("usercp_do_password_start");

Zeile 1277Zeile 1340
		require_once MYBB_ROOT."inc/datahandlers/user.php";
$userhandler = new UserDataHandler("update");


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


		$user = array(

		$user = array_merge($user, array(

			"uid" => $mybb->user['uid'],
"password" => $mybb->get_input('password'),
"password2" => $mybb->get_input('password2')

			"uid" => $mybb->user['uid'],
"password" => $mybb->get_input('password'),
"password2" => $mybb->get_input('password2')

		);

		));


$userhandler->set_data($user);



$userhandler->set_data($user);


Zeile 1323Zeile 1386
	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	$plugins->run_hooks("usercp_do_changename_start");


	$errors = array();


	if($mybb->usergroup['canchangename'] != 1)

	if($mybb->usergroup['canchangename'] != 1)

	{
error_no_permission();
}





	{
error_no_permission();
}

$user = array();

$plugins->run_hooks("usercp_do_changename_start");


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


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

	}

	}

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


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


		$user = array(

		$user = array_merge($user, array(

			"uid" => $mybb->user['uid'],
"username" => $mybb->get_input('username')

			"uid" => $mybb->user['uid'],
"username" => $mybb->get_input('username')

		);


		));


		$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 1355Zeile 1423
			$userhandler->update_user();
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php?action=changename", $lang->redirect_namechanged);

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



 
		}

		}

	}

	}

	if(count($errors) > 0)
{
$errors = inline_error($errors);

	if(count($errors) > 0)
{
$errors = inline_error($errors);

Zeile 1366Zeile 1433
}

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

}

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

{

{

	$plugins->run_hooks("usercp_changename_start");
if($mybb->usergroup['canchangename'] != 1)

	$plugins->run_hooks("usercp_changename_start");
if($mybb->usergroup['canchangename'] != 1)

	{

	{

		error_no_permission();

		error_no_permission();

	}












	}

// Coming back to this page after one or more errors were experienced, show field the user previously entered (with the exception of the password)
if($errors)
{
$username = htmlspecialchars_uni($mybb->get_input('username'));
}
else
{
$username = '';
}


	$plugins->run_hooks("usercp_changename_end");

eval("\$changename = \"".$templates->get("usercp_changename")."\";");
output_page($changename);
}

	$plugins->run_hooks("usercp_changename_end");

eval("\$changename = \"".$templates->get("usercp_changename")."\";");
output_page($changename);
}





if($mybb->input['action'] == "do_subscriptions")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

if($mybb->input['action'] == "do_subscriptions")
{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


$plugins->run_hooks("usercp_do_subscriptions_start");

 

if(!isset($mybb->input['check']) || !is_array($mybb->input['check']))
{
error($lang->no_subscriptions_selected);
}


if(!isset($mybb->input['check']) || !is_array($mybb->input['check']))
{
error($lang->no_subscriptions_selected);
}

 

$plugins->run_hooks("usercp_do_subscriptions_start");


// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));


// Clean input - only accept integers thanks!
$mybb->input['check'] = array_map('intval', $mybb->get_input('check', MyBB::INPUT_ARRAY));

Zeile 1494Zeile 1571
		$forumpermissions = $fpermissions[$subscription['fid']];

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))

		$forumpermissions = $fpermissions[$subscription['fid']];

if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))

		{

		{

			// Hmm, you don't have permission to view this thread - unsubscribe!
$del_subscriptions[] = $subscription['sid'];
}

			// Hmm, you don't have permission to view this thread - unsubscribe!
$del_subscriptions[] = $subscription['sid'];
}

Zeile 1505Zeile 1582
	}

if(!empty($del_subscriptions))

	}

if(!empty($del_subscriptions))

	{

	{

		$sids = implode(',', $del_subscriptions);

if($sids)

		$sids = implode(',', $del_subscriptions);

if($sids)

Zeile 1536Zeile 1613
		");

while($forum = $db->fetch_array($query))

		");

while($forum = $db->fetch_array($query))

		{

		{

			$readforums[$forum['fid']] = $forum['lastread'];
}


			$readforums[$forum['fid']] = $forum['lastread'];
}


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

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





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


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


Zeile 1573Zeile 1650
			$folder = '';
$prefix = '';
$thread['threadprefix'] = '';

			$folder = '';
$prefix = '';
$thread['threadprefix'] = '';





			// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0 && !empty($threadprefixes[$thread['prefix']]))
{

			// If this thread has a prefix, insert a space between prefix and subject
if($thread['prefix'] != 0 && !empty($threadprefixes[$thread['prefix']]))
{

Zeile 1596Zeile 1673
				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("usercp_subscriptions_thread_icon")."\";");

				$icon['path'] = htmlspecialchars_uni($icon['path']);
$icon['name'] = htmlspecialchars_uni($icon['name']);
eval("\$icon = \"".$templates->get("usercp_subscriptions_thread_icon")."\";");

			}
else

			}
else

			{
$icon = " ";
}

			{
$icon = " ";
}

Zeile 1720Zeile 1797

// What kind of notification type do we have here?
switch($thread['notification'])


// What kind of notification type do we have here?
switch($thread['notification'])

			{

			{

				case "2": // PM
$notification_type = $lang->pm_notification;
break;

				case "2": // PM
$notification_type = $lang->pm_notification;
break;

Zeile 1741Zeile 1818
	{
$remove_options = '';
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");

	{
$remove_options = '';
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");

	}

$plugins->run_hooks("usercp_subscriptions_end");

	}

$plugins->run_hooks("usercp_subscriptions_end");


eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);


eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";");
output_page($subscriptions);

Zeile 1766Zeile 1843
	{
$readforums[$forum['fid']] = $forum['lastread'];
}

	{
$readforums[$forum['fid']] = $forum['lastread'];
}





	$fpermissions = forum_permissions();
require_once MYBB_ROOT."inc/functions_forumlist.php";


	$fpermissions = forum_permissions();
require_once MYBB_ROOT."inc/functions_forumlist.php";


Zeile 1782Zeile 1859

$forums = '';
while($forum = $db->fetch_array($query))


$forums = '';
while($forum = $db->fetch_array($query))

	{

	{

		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


		$forum_url = get_forum_link($forum['fid']);
$forumpermissions = $fpermissions[$forum['fid']];


Zeile 1869Zeile 1946
	verify_post_check($mybb->get_input('my_post_key'));

$thread = get_thread($mybb->get_input('tid'));

	verify_post_check($mybb->get_input('my_post_key'));

$thread = get_thread($mybb->get_input('tid'));

	if(!$thread)

	if(!$thread || $thread['visible'] == -1)

	{
error($lang->error_invalidthread);
}

	{
error($lang->error_invalidthread);
}

Zeile 1898Zeile 1975
	add_subscribed_thread($thread['tid'], $mybb->get_input('notification', MyBB::INPUT_INT));

if($mybb->get_input('referrer'))

	add_subscribed_thread($thread['tid'], $mybb->get_input('notification', MyBB::INPUT_INT));

if($mybb->get_input('referrer'))

	{
$url = htmlspecialchars_uni($mybb->get_input('referrer'));
}
else













	{
$mybb->input['referrer'] = $mybb->get_input('referrer');

if(my_strpos($mybb->input['referrer'], $mybb->settings['bburl'].'/') !== 0)
{
if(my_strpos($mybb->input['referrer'], '/') === 0)
{
$mybb->input['referrer'] = my_substr($mybb->input['url'], 1);
}
$url_segments = explode('/', $mybb->input['referrer']);
$mybb->input['referrer'] = $mybb->settings['bburl'].'/'.end($url_segments);
}

$url = htmlspecialchars_uni($mybb->input['referrer']);
}
else

	{
$url = get_thread_link($thread['tid']);
}

	{
$url = get_thread_link($thread['tid']);
}

Zeile 1924Zeile 2013
		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();

		}


		}


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);


Zeile 1946Zeile 2035
	else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

	else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));

		if(!$thread)
{
error($lang->error_invalidthread);
}

		if(!$thread || $thread['visible'] == -1)
{
error($lang->error_invalidthread);
}


// Is the currently logged in user a moderator of this forum?
$ismod = is_moderator($thread['fid']);


// Is the currently logged in user a moderator of this forum?
$ismod = is_moderator($thread['fid']);

Zeile 1964Zeile 2053
		add_breadcrumb($lang->nav_addsubscription);

$forumpermissions = forum_permissions($thread['fid']);

		add_breadcrumb($lang->nav_addsubscription);

$forumpermissions = forum_permissions($thread['fid']);

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))

		if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 2007Zeile 2096
	}
}


	}
}


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

if($mybb->input['action'] == "removesubscription" && ($mybb->request_method == "post" || verify_post_check($mybb->get_input('my_post_key'), true)))

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));

{
// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));





	if($mybb->get_input('type') == "forum")
{
$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{
error($lang->error_invalidforum);

	if($mybb->get_input('type') == "forum")
{
$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{
error($lang->error_invalidforum);

		}


		}


		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);

		// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);





		// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_forum");

remove_subscribed_forum($forum['fid']);

		// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_forum");

remove_subscribed_forum($forum['fid']);

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{

		if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{

			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionremoved);

			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionremoved);

Zeile 2056Zeile 2145

// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($thread['fid']);


// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($thread['fid']);


// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_thread");

remove_subscribed_thread($thread['tid']);
if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionremoved);















































































// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_thread");

remove_subscribed_thread($thread['tid']);
if($server_http_referer && $mybb->request_method != 'post')
{
$url = $server_http_referer;
}
else
{
$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionremoved);
}
}

// Show remove subscription form when GET method and without valid my_post_key
if($mybb->input['action'] == "removesubscription")
{
$referrer = '';
if($mybb->get_input('type') == "forum")
{
$forum = get_forum($mybb->get_input('fid', MyBB::INPUT_INT));
if(!$forum)
{
error($lang->error_invalidforum);
}

add_breadcrumb($lang->nav_forumsubscriptions, "usercp.php?action=forumsubscriptions");
add_breadcrumb($lang->nav_removesubscription);

$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
error_no_permission();
}

// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($forum['fid']);

$lang->unsubscribe_from_forum = $lang->sprintf($lang->unsubscribe_from_forum, $forum['name']);

// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_display_forum");

eval("\$remove_forum_subscription = \"".$templates->get("usercp_removesubscription_forum")."\";");
output_page($remove_forum_subscription);
exit;
}
else
{
$thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
if(!$thread || $thread['visible'] == -1)
{
error($lang->error_invalidthread);
}

// Is the currently logged in user a moderator of this forum?
$ismod = is_moderator($thread['fid']);

// Make sure we are looking at a real thread here.
if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] > 1 && $ismod == true))
{
error($lang->error_invalidthread);
}

add_breadcrumb($lang->nav_subthreads, "usercp.php?action=subscriptions");
add_breadcrumb($lang->nav_removesubscription);

$forumpermissions = forum_permissions($thread['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $thread['uid'] != $mybb->user['uid']))
{
error_no_permission();
}

// check if the forum requires a password to view. If so, we need to show a form to the user
check_forum_password($thread['fid']);

require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
$thread['subject'] = $parser->parse_badwords($thread['subject']);
$thread['subject'] = htmlspecialchars_uni($thread['subject']);
$lang->unsubscribe_from_thread = $lang->sprintf($lang->unsubscribe_from_thread, $thread['subject']);

// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscription_display_thread");

eval("\$remove_thread_subscription = \"".$templates->get("usercp_removesubscription_thread")."\";");
output_page($remove_thread_subscription);
exit;

	}
}


	}
}


Zeile 2087Zeile 2253
		if($server_http_referer)
{
$url = $server_http_referer;

		if($server_http_referer)
{
$url = $server_http_referer;

		}

		}

		else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);

		else
{
$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);

	}
else

	}
else

	{
// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscriptions_thread");

	{
// Naming of the hook retained for backward compatibility while dropping usercp2.php
$plugins->run_hooks("usercp2_removesubscriptions_thread");





		$db->delete_query("threadsubscriptions", "uid='".$mybb->user['uid']."'");
if($server_http_referer)
{

		$db->delete_query("threadsubscriptions", "uid='".$mybb->user['uid']."'");
if($server_http_referer)
{

Zeile 2109Zeile 2275
			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

			$url = "usercp.php?action=subscriptions";
}
redirect($url, $lang->redirect_subscriptionsremoved);

	}

	}

}

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

}

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


$plugins->run_hooks("usercp_do_editsig_start");

 

// User currently has a suspended signature
if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)
{
error_no_permission();
}


// User currently has a suspended signature
if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)
{
error_no_permission();
}

 

$plugins->run_hooks("usercp_do_editsig_start");


if($mybb->get_input('updateposts') == "enable")
{


if($mybb->get_input('updateposts') == "enable")
{

Zeile 2217Zeile 2383

// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");


// User either doesn't have permission, or has their signature suspended
eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";");

	}
else

	}
else

	{
// User is allowed to edit their signature
if($mybb->settings['sigsmilies'] == 1)

	{
// User is allowed to edit their signature
if($mybb->settings['sigsmilies'] == 1)

Zeile 2257Zeile 2423
		$sig = htmlspecialchars_uni($sig);
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);


		$sig = htmlspecialchars_uni($sig);
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);


		if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)

		if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0)

		{
$codebuttons = build_mycode_inserter("signature");
}

		{
$codebuttons = build_mycode_inserter("signature");
}

Zeile 2333Zeile 2499
			}

// Because Gravatars are square, hijack the width

			}

// Because Gravatars are square, hijack the width

			list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

			list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

			$maxheight = (int)$maxwidth;

// Rating?

			$maxheight = (int)$maxwidth;

// Rating?

Zeile 2343Zeile 2509
			if(!in_array($rating, $types))
{
$rating = 'g';

			if(!in_array($rating, $types))
{
$rating = 'g';

			}

			}


$s = "?s={$maxheight}&r={$rating}&d=mm";



$s = "?s={$maxheight}&r={$rating}&d=mm";


Zeile 2363Zeile 2529
			// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatarurl']);
if(!$file)

			// Copy the avatar to the local server (work around remote URL access disabled for getimagesize)
$file = fetch_remote_file($mybb->input['avatarurl']);
if(!$file)

			{

			{

				$avatar_error = $lang->error_invalidavatarurl;
}
else

				$avatar_error = $lang->error_invalidavatarurl;
}
else

Zeile 2383Zeile 2549
					if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

					if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;

					}

					}

				}
}


				}
}


Zeile 2391Zeile 2557
			{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{

			{
if($width && $height && $mybb->settings['maxavatardims'] != "")
{

					list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

					list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

					if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;
}
}

					if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;
}
}

 
			}

// Limiting URL string to stay within database limit
if(strlen($mybb->input['avatarurl']) > 200)
{
$avatar_error = $lang->error_avatarurltoolong;

			}

if(empty($avatar_error))

			}

if(empty($avatar_error))

Zeile 2454Zeile 2626

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


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

		list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));

		list($maxwidth, $maxheight) = preg_split('/[|x]/', my_strtolower($mybb->settings['maxavatardims']));

		$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);
}


		$lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);
}


Zeile 2528Zeile 2700
		{
$user['buddylist'] = explode(',', $user['buddylist']);
}

		{
$user['buddylist'] = explode(',', $user['buddylist']);
}

		else
{
$user['buddylist'] = array();
}

		else
{
$user['buddylist'] = array();
}


$user['buddylist'][] = (int)$mybb->user['uid'];



$user['buddylist'][] = (int)$mybb->user['uid'];


Zeile 2713Zeile 2885
		foreach($users as $key => $username)
{
if(empty($username))

		foreach($users as $key => $username)
{
if(empty($username))

			{
unset($users[$key]);
continue;
}


			{
unset($users[$key]);
continue;
}


			if(my_strtoupper($mybb->user['username']) == my_strtoupper($username))
{
$adding_self = true;

			if(my_strtoupper($mybb->user['username']) == my_strtoupper($username))
{
$adding_self = true;

Zeile 2725Zeile 2897
				continue;
}
$users[$key] = $db->escape_string($username);

				continue;
}
$users[$key] = $db->escape_string($username);

		}

		}


// Get the requests we have sent that are still pending
$query = $db->simple_select('buddyrequests', 'touid', 'uid='.(int)$mybb->user['uid']);


// Get the requests we have sent that are still pending
$query = $db->simple_select('buddyrequests', 'touid', 'uid='.(int)$mybb->user['uid']);

Zeile 2733Zeile 2905
		while($req = $db->fetch_array($query))
{
$requests[$req['touid']] = true;

		while($req = $db->fetch_array($query))
{
$requests[$req['touid']] = true;

		}

		}


// Get the requests we have received that are still pending
$query = $db->simple_select('buddyrequests', 'uid', 'touid='.(int)$mybb->user['uid']);


// Get the requests we have received that are still pending
$query = $db->simple_select('buddyrequests', 'uid', 'touid='.(int)$mybb->user['uid']);

Zeile 2778Zeile 2950
					// On another list?
$string = "users_already_on_".$error_message."_list";
if(in_array($user['uid'], $selected_list))

					// On another list?
$string = "users_already_on_".$error_message."_list";
if(in_array($user['uid'], $selected_list))

					{

					{

						$string .= "_alt";
}


						$string .= "_alt";
}


Zeile 2899Zeile 3071
			if($sent === true)
{
$message = $lang->buddyrequests_sent_success;

			if($sent === true)
{
$message = $lang->buddyrequests_sent_success;

			}
}
}


			}
}
}


	// Removing a user from this list
elseif($mybb->get_input('delete', MyBB::INPUT_INT))
{

	// Removing a user from this list
elseif($mybb->get_input('delete', MyBB::INPUT_INT))
{

Zeile 3024Zeile 3196
			if($new_list == "")
{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";

			if($new_list == "")
{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n";

 
				echo "\$(\"#buddylink\").remove();\n";


				if($mybb->get_input('manage') == "ignored")

				if($mybb->get_input('manage') == "ignored")

				{

				{

					echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";

					echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";

				}

				}

				else
{
echo "\$(\"#buddy_list\").html(\"<li>{$lang->buddy_list_empty}</li>\");\n";
}

				else
{
echo "\$(\"#buddy_list\").html(\"<li>{$lang->buddy_list_empty}</li>\");\n";
}

			}

			}

			else
{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"".count(explode(",", $new_list))."\");\n";
}
echo $message_js;
exit;

			else
{
echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"".count(explode(",", $new_list))."\");\n";
}
echo $message_js;
exit;

		}

		}

		$mybb->input['action'] = "editlists";
}
else

		$mybb->input['action'] = "editlists";
}
else

Zeile 3047Zeile 3221
		if($error_message)
{
$message .= "<br />".$error_message;

		if($error_message)
{
$message .= "<br />".$error_message;

		}

		}

		redirect("usercp.php?action=editlists#".$mybb->get_input('manage'), $message);
}
}

		redirect("usercp.php?action=editlists#".$mybb->get_input('manage'), $message);
}
}

Zeile 3084Zeile 3258

$lang->current_buddies = $lang->sprintf($lang->current_buddies, $buddy_count);
if(!$buddy_list)


$lang->current_buddies = $lang->sprintf($lang->current_buddies, $buddy_count);
if(!$buddy_list)

	{
eval("\$buddy_list = \"".$templates->get("usercp_editlists_no_buddies")."\";");
}


	{
eval("\$buddy_list = \"".$templates->get("usercp_editlists_no_buddies")."\";");
}


	// Fetch out ignore list users
$ignore_count = 0;
$ignore_list = '';

	// Fetch out ignore list users
$ignore_count = 0;
$ignore_list = '';

Zeile 3109Zeile 3283
			}
eval("\$ignore_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$ignore_count;

			}
eval("\$ignore_list .= \"".$templates->get("usercp_editlists_user")."\";");
++$ignore_count;

		}
}


		}
}


	$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)
{

	$lang->current_ignored_users = $lang->sprintf($lang->current_ignored_users, $ignore_count);
if(!$ignore_list)
{

Zeile 3148Zeile 3322
				if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests", 1, 0)."\";");

				if($sent_rows == '')
{
eval("\$sent_rows = \"".$templates->get("usercp_editlists_no_requests", 1, 0)."\";");

				}


				}


				eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");

echo $sentrequests;

				eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");

echo $sentrequests;

Zeile 3281Zeile 3455
	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	$plugins->run_hooks("usercp_do_drafts_start");

 
	$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY);
if(empty($mybb->input['deletedraft']))
{
error($lang->no_drafts_selected);
}

	$mybb->input['deletedraft'] = $mybb->get_input('deletedraft', MyBB::INPUT_ARRAY);
if(empty($mybb->input['deletedraft']))
{
error($lang->no_drafts_selected);
}

 

$plugins->run_hooks("usercp_do_drafts_start");


	$pidin = array();
$tidin = array();

	$pidin = array();
$tidin = array();

 


	foreach($mybb->input['deletedraft'] as $id => $val)
{
if($val == "post")
{
$pidin[] = "'".(int)$id."'";

	foreach($mybb->input['deletedraft'] as $id => $val)
{
if($val == "post")
{
$pidin[] = "'".(int)$id."'";

		}

		}

		elseif($val == "thread")
{
$tidin[] = "'".(int)$id."'";
}
}
if($tidin)

		elseif($val == "thread")
{
$tidin[] = "'".(int)$id."'";
}
}
if($tidin)

	{

	{

		$tidin = implode(",", $tidin);
$db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'");
$tidinp = "OR tid IN ($tidin)";

		$tidin = implode(",", $tidin);
$db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'");
$tidinp = "OR tid IN ($tidin)";

Zeile 3326Zeile 3503

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


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

	$plugins->run_hooks("usercp_usergroups_start");

 
	$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";

	$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";





	$usergroups = $mybb->cache->read('usergroups');

	$usergroups = $mybb->cache->read('usergroups');

 

$plugins->run_hooks("usercp_usergroups_start");


// Changing our display group
if($mybb->get_input('displaygroup', MyBB::INPUT_INT))


// Changing our display group
if($mybb->get_input('displaygroup', MyBB::INPUT_INT))

	{
// Verify incoming POST request

	{
// Verify incoming POST request

		verify_post_check($mybb->get_input('my_post_key'));

if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)

		verify_post_check($mybb->get_input('my_post_key'));

if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)

Zeile 3365Zeile 3543
			error($lang->not_member_of_group);
}
if($mybb->user['usergroup'] == $mybb->get_input('leavegroup', MyBB::INPUT_INT))

			error($lang->not_member_of_group);
}
if($mybb->user['usergroup'] == $mybb->get_input('leavegroup', MyBB::INPUT_INT))

		{

		{

			error($lang->cannot_leave_primary_group);
}


			error($lang->cannot_leave_primary_group);
}


Zeile 3396Zeile 3574

// Joining a group
if($mybb->get_input('joingroup', MyBB::INPUT_INT))


// Joining a group
if($mybb->get_input('joingroup', MyBB::INPUT_INT))

	{

	{

		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


		// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


Zeile 3517Zeile 3695
	{
case "pgsql":
case "sqlite":

	{
case "pgsql":
case "sqlite":

			$query = $db->query("
SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers
FROM ".TABLE_PREFIX."groupleaders l

			$query = $db->query("
SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers
FROM ".TABLE_PREFIX."groupleaders l

				LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)

				LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid)
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))
LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)

Zeile 3558Zeile 3736
	}
$leadinggroups = '';
if($groupsledlist)

	}
$leadinggroups = '';
if($groupsledlist)

	{

	{

		eval("\$leadinggroups = \"".$templates->get("usercp_usergroups_leader")."\";");
}


		eval("\$leadinggroups = \"".$templates->get("usercp_usergroups_leader")."\";");
}


Zeile 3581Zeile 3759
	else
{
$displaycode = '';

	else
{
$displaycode = '';

	}

	}


eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
$showmemberof = false;


eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
$showmemberof = false;

Zeile 3597Zeile 3775
				eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveleader")."\";");
}
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3 && $usergroup['type'] != 5)

				eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveleader")."\";");
}
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3 && $usergroup['type'] != 5)

			{

			{

				eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveother")."\";");
}
else

				eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveother")."\";");
}
else

Zeile 3612Zeile 3790
			{
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']);
eval("\$description = \"".$templates->get("usercp_usergroups_memberof_usergroup_description")."\";");

			{
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']);
eval("\$description = \"".$templates->get("usercp_usergroups_memberof_usergroup_description")."\";");

			}

			}

			$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
{

			$trow = alt_trow();
if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
{

Zeile 3628Zeile 3806
			}
eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
}

			}
eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
}

	}

	}

	eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");

// List of groups this user has applied for but has not been accepted in to

	eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");

// List of groups this user has applied for but has not been accepted in to

Zeile 3643Zeile 3821
	if($mybb->user['additionalgroups'])
{
$existinggroups .= ",".$mybb->user['additionalgroups'];

	if($mybb->user['additionalgroups'])
{
$existinggroups .= ",".$mybb->user['additionalgroups'];

	}

	}


$joinablegroups = $joinablegrouplist = '';
$query = $db->simple_select("usergroups", "*", "(type='3' OR type='4' OR type='5') AND gid NOT IN ($existinggroups)", array('order_by' => 'title'));


$joinablegroups = $joinablegrouplist = '';
$query = $db->simple_select("usergroups", "*", "(type='3' OR type='4' OR type='5') AND gid NOT IN ($existinggroups)", array('order_by' => 'title'));

Zeile 3724Zeile 3902

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


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

	$plugins->run_hooks("usercp_attachments_start");

 
	require_once MYBB_ROOT."inc/functions_upload.php";

	require_once MYBB_ROOT."inc/functions_upload.php";





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

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

	{

	{

		error($lang->attachments_disabled);

		error($lang->attachments_disabled);

 
	}

$plugins->run_hooks("usercp_attachments_start");

// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums(true);
$inactiveforums = get_inactive_forums();
if($unviewable_forums)
{
$f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)";
}
if($inactiveforums)
{
$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";

	}

$attachments = '';

	}

$attachments = '';

Zeile 3761Zeile 3953
		FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

		FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)

		WHERE a.uid='".$mybb->user['uid']."'

		WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql}

		ORDER BY p.dateline DESC LIMIT {$start}, {$perpage}
");


		ORDER BY p.dateline DESC LIMIT {$start}, {$perpage}
");


	$bandwidth = $totaldownloads = 0;

	$bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;

	while($attachment = $db->fetch_array($query))
{
if($attachment['dateline'] && $attachment['tid'])

	while($attachment = $db->fetch_array($query))
{
if($attachment['dateline'] && $attachment['tid'])

Zeile 3788Zeile 3980
			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

			// Add to bandwidth total
$bandwidth += ($attachment['filesize'] * $attachment['downloads']);
$totaldownloads += $attachment['downloads'];

 
			$totalusage += $attachment['filesize'];
++$totalattachments;

		}
else
{
// This little thing delets attachments without a thread/post
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']);
}

		}
else
{
// This little thing delets attachments without a thread/post
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']);
}

 
		++$processedattachments;
}

if($processedattachments >= $perpage || $page > 1)
{
$query = $db->query("
SELECT SUM(a.filesize) AS ausage, COUNT(a.aid) AS acount
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE a.uid='".$mybb->user['uid']."' {$f_perm_sql}
");
$usage = $db->fetch_array($query);
$totalusage = $usage['ausage'];
$totalattachments = $usage['acount'];

$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");

	}


	}


	$query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
$totalusage = $usage['ausage'];
$totalattachments = $usage['acount'];

 
	$friendlyusage = get_friendly_size((int)$totalusage);
if($mybb->usergroup['attachquota'])
{

	$friendlyusage = get_friendly_size((int)$totalusage);
if($mybb->usergroup['attachquota'])
{

Zeile 3812Zeile 4019
	{
$attachquota = $lang->unlimited;
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);

	{
$attachquota = $lang->unlimited;
$usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);

	}

	}





	$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");

 
	$bandwidth = get_friendly_size($bandwidth);

if(!$attachments)

	$bandwidth = get_friendly_size($bandwidth);

if(!$attachments)

Zeile 3822Zeile 4028
		eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';
}

		eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";");
$usagenote = '';
}





	$plugins->run_hooks("usercp_attachments_end");

eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";");

	$plugins->run_hooks("usercp_attachments_end");

eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";");

Zeile 3834Zeile 4040
	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	// Verify incoming POST request
verify_post_check($mybb->get_input('my_post_key'));


	$plugins->run_hooks("usercp_do_attachments_start");

 
	require_once MYBB_ROOT."inc/functions_upload.php";
if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments']))
{
error($lang->no_attachments_selected);
}

	require_once MYBB_ROOT."inc/functions_upload.php";
if(!isset($mybb->input['attachments']) || !is_array($mybb->input['attachments']))
{
error($lang->no_attachments_selected);
}

 

$plugins->run_hooks("usercp_do_attachments_start");

// Get unviewable forums
$f_perm_sql = '';
$unviewable_forums = get_unviewable_forums(true);
$inactiveforums = get_inactive_forums();
if($unviewable_forums)
{
$f_perm_sql = " AND p.fid NOT IN ($unviewable_forums)";
}
if($inactiveforums)
{
$f_perm_sql .= " AND p.fid NOT IN ($inactiveforums)";
}


	$aids = implode(',', array_map('intval', $mybb->input['attachments']));

	$aids = implode(',', array_map('intval', $mybb->input['attachments']));

	$query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'");









$query = $db->query("
SELECT a.*, p.fid
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid)
WHERE aid IN ({$aids}) AND a.uid={$mybb->user['uid']} {$f_perm_sql}
");


	while($attachment = $db->fetch_array($query))
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

	while($attachment = $db->fetch_array($query))
{
remove_attachment($attachment['pid'], '', $attachment['aid']);

Zeile 4022Zeile 4250
	if($mybb->settings['usereferrals'] == 1)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);

	if($mybb->settings['usereferrals'] == 1)
{
$referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);

 

$referral_count = (int) $mybb->user['referrals'];
if($referral_count > 0)
{
$uid = (int) $mybb->user['uid'];
eval("\$mybb->user['referrals'] = \"".$templates->get('member_referrals_link')."\";");
}


		eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}


		eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
}


Zeile 4099Zeile 4335

foreach($subscriptions as $thread)
{


foreach($subscriptions as $thread)
{

 
					$plugins->run_hooks("usercp_thread_subscriptions_thread");

					$folder = '';
$folder_label = '';
$gotounread = '';

					$folder = '';
$folder_label = '';
$gotounread = '';

Zeile 4291Zeile 4528
		$latest_threads_threads = '';
foreach($threadcache as $thread)
{

		$latest_threads_threads = '';
foreach($threadcache as $thread)
{

 
			$plugins->run_hooks("usercp_latest_threads_thread"); 

			if($thread['tid'])
{
$bgcolor = alt_trow();

			if($thread['tid'])
{
$bgcolor = alt_trow();

Zeile 4407Zeile 4645

if($thread['closed'] == 1)
{


if($thread['closed'] == 1)
{

					$folder .= "lock";
$folder_label .= $lang->icon_lock;

					$folder .= "close";
$folder_label .= $lang->icon_close;

				}

$folder .= "folder";

				}

$folder .= "folder";