Vergleich usercp.php - 1.2.9 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: usercp.php 3139 2007-06-18 08:34:28Z chris $

 * $Id: usercp.php 3598 2008-01-20 20:42:43Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 157Zeile 157

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


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

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


	$plugins->run_hooks("usercp_do_profile_start");

if($mybb->input['away'] == "yes" && $mybb->settings['allowaway'] != "no")

	$plugins->run_hooks("usercp_do_profile_start");

if($mybb->input['away'] == "yes" && $mybb->settings['allowaway'] != "no")

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

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

			}

			}

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

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

Zeile 175Zeile 178
			}

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

			}

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

			{

			{

				error($lang->error_usercp_return_date_2038);
}


				error($lang->error_usercp_return_date_2038);
}


Zeile 186Zeile 189
				error($lang->error_usercp_return_date_past);
}
$returndate = intval($mybb->input['awayday'])."-".intval($mybb->input['awaymonth'])."-".intval($mybb->input['awayyear']);

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

		}
else
{

		}
else
{

			$returndate = "";
}
$away = array(

			$returndate = "";
}
$away = array(

Zeile 318Zeile 321
		if($errors)
{
if($user['away'] == "yes")

		if($errors)
{
if($user['away'] == "yes")

			{

			{

				$awaycheck['yes'] = "checked";
}
else

				$awaycheck['yes'] = "checked";
}
else

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

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

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

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

					$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"$profilefield[length]\" multiple=\"multiple\">$select</select>";

					$profilefield['length'] = 3;
}
$code = "<select name=\"profile_fields[$field][]\" size=\"$profilefield[length]\" multiple=\"multiple\">$select</select>";

Zeile 448Zeile 451
			}
}
elseif($type == "radio")

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

		{
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$checked = "";

		{
$expoptions = explode("\n", $options);
if(is_array($expoptions))
{
foreach($expoptions as $key => $val)
{
$checked = "";

					if($val == $userfield)
{
$checked = "checked=\"checked\"";

					if($val == $userfield)
{
$checked = "checked=\"checked\"";

Zeile 468Zeile 471
			if($errors)
{
$useropts = $userfield;

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

			}
else
{
$useropts = explode("\n", $userfield);
}

			}
else
{
$useropts = explode("\n", $userfield);
}

			if(is_array($useropts))
{
foreach($useropts as $key => $val)

			if(is_array($useropts))
{
foreach($useropts as $key => $val)

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

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

		}
else

		}
else

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

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

Zeile 563Zeile 566

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


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

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


	$plugins->run_hooks("usercp_do_options_start");

// Set up user handler.

	$plugins->run_hooks("usercp_do_options_start");

// Set up user handler.

Zeile 883Zeile 889

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


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

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


	$errors = array();

$plugins->run_hooks("usercp_do_email_start");

	$errors = array();

$plugins->run_hooks("usercp_do_email_start");

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

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





		$user = array(
"uid" => $mybb->user['uid'],
"email" => $mybb->input['email'],

		$user = array(
"uid" => $mybb->user['uid'],
"email" => $mybb->input['email'],

Zeile 938Zeile 947
				$userhandler->update_user();
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);

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

			}
}
}

			}
}
}

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

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

	}

	}

}

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

}

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($errors)
{

	// 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($errors)
{

Zeile 969Zeile 978

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


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

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


	$errors = array();

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

	$errors = array();

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

	{

	{

		$errors[] = $lang->error_invalidpassword;
}
else

		$errors[] = $lang->error_invalidpassword;
}
else

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

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

		}

		}

		else
{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey']);
$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php", $lang->redirect_passwordupdated);

		else
{
$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey']);
$plugins->run_hooks("usercp_do_password_end");
redirect("usercp.php", $lang->redirect_passwordupdated);

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

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


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


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

Zeile 1019Zeile 1031

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


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

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


	$plugins->run_hooks("usercp_do_changename_start");
if($mybb->usergroup['canchangename'] != "yes")
{
error_no_permission();

	$plugins->run_hooks("usercp_do_changename_start");
if($mybb->usergroup['canchangename'] != "yes")
{
error_no_permission();

	}

	}


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


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

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

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





		$userhandler->set_data($user);

if(!$userhandler->validate_user())

		$userhandler->set_data($user);

if(!$userhandler->validate_user())

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

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

	}

	}

}

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

}

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

