isite 2022.9.22 → 2022.9.25

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.
Files changed (35) hide show
  1. package/apps/client-side/app.js +3 -22
  2. package/apps/client-side/site_files/css/bootstrap5-addon.css +2 -0
  3. package/apps/client-side/site_files/css/effect.css +19 -12
  4. package/apps/client-side/site_files/css/images.css +16 -12
  5. package/apps/client-side/site_files/css/layout.css +16 -9
  6. package/apps/client-side/site_files/css/table.css +2 -1
  7. package/apps/client-side/site_files/js/angular.js +23512 -22334
  8. package/apps/client-side/site_files/js/angular.min.js +352 -6
  9. package/apps/client-side/site_files/js/angular.min.js.map +8 -0
  10. package/apps/client-side/site_files/js/directive.js +2 -2
  11. package/apps/client-side/site_files/js/jquery.js +2 -4
  12. package/apps/client-side/site_files/js/site.js +1 -1
  13. package/apps/client-side/site_files/js/site.min.js +1 -1
  14. package/apps/security/site_files/html/add_modal.html +28 -37
  15. package/apps/security/site_files/html/delete_modal.html +25 -36
  16. package/apps/security/site_files/html/login_modal.html +2 -2
  17. package/apps/security/site_files/html/logout_modal.html +14 -14
  18. package/apps/security/site_files/html/register_modal.html +23 -23
  19. package/apps/security/site_files/html/update_modal.html +22 -36
  20. package/apps/security/site_files/html/view_modal.html +26 -37
  21. package/index.js +2 -2
  22. package/lib/collection.js +4 -4
  23. package/lib/collectionFile.js +5 -2
  24. package/lib/data.js +118 -0
  25. package/lib/mongodb.js +5 -49
  26. package/lib/parser.js +100 -2
  27. package/lib/routing.js +44 -6
  28. package/lib/security.js +39 -3
  29. package/lib/session.js +29 -4
  30. package/lib/sessions.js +1 -1
  31. package/object-options/index.js +10 -2
  32. package/object-options/lib/fn.js +46 -2
  33. package/object-options/lib/fsm.js +24 -31
  34. package/object-options/lib/safty.js +3 -0
  35. package/package.json +2 -2
