1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* ***************************************************************************** |
4
|
|
|
* Contributions to this work were made on behalf of the GÉANT project, a |
5
|
|
|
* project that has received funding from the European Union’s Framework |
6
|
|
|
* Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus), |
7
|
|
|
* Horizon 2020 research and innovation programme under Grant Agreements No. |
8
|
|
|
* 691567 (GN4-1) and No. 731122 (GN4-2). |
9
|
|
|
* On behalf of the aforementioned projects, GEANT Association is the sole owner |
10
|
|
|
* of the copyright in all material which was developed by a member of the GÉANT |
11
|
|
|
* project. GÉANT Vereniging (Association) is registered with the Chamber of |
12
|
|
|
* Commerce in Amsterdam with registration number 40535155 and operates in the |
13
|
|
|
* UK as a branch of GÉANT Vereniging. |
14
|
|
|
* |
15
|
|
|
* Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands. |
16
|
|
|
* UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK |
17
|
|
|
* |
18
|
|
|
* License: see the web/copyright.inc.php file in the file structure or |
19
|
|
|
* <base_url>/copyright.php after deploying the software |
20
|
|
|
*/ |
21
|
|
|
?> |
22
|
|
|
<?php |
23
|
|
|
require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
24
|
|
|
|
25
|
|
|
$auth = new \web\lib\admin\Authentication(); |
26
|
|
|
$languageInstance = new \core\common\Language(); |
27
|
|
|
$uiElements = new web\lib\admin\UIElements(); |
28
|
|
|
|
29
|
|
|
$auth->authenticate(); |
30
|
|
|
$languageInstance->setTextDomain("web_admin"); |
31
|
|
|
|
32
|
|
|
|
33
|
|
|
header("Content-Type:text/html;charset=utf-8"); |
34
|
|
|
|
35
|
|
|
$validator = new \web\lib\common\InputValidation(); |
36
|
|
|
|
37
|
|
|
$dest = "../overview_certificates.php"; |
38
|
|
|
|
39
|
|
|
$user = new \core\User($_SESSION['user']); |
40
|
|
|
$mgmt = new \core\UserManagement(); |
41
|
|
|
|
42
|
|
|
$engine = new core\common\X509(); |
43
|
|
|
|
44
|
|
|
$certificate = $engine->der2pem($engine->pem2der($_POST['certdata'])); |
45
|
|
|
|
46
|
|
|
echo "<pre>$certificate</pre>"; |
47
|
|
|
|
48
|
|
|
?> |
|
|
|
|
49
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.