/var/www/myprog.com.ua/server/node/objects
NameSizeModeActions
camera.js11160644editdlrm
client.js27850644editdlrm
command.js11530666editdlrm
command_history.js10420666editdlrm
custom_error.js17720644editdlrm
device.js11230644editdlrm
event.js10990666editdlrm
event_history.js10430666editdlrm
host.js14920666editdlrm
host_config.js10280644editdlrm
place.js10760644editdlrm
places_cameras.js10180644editdlrm
places_devices.js10180644editdlrm
places_scenario.js10220644editdlrm
places_values.js10150644editdlrm
role.js16000644editdlrm
scenario.js11300644editdlrm
session.js16230644editdlrm
user.js12960644editdlrm
users_cameras.js10150644editdlrm
users_places.js10120644editdlrm
value.js11320666editdlrm
value_history.js10360666editdlrm
var.js10460644editdlrm
Edit: /var/www/myprog.com.ua/server/node/objects/session.js (1623B)
const User = require('../objects/user'); class Session { constructor(client_key, socket) { this.key = null; //client_key //this.operator = null; //this.driver = null; //this.user = null; this.user = null; this.socket = null; this.type = null; this.host = null; this.login = false; this.ver = null; if (client_key) { this.key = client_key; } if (socket) { this.socket = socket; } } set_user(user) { if (user) { console.debug('Session::set_user()::' + user.id); this.user = user; this.type = WHO.USER.VALUE; } } set_host(host) { if (host) { console.debug('Session::set_host()::' + host.id); this.host = host; this.type = WHO.HOST.VALUE; } } get_user() { return this.user; } is_host() { if (this.host!=null && this.host.id && this.host.id > 0) { return true; } else { return false; } } is_user() { if (this.user.id && this.user.id > 0) { return true; } else { return false; } } is_activated() { if (this.user) { return this.user.is_activated(); } else { return false; } } is_admin() { if (this.user) { return this.user.is_admin(); } else { return false; } } } module.exports = Session;