package/lib/data.js ADDED
@@ -0,0 +1,118 @@
1
+ module.exports = function init(____0) {
2
+ ____0.mimeTypes = {
3
+ a: 'application/octet-stream',
4
+ ai: 'application/postscript',
5
+ aif: 'audio/x-aiff',
6
+ aifc: 'audio/x-aiff',
7
+ aiff: 'audio/x-aiff',
8
+ au: 'audio/basic',
9
+ avi: 'video/x-msvideo',
10
+ bat: 'text/plain',
11
+ bin: 'application/octet-stream',
12
+ bmp: 'image/x-ms-bmp',
13
+ c: 'text/plain',
14
+ cdf: 'application/x-cdf',
15
+ csh: 'application/x-csh',
16
+ css: 'text/css',
17
+ dll: 'application/octet-stream',
18
+ doc: 'application/msword',
19
+ dot: 'application/msword',
20
+ dvi: 'application/x-dvi',
21
+ eml: 'message/rfc822',
22
+ eps: 'application/postscript',
23
+ etx: 'text/x-setext',
24
+ exe: 'application/octet-stream',
25
+ gif: 'image/gif',
26
+ gtar: 'application/x-gtar',
27
+ h: 'text/plain',
28
+ hdf: 'application/x-hdf',
29
+ htm: 'text/html',
30
+ html: 'text/html',
31
+ jpe: 'image/jpeg',
32
+ jpeg: 'image/jpeg',
33
+ jpg: 'image/jpeg',
34
+ js: 'application/x-javascript',
35
+ ksh: 'text/plain',
36
+ latex: 'application/x-latex',
37
+ m1v: 'video/mpeg',
38
+ man: 'application/x-troff-man',
39
+ me: 'application/x-troff-me',
40
+ mht: 'message/rfc822',
41
+ mhtml: 'message/rfc822',
42
+ mif: 'application/x-mif',
43
+ mov: 'video/quicktime',
44
+ movie: 'video/x-sgi-movie',
45
+ mp2: 'audio/mpeg',
46
+ mp3: 'audio/mpeg',
47
+ mp4: 'video/mp4',
48
+ mpa: 'video/mpeg',
49
+ mpe: 'video/mpeg',
50
+ mpeg: 'video/mpeg',
51
+ mpg: 'video/mpeg',
52
+ ms: 'application/x-troff-ms',
53
+ nc: 'application/x-netcdf',
54
+ nws: 'message/rfc822',
55
+ o: 'application/octet-stream',
56
+ obj: 'application/octet-stream',
57
+ oda: 'application/oda',
58
+ pbm: 'image/x-portable-bitmap',
59
+ pdf: 'application/pdf',
60
+ pfx: 'application/x-pkcs12',
61
+ pgm: 'image/x-portable-graymap',
62
+ png: 'image/png',
63
+ pnm: 'image/x-portable-anymap',
64
+ pot: 'application/vnd.ms-powerpoint',
65
+ ppa: 'application/vnd.ms-powerpoint',
66
+ ppm: 'image/x-portable-pixmap',
67
+ pps: 'application/vnd.ms-powerpoint',
68
+ ppt: 'application/vnd.ms-powerpoint',
69
+ pptx: 'application/vnd.ms-powerpoint',
70
+ ps: 'application/postscript',
71
+ pwz: 'application/vnd.ms-powerpoint',
72
+ py: 'text/x-python',
73
+ pyc: 'application/x-python-code',
74
+ pyo: 'application/x-python-code',
75
+ qt: 'video/quicktime',
76
+ ra: 'audio/x-pn-realaudio',
77
+ ram: 'application/x-pn-realaudio',
78
+ ras: 'image/x-cmu-raster',
79
+ rdf: 'application/xml',
80
+ rgb: 'image/x-rgb',
81
+ roff: 'application/x-troff',
82
+ rtx: 'text/richtext',
83
+ sgm: 'text/x-sgml',
84
+ sgml: 'text/x-sgml',
85
+ sh: 'application/x-sh',
86
+ shar: 'application/x-shar',
87
+ snd: 'audio/basic',
88
+ so: 'application/octet-stream',
89
+ src: 'application/x-wais-source',
90
+ swf: 'application/x-shockwave-flash',
91
+ t: 'application/x-troff',
92
+ tar: 'application/x-tar',
93
+ tcl: 'application/x-tcl',
94
+ tex: 'application/x-tex',
95
+ texi: 'application/x-texinfo',
96
+ texinfo: 'application/x-texinfo',
97
+ tif: 'image/tiff',
98
+ tiff: 'image/tiff',
99
+ tr: 'application/x-troff',
100
+ tsv: 'text/tab-separated-values',
101
+ txt: 'text/plain',
102
+ ustar: 'application/x-ustar',
103
+ vcf: 'text/x-vcard',
104
+ wav: 'audio/x-wav',
105
+ wiz: 'application/msword',
106
+ wsdl: 'application/xml',
107
+ xbm: 'image/x-xbitmap',
108
+ xlb: 'application/vnd.ms-excel',
109
+ xls: 'application/vnd.ms-excel',
110
+ xlsx: 'application/vnd.ms-excel',
111
+ xml: 'text/xml',
112
+ xpdl: 'application/xml',
113
+ xpm: 'image/x-xpixmap',
114
+ xsl: 'application/xml',
115
+ xwd: 'image/x-xwindowdump',
116
+ zip: 'application/zip',
117
+ };
118
+ };
package/lib/mongodb.js CHANGED
@@ -249,12 +249,6 @@ module.exports = function init(____0) {
249
249
  obj.collectionName = ____0.options.mongodb.collection;
250
250
  }
251
251
 
252
- let $req = obj.doc.$req;
253
- let $res = obj.doc.$res;
254
-
255
- delete obj.doc.$req;
256
- delete obj.doc.$res;
257
-
258
252
  obj.doc = _mongo.handleDoc(obj.doc);
259
253
 
260
254
  db.collection(____0.options.mongodb.prefix.collection + obj.collectionName).insertOne(obj.doc, function (err, result) {
@@ -265,8 +259,6 @@ module.exports = function init(____0) {
265
259
  db: obj.dbName,
266
260
  collection: obj.collectionName,
267
261
  doc: result,
268
- $req: $req,
269
- $res: $res,
270
262
  });
271
263
  }
