public function setImage($path)
{
$userImageDir = PIMCORE_WEBSITE_VAR . "/user-image";
if (!is_dir($userImageDir)) {
File::mkdir($userImageDir);
}
$destFile = $userImageDir . "/user-" . $this->getId() . ".png";
$thumb = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/user-thumbnail-" . $this->getId() . ".png";
@unlink($destFile);
@unlink($thumb);
copy($path, $destFile);
@chmod($destFile, File::getDefaultMode());
}