Vergleich usercp.php - 1.2.3 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 3Zeile 3
 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

 * MyBB 1.2
* Copyright � 2006 MyBB Group, All Rights Reserved
*

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

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

 *

 *

 * $Id: usercp.php 2725 2007-02-07 20:50:17Z CraKteR $

 * $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 267Zeile 270
		$bday[0] = $mybb->input['bday1'];
$bday[1] = $mybb->input['bday2'];
$bday[2] = intval($mybb->input['bday3']);

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

	}

	}

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

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

	}


	}


	$plugins->run_hooks("usercp_profile_start");

$bdaysel = '';

	$plugins->run_hooks("usercp_profile_start");

$bdaysel = '';

Zeile 289Zeile 292
		}
}
$bdaymonthsel[$bday[1]] = "selected";

		}
}
$bdaymonthsel[$bday[1]] = "selected";





	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

	if($user['website'] == "" || $user['website'] == "http://")
{
$user['website'] = "http://";

Zeile 333Zeile 336
		}
else
{

		}
else
{



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

			if($mybb->user['away'] == "yes")
{
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']);

			if($mybb->user['away'] == "yes")
{
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']);

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 615Zeile 621
		$errors = $userhandler->get_friendly_errors();
$errors = inline_error($errors);
$mybb->input['action'] = "options";

		$errors = $userhandler->get_friendly_errors();
$errors = inline_error($errors);
$mybb->input['action'] = "options";

	}
else

	}
else

	{
$userhandler->update_user();


	{
$userhandler->update_user();


Zeile 630Zeile 636
			if($mybb->input['remember'] == "yes")
{
my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], null, true);

			if($mybb->input['remember'] == "yes")
{
my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], null, true);

			}

			}

			else
{
my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], -1, true);

			else
{
my_setcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], -1, true);

Zeile 671Zeile 677
	if($user['allownotices'] == "yes")
{
$allownoticescheck = "checked=\"checked\"";

	if($user['allownotices'] == "yes")
{
$allownoticescheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$allownoticescheck = "";
}

if($user['invisible'] == "yes")
{
$invisiblecheck = "checked=\"checked\"";

		$allownoticescheck = "";
}

if($user['invisible'] == "yes")
{
$invisiblecheck = "checked=\"checked\"";

	}

	}

	else
{
$invisiblecheck = "";

	else
{
$invisiblecheck = "";

	}

	}


if($user['hideemail'] == "yes")


if($user['hideemail'] == "yes")

	{

	{

		$hideemailcheck = "checked=\"checked\"";
}
else

		$hideemailcheck = "checked=\"checked\"";
}
else

Zeile 698Zeile 704
	if($user['emailnotify'] == "yes")
{
$emailnotifycheck = "checked=\"checked\"";

	if($user['emailnotify'] == "yes")
{
$emailnotifycheck = "checked=\"checked\"";

	}
else
{

	}
else
{

		$emailnotifycheck = "";
}

if($user['showsigs'] == "yes")
{
$showsigscheck = "checked=\"checked\"";;

		$emailnotifycheck = "";
}

if($user['showsigs'] == "yes")
{
$showsigscheck = "checked=\"checked\"";;

	}

	}

	else
{
$showsigscheck = "";

	else
{
$showsigscheck = "";

Zeile 725Zeile 731
	if($user['showquickreply'] == "yes")
{
$showquickreplycheck = "checked=\"checked\"";

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

	}
else

	}
else

	{
$showquickreplycheck = "";

	{
$showquickreplycheck = "";

	}


	}


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

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

	else
{
$remembercheck = "";
}


	else
{
$remembercheck = "";
}


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

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

	}

	}

	else
{
$receivepmscheck = "";

	else
{
$receivepmscheck = "";

Zeile 752Zeile 758
	if($user['pmpopup'] == "yes")
{
$pmpopupcheck = "checked=\"checked\"";

	if($user['pmpopup'] == "yes")
{
$pmpopupcheck = "checked=\"checked\"";

	}

	}

	else
{
$pmpopupcheck = "";

	else
{
$pmpopupcheck = "";

Zeile 856Zeile 862
			}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

			}
}
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";");

	}

	}

	if($mybb->settings['userpppoptions'])
{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);

	if($mybb->settings['userpppoptions'])
{
$explodedppp = explode(",", $mybb->settings['userpppoptions']);

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 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 981Zeile 993
		// 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'],
"password" => $mybb->input['password'],
"password2" => $mybb->input['password2']

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

		);

