Vergleich usercp.php - 1.2.0 - 1.2.1

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

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

 * $Id: usercp.php 2173 2006-08-30 18:07:30Z Kilroy $

 * $Id: usercp.php 2265 2006-09-26 14:49:36Z Tikitiki $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 572Zeile 572
		"remember" => $mybb->input['remember'],
"receivepms" => $mybb->input['receivepms'],
"pmpopup" => $mybb->input['pmpopup'],

		"remember" => $mybb->input['remember'],
"receivepms" => $mybb->input['receivepms'],
"pmpopup" => $mybb->input['pmpopup'],

		"daysprune" => intval($mybb->input['daysprune']),

		"daysprune" => $mybb->input['daysprune'],

		"showcodebuttons" => $mybb->input['showcodebuttons'],
"pmnotify" => $mybb->input['pmnotify'],
"showredirect" => $mybb->input['showredirect']

		"showcodebuttons" => $mybb->input['showcodebuttons'],
"pmnotify" => $mybb->input['pmnotify'],
"showredirect" => $mybb->input['showredirect']

Zeile 612Zeile 612
			// Set the new one
if($mybb->input['remember'] == "yes")
{

			// Set the new one
if($mybb->input['remember'] == "yes")
{

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

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

			}
else
{

			}
else
{

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

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

			}
}


			}
}


Zeile 846Zeile 846
		$pppoptions = '';
if(is_array($explodedppp))
{

		$pppoptions = '';
if(is_array($explodedppp))
{

			foreach($explodedtpp as $key => $val)

			foreach($explodedppp as $key => $val)

			{
$val = trim($val);
$selected = "";

			{
$val = trim($val);
$selected = "";

Zeile 855Zeile 855
					$selected = "selected=\"selected\"";
}
$pppoptions .= "<option value=\"$val\" $selected>".sprintf($lang->ppp_option, $val)."</option>\n";

					$selected = "selected=\"selected\"";
}
$pppoptions .= "<option value=\"$val\" $selected>".sprintf($lang->ppp_option, $val)."</option>\n";

			}

			}

		}
eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
}

		}
eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";");
}

Zeile 867Zeile 867
if($mybb->input['action'] == "do_email" && $mybb->request_method == "post")
{
$plugins->run_hooks("usercp_do_email_start");

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

	$user = validate_password_from_uid($mybb->user['uid'], $mybb->input['password']);
if(!$user['uid'])
{
error($lang->error_invalidpassword);
}
if($mybb->input['email'] != $mybb->input['email2'])
{
error($lang->error_emailmismatch);
}






























	
$user = validate_password_from_uid($mybb->user['uid'], $mybb->input['password']);
if(!$user['uid'])
{
error($lang->error_invalidpassword);
}
if($mybb->input['email'] != $mybb->input['email2'])
{
error($lang->error_emailmismatch);
}

//Email Banning Code
if($mybb->settings['emailkeep'] != "yes")
{
$bannedemails = explode(" ", $mybb->settings['emailban']);
if(is_array($bannedemails))
{
foreach($bannedemails as $key => $bannedemail)
{
$bannedemail = trim($bannedemail);
if($bannedemail != "")
{
if(strstr($mybb->input['email'], $bannedemail) != "")
{
error($lang->error_bannedemail);
}
}
}
}
}
if(!preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $mybb->input['email']))
{
error($lang->error_invalidemail);
}
if(function_exists("emailChanged"))
{
emailChanged($mybb->user['uid'], $mybb->input['email']);
}





	//Email Banning Code
