Explorar el Código

fixed empty host

develop
Robin Thoni hace 10 años
padre
commit
e7c82b333b
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      src/DBO/Actions/ActionAddHost.cpp

+ 2
- 1
src/DBO/Actions/ActionAddHost.cpp Ver fichero

27
 
27
 
28
 const std::string ActionAddHost::getSql() const
28
 const std::string ActionAddHost::getSql() const
29
 {
29
 {
30
+    auto host = _host.empty() ? _domain : _host + "." + _domain;
30
     auto query = "INSERT INTO records (domain_id, name, type, content, ttl, prio, change_date)\n"
31
     auto query = "INSERT INTO records (domain_id, name, type, content, ttl, prio, change_date)\n"
31
-            "    VALUES(@domain_id, \"" + _host + "." + _domain + "\", \"" + _recordType + "\","
32
+            "    VALUES(@domain_id, \"" + host + "\", \"" + _recordType + "\","
32
             " \"" + _recordValue + "\", 84600, 0, " + std::to_string(time(nullptr)) + ");\n";
33
             " \"" + _recordValue + "\", 84600, 0, " + std::to_string(time(nullptr)) + ");\n";
33
 
34
 
34
     if (_reverseEnabled && _recordType == "A")
35
     if (_reverseEnabled && _recordType == "A")

Loading…
Cancelar
Guardar