isite 2022.9.17 → 2022.9.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/client-side/app.js +2 -3
- package/apps/client-side/site_files/css/bootstrap5-addon.css +2 -2
- package/apps/client-side/site_files/css/effect.css +6 -0
- package/apps/client-side/site_files/css/layout.css +39 -17
- package/apps/client-side/site_files/css/modal.css +12 -1
- package/apps/client-side/site_files/html/directive/i-checkbox.html +1 -1
- package/apps/client-side/site_files/js/app.js +3 -0
- package/apps/client-side/site_files/js/bootstrap-5-directive.js +1 -5
- package/apps/client-side/site_files/js/directive.js +1 -1
- package/apps/client-side/site_files/js/last.js +8 -3
- package/apps/client-side/site_files/js/site.js +34 -2
- package/index.js +1 -16
- package/isite_files/html/browser.html +1 -1
- package/lib/collection.js +810 -809
- package/lib/mongodb.js +8 -9
- package/lib/parser.js +27 -13
- package/lib/routing.js +11 -7
- package/lib/security.js +4 -10
- package/lib/session.js +149 -136
- package/lib/sessions.js +84 -26
- package/lib/storage.js +97 -104
- package/lib/ws.js +225 -221
- package/object-options/index.js +2 -2
- package/object-options/lib/fn.js +5 -2
- package/package.json +2 -2
- package/server.md +21 -0
- package/lib/setting.js +0 -59
package/lib/mongodb.js
CHANGED
|
@@ -51,14 +51,14 @@ module.exports = function init(____0) {
|
|
|
51
51
|
}, 1000);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
_mongo.handleDoc = function (doc) {
|
|
54
|
+
_mongo.handleDoc = function (doc, isProperty = false) {
|
|
55
55
|
if (!doc) {
|
|
56
56
|
return doc;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
if (
|
|
59
|
+
if (Array.isArray(doc)) {
|
|
60
60
|
doc.forEach((v, i) => {
|
|
61
|
-
doc[i] = _mongo.handleDoc(v);
|
|
61
|
+
doc[i] = _mongo.handleDoc(v, true);
|
|
62
62
|
});
|
|
63
63
|
return doc;
|
|
64
64
|
} else if (typeof doc === 'object') {
|
|
@@ -67,17 +67,17 @@ module.exports = function init(____0) {
|
|
|
67
67
|
delete doc[key];
|
|
68
68
|
} else if (typeof doc[key] === 'string' && ____0.fn.isDate(doc[key])) {
|
|
69
69
|
doc[key] = new Date(doc[key]);
|
|
70
|
-
} else if (
|
|
71
|
-
doc[key] = _mongo.handleDoc(doc[key]);
|
|
72
|
-
} else if (typeof doc[key] === 'array') {
|
|
70
|
+
} else if (Array.isArray(doc[key])) {
|
|
73
71
|
doc[key].forEach((v, i) => {
|
|
74
|
-
doc[key][i] = _mongo.handleDoc(v);
|
|
72
|
+
doc[key][i] = _mongo.handleDoc(v, true);
|
|
75
73
|
});
|
|
74
|
+
} else if (typeof doc[key] === 'object') {
|
|
75
|
+
doc[key] = _mongo.handleDoc(doc[key], true);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
return doc;
|
|
80
|
+
return isProperty ? doc : { ...doc };
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
_mongo.connectDBBusy = !1;
|
|
@@ -476,7 +476,6 @@ module.exports = function init(____0) {
|
|
|
476
476
|
if (obj.rename) {
|
|
477
477
|
$update.$rename = obj.rename;
|
|
478
478
|
}
|
|
479
|
-
|
|
480
479
|
_mongo.findOne(
|
|
481
480
|
{
|
|
482
481
|
dbName: obj.dbName,
|
package/lib/parser.js
CHANGED
|
@@ -32,9 +32,17 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function renderData(d) {
|
|
35
|
-
|
|
35
|
+
if (!d) {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
let hide = false;
|
|
39
|
+
let out = '';
|
|
40
|
+
if (d.indexOf('#') == 0) {
|
|
41
|
+
d = d.replace('#', '');
|
|
42
|
+
hide = true;
|
|
43
|
+
}
|
|
36
44
|
|
|
37
|
-
if (d
|
|
45
|
+
if (d == '*') {
|
|
38
46
|
out = JSON.stringify(req.data);
|
|
39
47
|
} else if (d) {
|
|
40
48
|
v = d.split('.');
|
|
@@ -63,9 +71,15 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
63
71
|
out = out[v[5]];
|
|
64
72
|
}
|
|
65
73
|
}
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
|
|
75
|
+
if (hide) {
|
|
76
|
+
out = ____0.hide(out);
|
|
77
|
+
} else {
|
|
78
|
+
if (typeof out === 'object') {
|
|
79
|
+
out = ____0.toJson(out);
|
|
80
|
+
}
|
|
68
81
|
}
|
|
82
|
+
|
|
69
83
|
return out || renderWord(d);
|
|
70
84
|
}
|
|
71
85
|
|
|
@@ -180,6 +194,13 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
180
194
|
return out;
|
|
181
195
|
}
|
|
182
196
|
|
|
197
|
+
function renderSetting(v) {
|
|
198
|
+
if (v && v == '*') {
|
|
199
|
+
return JSON.stringify(____0.setting);
|
|
200
|
+
} else {
|
|
201
|
+
return render_site('setting.' + v);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
183
204
|
function render_req(v) {
|
|
184
205
|
if (!v) {
|
|
185
206
|
return '';
|
|
@@ -240,7 +261,7 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
240
261
|
ip: req.session.ip,
|
|
241
262
|
requestesCount: req.session.requestesCount,
|
|
242
263
|
busy: req.session.$busy,
|
|
243
|
-
|
|
264
|
+
ipLookup: req.session.ip_list.find((info) => info.ip == req.session.ip),
|
|
244
265
|
});
|
|
245
266
|
}
|
|
246
267
|
if (v == 'lang') {
|
|
@@ -276,13 +297,6 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
276
297
|
}
|
|
277
298
|
}
|
|
278
299
|
|
|
279
|
-
function renderSetting(v) {
|
|
280
|
-
if (v && v == '*') {
|
|
281
|
-
return JSON.stringify(____0.setting.list);
|
|
282
|
-
}
|
|
283
|
-
return ____0.setting.get(v).value;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
300
|
function getContent(name) {
|
|
287
301
|
let path = null;
|
|
288
302
|
|
|
@@ -350,7 +364,7 @@ module.exports = function init(req, res, ____0, route) {
|
|
|
350
364
|
|
|
351
365
|
function renderHtml($, log) {
|
|
352
366
|
$('[x-setting]').each(function (i, elem) {
|
|
353
|
-
if (
|
|
367
|
+
if (____0.setting[$(this).attr('x-setting')] !== true) {
|
|
354
368
|
$(this).remove();
|
|
355
369
|
}
|
|
356
370
|
});
|
package/lib/routing.js
CHANGED
|
@@ -595,7 +595,6 @@ module.exports = function init(____0) {
|
|
|
595
595
|
}
|
|
596
596
|
});
|
|
597
597
|
if (!ok) {
|
|
598
|
-
|
|
599
598
|
if (route.name.contains(____0.strings[16])) {
|
|
600
599
|
res.status(401);
|
|
601
600
|
return res.json({
|
|
@@ -935,6 +934,11 @@ module.exports = function init(____0) {
|
|
|
935
934
|
if (____0.options.cache.enabled && req.route.cache) {
|
|
936
935
|
res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
|
|
937
936
|
}
|
|
937
|
+
} else if (name.endsWith('.webp')) {
|
|
938
|
+
res.set(____0.strings[7], 'image/webp');
|
|
939
|
+
if (____0.options.cache.enabled && req.route.cache) {
|
|
940
|
+
res.set('Cache-Control', 'public, max-age=' + 60 * ____0.options.cache.images);
|
|
941
|
+
}
|
|
938
942
|
}
|
|
939
943
|
res.end(req.content, ____0.getFileEncode(name));
|
|
940
944
|
});
|
|
@@ -1196,6 +1200,11 @@ module.exports = function init(____0) {
|
|
|
1196
1200
|
_0xrrxo.start = function (_ports, callback) {
|
|
1197
1201
|
____0.startTime = Date.now();
|
|
1198
1202
|
|
|
1203
|
+
____0.https.globalAgent.options = {
|
|
1204
|
+
key: ____0.fs.readFileSync( ____0.options.https.key || __dirname + '/../ssl/key.pem'),
|
|
1205
|
+
cert: ____0.fs.readFileSync(____0.options.https.cert || __dirname + '/../ssl/cert.pem'),
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1199
1208
|
const ports = [];
|
|
1200
1209
|
|
|
1201
1210
|
if (_ports && ____0.typeof(_ports) !== 'Array') {
|
|
@@ -1230,14 +1239,9 @@ module.exports = function init(____0) {
|
|
|
1230
1239
|
});
|
|
1231
1240
|
|
|
1232
1241
|
if (____0.options.https.enabled) {
|
|
1233
|
-
const https_options = {
|
|
1234
|
-
key: ____0.fs.readFileSync(____0.options.https.key || __dirname + '/../ssl/key.pem'),
|
|
1235
|
-
cert: ____0.fs.readFileSync(____0.options.https.cert || __dirname + '/../ssl/cert.pem'),
|
|
1236
|
-
};
|
|
1237
|
-
|
|
1238
1242
|
____0.options.https.ports.forEach((p, i) => {
|
|
1239
1243
|
let index = ____0.servers.length;
|
|
1240
|
-
____0.servers[index] = ____0.https.createServer(
|
|
1244
|
+
____0.servers[index] = ____0.https.createServer(_0xrrxo.handleServer);
|
|
1241
1245
|
____0.servers[index].listen(p, function () {
|
|
1242
1246
|
____0.log('');
|
|
1243
1247
|
____0.log('-----------------------------------------');
|
package/lib/security.js
CHANGED
|
@@ -743,7 +743,6 @@ module.exports = function init(____0) {
|
|
|
743
743
|
});
|
|
744
744
|
return;
|
|
745
745
|
}
|
|
746
|
-
|
|
747
746
|
____0.$users.update(
|
|
748
747
|
{
|
|
749
748
|
where: where,
|
|
@@ -753,16 +752,11 @@ module.exports = function init(____0) {
|
|
|
753
752
|
},
|
|
754
753
|
function (err, result) {
|
|
755
754
|
callback(err, result);
|
|
756
|
-
if (result.doc) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
element = Object.assign(element, security.handleUser(result.doc));
|
|
761
|
-
security.users[i] = element;
|
|
762
|
-
}
|
|
755
|
+
if (!err && result && result.doc) {
|
|
756
|
+
let index = security.users.findIndex((u) => u.id == result.doc.id);
|
|
757
|
+
if (index >= 0) {
|
|
758
|
+
security.users[index] = { ...security.users[index], ...result.doc };
|
|
763
759
|
}
|
|
764
|
-
____0.call('user update', result);
|
|
765
|
-
____0.call('[session][user][update]', result.doc);
|
|
766
760
|
}
|
|
767
761
|
}
|
|
768
762
|
);
|
package/lib/session.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
module.exports = function init(req, res, ____0, callback) {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
____0.getSession({ accessToken: req.cookie('access_token') || req.headers['Access-Token'] || req.headers['access-token'] }, (session) => {
|
|
4
3
|
if (!session.accessToken) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
session.accessToken = new Date().getTime().toString() + '_' + Math.random() * (10000 - 1000) + 1000;
|
|
5
|
+
session.accessToken = ____0.x0md50x(session.accessToken);
|
|
6
|
+
res.cookie('access_token', session.accessToken);
|
|
7
|
+
res.set('Access-Token', session.accessToken);
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
session.ip = req.ip;
|
|
@@ -13,155 +12,169 @@ module.exports = function init(req, res, ____0, callback) {
|
|
|
13
12
|
____0.saveSession(session);
|
|
14
13
|
|
|
15
14
|
function AssignFeatures() {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
____0.options.defaults.features.forEach((f) => {
|
|
16
|
+
req.features.push(f);
|
|
17
|
+
});
|
|
18
|
+
____0.features.forEach((f) => {
|
|
19
|
+
req.features.push(f.name);
|
|
20
|
+
});
|
|
21
|
+
if (____0.options.dynamic) {
|
|
22
|
+
req.features.push('site.dynamic');
|
|
23
|
+
}
|
|
24
|
+
req.features.push('ip.' + req.ip);
|
|
25
|
+
|
|
26
|
+
if (req.headers['host']) {
|
|
27
|
+
req.features.push('host.' + req.headers['host']);
|
|
28
|
+
req.headers['host'].split('.').forEach((h) => {
|
|
29
|
+
req.features.push('host.' + h);
|
|
21
30
|
});
|
|
22
|
-
|
|
23
|
-
req.features.push('site.dynamic');
|
|
24
|
-
}
|
|
25
|
-
req.features.push('ip.' + req.ip);
|
|
31
|
+
}
|
|
26
32
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
if (req.cookies.obj && req.cookies.obj['_ga'] && req.cookies.obj['_ga'].contains('sb')) {
|
|
34
|
+
req.features.push('browser.social');
|
|
35
|
+
req.features.push('browser.social.app');
|
|
36
|
+
}
|
|
37
|
+
if (req.cookies.obj && req.cookies.obj['_gab'] && req.cookies.obj['_gab'].contains('sb')) {
|
|
38
|
+
req.features.push('browser.social');
|
|
39
|
+
req.features.push('browser.social.app');
|
|
40
|
+
}
|
|
41
|
+
if (req.headers['x-browser'] && req.headers['x-browser'].contains('social-browser')) {
|
|
42
|
+
req.features.push('browser.social');
|
|
43
|
+
req.features.push('browser.social.app');
|
|
44
|
+
}
|
|
33
45
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
if (req.headers['user-agent']) {
|
|
47
|
+
req.userAgent = req.headers['user-agent'].toLowerCase();
|
|
48
|
+
req.features.push('user-agent.' + req.userAgent);
|
|
49
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(req.userAgent)) {
|
|
50
|
+
req.features.push('os.mobile');
|
|
51
|
+
} else {
|
|
52
|
+
req.features.push('os.desktop');
|
|
41
53
|
}
|
|
42
|
-
if (req.headers['x-browser'] && req.headers['x-browser'].contains('social-browser')) {
|
|
43
|
-
req.features.push('browser.social');
|
|
44
|
-
req.features.push('browser.social.app');
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (req.headers['user-agent']) {
|
|
48
|
-
req.userAgent = req.headers['user-agent'].toLowerCase();
|
|
49
|
-
req.features.push('user-agent.' + req.userAgent);
|
|
50
|
-
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(req.userAgent)) {
|
|
51
|
-
req.features.push('os.mobile');
|
|
52
|
-
} else {
|
|
53
|
-
req.features.push('os.desktop');
|
|
54
|
-
}
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
55
|
+
if (req.userAgent.contains('windows')) {
|
|
56
|
+
req.features.push('os.windows');
|
|
57
|
+
if (req.userAgent.contains('windows nt 5.1')) {
|
|
58
|
+
req.features.push('os.windowsxp');
|
|
59
|
+
} else if (req.userAgent.contains('windows nt 6.1')) {
|
|
60
|
+
req.features.push('os.windows7');
|
|
61
|
+
} else if (req.userAgent.contains('windows nt 6.2') || req.userAgent.contains('windows nt 6.3')) {
|
|
62
|
+
req.features.push('os.windows8');
|
|
63
|
+
} else if (req.userAgent.contains('windows nt 6.4') || req.userAgent.contains('windows nt 10')) {
|
|
64
|
+
req.features.push('os.windows10');
|
|
65
|
+
} else {
|
|
66
|
+
}
|
|
67
|
+
} else if (req.userAgent.contains('linux')) {
|
|
68
|
+
req.features.push('os.linux');
|
|
69
|
+
} else if (req.userAgent.contains('macintosh')) {
|
|
70
|
+
req.features.push('os.mac');
|
|
71
|
+
} else if (req.userAgent.contains('android')) {
|
|
72
|
+
req.features.push('os.android');
|
|
73
|
+
} else {
|
|
74
|
+
req.features.push('os.unknown');
|
|
75
|
+
}
|
|
77
76
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
77
|
+
if (req.userAgent.contains('edge')) {
|
|
78
|
+
req.features.push('browser.edge');
|
|
79
|
+
} else if (req.userAgent.contains('firefox')) {
|
|
80
|
+
req.features.push('browser.firefox');
|
|
81
|
+
} else if (req.userAgent.contains('opr')) {
|
|
82
|
+
req.features.push('browser.opera');
|
|
83
|
+
} else if (req.userAgent.contains('ucbrowser')) {
|
|
84
|
+
req.features.push('browser.ucbrowser');
|
|
85
|
+
} else if (req.userAgent.contains('bdbrowser') || req.userAgent.contains('baidu') || req.userAgent.contains('baidubrowser')) {
|
|
86
|
+
req.features.push('browser.baidu');
|
|
87
|
+
} else if (req.userAgent.contains('chromium')) {
|
|
88
|
+
req.features.push('browser.chromium');
|
|
89
|
+
} else if (req.userAgent.contains('chrome')) {
|
|
90
|
+
req.features.push('browser.chrome');
|
|
91
|
+
} else {
|
|
92
|
+
req.features.push('browser.unknown');
|
|
95
93
|
}
|
|
94
|
+
}
|
|
96
95
|
}
|
|
97
96
|
|
|
98
97
|
function ipInfo(session, callback) {
|
|
99
|
-
|
|
98
|
+
callback(session);
|
|
100
99
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
if (!____0.options.ipLookup) {
|
|
101
|
+
return session;
|
|
102
|
+
}
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
if (session.ip == '127.0.0.1' || session.ip == 'localhost') {
|
|
105
|
+
return session;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (session.$busy) {
|
|
109
|
+
return session;
|
|
110
|
+
}
|
|
108
111
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
____0.saveSession(session);
|
|
134
|
-
}, 1000 * 30);
|
|
135
|
-
})
|
|
136
|
-
.catch((err) => {
|
|
137
|
-
setTimeout(() => {
|
|
138
|
-
session = ____0.getSession(session);
|
|
139
|
-
session.$busy = !1;
|
|
140
|
-
____0.saveSession(session);
|
|
141
|
-
}, 1000 * 30);
|
|
112
|
+
session.$busy = !0;
|
|
113
|
+
____0.saveSession(session);
|
|
114
|
+
if (session.ip_list.length === 0 || !session.ip_list.some((info) => info.ip === session.ip)) {
|
|
115
|
+
____0
|
|
116
|
+
.fetch(`http://ip-api.com/json/${session.ip}`, {
|
|
117
|
+
method: 'get',
|
|
118
|
+
headers: { 'Content-Type': 'application/json' },
|
|
119
|
+
})
|
|
120
|
+
.then((res) => {
|
|
121
|
+
if (res.status == 200) {
|
|
122
|
+
return res.json();
|
|
123
|
+
} else {
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
.then((info) => {
|
|
127
|
+
____0.getSession(session, (session) => {
|
|
128
|
+
info.date = new Date();
|
|
129
|
+
info.ip = session.ip;
|
|
130
|
+
session.ip_list.unshift(info);
|
|
131
|
+
____0.saveSession(session);
|
|
132
|
+
setTimeout(() => {
|
|
133
|
+
____0.getSession(session, (session) => {
|
|
134
|
+
session.$busy = !1;
|
|
135
|
+
____0.saveSession(session);
|
|
142
136
|
});
|
|
143
|
-
|
|
137
|
+
}, 1000 * 30);
|
|
138
|
+
});
|
|
139
|
+
})
|
|
140
|
+
.catch((err) => {
|
|
141
|
+
setTimeout(() => {
|
|
142
|
+
____0.getSession(session, (session) => {
|
|
143
|
+
session.$busy = !1;
|
|
144
|
+
____0.saveSession(session);
|
|
145
|
+
});
|
|
146
|
+
}, 1000 * 30);
|
|
147
|
+
});
|
|
148
|
+
} else {
|
|
149
|
+
____0.getSession(session, (session) => {
|
|
150
|
+
session.$busy = !1;
|
|
151
|
+
____0.saveSession(session);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
144
154
|
}
|
|
145
155
|
|
|
146
156
|
AssignFeatures();
|
|
147
157
|
|
|
148
158
|
if (____0.security && session.user_id) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
____0.security.getUser(
|
|
160
|
+
{
|
|
161
|
+
id: session.user_id,
|
|
162
|
+
},
|
|
163
|
+
function (err, user) {
|
|
164
|
+
if (!err && user) {
|
|
165
|
+
session.user = user;
|
|
166
|
+
if (session.user) {
|
|
167
|
+
if (!session.user.permissions) {
|
|
168
|
+
session.user.permissions = [];
|
|
169
|
+
}
|
|
170
|
+
req.features.push('login');
|
|
171
|
+
}
|
|
172
|
+
ipInfo(session, callback);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
);
|
|
164
176
|
} else {
|
|
165
|
-
|
|
177
|
+
ipInfo(session, callback);
|
|
166
178
|
}
|
|
179
|
+
});
|
|
167
180
|
};
|