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

bernd authored 16 years ago

13) 
14) require_once('inc/debug.php');
15) require_once('inc/security.php');
16) 
17) require_once('vhosts.php');
18) 
Bernd Wurst Beschriftung im VHosts-Modu...

Bernd Wurst authored 5 years ago

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

bernd authored 16 years ago

20) $section = 'vhosts_vhosts';
21) 
22) require_role(ROLE_SYSTEMUSER);
23) 
24) $id = (int) $_GET['vhost'];
25) 
26) $vhost = get_vhost_details($id);
27) DEBUG($vhost);
28) 
29) $aliases = get_aliases($id);
30) DEBUG($aliases);
31) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

32) $mainalias = (strstr($vhost['options'], 'aliaswww') ? '<br /><strong>www.' . $vhost['fqdn'] . '</strong>' : '');
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

33) 
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 16 years ago

35)   <table>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

Hanno authored 5 years ago

40) foreach ($aliases as $alias) {
41)     $aliastype = 'Zusätzliche Adresse';
42)     if (strstr($alias['options'], 'forward')) {
43)         $aliastype = 'Umleitung auf Haupt-Adresse';
44)     }
45)     $formtoken = generate_form_token('aliases_toggle');
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

46)     $havewww = '<br />www.' . $alias['fqdn'] . ' &#160; (' . internal_link('aliasoptions', 'WWW-Alias entfernen', "alias={$alias['id']}&aliaswww=0&formtoken={$formtoken}") . ')';
47)     $nowww = '<br />' . internal_link('aliasoptions', 'Auch mit WWW', "alias={$alias['id']}&aliaswww=1&formtoken={$formtoken}");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

48)     $wwwalias = (strstr($alias['options'], 'aliaswww') ? $havewww : $nowww);
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

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

Hanno authored 5 years ago

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

bernd authored 16 years ago

53) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

bernd authored 16 years ago

56)     <td>{$alias['fqdn']}{$wwwalias}</td>
57)     <td>{$aliastype}<br />{$typetoggle}</td>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

60) }
61) 
bernd Usability fix

bernd authored 16 years ago

62) $form .= "
63) <tr>
64)   <td>
65)     <strong>Neuen Aliasnamen hinzufügen</strong><br />
66)     <input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"\" />
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

67)       <strong>.</strong>" . domainselect() . "<br />
bernd Usability fix

bernd authored 16 years ago

68)     <input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" />
69)       <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label>
70)   </td>
71)   <td>
72)     <select name=\"options[]\">
73)       <option value=\"\">zusätzliche Adresse</option>
74)       <option value=\"forward\">Umleitung auf Haupt-Adresse</option>
75)     </select>
76)   </td>
77)   <td>
78)     <input type=\"submit\" value=\"Hinzufügen\" />
79)   </td>
80) </tr>
81) </table>";
82) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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

Hanno authored 5 years ago

84) 
bernd Usability fix

bernd authored 16 years ago

85) output("<p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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