mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
Filemanager: Fix anonymous upload directory always reported failure when uploading
This commit is contained in:
parent
6647381bca
commit
92a166825f
@ -1791,6 +1791,7 @@ class filemanager_ui
|
|||||||
$path = $info['dirname'] . '/'. $info['filename'] . " ($i)." . $info['extension'];
|
$path = $info['dirname'] . '/'. $info['filename'] . " ($i)." . $info['extension'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$data['path'] = $path;
|
||||||
break;
|
break;
|
||||||
case 'ask':
|
case 'ask':
|
||||||
default:
|
default:
|
||||||
|
@ -75,9 +75,28 @@ class HiddenUpload extends AnonymousList
|
|||||||
$vfs = Vfs::mount();
|
$vfs = Vfs::mount();
|
||||||
$GLOBALS['egw']->sharing[Sharing::get_token($props['ui_path'])]->redo();
|
$GLOBALS['egw']->sharing[Sharing::get_token($props['ui_path'])]->redo();
|
||||||
parent::handle_upload_action($action, $selected, $dir, null, $arr);
|
parent::handle_upload_action($action, $selected, $dir, null, $arr);
|
||||||
if ($arr['files'])
|
|
||||||
|
// Parent upload action ruins our mount and says the upload failed.
|
||||||
|
// Do the mount again
|
||||||
|
$GLOBALS['egw']->sharing[Sharing::get_token($props['ui_path'])]->redo();
|
||||||
|
|
||||||
|
// Check ourselves for success
|
||||||
|
foreach($selected as $filekey => $file_info)
|
||||||
{
|
{
|
||||||
$arr['msg'] .= "\n" . lang("The uploaded file is only visible to the person sharing these files with you, not to yourself or other people knowing this sharing link.");
|
if(!is_array($file_info))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if($arr['uploaded'][$filekey] && Vfs::stat($arr['uploaded'][$filekey]['path']))
|
||||||
|
{
|
||||||
|
// success
|
||||||
|
$arr['files']++;
|
||||||
|
$arr['errs']--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($arr['files'])
|
||||||
|
{
|
||||||
|
$arr['msg'] = lang("The uploaded file is only visible to the person sharing these files with you, not to yourself or other people knowing this sharing link.");
|
||||||
$arr['type'] = 'notice';
|
$arr['type'] = 'notice';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user