Zeile 1071Zeile 1086
	eval("\$changename = \"".$templates->get("usercp_changename")."\";");
$plugins->run_hooks("usercp_changename_end");
output_page($changename);

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

}


}


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

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

Zeile 1110Zeile 1125
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE f.type='f' AND f.uid='".$mybb->user['uid']."'
ORDER BY t.lastpost DESC

		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
WHERE f.type='f' AND f.uid='".$mybb->user['uid']."'
ORDER BY t.lastpost DESC

 
		LIMIT {$start}, {$perpage}

	");
while($favorite = $db->fetch_array($query))
{

	");
while($favorite = $db->fetch_array($query))
{

Zeile 1202Zeile 1218
		$upper = $threadcount;
}
$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");

		$upper = $threadcount;
}
$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");

	$fpermissions = forum_permissions();

	$fpermissions = forum_permissions();

	$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."favorites s

	$query = $db->query("
SELECT s.*, t.*, t.username AS threadusername, u.username
FROM ".TABLE_PREFIX."favorites s

Zeile 1223Zeile 1239
			if($subscription['lastposteruid'] == 0)
{
$lastposterlink = $subscription['lastposter'];

			if($subscription['lastposteruid'] == 0)
{
$lastposterlink = $subscription['lastposter'];

			}

			}

			else
{
$lastposterlink = build_profile_link($subscription['lastposter'], $subscription['lastposteruid']);

			else
{
$lastposterlink = build_profile_link($subscription['lastposter'], $subscription['lastposteruid']);

			}

			}

			$subscription['author'] = $subscription['uid'];
if(!$subscription['username'])
{

			$subscription['author'] = $subscription['uid'];
if(!$subscription['username'])
{

Zeile 1235Zeile 1251
			}
$subscription['subject'] = htmlspecialchars_uni($parser->parse_badwords($subscription['subject']));
if($subscription['icon'] > 0 && $icon_cache[$subscription['icon']])

			}
$subscription['subject'] = htmlspecialchars_uni($parser->parse_badwords($subscription['subject']));
if($subscription['icon'] > 0 && $icon_cache[$subscription['icon']])

			{

			{

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

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

			{

			{

				$icon = "&nbsp;";
}
if($mybb->user['lastvisit'] == "0")

				$icon = "&nbsp;";
}
if($mybb->user['lastvisit'] == "0")

			{

			{

				$folder = "new";
}
if($subscription['lastpost'] > $mybb->user['lastvisit'])

				$folder = "new";
}
if($subscription['lastpost'] > $mybb->user['lastvisit'])

			{

			{

				$threadread = my_get_array_cookie("threadread", $subscription['tid']);
if($threadread < $subcription['lastpost'])
{

				$threadread = my_get_array_cookie("threadread", $subscription['tid']);
if($threadread < $subcription['lastpost'])
{

Zeile 1256Zeile 1272
				}
}
if($subscription['replies'] >= $mybb->settings['hottopic'])

				}
}
if($subscription['replies'] >= $mybb->settings['hottopic'])

			{

			{

				$folder .= "hot";
}
if($subscription['closed'] == "yes")

				$folder .= "hot";
}
if($subscription['closed'] == "yes")

Zeile 1268Zeile 1284
			$subscription['views'] = my_number_format($subscription['views']);
eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";");
$folder = "";

			$subscription['views'] = my_number_format($subscription['views']);
eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";");
$folder = "";

		}

		}

	}
if(!$threads)
{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");

	}
if(!$threads)
{
eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");

	}

	}

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

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

