/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/user.js (1296B)
const microtime = require('../helpers/date'); class User { constructor(data) { // db fields this.id = 0; this.login = 0; this.name = 'новый пользователь'; this.pass = ''; this.key = null; this.reg_date = null; this.last_date = null; this.active = 0; this.email = ''; this.deleted = 0; this.rule = 0; // set order data from db if (data) { for (var i in this) { if (data[i]) { this[i] = data[i]; console.log('client add '+i+' = '+data[i]); } } } } is_activated(){ return this.active==1?true:false; } is_admin(){ return this.rule==1?true:false; } get_id() { return parseInt(this.id); } set_id(value) { if (this.id != value) { this.id = parseInt(value); } } get_key() { return this.key; } get_name() { return this.name; } set_name(val) { if (val) { this.name = val; } } get_value(key) { return this[key]; } set_value(key, val) { this[key] = val; } } module.exports = User;