1aaaa700cdfda9c1e0bd92741205d07d8e0132de
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

1) <?php
2) 
3) require_once('inc/debug.php');
4) require_once('inc/security.php');
5) 
6) require_once('vhosts.php');
7) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

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

bernd authored 16 years ago

9) $section = 'vhosts_vhosts';
10) 
11) require_role(ROLE_SYSTEMUSER);
12) 
13) $id = (int) $_GET['vhost'];
14) 
15) $vhost = get_vhost_details($id);
16) DEBUG($vhost);
17) 
18) $aliases = get_aliases($id);
19) DEBUG($aliases);
20) 
21) $mainalias = (strstr($vhost['options'], 'aliaswww') ? '<br /><strong>www.'.$vhost['fqdn'].'</strong>' : '');
22) 
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 16 years ago

24)   <table>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

28) 
29) foreach ($aliases AS $alias) {
30)   $aliastype = 'Zusätzliche Adresse';
31)   if (strstr($alias['options'], 'forward')) {
32)     $aliastype = 'Umleitung auf Haupt-Adresse';
33)   }
34)   $formtoken = generate_form_token('aliases_toggle');
bernd eliminate .php extensions f...

bernd authored 15 years ago

35)   $havewww = '<br />www.'.$alias['fqdn'].' &#160; ('.internal_link('aliasoptions', 'WWW-Alias entfernen', "alias={$alias['id']}&aliaswww=0&formtoken={$formtoken}").')';
36)   $nowww = '<br />'.internal_link('aliasoptions', 'Auch mit WWW', "alias={$alias['id']}&aliaswww=1&formtoken={$formtoken}");
bernd Neue Dateien für Alias-Edit...

bernd authored 16 years ago

37)   $wwwalias = (strstr($alias['options'], 'aliaswww') ? $havewww : $nowww);
38) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 16 years ago

41)   $typetoggle = (strstr($alias['options'], 'forward') ? $remove_forward : $to_forward);
42) 
43)     
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

49) }
50) 
bernd Usability fix

bernd authored 16 years ago

51) $form .= "
52) <tr>
53)   <td>
54)     <strong>Neuen Aliasnamen hinzufügen</strong><br />
55)     <input type=\"text\" name=\"hostname\" id=\"hostname\" size=\"10\" value=\"\" />
56)       <strong>.</strong>".domainselect()."<br />
57)     <input type=\"checkbox\" name=\"options[]\" id=\"aliaswww\" value=\"aliaswww\" />
58)       <label for=\"aliaswww\">Auch mit <strong>www</strong> davor.</label>
59)   </td>
60)   <td>
61)     <select name=\"options[]\">
62)       <option value=\"\">zusätzliche Adresse</option>
63)       <option value=\"forward\">Umleitung auf Haupt-Adresse</option>
64)     </select>
65)   </td>
66)   <td>
67)     <input type=\"submit\" value=\"Hinzufügen\" />
68)   </td>
69) </tr>
70) </table>";
71) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

72) output(html_form('vhosts_add_alias', 'save', 'action=addalias&vhost='.$vhost['id'], $form));
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 15 years ago

75)   ".internal_link("vhosts", "Zurück zur Übersicht")."
bernd Usability fix

bernd authored 16 years ago

76) </p>");