update So 7. Jun 20:31:01 CEST 2020

This commit is contained in:
Robert Richter 2020-06-07 20:31:01 +02:00
parent 9ea7e220ee
commit d4fb233a4c
4 changed files with 27 additions and 25 deletions

View File

@ -251,7 +251,7 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp,
if (valid) {
var waip_uuid = req.body.waip_uuid;
var rmld_uuid = req.body.rmld_uuid;
waip.rmld_speichern(req.body, null, function (result) {
waip.rmld_speichern(req.body, null, 'web', function (result) {
if (result) {
req.flash('successMessage', 'Rückmeldung erfolgreich gesendet, auf zum Einsatz!');
res.redirect('/rmld/' + waip_uuid + '/' + rmld_uuid);

View File

@ -863,7 +863,8 @@ module.exports = function (fs, bcrypt, app_cfg) {
// Benutzer-Tabelle mit Standard-Admin befuellen
bcrypt.hash(app_cfg.global.defaultpass, app_cfg.global.saltRounds, function (err, hash) {
db.run(`INSERT INTO waip_users ( user, password, permissions, ip_address ) VALUES( ?, ?, 'admin', ? )`,
app_cfg.global.defaultuser, hash, app_cfg.global.defaultuserip, function (err) {
app_cfg.global.defaultuser, hash, app_cfg.global.defaultuserip,
function (err) {
if (err) {
console.error(err.message);
};

View File

@ -6,7 +6,6 @@ module.exports = function (db, uuidv4, app_cfg) {
// SQL-Abfragen
function db_einsatz_speichern(content, callback) {
// FIXME Einsatz nur speichern, wenn wachen fuer diesen hinterleget
content = JSON.parse(content);
// uuid erzeugen und zuweisen falls nicht vorhanden
if (!content.einsatzdaten.uuid) {

View File

@ -24,7 +24,8 @@ module.exports = function (io, sql, brk, async, app_cfg, api, proof) {
};
});
} else {
sql.db_log('Fehler-WAIP', 'Fehler: Keine Wache für den Einsatz mit der ID ' + waip_id + ' vorhanden!');
sql.db_log('Fehler-WAIP', 'Fehler: Keine Wache für den Einsatz mit der ID ' + waip_id + ' vorhanden! Einsatz wird gelöscht!');
sql.db_einsatz_loeschen(waip_id);
};
});
// pruefen ob für die beteiligten Wachen eine Verteiler-Liste hinterlegt ist, falls ja, Rueckmeldungs-Link senden
@ -88,8 +89,7 @@ module.exports = function (io, sql, brk, async, app_cfg, api, proof) {
};
function rmld_speichern(rueckmeldung, host, callback) {
// TODO an api senden
function rmld_speichern(rueckmeldung, host, app_id, callback) {
if (!host == null) {
host = ' von ' + host;
};
@ -103,6 +103,8 @@ module.exports = function (io, sql, brk, async, app_cfg, api, proof) {
callback && callback(result);
};
});
api.server_to_client_new_rmld(rueckmeldung, app_id);
api.client_to_server_new_rmld(rueckmeldung, app_id);
};
function rmld_verteilen_by_uuid(waip_uuid, rmld_uuid) {