mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
Fix exporting to a directory
This commit is contained in:
parent
df1f6b2ff4
commit
dff86e4842
@ -344,9 +344,9 @@
|
||||
*/
|
||||
private static function is__writable($path) {
|
||||
if ($path{strlen($path)-1}=='/') // recursively return a temporary file path
|
||||
return is__writable($path.uniqid(mt_rand()).'.tmp');
|
||||
return self::is__writable($path.uniqid(mt_rand()).'.tmp');
|
||||
else if (is_dir($path))
|
||||
return is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
|
||||
return self::is__writable($path.'/'.uniqid(mt_rand()).'.tmp');
|
||||
// check tmp file for read/write capabilities
|
||||
$rm = file_exists($path);
|
||||
$f = @fopen($path, 'a');
|
||||
@ -422,6 +422,8 @@
|
||||
$type = $data['type'];
|
||||
|
||||
if(is_dir($data['target']))
|
||||
{
|
||||
if($data['type'] == 'import')
|
||||
{
|
||||
$targets = array();
|
||||
foreach(scandir($data['target']) as $target)
|
||||
@ -445,6 +447,12 @@
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create a unique file for export
|
||||
$targets = array($data['target'].uniqid($definition->name).'.'.$po->get_filesuffix());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$targets = array($data['target']);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user