Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / components / license / service.js
index acd7e3b..c6cf19b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc8=['user','isUserLimit','crypto','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','parse','hasOwnProperty','use','License','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin'];(function(_0x485b5d,_0x5692b6){var _0xa90291=function(_0x57ea35){while(--_0x57ea35){_0x485b5d['push'](_0x485b5d['shift']());}};_0xa90291(++_0x5692b6);}(_0x5fc8,0x16e));var _0x85fc=function(_0xe9ff32,_0x29317b){_0xe9ff32=_0xe9ff32-0x0;var _0x533663=_0x5fc8[_0xe9ff32];return _0x533663;};'use strict';var crypto=require(_0x85fc('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x85fc('0x1'))['db'];var config=require(_0x85fc('0x2'));function getValueFromLicense(_0x39d537,_0x387168){if(_0x39d537&&_0x387168){if(_0x387168[_0x85fc('0x3')]&&_0x387168[_0x85fc('0x4')]){var _0x2a8005=_0x387168[_0x85fc('0x3')];var _0x1d4a38=_0x387168['license'];var _0x4592d3=_0x2a8005[_0x85fc('0x5')]('-')[0x4];var _0x1204c9=_0x2a8005[_0x85fc('0x5')]('-')[0x0];var _0x5a7e68=crypto[_0x85fc('0x6')](_0x85fc('0x7'),util[_0x85fc('0x8')](_0x85fc('0x9'),_0x4592d3,_0x2a8005,_0x1204c9));var _0x324fe8=_0x5a7e68[_0x85fc('0xa')](_0x1d4a38,_0x85fc('0xb'),'utf8');_0x324fe8+=_0x5a7e68['final']('utf8');var _0x27c614=JSON[_0x85fc('0xc')](_0x324fe8);return _0x27c614[_0x85fc('0xd')](_0x39d537)?_0x27c614[_0x39d537]:null;}}return null;}function isLimit(_0x3f6e35,_0x5112ab,_0x1ed96e,_0x312205){var _0x46cf02=_0x5112ab;return compose()[_0x85fc('0xe')](function(_0x16ff87,_0x5c9932,_0x31cbfa){return db[_0x85fc('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x85fc('0x10')](function(_0x4ec5bd){var _0x5cddfe=getValueFromLicense(_0x3f6e35,_0x4ec5bd);return _0x5cddfe?_0x5cddfe:_0x46cf02;})[_0x85fc('0x10')](function(_0x322d15){_0x46cf02=_0x322d15;return _0x1ed96e[_0x85fc('0x11')](_0x312205);})[_0x85fc('0x10')](function(_0x183cd6){if(_0x183cd6>=_0x46cf02){return _0x5c9932[_0x85fc('0x12')](0x193)['json']({'message':util[_0x85fc('0x8')](_0x85fc('0x13'),_0x3f6e35)});}_0x31cbfa();})[_0x85fc('0x14')](function(_0x4e1c4a){_0x31cbfa(_0x4e1c4a);});});}function isUserLimit(){return isLimit(_0x85fc('0x15'),0x1,db[_0x85fc('0x16')],{'where':{'$or':[{'role':_0x85fc('0x17')},{'role':_0x85fc('0x18')}]}});}exports[_0x85fc('0x19')]=isUserLimit;
\ No newline at end of file
+var _0x23c4=['base64','final','utf8','parse','use','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','composable-middleware','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update'];(function(_0x249a3e,_0x36a93a){var _0x4f771c=function(_0x5be32c){while(--_0x5be32c){_0x249a3e['push'](_0x249a3e['shift']());}};_0x4f771c(++_0x36a93a);}(_0x23c4,0x163));var _0x423c=function(_0x8b247d,_0x9401a9){_0x8b247d=_0x8b247d-0x0;var _0x4e10a3=_0x23c4[_0x8b247d];return _0x4e10a3;};'use strict';var crypto=require(_0x423c('0x0'));var util=require('util');var compose=require(_0x423c('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x441399,_0x529192){if(_0x441399&&_0x529192){if(_0x529192[_0x423c('0x2')]&&_0x529192[_0x423c('0x3')]){var _0x22c636=_0x529192[_0x423c('0x2')];var _0xe93090=_0x529192[_0x423c('0x3')];var _0x22fe6a=_0x22c636[_0x423c('0x4')]('-')[0x4];var _0x605578=_0x22c636['split']('-')[0x0];var _0x2e0ecc=crypto[_0x423c('0x5')](_0x423c('0x6'),util['format'](_0x423c('0x7'),_0x22fe6a,_0x22c636,_0x605578));var _0x5e2da7=_0x2e0ecc[_0x423c('0x8')](_0xe93090,_0x423c('0x9'),'utf8');_0x5e2da7+=_0x2e0ecc[_0x423c('0xa')](_0x423c('0xb'));var _0x65b789=JSON[_0x423c('0xc')](_0x5e2da7);return _0x65b789['hasOwnProperty'](_0x441399)?_0x65b789[_0x441399]:null;}}return null;}function isLimit(_0x275115,_0x115969,_0x422e48,_0x458a2d){var _0xd4807f=_0x115969;return compose()[_0x423c('0xd')](function(_0x158cd1,_0x29679a,_0x420f88){return db['License'][_0x423c('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x423c('0xf')](function(_0x2e8098){var _0x3ebe80=getValueFromLicense(_0x275115,_0x2e8098);return _0x3ebe80?_0x3ebe80:_0xd4807f;})[_0x423c('0xf')](function(_0x2640e7){_0xd4807f=_0x2640e7;return _0x422e48[_0x423c('0x10')](_0x458a2d);})[_0x423c('0xf')](function(_0x289ba9){if(_0x289ba9>=_0xd4807f){return _0x29679a[_0x423c('0x11')](0x193)[_0x423c('0x12')]({'message':util[_0x423c('0x13')](_0x423c('0x14'),_0x275115)});}_0x420f88();})[_0x423c('0x15')](function(_0x1c571e){_0x420f88(_0x1c571e);});});}function isUserLimit(){return isLimit(_0x423c('0x16'),0x1,db[_0x423c('0x17')],{'where':{'$or':[{'role':_0x423c('0x18')},{'role':_0x423c('0x19')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file