diff options
author | alecpl <alec@alec.pl> | 2009-10-03 19:12:27 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-10-03 19:12:27 +0000 |
commit | ebf8726eeaa507096ef28e776303b459c401a924 (patch) | |
tree | 2e10ae8f41fe12f97a34b034ecb89e46b1eb0b92 /plugins | |
parent | 2c7296a82df28cbd1d44949d948bdea35f4cb836 (diff) |
- Added attachment upload indicator with parallel upload (#1486058)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/filesystem_attachments/filesystem_attachments.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/filesystem_attachments/filesystem_attachments.php b/plugins/filesystem_attachments/filesystem_attachments.php index fcdcea7a5..dce2de293 100644 --- a/plugins/filesystem_attachments/filesystem_attachments.php +++ b/plugins/filesystem_attachments/filesystem_attachments.php @@ -57,7 +57,7 @@ class filesystem_attachments extends rcube_plugin $tmpfname = tempnam($temp_dir, 'rcmAttmnt'); if (move_uploaded_file($args['path'], $tmpfname) && file_exists($tmpfname)) { - $args['id'] = count($_SESSION['plugins']['filesystem_attachments']['tmp_files'])+1; + $args['id'] = $this->file_id(); $args['path'] = $tmpfname; $args['status'] = true; @@ -88,7 +88,7 @@ class filesystem_attachments extends rcube_plugin return $args; } - $args['id'] = count($_SESSION['plugins']['filesystem_attachments']['tmp_files'])+1; + $args['id'] = $this->file_id(); $args['status'] = true; // Note the file for later cleanup @@ -146,4 +146,11 @@ class filesystem_attachments extends rcube_plugin } return $args; } + + function file_id() + { + $userid = rcmail::get_instance()->user->ID; + list($usec, $sec) = explode(' ', microtime()); + return preg_replace('/[^0-9]/', '', $userid . $sec . $usec); + } } |