$userhandler->set_data($user);

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

		);

$userhandler->set_data($user);

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

			$userhandler->update_user();
my_setcookie("mybbuser", $mybb->user['uid']."_".$userhandler->data['loginkey']);
$plugins->run_hooks("usercp_do_password_end");

Zeile 1004Zeile 1016
	}
if(count($errors) > 0)
{

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

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

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

	}

	}

}

}


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


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

{

{

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

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

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

	$plugins->run_hooks("usercp_do_changename_start");

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

	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 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 1188Zeile 1204
	if($page > 0)
{
$start = ($page-1) *$perpage;

	if($page > 0)
{
$start = ($page-1) *$perpage;

	}
else
{

	}
else
{

		$start = 0;
$page = 1;
}

		$start = 0;
$page = 1;
}

Zeile 1253Zeile 1269
				if($threadread < $subcription['lastpost'])
{
$folder = "new";

				if($threadread < $subcription['lastpost'])
{
$folder = "new";

				}

				}

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

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

Zeile 1269Zeile 1285
			eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";");
$folder = "";
}

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

Zeile 1285Zeile 1301
		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 1316Zeile 1332
			if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">$lang->never</div>";

			if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
{
$lastpost = "<div align=\"center\">$lang->never</div>";

			}

			}

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);

			else
{
$lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']);

Zeile 1347Zeile 1363
	$plugins->run_hooks("usercp_forumsubscriptions_end");
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);

	$plugins->run_hooks("usercp_forumsubscriptions_end");
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";");
output_page($forumsubscriptions);

}

}


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 1410Zeile 1429
	else
{
$sigsmilies = $lang->off;

	else
{
$sigsmilies = $lang->off;

	}

	}

	if($mybb->settings['sigmycode'] == "yes")
{
$sigmycode = $lang->on;

	if($mybb->settings['sigmycode'] == "yes")
{
$sigmycode = $lang->on;

	}

	}

	else
{
$sigmycode = $lang->off;

	else
{
$sigmycode = $lang->off;

	}

	}

	if($mybb->settings['sightml'] == "yes")
{
$sightml = $lang->on;

	if($mybb->settings['sightml'] == "yes")
{
$sightml = $lang->on;

	}

	}

	else
{
$sightml = $lang->off;

	else
{
$sightml = $lang->off;

	}

	}

	if($mybb->settings['sigimgcode'] == "yes")
{
$sigimgcode = $lang->on;

	if($mybb->settings['sigimgcode'] == "yes")
{
$sigimgcode = $lang->on;

	}

	}

	else
{
$sigimgcode = $lang->off;

	else
{
$sigimgcode = $lang->off;

Zeile 1438Zeile 1457
	$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")."\";");

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

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

	output_page($editsig);
}

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 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 1515Zeile 1537
		$mybb->input['avatarurl'] = preg_replace("#script:#i", "", $mybb->input['avatarurl']); 
$mybb->input['avatarurl'] = htmlspecialchars($mybb->input['avatarurl']);
$ext = get_extension($mybb->input['avatarurl']);

		$mybb->input['avatarurl'] = preg_replace("#script:#i", "", $mybb->input['avatarurl']); 
$mybb->input['avatarurl'] = htmlspecialchars($mybb->input['avatarurl']);
$ext = get_extension($mybb->input['avatarurl']);

		list($width, $height, $type) = @getimagesize($mybb->input['avatarurl']); 

 




		if(!$type) 
{



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

			$avatar_error = $lang->error_invalidavatarurl;

 
		}
