Vergleich usercp.php - 1.04 - 1.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 719Zeile 719
{
$plugins->run_hooks("usercp_do_options_start");


{
$plugins->run_hooks("usercp_do_options_start");


	if($mybb->input['showcodebuttons'] != 1)

	if($mybb->input['showcodebuttons'] != '1')

	{
$mybb->input['showcodebuttons'] = 0;
}

	{
$mybb->input['showcodebuttons'] = 0;
}

Zeile 854Zeile 854
	}
$plugins->run_hooks("usercp_do_options_process");
$db->update_query(TABLE_PREFIX."users", $updatedoptions, "uid='".$mybb->user['uid']."'");

	}
$plugins->run_hooks("usercp_do_options_process");
$db->update_query(TABLE_PREFIX."users", $updatedoptions, "uid='".$mybb->user['uid']."'");

 
    // If the cookie settings are different, re-set the cookie
if($mybb->input['remember'] != $mybb->user['remember'])
{
$mybb->user['remember'] = $mybb->input['remember'];
// Unset the old one
myunsetcookie("mybbuser");
// Set the new one
if($mybb->input['remember'] == "yes")
{
mysetcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey']);
}
else
{
mysetcookie("mybbuser", $mybb->user['uid']."_".$mybb->user['loginkey'], -1);
}
}

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

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

Zeile 900Zeile 916
		error($lang->error_invalidemail);
}
if(function_exists("emailChanged"))

		error($lang->error_invalidemail);
}
if(function_exists("emailChanged"))

	{
emailChanged($mybb->user['uid'], $mybb->input['email']);
}

    {
emailChanged($mybb->user['uid'], $mybb->input['email']);
}





	if(!$mybb->user['usergroup'] == "5")

    if($mybb->user['usergroup'] != "5")

	{
$activationcode = random_str();
$now = time();

	{
$activationcode = random_str();
$now = time();

Zeile 923Zeile 939
		$uid = $mybb->user['uid'];
$lang->emailsubject_changeemail = sprintf($lang->emailsubject_changeemail, $mybb->settings['bbname']);
$lang->email_changeemail = sprintf($lang->email_changeemail, $mybb->user['username'], $mybb->settings['bbname'], $mybb->user['email'], $mybb->input['email'], $mybb->settings['bburl'], $activationcode, $mybb->user['username'], $mybb->user['uid']);

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

		mymail($email, $lang->emailsubject_changeemail, $lang->email_changeemail);


		$email = $mybb->input['email'];
mymail($email, $lang->emailsubject_changeemail, $lang->email_changeemail);

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

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

Zeile 953Zeile 970
		error($lang->error_invalidnewpassword);
}
if($mybb->input['password'] != $mybb->input['password2'])

		error($lang->error_invalidnewpassword);
}
if($mybb->input['password'] != $mybb->input['password2'])

	{

	{

		error($lang->error_passwordmismatch);
}
$plugins->run_hooks("usercp_do_password_process");

		error($lang->error_passwordmismatch);
}
$plugins->run_hooks("usercp_do_password_process");

Zeile 966Zeile 983
elseif($mybb->input['action'] == "changename")
{
$plugins->run_hooks("usercp_changename_start");

elseif($mybb->input['action'] == "changename")
{
$plugins->run_hooks("usercp_changename_start");

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

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

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

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

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

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

	{

	{

		nopermission();
}
if(!trim($mybb->input['username']) || eregi("<|>|&", $mybb->input['username']))

		nopermission();
}
if(!trim($mybb->input['username']) || eregi("<|>|&", $mybb->input['username']))

Zeile 1003Zeile 1020
	$plugins->run_hooks("usercp_favorites_start");
// Do Multi Pages
$query = $db->query("SELECT COUNT(f.tid) AS threads FROM ".TABLE_PREFIX."favorites f WHERE f.type='f' AND f.uid='".$mybb->user['uid']."'");

	$plugins->run_hooks("usercp_favorites_start");
// Do Multi Pages
$query = $db->query("SELECT COUNT(f.tid) AS threads FROM ".TABLE_PREFIX."favorites f WHERE f.type='f' AND f.uid='".$mybb->user['uid']."'");

	$threadcount = $db->result($query, 0);

$perpage = $mybb->settings['threadsperpage'];

	$threadcount = $db->result($query, 0);

$perpage = $mybb->settings['threadsperpage'];

	$page = intval($mybb->input['page']);
if($page)

	$page = intval($mybb->input['page']);
if($page)

	{
$start = ($page-1) *$perpage;
}
else
{
$start = 0;
$page = 1;
}
$end = $start + $perpage;
$lower = $start+1;
$upper = $end;

	{
$start = ($page-1) *$perpage;
}
else
{
$start = 0;
$page = 1;
}
$end = $start + $perpage;
$lower = $start+1;
$upper = $end;

	if($upper > $threadcount)
{
$upper = $threadcount;

	if($upper > $threadcount)
{
$upper = $threadcount;

Zeile 1095Zeile 1112
	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 1107Zeile 1124
	if($upper > $threadcount)
{
$upper = $threadcount;

	if($upper > $threadcount)
{
$upper = $threadcount;

	}

	}

	$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();
$query = $db->query("SELECT s.*, t.*, i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."favorites s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid = t.icon) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE s.type='s' AND s.uid='".$mybb->user['uid']."' ORDER BY t.lastpost DESC LIMIT $start, $perpage");

	$multipage = multipage($threadcount, $perpage, $page, "usercp.php?action=subscriptions");
$fpermissions = forum_permissions();
$query = $db->query("SELECT s.*, t.*, i.name AS iconname, i.path AS iconpath, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."favorites s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."icons i ON (i.iid = t.icon) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE s.type='s' AND s.uid='".$mybb->user['uid']."' ORDER BY t.lastpost DESC LIMIT $start, $perpage");

Zeile 1276Zeile 1293
		$sigimgcode = $lang->off;
}
$lang->edit_sig_note2 = sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);

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

 
	$sig = htmlspecialchars_uni($sig);

	eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
$plugins->run_hooks("usercp_endsig_end");
outputpage($editsig);

	eval("\$editsig = \"".$templates->get("usercp_editsig")."\";");
$plugins->run_hooks("usercp_endsig_end");
outputpage($editsig);

Zeile 1333Zeile 1351
	}

// Check to see if we're in a gallery or not

	}

