Server bei vmail-domain mit eintragen
bernd

bernd commited on 2011-03-11 13:30:21
Zeige 1 geänderte Dateien mit 3 Einfügungen und 1 Löschungen.


git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1945 87cf0b9e-d624-0410-a070-f6ee81989793
... ...
@@ -324,9 +324,11 @@ function change_domain($id, $type)
324 324
     db_query("UPDATE kundendaten.domains SET mail='none', lastchange=NOW() WHERE id={$id} LIMIT 1;");
325 325
   }
326 326
   elseif ($type == 'virtual') {
327
+    $result = mysql_fetch_assoc(db_query("SELECT id FROM system.servers WHERE hostname='".config('vmail_server')."'"));
328
+    $vmailserver = $result['id'];
327 329
     db_query("DELETE FROM mail.custom_mappings WHERE domain={$id} AND subdomain IS NULL LIMIT 1;");
328 330
     db_query("UPDATE kundendaten.domains SET mail='auto', lastchange=NOW() WHERE id={$id} LIMIT 1;");
329
-    db_query("INSERT INTO mail.virtual_mail_domains (domain) VALUES ({$id});");
331
+    db_query("INSERT INTO mail.virtual_mail_domains (domain, server) VALUES ({$id}, {$vmailserver});");
330 332
   }
331 333
   elseif ($type == 'auto') {
332 334
     db_query("DELETE FROM mail.virtual_mail_domains WHERE domain={$id} AND hostname IS NULL LIMIT 1;");
333 335