if($mybb->settings['emailkeep'] != "yes")
{
$bannedemails = explode(" ", $mybb->settings['emailban']);
if(is_array($bannedemails))
{
foreach($bannedemails as $key => $bannedemail)
{
$bannedemail = trim($bannedemail);
if($bannedemail != "")
{
if(strstr($mybb->input['email'], $bannedemail) != "")
{
error($lang->error_bannedemail);
}
}
}
}
}
if(!preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/si", $mybb->input['email']))
{
error($lang->error_invalidemail);
}
if(function_exists("emailChanged"))
{
emailChanged($mybb->user['uid'], $mybb->input['email']);




	if($mybb->user['usergroup'] != "5") 
{
$activationcode = random_str();
$now = time();
$db->delete_query(TABLE_PREFIX."awaitingactivation", "uid='".$mybb->user['uid']."'");
$newactivation = array(
"uid" => $mybb->user['uid'],
"dateline" => time(),
"code" => $activationcode,
"type" => "e",
"oldgroup" => $mybb->user['usergroup'],
"misc" => $db->escape_string($mybb->input['email'])
);

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

$username = $mybb->user['username'];
$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']);
my_mail($mybb->input['email'], $lang->emailsubject_changeemail, $lang->email_changeemail);
$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);
}
else
{
$db->update_query(TABLE_PREFIX."users", array('email' => $db->escape_string($mybb->input['email'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);

	}

	}


if($mybb->user['usergroup'] != "5")
{
$activationcode = random_str();
$now = time();
$db->delete_query(TABLE_PREFIX."awaitingactivation", "uid='".$mybb->user['uid']."'");
$newactivation = array(
"uid" => $mybb->user['uid'],
"dateline" => time(),
"code" => $activationcode,
"type" => "e",
"oldgroup" => $mybb->user['usergroup'],
"misc" => $db->escape_string($mybb->input['email'])
);
$db->insert_query(TABLE_PREFIX."awaitingactivation", $newactivation);

$username = $mybb->user['username'];
$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']);
my_mail($mybb->input['email'], $lang->emailsubject_changeemail, $lang->email_changeemail);
$plugins->run_hooks("usercp_do_email_verify");
error($lang->redirect_changeemail_activation);
}
else
{
$db->update_query(TABLE_PREFIX."users", array('email' => $db->escape_string($mybb->input['email'])), "uid='".$mybb->user['uid']."'");
$plugins->run_hooks("usercp_do_email_changed");
redirect("usercp.php", $lang->redirect_emailupdated);
}
}

}
































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


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

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

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

		error($lang->error_invalidpassword);
}
if($mybb->input['password'] == "")
{
error($lang->error_invalidnewpassword);
}
if($mybb->input['password'] != $mybb->input['password2'])
{
error($lang->error_passwordmismatch);
}
$plugins->run_hooks("usercp_do_password_process");
$logindetails = update_password($mybb->user['uid'], md5($mybb->input['password']), $mybb->user['salt']);

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

        error($lang->error_invalidpassword); 
}
if($mybb->input['password'] == "")
{
error($lang->error_invalidnewpassword);
}
if($mybb->input['password'] != $mybb->input['password2'])
{
error($lang->error_passwordmismatch);
}
$plugins->run_hooks("usercp_do_password_process");
$logindetails = update_password($mybb->user['uid'], md5($mybb->input['password']), $mybb->user['salt']);

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

}

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

}

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

Zeile 978Zeile 980
if($mybb->input['action'] == "do_changename" && $mybb->request_method == "post")
{
$plugins->run_hooks("usercp_do_changename_start");

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

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

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

		error_no_permission();

		error_no_permission();

	}
if(!trim($mybb->input['username']) || eregi("<|>|&", $mybb->input['username']))
{
error($lang->error_bannedusername);
}
$query = $db->simple_select(TABLE_PREFIX."users", "username", "LOWER(username)='".strtolower($mybb->input['username'])."'");

	}










	if($db->fetch_array($query))
{
error($lang->error_usernametaken);
}
$plugins->run_hooks("usercp_do_changename_process");
$db->update_query(TABLE_PREFIX."users", array('username' => $db->escape_string($mybb->input['username'])), "uid='".$mybb->user['uid']."'");
$db->update_query(TABLE_PREFIX."forums", array('lastposter' => $db->escape_string($mybb->input['username'])), "lastposter='".$mybb->user['username']."'");
$db->update_query(TABLE_PREFIX."threads", array('lastposter' => $db->escape_string($mybb->input['username'])), "lastposter='".$mybb->user['username']."'");
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);







	if(!trim($mybb->input['username']) || eregi("<|>|&", $mybb->input['username'])) 
{
error($lang->error_bannedusername);
}
$query = $db->simple_select(TABLE_PREFIX."users", "username", "LOWER(username)='".strtolower($mybb->input['username'])."'");

