|
|
|
@ -27,9 +27,24 @@
|
|
|
|
|
class filesystem_attachments extends rcube_plugin
|
|
|
|
|
{
|
|
|
|
|
public $task = '?(?!login).*';
|
|
|
|
|
public $initialized = false;
|
|
|
|
|
|
|
|
|
|
function init()
|
|
|
|
|
{
|
|
|
|
|
// Find filesystem_attachments-based plugins, we can use only one
|
|
|
|
|
foreach ($this->api->loaded_plugins() as $plugin_name) {
|
|
|
|
|
$plugin = $this->api->get_plugin($plugin_name);
|
|
|
|
|
if (($plugin instanceof filesystem_attachments) && $plugin->initialized) {
|
|
|
|
|
rcube::raise_error(array(
|
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
|
'message' => "Can use only one plugin for attachments/file uploads! Using '$plugin_name', ignoring others.",
|
|
|
|
|
), true, false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->initialized = true;
|
|
|
|
|
|
|
|
|
|
// Save a newly uploaded attachment
|
|
|
|
|
$this->add_hook('attachment_upload', array($this, 'upload'));
|
|
|
|
|
|
|
|
|
|