6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
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) 
8) $title = "Aliasnamen für Subdomain bearbeiten";
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) output("<h3>Aliasnamen für Subdomain bearbeiten</h3>");
22) 
23) $mainalias = (strstr($vhost['options'], 'aliaswww') ? '<br /><strong>www.'.$vhost['fqdn'].'</strong>' : '');
24) 
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 16 years ago

26)   <table>
bernd Entities repariert

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

37)   $havewww = '<br />www.'.$alias['fqdn'].' &#160; ('.internal_link('aliasoptions', 'WWW-Alias entfernen', "alias={$alias['id']}&aliaswww=0&formtoken={$formtoken}").')';
38)   $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

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

bernd authored 15 years ago

41)   $to_forward = internal_link('aliasoptions', 'In Umleitung umwandeln', "alias={$alias['id']}&forward=1&formtoken={$formtoken}");
42)   $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

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

bernd authored 16 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 16 years ago

51) }
52) 
bernd Usability fix

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

78) </p>");