else
{
$tmp_name = $mybb->settings['avataruploadpath']."/remote_".md5(uniqid(rand(), true));
$fp = @fopen($tmp_name, "wb");
if(!$fp)
{
$avatar_error = $lang->error_invalidavatarurl;
}
else
{
fwrite($fp, $file);
fclose($fp);
list($width, $height, $type) = @getimagesize($tmp_name);
@unlink($tmp_name);
if(!$type)
{
$avatar_error = $lang->error_invalidavatarurl;
}
}

		}

if(empty($avatar_error))

		}

if(empty($avatar_error))

Zeile 1680Zeile 1723
			$colspan = 1;
}
else

			$colspan = 1;
}
else

		{

		{

			$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

			$colspan = 2;
}
if($mybb->settings['maxavatardims'] != "")

		{

		{

			list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
$lang->avatar_note .= "<br />".sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);

			list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
$lang->avatar_note .= "<br />".sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight);

		}

		}

		if($mybb->settings['avatarsize'])
{
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024);

		if($mybb->settings['avatarsize'])
{
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024);

Zeile 1697Zeile 1740
		$plugins->run_hooks("usercp_avatar_end");
output_page($avatar);
}

		$plugins->run_hooks("usercp_avatar_end");
output_page($avatar);
}

}

}

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

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

Zeile 1708Zeile 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 1767Zeile 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 1788Zeile 1837
		$comma2 = ",";
}
if($mybb->input['list'] == "ignore")

		$comma2 = ",";
}
if($mybb->input['list'] == "ignore")

	{

	{

		$type = "ignorelist";
}
else

		$type = "ignorelist";
}
else

Zeile 1850Zeile 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 1873Zeile 1925
		$tidin = implode(",", $tidin);
$db->delete_query(TABLE_PREFIX."threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'");
$tidinp = "OR tid IN ($tidin)";

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

	}

	}

	if($pidin || $tidinp)
{
if($pidin)

	if($pidin || $tidinp)
{
if($pidin)

Zeile 1894Zeile 1946
{
$plugins->run_hooks("usercp_usergroups_start");
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";

{
$plugins->run_hooks("usercp_usergroups_start");
$ingroups = ",".$mybb->user['usergroup'].",".$mybb->user['additionalgroups'].",".$mybb->user['displaygroup'].",";





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

		}

		}

		$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");
$dispgroup = $db->fetch_array($query);
if($dispgroup['candisplaygroup'] != "yes")

		$query = $db->simple_select(TABLE_PREFIX."usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");
$dispgroup = $db->fetch_array($query);
if($dispgroup['candisplaygroup'] != "yes")

Zeile 1916Zeile 1971

// 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 1934Zeile 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 1948Zeile 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 2068Zeile 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 2142Zeile 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 2213Zeile 2275
	$bandwidth = get_friendly_size($bandwidth);
if($mybb->usergroup['attachquota'])
{

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

		$percent = round(($totalusage/($mybb->usergroup['attachquota']*1000))*100)."%";
$attachquota = get_friendly_size($mybb->usergroup['attachquota']*1000);

		$percent = round(($totalusage/($mybb->usergroup['attachquota']*1024))*100)."%";
$attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024);

		$usagenote = sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments);
}
else

		$usagenote = sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments);
}
else

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

Zeile 2260Zeile 2325
		$perday = $mybb->user['postnum'];
}


		$perday = $mybb->user['postnum'];
}


	$query = $db->simple_select(TABLE_PREFIX."posts", "COUNT(pid) AS posts", "visible > 0");
$posts = $db->fetch_field($query, "posts");

	$stats = $cache->read("stats");
$posts = $stats['numposts'];

	if($posts == 0)
{
$percent = "0";

	if($posts == 0)
{
$percent = "0";

Zeile 2298Zeile 2363
	}
// Make reputations row
$reputations = '';

	}
// Make reputations row
$reputations = '';

	if($mybb->usergroup['usereputationsystem'] == 'yes')

	if($mybb->usergroup['usereputationsystem'] == 'yes' && $mybb->settings['enablereputation'] == 'yes')

	{
$reputation_link = get_reputation($mybb->user['reputation']);
eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");

	{
$reputation_link = get_reputation($mybb->user['reputation']);
eval("\$reputation = \"".$templates->get("usercp_reputation")."\";");