Fix path for user photo
This commit is contained in:
parent
0e1c4d92da
commit
8c13c87429
@ -6860,10 +6860,10 @@ class Form
|
||||
$dir=$conf->user->dir_output;
|
||||
if (! empty($object->photo))
|
||||
{
|
||||
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
|
||||
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
|
||||
else $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
||||
$originalfile=get_exdir($id, 2, 0, 0, $object, 'user').$object->photo;
|
||||
if ((string) $imagesize == 'mini') $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_mini');
|
||||
else if ((string) $imagesize == 'small') $file=get_exdir($id, 2, 0, 0, $object, 'user').$object->id.'/'.getImageFileNameForSize($object->photo, '_small');
|
||||
else $file=get_exdir($id, 2, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
|
||||
$originalfile=get_exdir($id, 2, 0, 0, $object, 'user').'/'.$object->id.'/'.$object->photo;
|
||||
}
|
||||
if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility
|
||||
$email=$object->email;
|
||||
|
||||
@ -449,14 +449,14 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$error && !count($object->errors)) {
|
||||
if (GETPOST('deletephoto') && $object->photo) {
|
||||
$fileimg = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/'.$object->photo;
|
||||
$dirthumbs = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user').'/logos/thumbs';
|
||||
$fileimg = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/logos/'.$object->photo;
|
||||
$dirthumbs = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id.'/logos/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
|
||||
if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) {
|
||||
$dir = $conf->user->dir_output.'/'.get_exdir($object->id, 2, 0, 1, $object, 'user');
|
||||
$dir = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user