... | ... |
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely |
8 | 8 |
|
9 | 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 | 10 |
|
11 |
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 | 12 |
http://creativecommons.org/publicdomain/zero/1.0/ |
13 | 13 |
|
14 | 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. |
... | ... |
@@ -18,20 +18,18 @@ include_once('certs.php'); |
18 | 18 |
require_role(ROLE_SYSTEMUSER); |
19 | 19 |
|
20 | 20 |
$hint = ''; |
21 |
-$oldcert = NULL; |
|
22 |
-if (isset($_REQUEST['replace'])) |
|
23 |
-{ |
|
24 |
- title('Zertifikat ersetzen'); |
|
21 |
+$oldcert = null; |
|
22 |
+if (isset($_REQUEST['replace'])) { |
|
23 |
+ title('Zertifikat ersetzen'); |
|
25 | 24 |
|
26 |
- $cert = cert_details($_REQUEST['replace']); |
|
27 |
- $oldcert = $cert['id']; |
|
28 |
- $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> |
|
25 |
+ $cert = cert_details($_REQUEST['replace']); |
|
26 |
+ $oldcert = $cert['id']; |
|
27 |
+ $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> |
|
29 | 28 |
|
30 | 29 |
<p><strong>Daten des alten Zertifikats:</strong></p> |
31 | 30 |
<p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>"; |
32 |
- |
|
33 | 31 |
} else { |
34 |
- title('Neues Server-Zertifikat hinzufügen'); |
|
32 |
+ title('Neues Server-Zertifikat hinzufügen'); |
|
35 | 33 |
} |
36 | 34 |
|
37 | 35 |
|
... | ... |
@@ -43,10 +41,10 @@ output($hint.' |
43 | 41 |
<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>'); |
44 | 42 |
|
45 | 43 |
if ($oldcert) { |
46 |
- $cn = urlencode($cert['cn']); |
|
47 |
- addnew('savecert', "Einen neuen CSR für {$cert['cn']} erzeugen lassen", "action=newcsr&commonname={$cn}&replace={$oldcert}"); |
|
44 |
+ $cn = urlencode($cert['cn']); |
|
45 |
+ addnew('savecert', "Einen neuen CSR für {$cert['cn']} erzeugen lassen", "action=newcsr&commonname={$cn}&replace={$oldcert}"); |
|
48 | 46 |
} else { |
49 |
- addnew('newcsr', 'CSR automatisch erzeugen lassen'); |
|
47 |
+ addnew('newcsr', 'CSR automatisch erzeugen lassen'); |
|
50 | 48 |
} |
51 | 49 |
|
52 | 50 |
|
... | ... |
@@ -62,7 +60,7 @@ $form = ' |
62 | 60 |
<h4>privater Schlüssel:</h4>'; |
63 | 61 |
|
64 | 62 |
if ($oldcert) { |
65 |
- $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>'; |
|
63 |
+ $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>'; |
|
66 | 64 |
} |
67 | 65 |
|
68 | 66 |
$form .= '<p><textarea name="key" rows="10" cols="70"></textarea></p> |
... | ... |
@@ -40,7 +40,7 @@ $section = 'vhosts_certs'; |
40 | 40 |
|
41 | 41 |
output($hint.' |
42 | 42 |
<h4>CSR automatisch erzeugen</h4> |
43 |
-<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>'); |
|
43 |
+<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>'); |
|
44 | 44 |
|
45 | 45 |
if ($oldcert) { |
46 | 46 |
$cn = urlencode($cert['cn']); |
... | ... |
@@ -51,7 +51,7 @@ if ($oldcert) { |
51 | 51 |
|
52 | 52 |
|
53 | 53 |
output('<h4>Vorhandenes Zertifikat eintragen</h4> |
54 |
-<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
54 |
+<p>Sie können Ihr eigenes TLS-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
55 | 55 |
'); |
56 | 56 |
|
57 | 57 |
|
... | ... |
@@ -59,8 +59,13 @@ $form = ' |
59 | 59 |
<h4>Server-Zertifikat:</h4> |
60 | 60 |
<p><textarea name="cert" rows="10" cols="70"></textarea></p> |
61 | 61 |
|
62 |
-<h4>privater Schlüssel:</h4> |
|
63 |
-<p><textarea name="key" rows="10" cols="70"></textarea></p> |
|
62 |
+<h4>privater Schlüssel:</h4>'; |
|
63 |
+ |
|
64 |
+if ($oldcert) { |
|
65 |
+ $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>'; |
|
66 |
+} |
|
67 |
+ |
|
68 |
+$form .= '<p><textarea name="key" rows="10" cols="70"></textarea></p> |
|
64 | 69 |
|
65 | 70 |
<p><input type="submit" value="Speichern" /></p> |
66 | 71 |
|
... | ... |
@@ -72,4 +77,4 @@ output('<p>Es ist ein <strong>Zertifikat</strong> und ein dazu passender <strong |
72 | 77 |
<pre>-----BEGIN CERTIFICATE----- |
73 | 78 |
... |
74 | 79 |
-----END CERTIFICATE-----</pre> |
75 |
-<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p>'); |
|
80 |
+<p>aufweisen.'); |
... | ... |
@@ -21,6 +21,8 @@ $hint = ''; |
21 | 21 |
$oldcert = NULL; |
22 | 22 |
if (isset($_REQUEST['replace'])) |
23 | 23 |
{ |
24 |
+ title('Zertifikat ersetzen'); |
|
25 |
+ |
|
24 | 26 |
$cert = cert_details($_REQUEST['replace']); |
25 | 27 |
$oldcert = $cert['id']; |
26 | 28 |
$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> |
... | ... |
@@ -28,11 +30,12 @@ if (isset($_REQUEST['replace'])) |
28 | 30 |
<p><strong>Daten des alten Zertifikats:</strong></p> |
29 | 31 |
<p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>"; |
30 | 32 |
|
33 |
+} else { |
|
34 |
+ title('Neues Server-Zertifikat hinzufügen'); |
|
31 | 35 |
} |
32 | 36 |
|
33 |
-$section = 'vhosts_certs'; |
|
34 | 37 |
|
35 |
-title('Neues Server-Zertifikat hinzufügen'); |
|
38 |
+$section = 'vhosts_certs'; |
|
36 | 39 |
|
37 | 40 |
|
38 | 41 |
output($hint.' |
... | ... |
@@ -49,11 +52,6 @@ if ($oldcert) { |
49 | 52 |
|
50 | 53 |
output('<h4>Vorhandenes Zertifikat eintragen</h4> |
51 | 54 |
<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
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 |
-<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p> |
|
56 | 55 |
'); |
57 | 56 |
|
58 | 57 |
|
... | ... |
@@ -69,3 +67,9 @@ $form = ' |
69 | 67 |
'; |
70 | 68 |
|
71 | 69 |
output(html_form('vhosts_certs_new', 'savecert', 'action=new&replace='.$oldcert, $form)); |
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> |
|
75 |
+<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p>'); |
... | ... |
@@ -23,10 +23,10 @@ if (isset($_REQUEST['replace'])) |
23 | 23 |
{ |
24 | 24 |
$cert = cert_details($_REQUEST['replace']); |
25 | 25 |
$oldcert = $cert['id']; |
26 |
- $hint = "<p class=\"warning\"><strong>Hinweis:</strong> Dieses Zertifkkat 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> |
|
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> |
|
27 | 27 |
|
28 | 28 |
<p><strong>Daten des alten Zertifikats:</strong></p> |
29 |
-<p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p>"; |
|
29 |
+<p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p></div>"; |
|
30 | 30 |
|
31 | 31 |
} |
32 | 32 |
|
... | ... |
@@ -35,13 +35,26 @@ $section = 'vhosts_certs'; |
35 | 35 |
title('Neues Server-Zertifikat hinzufügen'); |
36 | 36 |
|
37 | 37 |
|
38 |
-output('<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
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> |
|
39 | 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> |
40 | 53 |
<pre>-----BEGIN CERTIFICATE----- |
41 | 54 |
... |
42 | 55 |
-----END CERTIFICATE-----</pre> |
43 | 56 |
<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p> |
44 |
-'.$hint); |
|
57 |
+'); |
|
45 | 58 |
|
46 | 59 |
|
47 | 60 |
$form = ' |
... | ... |
@@ -1,4 +1,18 @@ |
1 | 1 |
<?php |
2 |
+/* |
|
3 |
+This file belongs to the Webinterface of schokokeks.org Hosting |
|
4 |
+ |
|
5 |
+Written 2008-2012 by schokokeks.org Hosting, namely |
|
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 |
+*/ |
|
2 | 16 |
|
3 | 17 |
include_once('certs.php'); |
4 | 18 |
require_role(ROLE_SYSTEMUSER); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1812 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -18,11 +18,10 @@ if (isset($_REQUEST['replace'])) |
18 | 18 |
|
19 | 19 |
$section = 'vhosts_certs'; |
20 | 20 |
|
21 |
-$title = 'Neues Server-Zertifikat hinzufügen'; |
|
21 |
+title('Neues Server-Zertifikat hinzufügen'); |
|
22 | 22 |
|
23 | 23 |
|
24 |
-output('<h3>Neues Server-Zertifikat hinzufügen</h3> |
|
25 |
-<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
24 |
+output('<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
26 | 25 |
<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> |
27 | 26 |
<pre>-----BEGIN CERTIFICATE----- |
28 | 27 |
... |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1445 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -3,6 +3,19 @@ |
3 | 3 |
include_once('certs.php'); |
4 | 4 |
require_role(ROLE_SYSTEMUSER); |
5 | 5 |
|
6 |
+$hint = ''; |
|
7 |
+$oldcert = NULL; |
|
8 |
+if (isset($_REQUEST['replace'])) |
|
9 |
+{ |
|
10 |
+ $cert = cert_details($_REQUEST['replace']); |
|
11 |
+ $oldcert = $cert['id']; |
|
12 |
+ $hint = "<p class=\"warning\"><strong>Hinweis:</strong> Dieses Zertifkkat 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> |
|
13 |
+ |
|
14 |
+<p><strong>Daten des alten Zertifikats:</strong></p> |
|
15 |
+<p><strong>CN:</strong> {$cert['cn']}<br /><strong>Gültigkeit:</strong> {$cert['valid_from']} - {$cert['valid_until']}</p>"; |
|
16 |
+ |
|
17 |
+} |
|
18 |
+ |
|
6 | 19 |
$section = 'vhosts_certs'; |
7 | 20 |
|
8 | 21 |
$title = 'Neues Server-Zertifikat hinzufügen'; |
... | ... |
@@ -14,7 +27,8 @@ output('<h3>Neues Server-Zertifikat hinzufügen</h3> |
14 | 27 |
<pre>-----BEGIN CERTIFICATE----- |
15 | 28 |
... |
16 | 29 |
-----END CERTIFICATE-----</pre> |
17 |
-<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p>'); |
|
30 |
+<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p> |
|
31 |
+'.$hint); |
|
18 | 32 |
|
19 | 33 |
|
20 | 34 |
$form = ' |
... | ... |
@@ -28,4 +42,4 @@ $form = ' |
28 | 42 |
|
29 | 43 |
'; |
30 | 44 |
|
31 |
-output(html_form('vhosts_certs_new', 'savecert', 'action=new', $form)); |
|
45 |
+output(html_form('vhosts_certs_new', 'savecert', 'action=new&replace='.$oldcert, $form)); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1421 87cf0b9e-d624-0410-a070-f6ee81989793
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,31 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+include_once('certs.php'); |
|
4 |
+require_role(ROLE_SYSTEMUSER); |
|
5 |
+ |
|
6 |
+$section = 'vhosts_certs'; |
|
7 |
+ |
|
8 |
+$title = 'Neues Server-Zertifikat hinzufügen'; |
|
9 |
+ |
|
10 |
+ |
|
11 |
+output('<h3>Neues Server-Zertifikat hinzufügen</h3> |
|
12 |
+<p>Sie können Ihr eigenes SSL-Zertifikat hinterlegen, das Sie dann für eine oder mehrere Webserver-Konfigurationen verwenden können.</p> |
|
13 |
+<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> |
|
14 |
+<pre>-----BEGIN CERTIFICATE----- |
|
15 |
+... |
|
16 |
+-----END CERTIFICATE-----</pre> |
|
17 |
+<p>aufweisen. Sind die genannten Vorausetzungen erfüllt, können Sie Ihre Zertifikats-Daten einfach in untenstehendes Formular eingeben.</p>'); |
|
18 |
+ |
|
19 |
+ |
|
20 |
+$form = ' |
|
21 |
+<h4>Server-Zertifikat:</h4> |
|
22 |
+<p><textarea name="cert" rows="10" cols="70"></textarea></p> |
|
23 |
+ |
|
24 |
+<h4>privater Schlüssel:</h4> |
|
25 |
+<p><textarea name="key" rows="10" cols="70"></textarea></p> |
|
26 |
+ |
|
27 |
+<p><input type="submit" value="Speichern" /></p> |
|
28 |
+ |
|
29 |
+'; |
|
30 |
+ |
|
31 |
+output(html_form('vhosts_certs_new', 'savecert', 'action=new', $form)); |