Allow domains/groups/adlists to be removed from the database

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-01-20 12:33:16 +01:00
parent b08954aec7
commit 7fa2dac90a
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -243,11 +243,10 @@ static int api_list_write(struct mg_connection *conn,
get_bool_var(payload, "enabled", &row.enabled);
char comment[256] = { 0 };
GET_VAR("comment", comment, payload);
if(GET_VAR("comment", comment, payload) > 0)
row.comment = comment;
else
row.description = NULL;
row.comment = NULL;
char description[256] = { 0 };
if(GET_VAR("description", description, payload) > 0)
+3 -3
View File
@@ -1531,7 +1531,7 @@ bool gravityDB_addToTable(const enum gravity_list_type listtype, const tablerow
bool okay = false;
if((rc = sqlite3_step(stmt)) == SQLITE_DONE)
{
// Domain added
// Domain added/modified
okay = true;
}
else
@@ -1604,7 +1604,7 @@ bool gravityDB_delFromTable(const enum gravity_list_type listtype, const char* a
}
// Bind domain to prepared statement (if requested)
int idx = sqlite3_bind_parameter_index(stmt, "argument");
int idx = sqlite3_bind_parameter_index(stmt, ":argument");
if(idx > 0 && (rc = sqlite3_bind_text(stmt, idx, argument, -1, SQLITE_STATIC)) != SQLITE_OK)
{
*message = sqlite3_errmsg(gravity_db);
@@ -1616,7 +1616,7 @@ bool gravityDB_delFromTable(const enum gravity_list_type listtype, const char* a
}
// Bind type to prepared statement (if requested)
idx = sqlite3_bind_parameter_index(stmt, "type");
idx = sqlite3_bind_parameter_index(stmt, ":type");
if(idx > 0 && (rc = sqlite3_bind_int(stmt, idx, type)) != SQLITE_OK)
{
*message = sqlite3_errmsg(gravity_db);