');
}
}
}
else {
@unlink($filepath.$userpic[name].".tmp");
$error = "picture is to big max 230/210px";
die('ERROR: '.$error.'
');
}
}
$birthday = $b_year.'-'.$b_month.'-'.$b_day;
safe_query("UPDATE `".PREFIX."user` SET nickname='".mysql_escape_string($nickname)."',
email='".mysql_escape_string($mail)."',
firstname='".mysql_escape_string($firstname)."',
lastname='".mysql_escape_string($lastname)."',
sex='".mysql_escape_string($sex)."',
country='".mysql_escape_string($flag)."',
town='".mysql_escape_string($town)."',
birthday='".$birthday."',
icq='".$icq."',
usertext='".mysql_escape_string($usertext)."',
clantag='".mysql_escape_string($clantag)."',
clanname='".mysql_escape_string($clanname)."',
clanhp='".mysql_escape_string($clanhp)."',
clanirc='".mysql_escape_string($clanirc)."',
clanhistory='".mysql_escape_string($clanhistory)."',
cpu='".mysql_escape_string($cpu)."' WHERE userID='$id' ");
safe_query("UPDATE `".PREFIX."user` SET mainboard='".mysql_escape_string($mainboard)."',
ram='".mysql_escape_string($ram)."',
monitor='".mysql_escape_string($monitor)."',
graphiccard='".mysql_escape_string($graphiccard)."',
soundcard='".mysql_escape_string($soundcard)."',
verbindung='".mysql_escape_string($connection)."',
keyboard='".mysql_escape_string($keyboard)."',
mouse='".mysql_escape_string($mouse)."',
mousepad='".mysql_escape_string($mousepad)."',
mailonpm='".mysql_escape_string($pm_mail)."',
newsletter='".mysql_escape_string($newsletter)."',
homepage='".mysql_escape_string($homepage)."',
about='".mysql_escape_string($about)."' WHERE userID='$id' ");
if($editname) {
safe_query("UPDATE ".PREFIX."user SET username='$usernamenew' WHERE userID='$id' ");
echo'Your Profile has been updated. You have changed your username too, you have to login again!';
$loggedin=false;
}
else echo'Your Profile has been updated. Just wait a few seconds to be redirected!
';
}
elseif($_GET['action']=="editpwd") {
echo'';
}
elseif($_POST['savepwd']) {
$oldpwd = $_POST['oldpwd'];
$pwd1 = $_POST['pwd1'];
$pwd2 = $_POST['pwd2'];
$id=$userID;
$ergebnis=safe_query("SELECT * FROM ".PREFIX."user WHERE userID='$id'");
$ds=mysql_fetch_array($ergebnis);
if(!(strlen(trim($oldpwd)))) {
$error="you forgot to enter your old password!";
die('ERROR: '.$error.'
');
}
$oldmd5pwd=md5($oldpwd);
if($oldmd5pwd != $ds[password]) {
$error="your old password is not valid!";
die('ERROR: '.$error.'
');
}
if($pwd1 == $pwd2) {
if(!(strlen(trim($pwd1)))) {
$error="you forgot to enter a new password!";
die('ERROR: '.$error.'
');
}
}
else {
$error="your repeated password is not valid!";
die('ERROR: '.$error.'
');
}
$newmd5pwd=md5($pwd1);
safe_query("UPDATE ".PREFIX."user SET password='$newmd5pwd' WHERE userID='$userID'");
echo'Your password has been changed. You have to log in again.';
//logout
unset($_SESSION['ws_auth']);
unset($_SESSION['ws_lastlogin']);
if (isset($_COOKIE['ws_session'])) {
setcookie('ws_session', '', time()-42000, '/');
}
if (isset($_COOKIE['PHPSESSID'])) {
setcookie('PHPSESSID', '', time()-42000, '/');
}
session_destroy();
if (isset($_COOKIE['ws_auth'])) {
setcookie('ws_auth', '', time()-(24*60*60));
}
}
else {
$ergebnis=safe_query("SELECT * FROM ".PREFIX."user WHERE userID='$userID' ");
$anz=mysql_num_rows($ergebnis);
if($anz) {
$ds=mysql_fetch_array($ergebnis);
$flag = '[flag]'.$ds[country].'[/flag]';
$country=flags($flag);
if($ds[sex]=="m") $sex='';
else $sex='';
if($ds[newsletter]=="1") $newsletter='';
else $newsletter='';
if($ds[mailonpm]=="1") $pm_mail='';
else $pm_mail='';
$b_day=substr($ds[birthday],8,2);
$b_month=substr($ds[birthday],5,2);
$b_year=substr($ds[birthday],0,4);
$countries=str_replace(" selected", "", $countries);
$countries=str_replace('value="'.$ds[country].'"', 'value="'.$ds[country].'" selected', $countries);
if($ds[avatar]) $viewavatar='• Avatar:';
else $viewavatar='Avatar:';
if($ds[userpic]) $viewpic='• Userpic:';
else $viewpic='User-Pic:';
$usertext=clearfromtags($ds[usertext]);
$clanhistory=clearfromtags($ds[clanhistory]);
$clanname=clearfromtags($ds[clanname]);
$clantag=clearfromtags($ds[clantag]);
$clanirc=clearfromtags($ds[clanirc]);
$firstname=clearfromtags($ds[firstname]);
$lastname=clearfromtags($ds[lastname]);
$town=clearfromtags($ds[town]);
$cpu=clearfromtags($ds[cpu]);
$mainboard=clearfromtags($ds[mainboard]);
$ram=clearfromtags($ds[ram]);
$monitor=clearfromtags($ds[monitor]);
$graphiccard=clearfromtags($ds[graphiccard]);
$soundcard=clearfromtags($ds[soundcard]);
$connection=clearfromtags($ds[verbindung]);
$keyboard=clearfromtags($ds[keyboard]);
$mouse=clearfromtags($ds[mouse]);
$mousepad=clearfromtags($ds[mousepad]);
$clanhp=$ds[clanhp];
$bg1=BG_1;
$bg2=BG_2;
$bg3=BG_3;
$bg4=BG_4;
eval ("\$myprofile = \"".gettemplate("myprofile")."\";");
echo $myprofile;
}
else echo'You have to be logged in to view your profile!