272
264
  } else {
@@ -452,12 +444,6 @@ module.exports = function init(____0) {
452
444
  obj.collectionName = ____0.options.mongodb.collection;
453
445
  }
454
446
 
455
- let $req = obj.$req;
456
- let $res = obj.$res;
457
-
458
- delete obj.$req;
459
- delete obj.$res;
460
-
461
447
  if (obj.where && obj.where._id && typeof obj.where._id === 'string') {
462
448
  obj.where._id = _mongo.ObjectID(obj.where._id);
463
449
  }
@@ -496,8 +482,6 @@ module.exports = function init(____0) {
496
482
  callback(
497
483
  null,
498
484
  {
499
- $req: $req,
500
- $res: $res,
501
485
  doc: doc2,
502
486
  old_doc: doc,
503
487
  where: obj.where,
@@ -515,9 +499,6 @@ module.exports = function init(____0) {
515
499
  old_doc: doc,
516
500
  where: obj.where,
517
501
  update: $update,
518
-
519
- $req: $req,
520
- $res: $res,
521
502
  });
522
503
  }
523
504
  }
@@ -544,12 +525,6 @@ module.exports = function init(____0) {
544
525
  obj.collectionName = ____0.options.mongodb.collection;
545
526
  }
546
527
 
547
- let $req = obj.$req;
548
- let $res = obj.$res;
549
-
550
- delete obj.$req;
551
- delete obj.$res;
552
-
553
528
  let $update = {};
554
529
  if (obj.set) {
555
530
  $update.$set = obj.set;
@@ -582,8 +557,6 @@ module.exports = function init(____0) {
582
557
  ok: result.result.ok,
583
558
  where: obj.where,
584
559
  update: $update,
585
- $req: req,
586
- $res: res,
587
560
  });
588
561
  }
