828df758a7b28057a552c24fe6034a44ea344ae2
bernd Neue Zertifikatsverwaltung

bernd authored 15 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 2 years 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 2 years 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 15 years ago

13) 
14) require_once("certs.php");
15) require_role(ROLE_SYSTEMUSER);
16) 
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 8 years ago

17) title("Zertifikate");
bernd Neue Zertifikatsverwaltung

bernd authored 15 years ago

18) 
Bernd Wurst Interface für Zertifikate i...

Bernd Wurst authored 8 years ago

19) output('<p>Bei '.config('company_name').' können Sie Ihre eigenen Zertifikate nutzen. Wir verwenden dafür (wenn nicht anders vereinbart) die SNI-Technik.
hanno text reduziert

hanno authored 15 years ago

20) Beim Anlegen von Webserver-Konfigurationen können Sie dann eines Ihrer Zertifikate für jede Konfiguration auswählen.</p>
bernd Neue Zertifikatsverwaltung

bernd authored 15 years ago

21) 
22) <h4>Ihre bisher vorhandenen Zertifikate</h4>
23) ');
24) 
25) $certs = user_certs();
26) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

27) if (count($certs) > 0) {
28)     output("<table><tr><th>Name/Details</th><th>CommonName</th><th>Gültig ab</th><th>Gültig bis</th><th>&#160;</th></tr>");
29)     foreach ($certs as $c) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

30)         $style = "";
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

31)         if ($c['valid_until'] <= date('Y-m-d')) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

32)             $style = ' style="background-color: #f88;" ';
33)         } elseif ($c['valid_until'] <= date('Y-m-d', time() + (30 * 24 * 3600)) && !cert_is_letsencrypt($c['id'])) {
34)             $style = ' style="background-color: #ff8;" ';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

35)         }
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 5 years ago

36)         output("<tr><td{$style}>".internal_link('showcert', filter_output_html($c['subject']), "mode=cert&id={$c['id']}")."</td><td{$style}>".filter_output_html($c['cn'])."</td><td{$style}>{$c['valid_from']}</td><td{$style}>{$c['valid_until']}</td><td>".internal_link('newcert', '<img src="'.$prefix.'images/refresh.png" title="Neue Version des Zertifikats einspielen" />', 'replace='.$c['id'])." &#160; ".internal_link('savecert', '<img src="'.$prefix.'images/delete.png" />', 'action=delete&id='.$c['id'])."</td></tr>");
bernd Farbige Markierung wenn ein...

bernd authored 12 years ago

37)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

38)     output("</table>");
39) } else {
40)     output('<p><em>Bisher haben Sie keine Zertifikate eingetragen</em></p>');
bernd Neue Zertifikatsverwaltung

bernd authored 15 years ago

41) }
42) 
Bernd Wurst Neuer Workflow für Cert-Rep...

Bernd Wurst authored 11 years ago

43) addnew('newcert', 'Neues Zertifikat erzeugen / eintragen');
44) 
bernd Neue Zertifikatsverwaltung

bernd authored 15 years ago

45) 
bernd CSR-Erstellung

bernd authored 15 years ago

46) 
47) $csr = user_csr();
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

48) if (count($csr) > 0) {
49)     output('<h3>offene CSRs</h3>');
50)     output("<table><tr><th>Host-/Domainname</th><th>Bitlänge</th><th>Erzeugt am</th><th>&#160;</th></tr>");
51)     foreach ($csr as $c) {
52)         output("<tr><td>".internal_link('showcert', $c['hostname'], 'mode=csr&id='.$c['id'])."</td><td>{$c['bits']}</td><td>{$c['created']}</td><td>".internal_link('savecert', '<img src="'.$prefix.'images/delete.png" />', 'action=deletecsr&id='.$c['id'])." &#160; ".internal_link('certfromcsr', '<img src="'.$prefix.'images/ok.png" alt="Zertifikat hinzufügen" title="Zertifikat hinzufügen" />', "id={$c['id']}")."</td></tr>");
53)     }
54)     output("</table>");