Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / components / license / service.js
index 350fe94..d5baae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2514=['users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch'];(function(_0x136b8a,_0x45268e){var _0x52b0de=function(_0x4dc88e){while(--_0x4dc88e){_0x136b8a['push'](_0x136b8a['shift']());}};_0x52b0de(++_0x45268e);}(_0x2514,0xe4));var _0x4251=function(_0x42ff3d,_0x8b096f){_0x42ff3d=_0x42ff3d-0x0;var _0x4ff2c0=_0x2514[_0x42ff3d];return _0x4ff2c0;};'use strict';var crypto=require(_0x4251('0x0'));var util=require(_0x4251('0x1'));var compose=require(_0x4251('0x2'));var db=require(_0x4251('0x3'))['db'];var config=require(_0x4251('0x4'));function getValueFromLicense(_0x58f1fb,_0x260b52){if(_0x58f1fb&&_0x260b52){if(_0x260b52[_0x4251('0x5')]&&_0x260b52[_0x4251('0x6')]){var _0x4f4879=_0x260b52[_0x4251('0x5')];var _0x3a6090=_0x260b52[_0x4251('0x6')];var _0x13905f=_0x4f4879['split']('-')[0x4];var _0x3eb282=_0x4f4879[_0x4251('0x7')]('-')[0x0];var _0x1b594b=crypto[_0x4251('0x8')](_0x4251('0x9'),util[_0x4251('0xa')](_0x4251('0xb'),_0x13905f,_0x4f4879,_0x3eb282));var _0x2198f5=_0x1b594b['update'](_0x3a6090,'base64',_0x4251('0xc'));_0x2198f5+=_0x1b594b[_0x4251('0xd')](_0x4251('0xc'));var _0x417608=JSON[_0x4251('0xe')](_0x2198f5);return _0x417608[_0x4251('0xf')](_0x58f1fb)?_0x417608[_0x58f1fb]:null;}}return null;}function isLimit(_0x3723e4,_0x37f456,_0x28151a,_0x417349){var _0x2c896e=_0x37f456;return compose()[_0x4251('0x10')](function(_0x3a3ee8,_0x428afc,_0x2ffe1d){return db[_0x4251('0x11')][_0x4251('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x40b4e1){var _0x12e721=getValueFromLicense(_0x3723e4,_0x40b4e1);return _0x12e721?_0x12e721:_0x2c896e;})[_0x4251('0x13')](function(_0x4ac664){_0x2c896e=_0x4ac664;return _0x28151a[_0x4251('0x14')](_0x417349);})[_0x4251('0x13')](function(_0x4b1fbd){if(_0x4b1fbd>=_0x2c896e){return _0x428afc[_0x4251('0x15')](0x193)['json']({'message':util[_0x4251('0xa')](_0x4251('0x16'),_0x3723e4)});}_0x2ffe1d();})[_0x4251('0x17')](function(_0x52300c){_0x2ffe1d(_0x52300c);});});}function isUserLimit(){return isLimit(_0x4251('0x18'),0x1,db[_0x4251('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0x4251('0x1a')}]}});}exports[_0x4251('0x1b')]=isUserLimit;
\ No newline at end of file
+var _0x4a27=['utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update'];(function(_0x3e317b,_0x4d74ec){var _0x20fd5a=function(_0x473f3a){while(--_0x473f3a){_0x3e317b['push'](_0x3e317b['shift']());}};_0x20fd5a(++_0x4d74ec);}(_0x4a27,0x1a9));var _0x74a2=function(_0x18b931,_0x2cad1d){_0x18b931=_0x18b931-0x0;var _0x114958=_0x4a27[_0x18b931];return _0x114958;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x74a2('0x0'));var db=require(_0x74a2('0x1'))['db'];var config=require(_0x74a2('0x2'));function getValueFromLicense(_0x7df1bf,_0x45056c){if(_0x7df1bf&&_0x45056c){if(_0x45056c[_0x74a2('0x3')]&&_0x45056c[_0x74a2('0x4')]){var _0xf562e6=_0x45056c[_0x74a2('0x3')];var _0x295bea=_0x45056c[_0x74a2('0x4')];var _0x296bc2=_0xf562e6[_0x74a2('0x5')]('-')[0x4];var _0x355241=_0xf562e6[_0x74a2('0x5')]('-')[0x0];var _0x1c11e5=crypto[_0x74a2('0x6')](_0x74a2('0x7'),util['format'](_0x74a2('0x8'),_0x296bc2,_0xf562e6,_0x355241));var _0x4313d1=_0x1c11e5[_0x74a2('0x9')](_0x295bea,'base64',_0x74a2('0xa'));_0x4313d1+=_0x1c11e5[_0x74a2('0xb')](_0x74a2('0xa'));var _0x46629b=JSON[_0x74a2('0xc')](_0x4313d1);return _0x46629b[_0x74a2('0xd')](_0x7df1bf)?_0x46629b[_0x7df1bf]:null;}}return null;}function isLimit(_0x606108,_0x27f8dc,_0x13a167,_0x2bbcf8){var _0x35254d=_0x27f8dc;return compose()[_0x74a2('0xe')](function(_0x2b7772,_0x4346f6,_0x23d5b3){return db[_0x74a2('0xf')][_0x74a2('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x74a2('0x11')](function(_0x2c6cd2){var _0x5499ae=getValueFromLicense(_0x606108,_0x2c6cd2);return _0x5499ae?_0x5499ae:_0x35254d;})[_0x74a2('0x11')](function(_0x8054f4){_0x35254d=_0x8054f4;return _0x13a167[_0x74a2('0x12')](_0x2bbcf8);})['then'](function(_0x9853a4){if(_0x9853a4>=_0x35254d){return _0x4346f6[_0x74a2('0x13')](0x193)[_0x74a2('0x14')]({'message':util[_0x74a2('0x15')](_0x74a2('0x16'),_0x606108)});}_0x23d5b3();})[_0x74a2('0x17')](function(_0x2f029e){_0x23d5b3(_0x2f029e);});});}function isUserLimit(){return isLimit(_0x74a2('0x18'),0x1,db[_0x74a2('0x19')],{'where':{'$or':[{'role':_0x74a2('0x1a')},{'role':_0x74a2('0x1b')}]}});}exports[_0x74a2('0x1c')]=isUserLimit;
\ No newline at end of file