Zeile 1281Zeile 1297
if($mybb->input['action'] == "forumsubscriptions")
{
$plugins->run_hooks("usercp_forumsubscriptions_start");

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

	$query = $db->query("

	$query = $db->query("

		SELECT *
FROM ".TABLE_PREFIX."forumpermissions
WHERE gid='".$mybb->user['usergroup']."'

		SELECT *
FROM ".TABLE_PREFIX."forumpermissions
WHERE gid='".$mybb->user['usergroup']."'

	");

	");

	while($permissions = $db->fetch_array($query))
{
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;

	while($permissions = $db->fetch_array($query))
{
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions;

Zeile 1301Zeile 1317
	");
$forums = '';
while($forum = $db->fetch_array($query))

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

	{

	{

		$forumpermissions = $fpermissions[$forum['fid']];
if($forumpermissions['canview'] != "no")
{

		$forumpermissions = $fpermissions[$forum['fid']];
if($forumpermissions['canview'] != "no")
{

Zeile 1351Zeile 1367

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


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

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


	$plugins->run_hooks("usercp_do_editsig_start");
if($mybb->input['updateposts'] == "enable")
{

	$plugins->run_hooks("usercp_do_editsig_start");
if($mybb->input['updateposts'] == "enable")
{

Zeile 1399Zeile 1418
			"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],
);

			"allow_imgcode" => $mybb->settings['sigimgcode'],
"me_username" => $mybb->user['username'],
);





		$sigpreview = $parser->parse_message($sig, $sig_parser);
eval("\$signature = \"".$templates->get($template)."\";");
}
if($mybb->settings['sigsmilies'] == "yes")

		$sigpreview = $parser->parse_message($sig, $sig_parser);
eval("\$signature = \"".$templates->get($template)."\";");
}
if($mybb->settings['sigsmilies'] == "yes")

	{

	{

		$sigsmilies = $lang->on;

		$sigsmilies = $lang->on;

	}
else
{

	}
else
{

		$sigsmilies = $lang->off;
}
if($mybb->settings['sigmycode'] == "yes")

		$sigsmilies = $lang->off;
}
if($mybb->settings['sigmycode'] == "yes")

	{

	{

		$sigmycode = $lang->on;

		$sigmycode = $lang->on;

	}
else
{

	}
else
{

		$sigmycode = $lang->off;
}
if($mybb->settings['sightml'] == "yes")

		$sigmycode = $lang->off;
}
if($mybb->settings['sightml'] == "yes")

	{

	{

		$sightml = $lang->on;

		$sightml = $lang->on;

	}
else
{

	}
else
{

		$sightml = $lang->off;
}
if($mybb->settings['sigimgcode'] == "yes")

		$sightml = $lang->off;
}
if($mybb->settings['sigimgcode'] == "yes")

Zeile 1432Zeile 1451
		$sigimgcode = $lang->on;
}
else

		$sigimgcode = $lang->on;
}
else

	{

	{

		$sigimgcode = $lang->off;
}
$sig = htmlspecialchars_uni($sig);
$lang->edit_sig_note2 = sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");

		$sigimgcode = $lang->off;
}
$sig = htmlspecialchars_uni($sig);
$lang->edit_sig_note2 = sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");

	$plugins->run_hooks("usercp_endsig_end");

	$plugins->run_hooks("usercp_editsig_end");

	output_page($editsig);
}

	output_page($editsig);
}





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

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

{ 




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


	$plugins->run_hooks("usercp_do_avatar_start"); 
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->input['remove']) // remove avatar

	$plugins->run_hooks("usercp_do_avatar_start"); 
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->input['remove']) // remove avatar

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

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

			{ 

			{ 

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']); 
}
else

				$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']); 
}
else

Zeile 1484Zeile 1506
			} 
remove_avatars($mybb->user['uid']);
}

			} 
remove_avatars($mybb->user['uid']);
}

	} 

	}

	elseif($_FILES['avatarupload']['name']) // upload avatar 
{
if($mybb->usergroup['canuploadavatars'] == "no")

	elseif($_FILES['avatarupload']['name']) // upload avatar 
{
if($mybb->usergroup['canuploadavatars'] == "no")

Zeile 1729Zeile 1751
}
if($mybb->input['action'] == "do_notepad" && $mybb->request_method == "post")
{

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

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


	$plugins->run_hooks("usercp_do_notepad_start");
$db->update_query(TABLE_PREFIX."users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_notepad_end");

	$plugins->run_hooks("usercp_do_notepad_start");
$db->update_query(TABLE_PREFIX."users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_notepad_end");

Zeile 1788Zeile 1813
}
if($mybb->input['action'] == "do_editlists" && $mybb->request_method == "post")
{

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

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


	$plugins->run_hooks("usercp_do_editlists_start");
$comma = '';
$users = '';

	$plugins->run_hooks("usercp_do_editlists_start");
$comma = '';
$users = '';

Zeile 1843Zeile 1871
			$editurl = "newreply.php?action=editdraft&amp;pid={$draft['pid']}";
$id = $draft['pid'];
$type = "post";

			$editurl = "newreply.php?action=editdraft&amp;pid={$draft['pid']}";
$id = $draft['pid'];
$type = "post";

		}

		}

		elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{
$detail = $lang->forum." <a href=\"forumdisplay.php?fid=".$draft['fid']."\">".htmlspecialchars_uni($draft['forumname'])."</a>";

		elseif($draft['threadvisible'] == -2) // We're looking at a draft thread
{
$detail = $lang->forum." <a href=\"forumdisplay.php?fid=".$draft['fid']."\">".htmlspecialchars_uni($draft['forumname'])."</a>";

Zeile 1857Zeile 1885
		eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");
}
if(!$drafts)

		eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");
}
if(!$drafts)

	{

	{

		eval("\$drafts = \"".$templates->get("usercp_drafts_none")."\";");
}
else

		eval("\$drafts = \"".$templates->get("usercp_drafts_none")."\";");
}
else

