update So 7. Jun 19:01:01 CEST 2020
This commit is contained in:
parent
98c68cb660
commit
1bd357bcd6
@ -38,13 +38,14 @@ app.use(bodyParser.urlencoded({
|
|||||||
// Scripte einbinden
|
// Scripte einbinden
|
||||||
var sql_cfg = require('./server/sql_cfg')(fs, bcrypt, app_cfg);
|
var sql_cfg = require('./server/sql_cfg')(fs, bcrypt, app_cfg);
|
||||||
var sql = require('./server/sql_qry')(sql_cfg, uuidv4, app_cfg);
|
var sql = require('./server/sql_qry')(sql_cfg, uuidv4, app_cfg);
|
||||||
var api = require('./server/sql_qry')(sql_cfg, uuidv4, app_cfg);
|
var api = require('./server/api')(sql_cfg, uuidv4, app_cfg);
|
||||||
var brk = require('./server/broker')(app_cfg, sql, uuidv4);
|
var brk = require('./server/broker')(app_cfg, sql, uuidv4);
|
||||||
var waip = require('./server/waip')(io, sql, brk, async, app_cfg, api);
|
var proof = require('./server/proof')(app_cfg, sql);
|
||||||
|
var waip = require('./server/waip')(io, sql, brk, async, app_cfg, api, proof);
|
||||||
var socket = require('./server/socket')(io, sql, app_cfg, waip);
|
var socket = require('./server/socket')(io, sql, app_cfg, waip);
|
||||||
var udp = require('./server/udp')(app_cfg, waip, sql);
|
var udp = require('./server/udp')(app_cfg, waip, sql);
|
||||||
var auth = require('./server/auth')(app, app_cfg, sql_cfg, async, bcrypt, passport, io);
|
var auth = require('./server/auth')(app, app_cfg, sql_cfg, async, bcrypt, passport, io);
|
||||||
var routes = require('./server/routing')(app, sql, uuidv4, app_cfg, passport, auth, waip, udp);
|
var routes = require('./server/routing')(app, sql, uuidv4, app_cfg, passport, auth, waip, udp, proof);
|
||||||
|
|
||||||
// Server starten
|
// Server starten
|
||||||
webserver.listen(app_cfg.global.https_port, function() {
|
webserver.listen(app_cfg.global.https_port, function() {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ module.exports = function (io, sql, app_cfg, waip) {
|
|||||||
// versuche Remote-IP zu ermitteln
|
// versuche Remote-IP zu ermitteln
|
||||||
var remote_ip = socket.handshake.headers["x-real-ip"] || socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress;
|
var remote_ip = socket.handshake.headers["x-real-ip"] || socket.handshake.headers['x-forwarded-for'] || socket.request.connection.remoteAddress;
|
||||||
|
|
||||||
//TODO Verschlüsselung: pruefen ob Verbindung mit passendem Geheimnis und aus IP-Bereich, das Ergebnis loggen
|
//TODO API: Eingehende Verbindung nur mit passendem Geheimnis und aus passendem IP-Bereich zulassen, das Ergebnis loggen
|
||||||
|
|
||||||
// in Liste der Clients mit aufnehmen
|
// in Liste der Clients mit aufnehmen
|
||||||
sql.db_client_update_status(socket, 'api');
|
sql.db_client_update_status(socket, 'api');
|
||||||
@ -93,7 +93,7 @@ module.exports = function (io, sql, app_cfg, waip) {
|
|||||||
|
|
||||||
if (app_cfg.endpoint.enabled) {
|
if (app_cfg.endpoint.enabled) {
|
||||||
// Verbindung zu anderem Server aufbauen
|
// Verbindung zu anderem Server aufbauen
|
||||||
// TODO Verschlüsselung: Verbindungsaufbau mit passendem Geheimnis absichern
|
// TODO API: Verbindungsaufbau mit passendem Geheimnis absichern, IP-Adresse senden
|
||||||
var remote_api = io_api.connect(app_cfg.endpoint.host, {
|
var remote_api = io_api.connect(app_cfg.endpoint.host, {
|
||||||
reconnect: true
|
reconnect: true
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,13 +5,13 @@ app_cfg.global = {
|
|||||||
development: true,
|
development: true,
|
||||||
http_port: 3000,
|
http_port: 3000,
|
||||||
https_port: 3443,
|
https_port: 3443,
|
||||||
udpport: 60233,
|
udpport: 60233,
|
||||||
database: './database.sqlite3',
|
database: './database.sqlite3',
|
||||||
soundpath: '/public/media/',
|
soundpath: '/public/media/',
|
||||||
mediapath: '/media/',
|
mediapath: '/media/',
|
||||||
time_to_delete_waip: 60,
|
time_to_delete_waip: 60,
|
||||||
default_time_for_standby: 10,
|
default_time_for_standby: 10,
|
||||||
circumcircle: 5,
|
circumcircle: 5,
|
||||||
defaultuser: 'me',
|
defaultuser: 'me',
|
||||||
defaultpass: '123',
|
defaultpass: '123',
|
||||||
defaultuserip: '127.0.0.1',
|
defaultuserip: '127.0.0.1',
|
||||||
@ -52,4 +52,4 @@ app_cfg.endpoint = {
|
|||||||
send_data_type: ['uuid', 'nummer', 'alarmzeit', 'art', 'stichwort', 'sondersignal', 'ort', 'ortsteil', 'wgs84_area']
|
send_data_type: ['uuid', 'nummer', 'alarmzeit', 'art', 'stichwort', 'sondersignal', 'ort', 'ortsteil', 'wgs84_area']
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = app_cfg;
|
module.exports = app_cfg;
|
||||||
22
server/proof.js
Executable file
22
server/proof.js
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
module.exports = function (app_cfg, sql) {
|
||||||
|
|
||||||
|
// Module laden
|
||||||
|
const test = 'test';
|
||||||
|
|
||||||
|
function validate_waip(data, callback) {
|
||||||
|
// TODO Validierung: Einsatzdaten auf Validität prüfen
|
||||||
|
callback && callback(true);
|
||||||
|
// SQL-Log
|
||||||
|
};
|
||||||
|
|
||||||
|
function validate_rmld(data, callback) {
|
||||||
|
// TODO Validierung: Rueckmeldung auf plausibilität
|
||||||
|
callback && callback(true);
|
||||||
|
// SQL-Log
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
validate_waip: validate_waip,
|
||||||
|
validate_rmld: validate_rmld
|
||||||
|
};
|
||||||
|
};
|
||||||
@ -1,4 +1,4 @@
|
|||||||
module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp) {
|
module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp, proof) {
|
||||||
|
|
||||||
/* ########################### */
|
/* ########################### */
|
||||||
/* ##### Statische Seiten #### */
|
/* ##### Statische Seiten #### */
|
||||||
@ -54,8 +54,8 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp)
|
|||||||
err.status = 403;
|
err.status = 403;
|
||||||
next(err);
|
next(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ##################### */
|
/* ##################### */
|
||||||
/* ####### Login ####### */
|
/* ####### Login ####### */
|
||||||
@ -247,16 +247,19 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp)
|
|||||||
|
|
||||||
// Rueckmeldung entgegennehmen
|
// Rueckmeldung entgegennehmen
|
||||||
app.post('/rmld/:waip_uuid/:rmld_uuid', function (req, res) {
|
app.post('/rmld/:waip_uuid/:rmld_uuid', function (req, res) {
|
||||||
// TODO Validierung: Rueckmeldung auf Validiteat pruefen
|
proof.validate_rmld(req.body, function (valid) {
|
||||||
var waip_uuid = req.body.waip_uuid;
|
if (valid) {
|
||||||
var rmld_uuid = req.body.rmld_uuid;
|
var waip_uuid = req.body.waip_uuid;
|
||||||
waip.rmld_speichern(req.body, null, function (result) {
|
var rmld_uuid = req.body.rmld_uuid;
|
||||||
if (result) {
|
waip.rmld_speichern(req.body, null, function (result) {
|
||||||
req.flash('successMessage', 'Rückmeldung erfolgreich gesendet, auf zum Einsatz!');
|
if (result) {
|
||||||
res.redirect('/rmld/' + waip_uuid + '/' + rmld_uuid);
|
req.flash('successMessage', 'Rückmeldung erfolgreich gesendet, auf zum Einsatz!');
|
||||||
} else {
|
res.redirect('/rmld/' + waip_uuid + '/' + rmld_uuid);
|
||||||
req.flash('errorMessage', 'Fehler beim Senden der Rückmeldung!');
|
} else {
|
||||||
res.redirect('/rmld/' + waip_uuid + '/' + rmld_uuid);
|
req.flash('errorMessage', 'Fehler beim Senden der Rückmeldung!');
|
||||||
|
res.redirect('/rmld/' + waip_uuid + '/' + rmld_uuid);
|
||||||
|
};
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -83,11 +83,11 @@ module.exports = function (fs, bcrypt, app_cfg) {
|
|||||||
user_agent TEXT,
|
user_agent TEXT,
|
||||||
reset_timestamp DATETIME)`);
|
reset_timestamp DATETIME)`);
|
||||||
// Rueckmelde-Tabelle erstellen
|
// Rueckmelde-Tabelle erstellen
|
||||||
// TODO: ALIAS-Spalte hinterlegen, abfragen nochmals prüfen ob mit übermittelt, ggf. mit Konfig
|
|
||||||
db.run(`CREATE TABLE waip_response (
|
db.run(`CREATE TABLE waip_response (
|
||||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
|
||||||
waip_uuid TEXT,
|
waip_uuid TEXT,
|
||||||
rmld_uuid TEXT,
|
rmld_uuid TEXT,
|
||||||
|
alias TEXT,
|
||||||
einsatzkraft INTEGER,
|
einsatzkraft INTEGER,
|
||||||
maschinist INTEGER,
|
maschinist INTEGER,
|
||||||
fuehrungskraft INTEGER,
|
fuehrungskraft INTEGER,
|
||||||
@ -129,6 +129,7 @@ module.exports = function (fs, bcrypt, app_cfg) {
|
|||||||
waip_wachen_id INTEGER,
|
waip_wachen_id INTEGER,
|
||||||
tw_account_id INTEGER,
|
tw_account_id INTEGER,
|
||||||
tw_account_list TEXT,
|
tw_account_list TEXT,
|
||||||
|
bkp_recipient TEXT,
|
||||||
FOREIGN KEY(waip_wachen_id) REFERENCES waip_wachen(id),
|
FOREIGN KEY(waip_wachen_id) REFERENCES waip_wachen(id),
|
||||||
FOREIGN KEY(tw_account_id) REFERENCES waip_twitter_accounts(id))`);
|
FOREIGN KEY(tw_account_id) REFERENCES waip_twitter_accounts(id))`);
|
||||||
// Log erstellen
|
// Log erstellen
|
||||||
|
|||||||
@ -751,7 +751,7 @@ module.exports = function (db, uuidv4, app_cfg) {
|
|||||||
|
|
||||||
function db_vmtl_get_list(waip_id, callback) {
|
function db_vmtl_get_list(waip_id, callback) {
|
||||||
// Pruefen ob fuer eine Wache im Einsatz ein Verteilerliste hinterlegt ist
|
// Pruefen ob fuer eine Wache im Einsatz ein Verteilerliste hinterlegt ist
|
||||||
db.get(`select t.waip_wachen_id, t.tw_account_id, t.tw_account_list from waip_vmlt_tw_wachen t
|
db.get(`select t.waip_wachen_id, t.tw_account_id, t.tw_account_list from waip_vmtl_tw_wachen t
|
||||||
where waip_wachen_id = (select distinct w.id wachen_id from waip_wachen w left join waip_einsatzmittel em on em.wachenname = w.name_wache
|
where waip_wachen_id = (select distinct w.id wachen_id from waip_wachen w left join waip_einsatzmittel em on em.wachenname = w.name_wache
|
||||||
where em.waip_einsaetze_ID = ?)`, [waip_id], function (err, twitter_liste) {
|
where em.waip_einsaetze_ID = ?)`, [waip_id], function (err, twitter_liste) {
|
||||||
if (err == null && twitter_liste) {
|
if (err == null && twitter_liste) {
|
||||||
|
|||||||
112
server/waip.js
112
server/waip.js
@ -1,48 +1,52 @@
|
|||||||
module.exports = function (io, sql, brk, async, app_cfg, api) {
|
module.exports = function (io, sql, brk, async, app_cfg, api, proof) {
|
||||||
|
|
||||||
// Einsatzmeldung in Datenbank speichern
|
// Einsatzmeldung in Datenbank speichern
|
||||||
function einsatz_speichern(einsatz_rohdaten, app_id) {
|
function einsatz_speichern(einsatz_rohdaten, app_id) {
|
||||||
// TODO Validierung: Einsatzdaten auf Validität prüfen
|
proof.validate_waip(einsatz_rohdaten, function (valid) {
|
||||||
// Einsatzmeldung (JSON) speichern
|
if (valid) {
|
||||||
sql.db_einsatz_speichern(einsatz_rohdaten, function (waip_id) {
|
|
||||||
sql.db_log('WAIP', 'DEBUG: Neuer Einsatz mit der ID ' + waip_id);
|
// Einsatzmeldung (JSON) speichern
|
||||||
// nach dem Speichern anhand der waip_id die beteiligten Wachennummern zum Einsatz ermitteln
|
sql.db_einsatz_speichern(einsatz_rohdaten, function (waip_id) {
|
||||||
// FIXME: Einsatz nur verteilen, falls dieser nicht bereits so angezeigt wurde (Doppelalarmierung vermeiden)
|
sql.db_log('WAIP', 'DEBUG: Neuer Einsatz mit der ID ' + waip_id);
|
||||||
sql.db_einsatz_get_rooms(waip_id, function (socket_rooms) {
|
// nach dem Speichern anhand der waip_id die beteiligten Wachennummern zum Einsatz ermitteln
|
||||||
if (socket_rooms) {
|
// FIXME: Einsatz nur verteilen, falls dieser nicht bereits so angezeigt wurde (Doppelalarmierung vermeiden)
|
||||||
socket_rooms.forEach(function (rooms) {
|
sql.db_einsatz_get_rooms(waip_id, function (socket_rooms) {
|
||||||
// fuer jede Wache(rooms.room) die verbundenen Sockets(Clients) ermitteln und den Einsatz verteilen
|
if (socket_rooms) {
|
||||||
var room_sockets = io.nsps['/waip'].adapter.rooms[rooms.room];
|
socket_rooms.forEach(function (rooms) {
|
||||||
if (typeof room_sockets !== 'undefined'){
|
// fuer jede Wache(rooms.room) die verbundenen Sockets(Clients) ermitteln und den Einsatz verteilen
|
||||||
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
var room_sockets = io.nsps['/waip'].adapter.rooms[rooms.room];
|
||||||
var socket = io.of('/waip').connected[socket_id];
|
if (typeof room_sockets !== 'undefined') {
|
||||||
waip_verteilen(waip_id, socket, rooms.room);
|
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
||||||
sql.db_log('WAIP', 'Einsatz ' + waip_id + ' wird an ' + socket.id + ' (' + rooms.room + ') gesendet');
|
var socket = io.of('/waip').connected[socket_id];
|
||||||
|
waip_verteilen(waip_id, socket, rooms.room);
|
||||||
|
sql.db_log('WAIP', 'Einsatz ' + waip_id + ' wird an ' + socket.id + ' (' + rooms.room + ') gesendet');
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
};
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
sql.db_log('Fehler-WAIP', 'Fehler: Keine Wache für den Einsatz mit der ID ' + waip_id + ' vorhanden!');
|
|
||||||
};
|
|
||||||
});
|
|
||||||
// pruefen ob für die beteiligten Wachen eine Verteiler-Liste hinterlegt ist, falls ja, Rueckmeldungs-Link senden
|
|
||||||
sql.db_vmtl_get_list(waip_id, function (vmtl_data) {
|
|
||||||
if (vmtl_data) {
|
|
||||||
brk.alert_vmtl_list(vmtl_data, function (result) {
|
|
||||||
if (!result) {
|
|
||||||
sql.db_log('VMTL', 'Link zur Einsatz-Rückmeldung erfolgreichen an Vermittler-Liste gesendet. ' + result);
|
|
||||||
} else {
|
} else {
|
||||||
sql.db_log('VMTL', 'Fehler beim senden des Links zur Einsatz-Rueckmeldung an die Vermittler-Liste: ' + result);
|
sql.db_log('Fehler-WAIP', 'Fehler: Keine Wache für den Einsatz mit der ID ' + waip_id + ' vorhanden!');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
} else {
|
// pruefen ob für die beteiligten Wachen eine Verteiler-Liste hinterlegt ist, falls ja, Rueckmeldungs-Link senden
|
||||||
sql.db_log('VMTL', 'Keine Vermittler-Liste für Wachen im Einsatz ' + waip_id + ' hinterlegt. Rückmeldung wird nicht verteilt.');
|
sql.db_vmtl_get_list(waip_id, function (vmtl_data) {
|
||||||
};
|
if (vmtl_data) {
|
||||||
});
|
brk.alert_vmtl_list(vmtl_data, function (result) {
|
||||||
|
if (!result) {
|
||||||
|
sql.db_log('VMTL', 'Link zur Einsatz-Rückmeldung erfolgreichen an Vermittler-Liste gesendet. ' + result);
|
||||||
|
} else {
|
||||||
|
sql.db_log('VMTL', 'Fehler beim senden des Links zur Einsatz-Rueckmeldung an die Vermittler-Liste: ' + result);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sql.db_log('VMTL', 'Keine Vermittler-Liste für Wachen im Einsatz ' + waip_id + ' hinterlegt. Rückmeldung wird nicht verteilt.');
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Einsatzdaten per API weiterleiten (entweder zum Server oder zum verbunden Client)
|
||||||
|
api.server_to_client_new_waip(einsatz_rohdaten, app_id);
|
||||||
|
api.client_to_server_new_waip(einsatz_rohdaten, app_id);
|
||||||
|
};
|
||||||
});
|
});
|
||||||
// Einsatzdaten per API weiterleiten (entweder zum Server oder zum verbunden Client)
|
|
||||||
api.server_to_client_new_waip(einsatz_rohdaten, app_id);
|
|
||||||
api.client_to_server_new_waip(einsatz_rohdaten, app_id);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Einsatz an Client verteilen
|
// Einsatz an Client verteilen
|
||||||
@ -110,9 +114,9 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
socket_rooms.forEach(function (row) {
|
socket_rooms.forEach(function (row) {
|
||||||
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Standby senden
|
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Standby senden
|
||||||
var room_sockets = io.nsps['/waip'].adapter.rooms[row.room];
|
var room_sockets = io.nsps['/waip'].adapter.rooms[row.room];
|
||||||
if (typeof room_sockets !== 'undefined') {
|
if (typeof room_sockets !== 'undefined') {
|
||||||
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
||||||
// wenn Raum zum Einsatz aufgerufen ist, dann Rueckmeldung aus DB laden und an diesen versenden
|
// wenn Raum zum Einsatz aufgerufen ist, dann Rueckmeldung aus DB laden und an diesen versenden
|
||||||
sql.db_rmld_get_by_rmlduuid(rmld_uuid, function (rmld_obj) {
|
sql.db_rmld_get_by_rmlduuid(rmld_uuid, function (rmld_obj) {
|
||||||
if (rmld_obj) {
|
if (rmld_obj) {
|
||||||
// Rückmeldung an Clients/Räume senden, wenn richtiger Einsatz angezeigt wird
|
// Rückmeldung an Clients/Räume senden, wenn richtiger Einsatz angezeigt wird
|
||||||
@ -133,24 +137,24 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
});*/
|
});*/
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -259,7 +263,7 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
};
|
};
|
||||||
if (app_cfg.global.development) {
|
if (app_cfg.global.development) {
|
||||||
console.log(commands);
|
console.log(commands);
|
||||||
};
|
};
|
||||||
var childD = proc.spawn('/bin/sh', commands);
|
var childD = proc.spawn('/bin/sh', commands);
|
||||||
childD.stdin.setEncoding('ascii');
|
childD.stdin.setEncoding('ascii');
|
||||||
childD.stderr.setEncoding('ascii');
|
childD.stderr.setEncoding('ascii');
|
||||||
@ -305,10 +309,10 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
data.forEach(function (row) {
|
data.forEach(function (row) {
|
||||||
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Standby senden
|
// fuer jede Wache(row.room) die verbundenen Sockets(Clients) ermitteln und Standby senden
|
||||||
var room_sockets = io.nsps['/waip'].adapter.rooms[row.room];
|
var room_sockets = io.nsps['/waip'].adapter.rooms[row.room];
|
||||||
if (typeof room_sockets !== 'undefined') {
|
if (typeof room_sockets !== 'undefined') {
|
||||||
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
Object.keys(room_sockets.sockets).forEach(function (socket_id) {
|
||||||
// Standby senden
|
// Standby senden
|
||||||
var socket = io.of('/waip').connected[socket_id];
|
var socket = io.of('/waip').connected[socket_id];
|
||||||
sql.db_client_check_waip_id(socket.id, waip_id, function (same_id) {
|
sql.db_client_check_waip_id(socket.id, waip_id, function (same_id) {
|
||||||
if (same_id) {
|
if (same_id) {
|
||||||
socket.emit('io.standby', null);
|
socket.emit('io.standby', null);
|
||||||
@ -320,7 +324,7 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// TODO: an Dashboard senden, das der Einsatz gelöscht wurde
|
// TODO: an Dashboard senden, das der Einsatz gelöscht wurde
|
||||||
// FIXME: Rueckmeldung löschen, und vorher backup
|
// FIXME: Rueckmeldung löschen, und vorher backup
|
||||||
@ -348,9 +352,9 @@ module.exports = function (io, sql, brk, async, app_cfg, api) {
|
|||||||
|
|
||||||
function dbrd_verteilen(dbrd_uuid, socket) {
|
function dbrd_verteilen(dbrd_uuid, socket) {
|
||||||
console.log(JSON.stringify(dbrd_uuid));
|
console.log(JSON.stringify(dbrd_uuid));
|
||||||
sql.db_einsatz_get_by_uuid(dbrd_uuid, function(einsatzdaten) {
|
sql.db_einsatz_get_by_uuid(dbrd_uuid, function (einsatzdaten) {
|
||||||
if (einsatzdaten) {
|
if (einsatzdaten) {
|
||||||
sql.db_user_check_permission(socket.request.user, einsatzdaten.id, function(valid) {
|
sql.db_user_check_permission(socket.request.user, einsatzdaten.id, function (valid) {
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
delete einsatzdaten.objekt;
|
delete einsatzdaten.objekt;
|
||||||
delete einsatzdaten.besonderheiten;
|
delete einsatzdaten.besonderheiten;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user