Vergleich usercp.php - 1.8.16 - 1.8.26

  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 1203Zeile 1265
				// Emails require verification
$activationcode = random_str();
$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");

				// Emails require verification
$activationcode = random_str();
$db->delete_query("awaitingactivation", "uid='".$mybb->user['uid']."'");





				$newactivation = array(
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,

				$newactivation = array(
"uid" => $mybb->user['uid'],
"dateline" => TIME_NOW,

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

				$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']);
my_mail($mybb->get_input('email'), $lang->emailsubject_changeemail, $mail_message);

$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);

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

$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);

			}

			}

			else
{
$userhandler->update_user();

			else
{
$userhandler->update_user();

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");
if(validate_password_from_uid($mybb->user['uid'], $mybb->get_input('oldpassword')) == false)

	$errors = array();

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

	{
$errors[] = $lang->error_invalidpassword;

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





		if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

		if(!$userhandler->validate_user())
{
$errors = $userhandler->get_friendly_errors();

Zeile 1293Zeile 1356
		{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey'], null, true, "lax");

		{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey'], null, true, "lax");





			// Notify the user by email that their password has been changed
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']);
my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);

			// Notify the user by email that their password has been changed
$mail_message = $lang->sprintf($lang->email_changepassword, $mybb->user['username'], $mybb->user['email'], $mybb->settings['bbname'], $mybb->settings['bburl']);
$lang->emailsubject_changepassword = $lang->sprintf($lang->emailsubject_changepassword, $mybb->settings['bbname']);
my_mail($mybb->user['email'], $lang->emailsubject_changepassword, $mail_message);





			$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);
}

			$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php?action=password", $lang->redirect_passwordupdated);
}

Zeile 1308Zeile 1371
			$mybb->input['action'] = "password";
$errors = inline_error($errors);
}

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

}


}


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

eval("\$editpassword = \"".$templates->get("usercp_password")."\";");

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

eval("\$editpassword = \"".$templates->get("usercp_password")."\";");

	output_page($editpassword);
}


	output_page($editpassword);
}


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

if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
// 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)
{
error_no_permission();

	if($mybb->usergroup['canchangename'] != 1)
{
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;

Zeile 1339Zeile 1407
		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'],
"username" => $mybb->get_input('username')

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

		);

		));


$userhandler->set_data($user);


$userhandler->set_data($user);





		if(!$userhandler->validate_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)

		}
}
if(count($errors) > 0)

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

	if($mybb->usergroup['canchangename'] != 1)
{
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");

	}

$plugins->run_hooks("usercp_changename_end");

Zeile 1383Zeile 1460
{
// 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_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 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 1899Zeile 1976

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


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

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













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

	}
else
{

Zeile 1909Zeile 1998
}

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

}

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

{
// Verify incoming POST request

{
// Verify incoming POST request

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

	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)

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

		{

		{

			error($lang->error_invalidforum);
}
$forumpermissions = forum_permissions($forum['fid']);
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)

			error($lang->error_invalidforum);
}
$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

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

// Naming of the hook retained for backward compatibility while dropping usercp2.php

		check_forum_password($forum['fid']);

// Naming of the hook retained for backward compatibility while dropping usercp2.php

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)

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

		{
error($lang->error_invalidthread);
}

		{
error($lang->error_invalidthread);
}

Zeile 1976Zeile 2065
		if($server_http_referer)
{
$referrer = $server_http_referer;

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

		}

		}


require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;


require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;

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

Zeile 2027Zeile 2116
		$plugins->run_hooks("usercp2_removesubscription_forum");

remove_subscribed_forum($forum['fid']);

		$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";
}

		{
$url = "usercp.php?action=forumsubscriptions";
}

