4c630eb1d90ef9c268aeff3700814575bdf24ed6
bernd Neue Dateien für Alias-Edit...

bernd authored 16 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 Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 Dateien für Alias-Edit...

bernd authored 16 years ago

16) 
17) require_once('inc/debug.php');
18) require_once('inc/security.php');
19) 
20) require_once('vhosts.php');
21) 
Bernd Wurst Beschriftung im VHosts-Modu...

Bernd Wurst authored 5 years ago

22) title("Aliasnamen für Website bearbeiten");
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

23) $section = 'vhosts_vhosts';
24) 
25) require_role(ROLE_SYSTEMUSER);
26) 
27) $id = (int) $_GET['vhost'];
28) 
29) $vhost = get_vhost_details($id);
30) DEBUG($vhost);
31) 
32) $aliases = get_aliases($id);
33) DEBUG($aliases);
34) 
35) $mainalias = (strstr($vhost['options'], 'aliaswww') ? '<br /><strong>www.'.$vhost['fqdn'].'</strong>' : '');
36) 
bernd Usability fix

bernd authored 16 years ago

37) $form = "
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

38)   <table>
bernd Entities repariert

bernd authored 16 years ago

39)     <tr><th>Adresse</th><th>Verhalten</th><th>&#160;</th></tr>
40)     <tr><td><strong>{$vhost['fqdn']}</strong>{$mainalias}</td><td>Haupt-Adresse</td><td>&#160;</td></tr>
bernd Usability fix

bernd authored 16 years ago

41) ";
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

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

Hanno authored 5 years ago

43) foreach ($aliases as $alias) {
44)     $aliastype = 'Zusätzliche Adresse';
45)     if (strstr($alias['options'], 'forward')) {
46)         $aliastype = 'Umleitung auf Haupt-Adresse';
47)     }
48)     $formtoken = generate_form_token('aliases_toggle');
49)     $havewww = '<br />www.'.$alias['fqdn'].' &#160; ('.internal_link('aliasoptions', 'WWW-Alias entfernen', "alias={$alias['id']}&aliaswww=0&formtoken={$formtoken}").')';
50)     $nowww = '<br />'.internal_link('aliasoptions', 'Auch mit WWW', "alias={$alias['id']}&aliaswww=1&formtoken={$formtoken}");
51)     $wwwalias = (strstr($alias['options'], 'aliaswww') ? $havewww : $nowww);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

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

Hanno authored 5 years ago

53)     $to_forward = internal_link('aliasoptions', 'In Umleitung umwandeln', "alias={$alias['id']}&forward=1&formtoken={$formtoken}");
54)     $remove_forward = internal_link('aliasoptions', 'In zusätzliche Adresse umwandeln', "alias={$alias['id']}&forward=0&formtoken={$formtoken}");
55)     $typetoggle = (strstr($alias['options'], 'forward') ? $remove_forward : $to_forward);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

56) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

58)     $form .= "<tr>
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

59)     <td>{$alias['fqdn']}{$wwwalias}</td>
60)     <td>{$aliastype}<br />{$typetoggle}</td>
bernd eliminate .php extensions f...

bernd authored 15 years ago

61)     <td>".internal_link('save', 'Aliasname löschen', "action=deletealias&alias={$alias['id']}")."</td></tr>
bernd Usability fix

bernd authored 16 years ago

62)   ";
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

63) }
64) 
bernd Usability fix

bernd authored 16 years ago

65) $form .= "
66) <tr>
67)   <td>
68)     <strong>Neuen Aliasnamen hinzufügen</strong><br />
69)     <input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"\" />
70)       <strong>.</strong>".domainselect()."<br />
71)     <input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" />
72)       <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label>
73)   </td>
74)   <td>
75)     <select name=\"options[]\">
76)       <option value=\"\">zusätzliche Adresse</option>
77)       <option value=\"forward\">Umleitung auf Haupt-Adresse</option>
78)     </select>
79)   </td>
80)   <td>
81)     <input type=\"submit\" value=\"Hinzufügen\" />
82)   </td>
83) </tr>
84) </table>";
85) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

86) output(html_form('vhosts_add_alias', 'save', 'action=addalias&vhost='.$vhost['id'], $form));
Hanno remove whitespace in empty...

Hanno authored 5 years ago

87) 
bernd Usability fix

bernd authored 16 years ago

88) output("<p>
bernd eliminate .php extensions f...

bernd authored 15 years ago

89)   ".internal_link("vhosts", "Zurück zur Übersicht")."