FOSSology
3.2.0rc1
Open Source License Compliance by Open Source Software
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
AdminLicenseToCSV.php
1
<?php
2
/***********************************************************
3
* Copyright (C) 2014-2017 Siemens AG
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* version 2 as published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
***********************************************************/
18
19
namespace
Fossology\UI\Page
;
20
21
use
Fossology\Lib\Auth\Auth
;
22
use
Fossology\Lib\Plugin\DefaultPlugin
;
23
use
Symfony\Component\HttpFoundation\Request
;
24
use
Symfony\Component\HttpFoundation\Response
;
25
26
class
AdminLicenseToCSV
extends
DefaultPlugin
27
{
28
const
NAME =
"admin_license_to_csv"
;
29
30
function
__construct()
31
{
32
parent::__construct(self::NAME, array(
33
self::TITLE =>
"Admin License CSV Export"
,
34
self::MENU_LIST =>
"Admin::License Admin::CSV Export"
,
35
self::REQUIRES_LOGIN =>
true
,
36
self::PERMISSION =>
Auth::PERM_ADMIN
37
));
38
}
39
44
protected
function
handle
(Request $request)
45
{
46
$licenseCsvExport = new \Fossology\Lib\Application\LicenseCsvExport($this->
getObject
(
'db.manager'
));
47
$content = $licenseCsvExport->createCsv(intval($request->get(
'rf'
)));
48
$fileName =
"fossology-license-export-"
.date(
"YMj-Gis"
);
49
$headers = array(
50
'Content-type'
=>
'text/csv, charset=UTF-8'
,
51
'Content-Disposition'
=>
'attachment; filename='
.$fileName.
'.csv'
,
52
'Pragma'
=>
'no-cache'
,
53
'Cache-Control'
=>
'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0'
,
54
'Expires'
=>
'Expires: Thu, 19 Nov 1981 08:52:00 GMT'
);
55
56
return
new
Response($content, Response::HTTP_OK, $headers);
57
}
58
}
59
60
register_plugin(
new
AdminLicenseToCSV
());
Request
Response
Fossology\Lib\Plugin\DefaultPlugin
Definition:
DefaultPlugin.php:32
Fossology\Lib\Auth\Auth\PERM_ADMIN
const PERM_ADMIN
Definition:
Auth.php:63
Fossology\Lib\Plugin\DefaultPlugin\getObject
getObject($name)
Definition:
DefaultPlugin.php:249
Fossology\UI\Page\AdminLicenseToCSV
Definition:
AdminLicenseToCSV.php:26
Fossology\UI\Page\AdminLicenseToCSV\handle
handle(Request $request)
Definition:
AdminLicenseToCSV.php:44
Fossology\UI\Page
Definition:
AboutPage.php:20
Auth
DefaultPlugin
src
www
ui
page
AdminLicenseToCSV.php
Generated on Mon Jun 29 2020 12:03:44 for FOSSology by
1.8.11