Zeile 1871Zeile 1899
}
if($mybb->input['action'] == "do_drafts" && $mybb->request_method == "post")
{

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

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


	$plugins->run_hooks("usercp_do_drafts_start");
if(!$mybb->input['deletedraft'])
{

	$plugins->run_hooks("usercp_do_drafts_start");
if(!$mybb->input['deletedraft'])
{

Zeile 1919Zeile 1950
	// Changing our display group
if($mybb->input['displaygroup'])
{

	// Changing our display group
if($mybb->input['displaygroup'])
{

		if(!strstr($ingroups, ",".$mybb->input['displaygroup'].","))




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

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

		{
error($lang->not_member_of_group);
}

		{
error($lang->not_member_of_group);
}

Zeile 1938Zeile 1972
	// Leaving a group
if($mybb->input['leavegroup'])
{

	// Leaving a group
if($mybb->input['leavegroup'])
{

		if(!strstr($ingroups, ",".$mybb->input['leavegroup'].","))




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

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

		{
error($lang->not_member_of_group);

		{
error($lang->not_member_of_group);

		}

		}

		if($mybb->user['usergroup'] == $mybb->input['leavegroup'])
{
error($lang->cannot_leave_primary_group);

		if($mybb->user['usergroup'] == $mybb->input['leavegroup'])
{
error($lang->cannot_leave_primary_group);

Zeile 1955Zeile 1992
		leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']);
$plugins->run_hooks("usercp_usergroups_leave_group");
redirect("usercp.php?action=usergroups", $lang->left_group);

		leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']);
$plugins->run_hooks("usercp_usergroups_leave_group");
redirect("usercp.php?action=usergroups", $lang->left_group);

 
		exit;

	}

// Joining a group
if($mybb->input['joingroup'])
{

	}

// Joining a group
if($mybb->input['joingroup'])
{

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


		$mybb->input['joingroup'] = intval($mybb->input['joingroup']);
$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'");
$usergroup = $db->fetch_array($query);

		$mybb->input['joingroup'] = intval($mybb->input['joingroup']);
$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'");
$usergroup = $db->fetch_array($query);

Zeile 1969Zeile 2010
			error($lang->cannot_join_group);
}


			error($lang->cannot_join_group);
}


		if(strstr($ingroups, ",".intval($mybb->input['joingroup']).",") || $mybb->user['usergroup'] == $mybb->input['joingroup'] || $mybb->user['displaygroup'] == $mybb->input['joingroup'])

		if(strpos($ingroups, ",".intval($mybb->input['joingroup']).",") !== false)

		{
error($lang->already_member_of_group);
}

		{
error($lang->already_member_of_group);
}

Zeile 2089Zeile 2130
			}
else
{

			}
else
{

				$leavelink = "<div align=\"center\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."\">".$lang->usergroup_leave."</a></div>";

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

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

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

Zeile 2163Zeile 2204
		}
else
{

		}
else
{

			$joinlink = "<a href=\"usercp.php?action=usergroups&amp;joingroup={$usergroup['gid']}\">{$lang->join_group}</a>";

			$joinlink = "<a href=\"usercp.php?action=usergroups&amp;joingroup={$usergroup['gid']}&amp;my_post_key={$mybb->post_code}\">{$lang->join_group}</a>";

		}
$usergroupleaders = '';
if($groupleaders[$usergroup['gid']])

		}
$usergroupleaders = '';
if($groupleaders[$usergroup['gid']])

Zeile 2255Zeile 2296
}
if($mybb->input['action'] == "do_attachments" && $mybb->request_method == "post")
{

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

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


	$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if(!is_array($mybb->input['attachments']))

	$plugins->run_hooks("usercp_do_attachments_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if(!is_array($mybb->input['attachments']))