mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
Add anonymous export option
This commit is contained in:
@@ -15,7 +15,6 @@ use Silex\Application;
|
|||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
|
||||||
|
|
||||||
class DoDownload implements ControllerProviderInterface
|
class DoDownload implements ControllerProviderInterface
|
||||||
{
|
{
|
||||||
@@ -124,7 +123,8 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
'module' => _('Export'),
|
'module' => _('Export'),
|
||||||
'list' => $list,
|
'list' => $list,
|
||||||
'records' => $records,
|
'records' => $records,
|
||||||
'token' => $token
|
'token' => $token,
|
||||||
|
'anonymous' => $request->query->get('anonymous', false)
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +166,13 @@ class DoDownload implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$app->finish(function ($request, $response) use ($list, $app) {
|
$app->finish(function ($request, $response) use ($list, $app) {
|
||||||
\set_export::log_download($app, $list, $request->request->get('type'));
|
\set_export::log_download(
|
||||||
|
$app,
|
||||||
|
$list,
|
||||||
|
$request->request->get('type'),
|
||||||
|
(null !== $request->request->get('anonymous') ? true : false),
|
||||||
|
(isset($list['email']) ? $list['email'] : '')
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
$response = \set_export::stream_file(
|
$response = \set_export::stream_file(
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ class Export implements ControllerProviderInterface
|
|||||||
|
|
||||||
$remaingEmails = $destMails;
|
$remaingEmails = $destMails;
|
||||||
|
|
||||||
$url = $app['phraseanet.registry']->get('GV_ServerName') . 'mail-export/' . $token . '/';
|
$url = $app['phraseanet.registry']->get('GV_ServerName') . 'download/' . $token . '/prepare/?anonymous';
|
||||||
|
|
||||||
$from = array(
|
$from = array(
|
||||||
'name' => $app['phraseanet.user']->get_display_name(),
|
'name' => $app['phraseanet.user']->get_display_name(),
|
||||||
|
|||||||
@@ -83,7 +83,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display:none">
|
<div style="display:none">
|
||||||
<form name="download" action="{{ path('document_download', {'token': token}) }}" method="post" target="file_frame"></form>
|
<form name="download" action="{{ path('document_download', {'token': token}) }}" method="post" target="file_frame">
|
||||||
|
{% if anonymous %}
|
||||||
|
<input type="hidden" name="anonymous" value="1" />
|
||||||
|
{% endif%}
|
||||||
|
</form>
|
||||||
<iframe name="file_frame"></iframe>
|
<iframe name="file_frame"></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user