232 local function list_append(username, host, datastore, data) |
232 local function list_append(username, host, datastore, data) |
233 if not data then return; end |
233 if not data then return; end |
234 if callback(username, host, datastore) == false then return true; end |
234 if callback(username, host, datastore) == false then return true; end |
235 -- save the datastore |
235 -- save the datastore |
236 |
236 |
237 local data = "item(" .. serialize(data) .. ");\n"; |
237 data = "item(" .. serialize(data) .. ");\n"; |
238 local ok, msg = append(username, host, datastore, "list", data); |
238 local ok, msg = append(username, host, datastore, "list", data); |
239 if not ok then |
239 if not ok then |
240 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); |
240 log("error", "Unable to write to %s storage ('%s') for user: %s@%s", datastore, msg, username or "nil", host or "nil"); |
241 return ok, msg; |
241 return ok, msg; |
242 end |
242 end |