59775c0fe3d083d17ca8c0421bb407d67dc39d7f
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Updated copyright notice (2...

Bernd Wurst authored 11 years ago

5) Written 2008-2013 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

16) 
17) include_once('certs.php');
18) require_role(ROLE_SYSTEMUSER);
19) 
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

20) $hint = '';
21) $oldcert = NULL;
22) if (isset($_REQUEST['replace']))
23) {
24)   $cert = cert_details($_REQUEST['replace']);
25)   $oldcert = $cert['id'];
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

26)   $hint = "<div style=\"border: 2px solid red; padding: 1em; margin: 1em;\"<p><strong>Hinweis:</strong> Dieses Zertifikat soll als Ersatz für ein bestehendes Zertifikat eingetragen werden. Dabei wird jede Benutzung des alten Zertifikats durch das neue ersetzt. Das alte Zertifikat wird dann umgehend gelöscht.<p>
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

27) 
28) <p><strong>Daten des alten Zertifikats:</strong></p>
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

29) <p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>";
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

30) 
31) }
32) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

33) $section = 'vhosts_certs';
34) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

35) title('Neues Server-Zertifikat hinzufügen');
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

36) 
37) 
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

38) output($hint.'
39) <h4>CSR automatisch erzeugen</h4>
40) <p>Mit unserem CSR-Generator können Sie einen Certificate-signing-request (CSR) automatisch erzeugen lassen. Nutzen Sie diese Möglichkeit bitte nur, wenn Sie ein so genanntes "Domain validated"-Zertifikat beantragen werden, das keine persönlichen Daten bzw. Firmendaten enthält. Kostenlose Zertifikate von CAcert oder StartSSL können Sie mit dieser Funktion erzeugen.</p>');
41) 
42) if ($oldcert) {
43)   $cn = urlencode($cert['cn']);
44)   addnew('savecert', "Einen neuen CSR für {$cert['cn']} erzeugen lassen", "action=newcsr&commonname={$cn}&replace={$oldcert}");
45) } else {
46)   addnew('newcsr', 'CSR automatisch erzeugen lassen');
47) }
48) 
49) 
50) output('<h4>Vorhandenes Zertifikat eintragen</h4>
51) <p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p>
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

52) <p>Sie benötigen dazu mindestens ein <strong>Zertifikat</strong> und einen <strong>privaten Schlüssel</strong> (ohne Passwort!). Alle Daten müssen im <strong>PEM-Format</strong> vorliegen, also in etwa die Form</p>
53) <pre>-----BEGIN CERTIFICATE-----
54) ...
55) -----END CERTIFICATE-----</pre>
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 14 years ago

56) <p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p>
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

57) ');
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

58) 
59) 
60) $form = '
61) <h4>Server-Zertifikat:</h4>
62) <p><textarea name="cert" rows="10" cols="70"></textarea></p>
63) 
64) <h4>privater Schlüssel:</h4>
65) <p><textarea name="key" rows="10" cols="70"></textarea></p>
66) 
67) <p><input type="submit" value="Speichern" /></p>
68) 
69) ';
70)