354c05a4ddd678c49bcbba458bffa7d13482139a
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

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

Bernd Wurst authored 12 years ago

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

bernd authored 14 years ago

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

bernd authored 14 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 11 years ago

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

Hanno authored 5 years ago

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

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

Bernd Wurst authored 11 years ago

27) <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 11 years ago

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

Hanno authored 5 years ago

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

bernd authored 14 years ago

30) }
31) 
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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

Bernd Wurst authored 11 years ago

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

bernd authored 14 years ago

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

Hanno Böck authored 6 months ago

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

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 7 years ago

38) <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 11 years ago

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

Hanno authored 5 years ago

41)     $cn = urlencode($cert['cn']);
42)     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 11 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 11 years ago

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

Bernd Wurst authored 7 years ago

49) <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 11 years ago

50) ');
bernd Neue Zertifikatsverwaltung

bernd authored 14 years ago

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

Bernd Wurst authored 10 years ago

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

Hanno authored 5 years ago

60)     $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 10 years ago

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

bernd authored 14 years ago

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

Hanno Böck authored 6 months ago

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

Bernd Wurst authored 11 years ago

70) 
71) 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>
72) <pre>-----BEGIN CERTIFICATE-----
73) ...
74) -----END CERTIFICATE-----</pre>