SPF und TXT records
bernd

bernd commited on 2009-09-07 06:05:53
Zeige 4 geänderte Dateien mit 21 Einfügungen und 5 Löschungen.


git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1462 87cf0b9e-d624-0410-a070-f6ee81989793
... ...
@@ -70,6 +70,8 @@ output('<h4>Neuen DNS-Record anlegen</h4>
70 70
 <ul>
71 71
 <li>'.internal_link('dns_record_edit', 'AAAA (IPv6-Adresse)', 'id=new&type=aaaa&domain='.$domain->id).'</li>
72 72
 <li>'.internal_link('dns_record_edit', 'CNAME (Aliasnamen)', 'id=new&type=cname&domain='.$domain->id).'</li>
73
+<li>'.internal_link('dns_record_edit', 'SPF', 'id=new&type=spf&domain='.$domain->id).'</li>
74
+<li>'.internal_link('dns_record_edit', 'TXT', 'id=new&type=txt&domain='.$domain->id).'</li>
73 75
 </ul>
74 76
 ');
75 77
 
... ...
@@ -84,6 +84,13 @@ if ($type == 'ptr' || $type == 'cname')
84 84
 ';
85 85
 }
86 86
 
87
+if ($type == 'spf' || $type == 'txt')
88
+{
89
+  $form .= '
90
+<tr><td><label for="data">Inhalt:</label></td><td><input type="text" name="data" id="data" value="'.$data['data'].'" /></td></tr>
91
+';
92
+}
93
+
87 94
 if ($dyndns)
88 95
 {
89 96
   $form .= '
... ...
@@ -26,7 +26,7 @@ else
26 26
 }
27 27
 
28 28
 
29
-if ($_GET['action'] == 'delete') {
29
+if (isset($_GET['action']) && ($_GET['action'] == 'delete')) {
30 30
   $sure = user_is_sure();
31 31
   if ($sure === NULL)
32 32
   {
... ...
@@ -56,10 +56,10 @@ else
56 56
   
57 57
   $record['hostname'] = $_REQUEST['hostname'];
58 58
   $record['domain'] = (int) $_REQUEST['domain'];
59
-  $record['ip'] = $_REQUEST['ip'];
59
+  $record['ip'] = (isset($_REQUEST['ip']) ? $_REQUEST['ip'] : '');
60 60
   $record['data'] = $_REQUEST['data'];
61
-  $record['dyndns'] = (int) $_REQUEST['dyndns'];
62
-  $record['spec'] = (int) $_REQUEST['spec'];
61
+  $record['dyndns'] = (isset($_REQUEST['dyndns']) ? (int) $_REQUEST['dyndns'] : '');
62
+  $record['spec'] = (isset($_REQUEST['spec']) ? (int) $_REQUEST['spec'] : '');
63 63
   $record['ttl'] = (int) $_REQUEST['ttl'];
64 64
   
65 65
   save_dns_record($id, $record);
... ...
@@ -222,11 +222,18 @@ function save_dns_record($id, $record)
222 222
       $record['ip'] = '';
223 223
       verify_input_hostname($record['data']);
224 224
       if (! $record['data'] )
225
-        system_failure('MX hostname missing');
225
+        system_failure('destination host missing');
226 226
       break;
227 227
 
228 228
     case 'spf':
229 229
     case 'txt':
230
+      $record['dyndns'] = '';
231
+      $record['spec'] = '';
232
+      $record['ip'] = '';
233
+      if (! $record['data'] )
234
+        system_failure('text entry missing');
235
+      break;
236
+
230 237
     case 'srv':
231 238
       system_failure('not implemented yet');
232 239
     default:
233 240