Zeile 2050Zeile 2139

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


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

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

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

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

		}

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


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 2093Zeile 2259
			$url = "usercp.php?action=forumsubscriptions";
}
redirect($url, $lang->redirect_forumsubscriptionsremoved);

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

	}

	}

	else
{
// Naming of the hook retained for backward compatibility while dropping usercp2.php

	else
{
// Naming of the hook retained for backward compatibility while dropping usercp2.php

Zeile 2101Zeile 2267

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


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

		{

		{

			$url = $server_http_referer;

			$url = $server_http_referer;

		}

		}

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

		else
{
$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")
{
$update_signature = array(

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

Zeile 2155Zeile 2321
	{
$sig = $mybb->get_input('signature');
$template = "usercp_editsig_preview";

	{
$sig = $mybb->get_input('signature');
$template = "usercp_editsig_preview";

	}

	}

	elseif(empty($error))
{
$sig = $mybb->user['signature'];

	elseif(empty($error))
{
$sig = $mybb->user['signature'];

Zeile 2170Zeile 2336
	if(!isset($error))
{
$error = '';

	if(!isset($error))
{
$error = '';

	}


	}


	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended

	if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
{
// User currently has no signature and they're suspended

Zeile 2179Zeile 2345
	}

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

	}

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

	{

	{

		// Usergroup has no permission to use this facility
error_no_permission();
}

		// Usergroup has no permission to use this facility
error_no_permission();
}

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
{
// User is allowed to edit their signature

	else
{
// User is allowed to edit their signature

Zeile 2225Zeile 2391
		{
$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();

		{
$sigsmilies = $lang->on;
$smilieinserter = build_clickable_smilies();

		}

		}

		else

		else

		{

		{

			$sigsmilies = $lang->off;
}
if($mybb->settings['sigmycode'] == 1)
{
$sigmycode = $lang->on;

			$sigsmilies = $lang->off;
}
if($mybb->settings['sigmycode'] == 1)
{
$sigmycode = $lang->on;

		}

		}

		else
{
$sigmycode = $lang->off;

		else
{
$sigmycode = $lang->off;

Zeile 2256Zeile 2422
		}
$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 2279Zeile 2445
	require_once MYBB_ROOT."inc/functions_upload.php";

$avatar_error = "";

	require_once MYBB_ROOT."inc/functions_upload.php";

$avatar_error = "";





	if(!empty($mybb->input['remove'])) // remove avatar
{
$updated_avatar = array(

	if(!empty($mybb->input['remove'])) // remove avatar
{
$updated_avatar = array(

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 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 2468Zeile 2640

$auto_resize = '';
if($mybb->settings['avatarresizing'] == "auto")


$auto_resize = '';
if($mybb->settings['avatarresizing'] == "auto")

	{

	{

		eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_auto")."\";");

		eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_auto")."\";");

	}

	}

	elseif($mybb->settings['avatarresizing'] == "user")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");

	elseif($mybb->settings['avatarresizing'] == "user")
{
eval("\$auto_resize = \"".$templates->get("usercp_avatar_auto_resize_user")."\";");

	}


	}


	$avatarupload = '';
if($mybb->usergroup['canuploadavatars'] == 1)
{

	$avatarupload = '';
if($mybb->usergroup['canuploadavatars'] == 1)
{

Zeile 2490Zeile 2662

$removeavatar = '';
if(!empty($mybb->user['avatar']))


$removeavatar = '';
if(!empty($mybb->user['avatar']))

	{

	{

		eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";");
}

		eval("\$removeavatar = \"".$templates->get("usercp_avatar_remove")."\";");
}





	$plugins->run_hooks("usercp_avatar_end");

if(!isset($avatar_error))

	$plugins->run_hooks("usercp_avatar_end");

if(!isset($avatar_error))

	{

	{

		$avatar_error = '';
}

		$avatar_error = '';
}





	eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
output_page($avatar);
}

	eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
output_page($avatar);
}





if($mybb->input['action'] == "acceptrequest")
{
// Verify incoming POST request

if($mybb->input['action'] == "acceptrequest")
{
// Verify incoming POST request

Zeile 2527Zeile 2699
		if($user['buddylist'] != '')
{
$user['buddylist'] = explode(',', $user['buddylist']);

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

		}
else
{

		}
else
{

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


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


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

				if($mybb->get_input('manage') == "ignored")
{
echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";

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

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

	{

	{

		error($lang->no_drafts_selected);
}

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

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

		{

		{

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

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

	}

	}

	if($tidin)
{
$tidin = implode(",", $tidin);

	if($tidin)
{
$tidin = implode(",", $tidin);

Zeile 3310Zeile 3487
	{
$pidinq = $tidin = '';
if($pidin)

	{
$pidinq = $tidin = '';
if($pidin)

		{

		{

			$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";

			$pidin = implode(",", $pidin);
$pidinq = "pid IN ($pidin)";

		}

		}

		else
{
$pidinq = "1=0";

		else
{
$pidinq = "1=0";

		}

		}

		$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");
}
$plugins->run_hooks("usercp_do_drafts_end");

		$db->delete_query("posts", "($pidinq $tidinp) AND visible='-2' AND uid='".$mybb->user['uid']."'");
}
$plugins->run_hooks("usercp_do_drafts_end");

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'].",";

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

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

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

Zeile 3338Zeile 3516
		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)

		{
error($lang->not_member_of_group);
}

		{
error($lang->not_member_of_group);
}


$dispgroup = $usergroups[$mybb->get_input('displaygroup', MyBB::INPUT_INT)];
if($dispgroup['candisplaygroup'] != 1)


$dispgroup = $usergroups[$mybb->get_input('displaygroup', MyBB::INPUT_INT)];
if($dispgroup['candisplaygroup'] != 1)

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


		$usergroup = $usergroups[$mybb->get_input('joingroup', MyBB::INPUT_INT)];

if($usergroup['type'] == 5)

		$usergroup = $usergroups[$mybb->get_input('joingroup', MyBB::INPUT_INT)];

if($usergroup['type'] == 5)

Zeile 3488Zeile 3666
		verify_post_check($mybb->get_input('my_post_key'));

$usergroup = $usergroups[$mybb->get_input('acceptinvite', MyBB::INPUT_INT)];

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

$usergroup = $usergroups[$mybb->get_input('acceptinvite', MyBB::INPUT_INT)];





		if(my_strpos($ingroups, ",".$mybb->get_input('acceptinvite', MyBB::INPUT_INT).",") !== false)
{
error($lang->already_accepted_invite);

		if(my_strpos($ingroups, ",".$mybb->get_input('acceptinvite', MyBB::INPUT_INT).",") !== false)
{
error($lang->already_accepted_invite);

		}

		}


$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".$mybb->get_input('acceptinvite', MyBB::INPUT_INT)."' AND invite='1'");
$joinrequest = $db->fetch_array($query);


$query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."' AND gid='".$mybb->get_input('acceptinvite', MyBB::INPUT_INT)."' AND invite='1'");
$joinrequest = $db->fetch_array($query);

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

	{
case "pgsql":
case "sqlite":

			$query = $db->query("

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

				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)
WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers

				LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid AND j.uid != 0)
WHERE l.uid='".$mybb->user['uid']."'
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers

			");
break;
default:

			");
break;
default:

Zeile 3577Zeile 3755
	elseif($usergroup['candisplaygroup'] == 1)
{
eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");

	elseif($usergroup['candisplaygroup'] == 1)
{
eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");

	}
else
{

	}
else
{

		$displaycode = '';
}


		$displaycode = '';
}


Zeile 3587Zeile 3765
	$showmemberof = false;
if($mybb->user['additionalgroups'])
{

	$showmemberof = false;
if($mybb->user['additionalgroups'])
{

		$query = $db->simple_select("usergroups", "*", "gid IN (".$mybb->user['additionalgroups'].") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));








		$additionalgroups = implode(
',',
array_map(
'intval',
explode(',', $mybb->user['additionalgroups'])
)
);
$query = $db->simple_select("usergroups", "*", "gid IN (".$additionalgroups.") AND gid !='".$mybb->user['usergroup']."'", array('order_by' => 'title'));

		while($usergroup = $db->fetch_array($query))
{
$showmemberof = true;

		while($usergroup = $db->fetch_array($query))
{
$showmemberof = true;

Zeile 3603Zeile 3788
			else
{
eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leave")."\";");

			else
{
eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leave")."\";");

			}


			}


			$description = '';
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
$usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);

			$description = '';
$usergroup['title'] = htmlspecialchars_uni($usergroup['title']);
$usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);

Zeile 3619Zeile 3804
				eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
}
elseif($usergroup['candisplaygroup'] == 1)

				eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
}
elseif($usergroup['candisplaygroup'] == 1)

			{

			{

				eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");
}
else

				eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");
}
else

Zeile 3641Zeile 3826
	// Fetch list of groups the member can join
$existinggroups = $mybb->user['usergroup'];
if($mybb->user['additionalgroups'])

	// Fetch list of groups the member can join
$existinggroups = $mybb->user['usergroup'];
if($mybb->user['additionalgroups'])

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








	{
$additionalgroups = implode(
',',
array_map(
'intval',
explode(',', $mybb->user['additionalgroups'])
)
);
$existinggroups .= ",".$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 3916

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 3967
		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 3994
			// 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 4033
	{
$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 4042
		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 4054
	// 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 4264
	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 4349

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 4542
		$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 4659

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