3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 11 months ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting
5) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

6) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

7)   Bernd Wurst <bernd@schokokeks.org>
8)   Hanno Böck <hanno@schokokeks.org>
9) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

10) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

11) 
12) 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.
13) */
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

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

bernd authored 16 years ago

18) $hint = '';
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

19) $oldcert = null;
20) if (isset($_REQUEST['replace'])) {
21)     title('Zertifikat ersetzen');
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 13 years ago

22) 
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

23)     $cert = cert_details($_REQUEST['replace']);
24)     $oldcert = $cert['id'];
25)     $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 16 years ago

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

Bernd Wurst authored 13 years ago

28) <p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>";
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 13 years ago

29) } else {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

30)     title('Neues Server-Zertifikat hinzufügen');
bernd neue Bilder, mehr SSL-Zerti...

bernd authored 16 years ago

31) }
32) 
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

33) 
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 13 years ago

34) $section = 'vhosts_certs';
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

35) 
36) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

37) output($hint . '
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 13 years ago

38) <h4>CSR automatisch erzeugen</h4>
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 9 years ago

39) <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.</p>');
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 13 years ago

40) 
41) if ($oldcert) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

42)     $cn = urlencode($cert['cn']);
43)     addnew('savecert', "Einen neuen CSR für {$cert['cn']} erzeugen lassen", "action=newcsr&commonname={$cn}&replace={$oldcert}");
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 13 years ago

44) } else {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

45)     addnew('newcsr', 'CSR automatisch erzeugen lassen');
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 13 years ago

46) }
47) 
48) 
49) output('<h4>Vorhandenes Zertifikat eintragen</h4>
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 9 years ago

50) <p>Sie können Ihr eigenes TLS-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p>
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 13 years ago

51) ');
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

52) 
53) 
54) $form = '
55) <h4>Server-Zertifikat:</h4>
56) <p><textarea name="cert" rows="10" cols="70"></textarea></p>
57) 
Bernd Wurst Ermögliche einen Zertifikat...

Bernd Wurst authored 11 years ago

58) <h4>privater Schlüssel:</h4>';
59) 
60) if ($oldcert) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

61)     $form .= '<p>Wenn Ihre Zertifizierungsstelle einen echten <em>renew</em>-Vorgang durchführt und das Zertifikat basierend auf dem alten CSR neu ausgestellt hat, brauchen Sie hier keinen privaten Schlüssel anzugeben.</p>';
Bernd Wurst Ermögliche einen Zertifikat...

Bernd Wurst authored 11 years ago

62) }
63) 
64) $form .= '<p><textarea name="key" rows="10" cols="70"></textarea></p>
bernd Neue Zertifikatsverwaltung

bernd authored 16 years ago

65) 
66) <p><input type="submit" value="Speichern" /></p>
67) 
68) ';
69) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

70) output(html_form('vhosts_certs_new', 'savecert', 'action=new&replace=' . $oldcert, $form));
Bernd Wurst Titel und Hilfetext auf der...

Bernd Wurst authored 13 years ago

71) 
72) output('<p>Es ist ein <strong>Zertifikat</strong> und ein dazu passender <strong>privater Schlüssel</strong> (ohne Passwort!) nötig. Alle Daten müssen im <strong>PEM-Format</strong> vorliegen, also in etwa die Form</p>
73) <pre>-----BEGIN CERTIFICATE-----
74) ...
75) -----END CERTIFICATE-----</pre>