_rootFolderID));
printCenterStart();
printStartBox(getMLText("my_account"));
print "
";
printMLText("editing_user_data");
$fullname = sanitizeString($fullname);
$email = sanitizeString($email);
$comment = sanitizeString($comment);
if (isset($pwd) && ($pwd != ""))
$user->setPwd(md5($pwd));
if ($user->getFullName() != $fullname)
$user->setFullName($fullname);
if ($user->getEmail() != $email)
$user->setEmail($email);
if ($user->getComment() != $comment)
$user->setComment($comment);
if (isset($userfile) && ($userfile != "") && ($userfile != "none"))
{
$lastDotIndex = strrpos(basename($userfile_name), ".");
$fileType = substr($userfile_name, $lastDotIndex);
if ($fileType != ".jpg")
{
printMLText("error_occured");
printMLText("only_jpg_user_images");
printGoBack();
print "
";
printEndBox();
printCenterEnd();
printHTMLFoot();
exit;
}
//verkleinern des Bildes, so dass es 150 Pixel hoch ist
if(file_exists($userfile))
{
// Originalbild einlesen
$origImg = imagecreatefromjpeg($userfile);
$width = imagesx($origImg);
$height = imagesy($origImg);
// Thumbnail im Speicher erzeugen
$newHeight = 150;
$newWidth = ($width/$height) * $newHeight;
$newImg = imagecreate($newWidth, $newHeight);
// Verkleinern
imagecopyresized($newImg, $origImg, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
// In File speichern
imagejpeg($newImg, $userfile);
// Aufräumen
imagedestroy($origImg);
imagedestroy($newImg);
}
$user->setImage($userfile, $userfile_type);
}
printMLText("op_finished");
printGoto(array(
array(getMLText("content"), "../out/out.ViewFolder.php?folderid=1"),
array(getMLText("my_account"), "../out/out.EditUserData.php")
));
print "";
printEndBox();
printCenterEnd();
printHTMLFoot();
?>