589
562
  } else {
@@ -602,12 +575,7 @@ module.exports = function init(____0) {
602
575
  if (obj.collectionName === undefined) {
603
576
  obj.collectionName = ____0.options.mongodb.collection;
604
577
  }
605
-
606
- let $req = obj.where.$req;
607
- let $res = obj.where.$res;
608
-
609
- delete obj.where.$req;
610
- delete obj.where.$res;
578
+
611
579
 
612
580
  _mongo.findOne(
613
581
  {
@@ -623,8 +591,6 @@ module.exports = function init(____0) {
623
591
  callback(
624
592
  null,
625
593
  {
626
- $req: $req,
627
- $res: $res,
628
594
  db: obj.dbName,
629
595
  collection: obj.collectionName,
630
596
  count: result.deletedCount,
@@ -637,8 +603,6 @@ module.exports = function init(____0) {
637
603
  db: obj.dbName,
638
604
  collection: obj.collectionName,
639
605
  doc: doc,
640
- $req: $req,
641
- $res: $res,
642
606
  });
643
607
  }
644
608
  } else {
@@ -647,7 +611,7 @@ module.exports = function init(____0) {
647
611
  });
648
612
  } else {
649
613
  callback({
650
- message: 'Not Exists',
614
+ message: 'Not Exists : ' + JSON.stringify(obj.where),
651
615
  });
652
616
  }
653
617
  }
@@ -669,8 +633,7 @@ module.exports = function init(____0) {
669
633
  {
670
634
  db: obj.dbName,
671
635
  collection: obj.collectionName,
672
- $req: $req,
673
- $res: $res,
636
+
674
637
  count: 0,
675
638
  ok: 0,
676
639
  exists: 0,
@@ -679,11 +642,6 @@ module.exports = function init(____0) {
679
642
  );
680
643
  return;
681
644
  }
682
- let $req = obj.where.$req;
683
- let $res = obj.where.$res;
684
-
685
- delete obj.where.$req;
686
- delete obj.where.$res;
687
645
 
688
646
  _mongo.connectDB(obj.dbName, function (err, db) {
689
647
  if (!err) {
@@ -697,8 +655,7 @@ module.exports = function init(____0) {
697
655
  {
698
656
  db: obj.dbName,
699
657
  collection: obj.collectionName,
700
- $req: $req,
701
- $res: $res,
658
+
702
659
  count: result.deletedCount,
703
660
  },
704
661
  result
@@ -707,8 +664,7 @@ module.exports = function init(____0) {
707
664
  ____0.call('mongodb after delete many', {
708
665
  db: obj.dbName,
709
666
  collection: obj.collectionName,
710
- $req: $req,
711
- $res: $res,
667
+
712
668
  where: obj.where,
713
669
  count: result.deletedCount,
714
670
  });
package/lib/parser.js CHANGED
@@ -80,7 +80,7 @@ module.exports = function init(req, res, ____0, route) {
80
80
  }
81
81
  }
82
82
 
83
- return out || renderWord(d);
83
+ return out || '';
84
84
  }
85
85
 
86
86
  function renderUser(v) {
@@ -345,7 +345,7 @@ module.exports = function init(req, res, ____0, route) {
345
345
  return txt;
346
346
  } else if (name.endsWith('.html')) {
347
347
  let txt = ____0.readFileSync(path);
348
- let $ = ____0.$.load(txt);
348
+ let $ = ____0.$.load(txt, null, false);
349
349
  $ = renderHtml($);
350
350
  return $.html();
351
351
  } else if (name.endsWith('.js')) {
@@ -362,6 +362,100 @@ module.exports = function init(req, res, ____0, route) {
362
362
  }
363
363
  }
364
364
 
365
+ function handleXList1($, el, data) {
366
+ let property = $(el).attr('x-list1').split('.');
367
+ $(el).removeAttr('x-list1');
368
+ let list = null;
369
+ let html2 = '';
370
+ if (property.length > 0) {
371
+ if (property[0] == '*') {
372
+ list = data;
373
+ } else {
374
+ list = data[property[0]];
375
+ }
376
+ }
377
+ if (list && property.length > 1) {
378
+ list = list[property[1]];
379
+ }
380
+ if (Array.isArray(list)) {
381
+ let matches = $.html(el).match(/##item1.*?##/g);
382
+ list.forEach((item, i) => {
383
+ $(el).attr('x-item1', i);
384
+ let _html = $.html(el);
385
+ if (matches) {
386
+ for (let i = 0; i < matches.length; i++) {
387
+ let p = matches[i].replace('##item1.', '').replace('##', '').split('.');
388
+ let v = null;
389
+ if (p.length > 0) {
390
+ v = item[p[0]];
391
+ }
392
+ if (p.length > 1 && v) {
393
+ v = v[p[1]];
394
+ }
395
+ if (p.length > 2 && v) {
396
+ v = v[p[2]];
397
+ }
398
+
399
+ _html = _html.replace(matches[i], v || '');
400
+ }
401
+ }
402
+ let $2 = ____0.$.load(_html);
403
+ $2('[x-list2]').each(function (i2, elem2) {
404
+ $(handleXList2($2, elem2, item)).insertAfter($(this));
405
+ $(this).remove();
406
+ });
407
+ html2 += $2.html();
408
+ });
409
+ }
410
+ return html2;
411
+ }
412
+
413
+ function handleXList2($, el, data) {
414
+ let property = $(el).attr('x-list2').split('.');
415
+ $(el).removeAttr('x-list2');
416
+ let list = null;
417
+ let html2 = '';
418
+ if (property.length > 0) {
419
+ if (property[0] == '*') {
420
+ list = data;
421
+ } else {
422
+ list = data[property[0]];
423
+ }
424
+ }
425
+ if (list && property.length > 1) {
426
+ list = list[property[1]];
427
+ }
428
+ if (Array.isArray(list)) {
429
+ let matches = $.html(el).match(/##item2.*?##/g);
430
+ list.forEach((item, i) => {
431
+ $(el).attr('x-item2', i);
432
+ let _html = $.html(el);
433
+ if (matches) {
434
+ for (let i = 0; i < matches.length; i++) {
435
+ let p = matches[i].replace('##item2.', '').replace('##', '').split('.');
436
+ let v = null;
437
+ if (p.length > 0) {
438
+ if (p[0] == '*') {
439
+ v = item;
440
+ } else {
441
+ v = item[p[0]];
442
+ }
443
+ }
444
+ if (p.length > 1 && v) {
445
+ v = v[p[1]];
446
+ }
447
+ if (p.length > 2 && v) {
448
+ v = v[p[2]];
449
+ }
450
+ _html = _html.replace(matches[i], v || '');
451
+ }
452
+ }
453
+ html2 += _html;
454
+ });
455
+ }
456
+ return html2;
457
+ }
458
+
365
459
  function renderHtml($, log) {
366
460
  $('[x-setting]').each(function (i, elem) {
367
461
  if (____0.setting[$(this).attr('x-setting')] !== true) {
@@ -520,6 +614,10 @@ module.exports = function init(req, res, ____0, route) {
520
614
  }
521
615
  });
522
616
 
617
+ $('[x-list1]').each(function (i, elem) {
618
+ $(handleXList1($, elem, req.data)).insertAfter($(this));
619
+ $(this).remove();
620
+ });
523
621
  return $;
524
622
  }
525
623
 
package/lib/routing.js CHANGED
@@ -363,6 +363,7 @@ module.exports = function init(____0) {
363
363
  route.public = r.public ?? (____0.options.public || false);
364
364
  route.method = r.method || 'GET';
365
365
  route.path = r.path || null;
366
+ route.lang = r.lang || null;
366
367
  route.content = r.content;
367
368
  route.headers = r.headers;
368
369
  route.parser = r.parser || 'static';
@@ -557,6 +558,9 @@ module.exports = function init(____0) {
557
558
  };
558
559
 
559
560
  _0xrrxo.handleRoute = async function (req, res, route) {
561
+ if (route.lang) {
562
+ req.session.lang = route.lang;
563
+ }
560
564
  if (!route.public) {
561
565
  if (!route.name.like(____0.strings[15]) && route.require.features.length > 0) {
562
566
  let ok = !0;
@@ -626,6 +630,9 @@ module.exports = function init(____0) {
626
630
  };
627
631
 
628
632
  _0xrrxo.handleServer = async function (req, res) {
633
+ req.host = '';
634
+ req.domain = '';
635
+ req.subDomain = '';
629
636
  req.obj = {};
630
637
  req.query = {};
631
638
  req.queryRaw = {};
@@ -648,6 +655,28 @@ module.exports = function init(____0) {
648
655
  });
649
656
  };
650
657
 
658
+ req.getUserFinger = function () {
659
+ let userFinger = {
660
+ id: null,
661
+ email: null,
662
+ date: new Date(),
663
+ ip: null,
664
+ };
665
+
666
+ if (req && req.session && req.session.user) {
667
+ req.session.user.profile = req.session.user.profile || {};
668
+ userFinger.id = req.session.user.id;
669
+ userFinger.email = req.session.user.email;
670
+ userFinger.name = req.session.user.profile.name || userFinger.email;
671
+ userFinger.name_ar = req.session.user.profile.name_ar || userFinger.email;
672
+ userFinger.name_en = req.session.user.profile.name_en || userFinger.email;
673
+ userFinger.ip = req.ip;
674
+ } else {
675
+ }
676
+
677
+ return userFinger;
678
+ };
679
+
651
680
  res.code = null;
652
681
  req.socket.remoteAddress = req.socket.remoteAddress || '';
653
682
  req.acceptEncoding = req.headers[____0.strings[5]] ? req.headers[____0.strings[5]] : '';
@@ -705,7 +734,11 @@ module.exports = function init(____0) {
705
734
  arg1 &&
706
735
  res.headers &&
707
736
  res.headers[____0.strings[7]] &&
708
- (res.headers[____0.strings[7]].like('*text/css*') || res.headers[____0.strings[7]].like('*application/javascript*') || res.headers[____0.strings[7]].like('*text/html*') || res.headers[____0.strings[7]].like('*text/plain*') || res.headers[____0.strings[7]].like('*application/json*'))
737
+ (res.headers[____0.strings[7]].like('*text/css*') ||
738
+ res.headers[____0.strings[7]].like('*application/javascript*') ||
739
+ res.headers[____0.strings[7]].like('*text/html*') ||
740
+ res.headers[____0.strings[7]].like('*text/plain*') ||
741
+ res.headers[____0.strings[7]].like('*application/json*'))
709
742
  ) {
710
743
  if (req.acceptEncoding.match(/\bdeflate\b/) && typeof arg1 === 'string') {
711
744
  res.set(____0.strings[8], 'deflate');
@@ -838,7 +871,7 @@ module.exports = function init(____0) {
838
871
  req.content = ____0.parser(req, res, ____0, req.route).html(req.content);
839
872
  }
840
873
 
841
- res.status(200);
874
+ res.status(options.code || 200);
842
875
 
843
876
  if (req.route.compress) {
844
877
  req.content = req.content.replace(/\r?\n|\r/g, ' ').replace(/\s+/g, ' ');
@@ -973,7 +1006,7 @@ module.exports = function init(____0) {
973
1006
  req.data = { ...req.data, ..._data };
974
1007
  req.route.parser = 'js';
975
1008
  let out = ____0.parser(req, res, ____0, req.route).js(req.route.content);
976
- res.set(____0.strings[7], 'text/js');
1009
+ res.set(____0.strings[7], 'text/javascript');
977
1010
  res.status(200).end(out);
978
1011
  });
979
1012
  };
@@ -1013,9 +1046,9 @@ module.exports = function init(____0) {
1013
1046
  }
1014
1047
  };
1015
1048
 
1016
- res.redirect = (url) => {
1049
+ res.redirect = (url, code) => {
1017
1050
  res.set('Location', url);
1018
- res.status(302).end();
1051
+ res.status(code || 302).end();
1019
1052
  };
1020
1053
 
1021
1054
  res.setHeader('CharSet', 'UTF-8');
@@ -1027,6 +1060,11 @@ module.exports = function init(____0) {
1027
1060
  res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
1028
1061
  }
1029
1062
 
1063
+ if (____0.options.www === false && req.headers.host.contains('www')) {
1064
+ res.redirect('//' + req.headers.host.replace('www.', '') + req.url, 301);
1065
+ return;
1066
+ }
1067
+
1030
1068
  if (!req.urlParser.pathname.like(____0.strings[0])) {
1031
1069
  if (!____0._0_a405) {
1032
1070
  res.status(405);
@@ -1201,7 +1239,7 @@ module.exports = function init(____0) {
1201
1239
  ____0.startTime = Date.now();
1202
1240
 
1203
1241
  ____0.https.globalAgent.options = {
1204
- key: ____0.fs.readFileSync( ____0.options.https.key || __dirname + '/../ssl/key.pem'),
1242
+ key: ____0.fs.readFileSync(____0.options.https.key || __dirname + '/../ssl/key.pem'),
1205
1243
  cert: ____0.fs.readFileSync(____0.options.https.cert || __dirname + '/../ssl/cert.pem'),
1206
1244
  };
1207
1245
 
package/lib/security.js CHANGED
@@ -155,6 +155,8 @@ module.exports = function init(____0) {
155
155
  id: 1000000,
156
156
  name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
157
157
  name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
158
+ users_count : 100,
159
+ branch_count : 100
158
160
  },
159
161
  branch: {
160
162
  id: 1000000,
@@ -171,9 +173,43 @@ module.exports = function init(____0) {
171
173
  },
172
174
  });
173
175
  });
174
- ____0.options.security.users.forEach((user) => {
175
- user.key = user.key || ____0.options.security.key;
176
- security.users.push(____0.options.security.users[i]);
176
+ ____0.options.security.users.forEach((user, i) => {
177
+ if (!user.id) {
178
+ user.id = security.users.length + 1;
179
+ }
180
+ security.users.push({
181
+ is_admin: !0,
182
+ $psermissions: ['*'],
183
+ roles: ['*'],
184
+ permissions: [
185
+ {
186
+ name: '*',
187
+ },
188
+ ],
189
+ branch_list: [
190
+ {
191
+ company: {
192
+ id: 1000000,
193
+ name_ar: ____0._x0f1xo('3758577347381765211627694539135245595691'),
194
+ name_en: ____0._x0f1xo('3758577347381765211627694539135245595691'),
195
+ users_count : 100,
196
+ branch_count : 100
197
+ },
198
+ branch: {
199
+ id: 1000000,
200
+ name_ar: ____0._x0f1xo('3758577347381765211623734138825443129191'),
201
+ name_en: ____0._x0f1xo('3758577347381765211623734138825443129191'),
202
+ },
203
+ },
204
+ ],
205
+ profile: {
206
+ name: user.email,
207
+ },
208
+ ref_info: {
209
+ _id: '',
210
+ },
211
+ ...user,
212
+ });
177
213
  });
178
214
 
179
215
  security.addPermissions = function (list, callback) {
package/lib/session.js CHANGED
@@ -28,10 +28,35 @@ module.exports = function init(req, res, ____0, callback) {
28
28
  req.features.push('ip.' + req.ip);
29
29
 
30
30
  if (req.headers['host']) {
31
- req.features.push('host.' + req.headers['host']);
32
- req.headers['host'].split('.').forEach((h) => {
33
- req.features.push('host.' + h);
34
- });
31
+ req.host = req.headers['host'];
32
+ req.hostArray = req.host.split(':')[0].split('.').reverse();
33
+ if (req.hostArray[0] == 'localhost') {
34
+ req.domain = req.hostArray[0];
35
+ req.features.push('host.' + req.hostArray[0]);
36
+ if (req.hostArray[1]) {
37
+ req.subDomain = req.hostArray[1];
38
+ req.features.push('host.' + req.hostArray[1]);
39
+ }
40
+ } else {
41
+ if (req.hostArray.length == 2) {
42
+ req.domain = req.hostArray[1] + '.' + req.hostArray[0];
43
+ req.features.push('host.' + req.hostArray[0]);
44
+ req.features.push('host.' + req.hostArray[1]);
45
+ } else if (req.hostArray.length == 3) {
46
+ req.domain = req.hostArray[1] + '.' + req.hostArray[0];
47
+ req.subDomain = req.hostArray[2];
48
+ req.features.push('host.' + req.hostArray[0]);
49
+ req.features.push('host.' + req.hostArray[1]);
50
+ req.features.push('host.' + req.hostArray[2]);
51
+ } else if (req.hostArray.length == 4) {
52
+ req.domain = req.hostArray[1] + '.' + req.hostArray[0];
53
+ req.subDomain = req.hostArray[2];
54
+ req.features.push('host.' + req.hostArray[0]);
55
+ req.features.push('host.' + req.hostArray[1]);
56
+ req.features.push('host.' + req.hostArray[2]);
57
+ req.features.push('host.' + req.hostArray[3]);
58
+ }
59
+ }
35
60
  }
36
61
 
37
62
  if (req.cookies.obj && req.cookies.obj['_ga'] && req.cookies.obj['_ga'].contains('sb')) {
package/lib/sessions.js CHANGED
@@ -127,7 +127,7 @@ module.exports = function init(____0) {
127
127
  sessions.list.push(session);
128
128
  callback(sessions.list[session.$index]);
129
129
  }
130
- });
130
+ } , true);
131
131
  } else {
132
132
  session.$new = !0;
133
133
  session.lang = ____0.options.lang;
@@ -41,9 +41,13 @@ function setOptions(_options, ____0) {
41
41
  theme: 'default',
42
42
  help: !1,
43
43
  stdin: !0,
44
- _0xmmxo: '26351691',
45
- _0xyyxo: '2654127326519191',
44
+ _0xmmxo: '26719191',
45
+ _0xyyxo: '2654127326719191',
46
46
  ipLookup: false,
47
+ www: true,
48
+ subDomainIntegration: false,
49
+ domainIntegration: false,
50
+ portIntegration: false,
47
51
  https: {
48
52
  enabled: !1,
49
53
  port: null,
@@ -157,6 +161,10 @@ function setOptions(_options, ____0) {
157
161
  _x0oo.apps_dir = _x0oo.apps_dir || template.apps_dir;
158
162
  _x0oo._0x14xo = _x0oo._0x14xo ?? !1;
159
163
  _x0oo.ipLookup = _x0oo.ipLookup ?? !1;
164
+ _x0oo.subDomainIntegration = _x0oo.subDomainIntegration ?? !1;
165
+ _x0oo.domainIntegration = _x0oo.domainIntegration ?? !1;
166
+ _x0oo.portIntegration = _x0oo.portIntegration ?? !1;
167
+ _x0oo.www = _x0oo.www ?? template.www;
160
168
 
161
169
  _x0oo.https = _x0oo.https || template.https;
162
170
  _x0oo.https.enabled = _x0oo.https.enabled ?? template.https.enabled;