// Check to see if we're in a gallery or not

	if($mybb->input['gallery'])

	if($activegallery)

	{

	{

		$gallery = $mybb->input['gallery'];

		$gallery = str_replace("..", "", $mybb->input['gallery']);

		$lang->avatars_in_gallery = sprintf($lang->avatars_in_gallery, $friendlyname);
// Get a listing of avatars in this gallery
$avatardir = $mybb->settings['avatardir'];

		$lang->avatars_in_gallery = sprintf($lang->avatars_in_gallery, $friendlyname);
// Get a listing of avatars in this gallery
$avatardir = $mybb->settings['avatardir'];

Zeile 1414Zeile 1432
		{
eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");
$colspan = 1;

		{
eval("\$currentavatar = \"".$templates->get("usercp_avatar_current")."\";");
$colspan = 1;

		}
else
{

		}
else
{

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

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

Zeile 1432Zeile 1450
		eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
$plugins->run_hooks("usercp_avatar_end");
outputpage($avatar);

		eval("\$avatar = \"".$templates->get("usercp_avatar")."\";");
$plugins->run_hooks("usercp_avatar_end");
outputpage($avatar);

	}

	}


}
elseif($mybb->input['action'] == "do_avatar")


}
elseif($mybb->input['action'] == "do_avatar")

Zeile 1447Zeile 1465
	elseif($mybb->input['gallery']) // Gallery avatar
{
if($mybb->input['gallery'] == "default")

	elseif($mybb->input['gallery']) // Gallery avatar
{
if($mybb->input['gallery'] == "default")

		{

		{

			$avatarpath = addslashes($mybb->settings['avatardir']."/".$mybb->input['avatar']);

			$avatarpath = addslashes($mybb->settings['avatardir']."/".$mybb->input['avatar']);

		}

		}

		else
{
$avatarpath = addslashes($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);
}
if(file_exists($avatarpath))

		else
{
$avatarpath = addslashes($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);
}
if(file_exists($avatarpath))

		{

		{

			$db->query("UPDATE ".TABLE_PREFIX."users SET avatar='$avatarpath', avatartype='gallery' WHERE uid='".$mybb->user['uid']."'");
}
remove_avatars($mybb->user['uid']);

			$db->query("UPDATE ".TABLE_PREFIX."users SET avatar='$avatarpath', avatartype='gallery' WHERE uid='".$mybb->user['uid']."'");
}
remove_avatars($mybb->user['uid']);

Zeile 1470Zeile 1488
		if($avatar['error'])
{
error($avatar['error']);

		if($avatar['error'])
{
error($avatar['error']);

		}

		}

		$db->query("UPDATE ".TABLE_PREFIX."users SET avatar='".$avatar['avatar']."', avatartype='upload' WHERE uid='".$mybb->user['uid']."'");
}
else

		$db->query("UPDATE ".TABLE_PREFIX."users SET avatar='".$avatar['avatar']."', avatartype='upload' WHERE uid='".$mybb->user['uid']."'");
}
else

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

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

		if(preg_match("#gif|jpg|jpeg|jpe|bmp|png#i", $ext) && $mybb->settings['maxavatardims'] != "")








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

if(!$type)
{
error($lang->error_invalidavatarurl);
}

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

		{

		{

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

 
			list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{

			list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{

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

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

	{

	{

		eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";");
}
eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";");

		eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";");
}
eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";");

Zeile 1649Zeile 1673
		elseif($val == "thread")
{
$tidin[] .= "'".intval($id)."'";

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

		}

		}

	}
if($tidin)
{

	}
if($tidin)
{

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

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

 
		$mybb->input['joingroup'] = intval($mybb->input['joingroup']);

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


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


		if($usergroup['type'] != 4 && $usergroup['type'] != 3)

		if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid'])

		{
error($lang->cannot_join_group);
}

		{
error($lang->cannot_join_group);
}