if($db->fetch_array($query))
{
error($lang->error_usernametaken);
}
$plugins->run_hooks("usercp_do_changename_process");
$db->update_query(TABLE_PREFIX."users", array('username' => $db->escape_string($mybb->input['username'])), "uid='".$mybb->user['uid']."'");
$db->update_query(TABLE_PREFIX."forums", array('lastposter' => $db->escape_string($mybb->input['username'])), "lastposter='".$mybb->user['username']."'");
$db->update_query(TABLE_PREFIX."threads", array('lastposter' => $db->escape_string($mybb->input['username'])), "lastposter='".$mybb->user['username']."'");
$plugins->run_hooks("usercp_do_changename_end");
redirect("usercp.php", $lang->redirect_namechanged);

}

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

}

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

Zeile 1010Zeile 1013
	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 1074Zeile 1077
			if($favorite['icon'] > 0 && $icon_cache[$favorite['icon']])
{
$icon = $icon_cache[$favorite['icon']];

			if($favorite['icon'] > 0 && $icon_cache[$favorite['icon']])
{
$icon = $icon_cache[$favorite['icon']];

				$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}
else
{
$icon = "&nbsp;";
}
if($mybb->user['lastvisit'] == "0")
{
$folder = "new";
}

				$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
}
else
{
$icon = "&nbsp;";
}
if($mybb->user['lastvisit'] == "0")
{
$folder = "new";
}

			if($favorite['lastpost'] > $mybb->user['lastvisit'])
{
$threadread = my_get_array_cookie("threadread", $favorite['tid']);

			if($favorite['lastpost'] > $mybb->user['lastvisit'])
{
$threadread = my_get_array_cookie("threadread", $favorite['tid']);

Zeile 1110Zeile 1113
	if(!$threads)
{
eval("\$threads = \"".$templates->get("usercp_favorites_none")."\";");

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

	}

	}

	eval("\$favorites = \"".$templates->get("usercp_favorites")."\";");
$plugins->run_hooks("usercp_favorites_end");
output_page($favorites);

	eval("\$favorites = \"".$templates->get("usercp_favorites")."\";");
$plugins->run_hooks("usercp_favorites_end");
output_page($favorites);

Zeile 1137Zeile 1140
	$lower = $start+1;
$upper = $end;
if($upper > $threadcount)

	$lower = $start+1;
$upper = $end;
if($upper > $threadcount)

	{

	{

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

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

Zeile 1155Zeile 1158
	{
$forumpermissions = $fpermissions[$subscription['fid']];
if($forumpermissions['canview'] != "no" || $forumpermissions['canviewthreads'] != "no")

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

		{

		{

			$lastpostdate = my_date($mybb->settings['dateformat'], $subscription['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $subscription['lastpost']);
// Don't link to guest's profiles (they have no profile).

			$lastpostdate = my_date($mybb->settings['dateformat'], $subscription['lastpost']);
$lastposttime = my_date($mybb->settings['timeformat'], $subscription['lastpost']);
// Don't link to guest's profiles (they have no profile).

Zeile 1299Zeile 1302
		$db->update_query(TABLE_PREFIX."posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->input['updateposts'] == "disable")

		$db->update_query(TABLE_PREFIX."posts", $update_signature, "uid='".$mybb->user['uid']."'");
}
elseif($mybb->input['updateposts'] == "disable")

	{

	{

		$update_signature = array(
"includesig" => "no"
);

		$update_signature = array(
"includesig" => "no"
);

Zeile 1323Zeile 1326
		$sig = $mybb->input['signature'];
$template = "usercp_editsig_preview";
}

		$sig = $mybb->input['signature'];
$template = "usercp_editsig_preview";
}

	elseif(!$error)

	else if(!$error)

	{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";
}

	{
$sig = $mybb->user['signature'];
$template = "usercp_editsig_current";
}

 
	

	if($sig)
{
$sig_parser = array(

	if($sig)
{
$sig_parser = array(

Zeile 1344Zeile 1348
	if($mybb->settings['sigsmilies'] == "yes")
{
$sigsmilies = $lang->on;

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

	}
else
{

	}
else
{

		$sigsmilies = $lang->off;

		$sigsmilies = $lang->off;

	}

	}

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

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

	}
else
{

	}
else
{

		$sigmycode = $lang->off;

		$sigmycode = $lang->off;

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

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

	{
$sightml = $lang->on;
}

	{
$sightml = $lang->on;
}

	else
{
$sightml = $lang->off;
}

	else
{
$sightml = $lang->off;
}

	if($mybb->settings['sigimgcode'] == "yes")

	if($mybb->settings['sigimgcode'] == "yes")

	{

	{

		$sigimgcode = $lang->on;

		$sigimgcode = $lang->on;

	}

	}

	else
{
$sigimgcode = $lang->off;

	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")."\";");
$plugins->run_hooks("usercp_endsig_end");
output_page($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");
output_page($editsig);
}

 

if($mybb->input['action'] == "do_avatar" && $mybb->request_method == "post")
{
$plugins->run_hooks("usercp_do_avatar_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->input['remove']) // remove avatar
{
$updated_avatar = array(
"avatar" => "",
"avatardimensions" => "",
"avatartype" => ""
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);
}
elseif($mybb->input['gallery']) // Gallery avatar
{
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['gallery']."/".$mybb->input['avatar']);
}
if(file_exists($avatarpath))
{
$updated_avatar = array(
"avatar" => $avatarpath,
"avatardimensions" => "",
"avatartype" => "gallery"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}
remove_avatars($mybb->user['uid']);
}
elseif($_FILES['avatarupload']['name']) // upload avatar
{
if($mybb->usergroup['canuploadavatars'] == "no")
{
error_no_permission();
}
$avatar = upload_avatar();
if($avatar['error'])
{
error($avatar['error']);
}
if($avatar['width'] > 0 && $avatar['height'] > 0)
{
$avatar_dimensions = $avatar['width']."|".$avatar['height'];
}
$updated_avatar = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}
else // remote avatar
{
$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)
{
error($lang->error_invalidavatarurl);
}

if($width && $height && $mybb->settings['maxavatardims'] != "")
{
list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
error($lang->error_avatartoobig);
}
}
if($width > 0 && $height > 0)
{
$avatar_dimensions = intval($width)."|".intval($height);
}
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->input['avatarurl']),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);
}
$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php", $lang->redirect_avatarupdated);
}


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


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

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

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

}
if($mybb->input['action'] == "do_avatar" && $mybb->request_method == "post")
{
$plugins->run_hooks("usercp_do_avatar_start");
require_once MYBB_ROOT."inc/functions_upload.php";
if($mybb->input['remove']) // remove avatar
{
$updated_avatar = array(
"avatar" => "",
"avatardimensions" => "",
"avatartype" => ""
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);
}
elseif($mybb->input['gallery']) // Gallery avatar
{
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['gallery']."/".$mybb->input['avatar']);
}
if(file_exists($avatarpath))
{
$updated_avatar = array(
"avatar" => $avatarpath,
"avatardimensions" => "",
"avatartype" => "gallery"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}
remove_avatars($mybb->user['uid']);
}
elseif($_FILES['avatarupload']['name']) // upload avatar
{
if($mybb->usergroup['canuploadavatars'] == "no")
{
error_no_permission();
}
$avatar = upload_avatar();
if($avatar['error'])
{
error($avatar['error']);
}
if($avatar['width'] > 0 && $avatar['height'] > 0)
{
$avatar_dimensions = $avatar['width']."|".$avatar['height'];
}
$updated_avatar = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
}
else // remote avatar
{
$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)
{
error($lang->error_invalidavatarurl);
}

if($width && $height && $mybb->settings['maxavatardims'] != "")
{
list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight))
{
$lang->error_avatartoobig = sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
error($lang->error_avatartoobig);
}
}
if($width > 0 && $height > 0)
{
$avatar_dimensions = intval($width)."|".intval($height);
}
$updated_avatar = array(
"avatar" => $db->escape_string($mybb->input['avatarurl']),
"avatardimensions" => $avatar_dimensions,
"avatartype" => "remote"
);
$db->update_query(TABLE_PREFIX."users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);
}
$plugins->run_hooks("usercp_do_avatar_end");
redirect("usercp.php", $lang->redirect_avatarupdated);

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

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