$title = "Himmel";
$header = "Deine persönlichen Einstellungen";
include ("./inc/header.php");
include ("./inc/crypt.php");
if (!IsSet($_POST["action"]))
{
echo Get_Text("Hallo").$_SESSION['Nick'].",
\n\n";
Print_Text(13);
?>
Print_Text("pub_einstellungen_Text_UserData");?>
Print_Text(14);?>
} else {
switch ($_POST["action"]) {
case 'set':
if ($_POST["new1"]==$_POST["new2"]){
Print_Text(25);
$sql = "select * from User where UID=".$_SESSION['UID'];
$Erg = mysql_query($sql, $con);
if (PassCrypt($_POST["old"])==mysql_result($Erg, 0, "Passwort")) {
Print_Text(26);
Print_Text(27);
$usql = "update User set Passwort='".PassCrypt($_POST["new1"])."' ".
"where UID=".$_SESSION['UID']." limit 1";
$Erg = mysql_query($usql, $con);
if ($Erg==1) {
Print_Text(28);
} else {
Print_Text(29);
}
} else {
Print_Text(30);
}
} else {
Print_Text(31);
}
break;
case 'colour':
$chsql="Update User set color= \"". $_POST["colourid"]. "\" where UID = \"".$_SESSION['UID']."\" limit 1";
$Erg = mysql_query($chsql, $con);
$_SESSION['color']=$_POST["colourid"];
if ($Erg==1) {
Print_Text(32);
} else {
Print_Text(29);
}
break;
case 'sprache':
$chsql="Update User set Sprache = \"". $_POST["language"]. "\" where UID = \"".$_SESSION['UID']."\" limit 1";
$Erg = mysql_query($chsql, $con);
$_SESSION['Sprache']=$_POST["language"];
if ($Erg==1) {
Print_Text(33);
} else {
Print_Text(29);
}
break;
case 'avatar':
$chsql="Update User set Avatar = \"". $_POST["eAvatar"]. "\" where UID = \"". $_SESSION['UID']. "\" limit 1";
$Erg = mysql_query($chsql, $con);
$_SESSION['Avatar']=$_POST["eAvatar"];
if ($Erg==1) {
Print_Text(34);
} else {
Print_Text(29);
}
break;
case 'setUserData':
$chsql= "UPDATE User SET ".
"`Nick`='". $_POST["eNick"]. "', `Name`='". $_POST["eName"]. "', ".
"`Vorname`='". $_POST["eVorname"]. "', `Alter`='". $_POST["eAlter"]. "', ".
"`Telefon`='". $_POST["eTelefon"]. "', `Handy`='". $_POST["eHandy"]. "', ".
"`DECT`='". $_POST["eDECT"]. "', `email`='". $_POST["eemail"]. "' ".
"WHERE UID='". $_SESSION['UID']. "' LIMIT 1;";
$Erg = mysql_query($chsql, $con);
if ($Erg==1)
{
$_SESSION['Nick'] = $_POST["eNick"];
$_SESSION['Name'] = $_POST["eName"];
$_SESSION['Vorname'] = $_POST["eVorname"];
$_SESSION['Alter'] = $_POST["eAlter"];
$_SESSION['Telefon'] = $_POST["eTelefon"];
$_SESSION['Handy'] = $_POST["eHandy"];
$_SESSION['DECT'] = $_POST["eDECT"];
$_SESSION['email'] = $_POST["eemail"];
Print_Text("pub_einstellungen_UserDateSaved");
}
else
{
Print_Text(29);
echo mysql_error( $con);
}
break;
}
}
include ("./inc/footer.php");
?>