Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / components / license / service.js
index 350fe94..0ada25f 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 _0x5ca5=['util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','use','then','count','status','catch','User','admin','user','isUserLimit','crypto'];(function(_0x2267a2,_0x453e4b){var _0x1406a7=function(_0x5a0bb0){while(--_0x5a0bb0){_0x2267a2['push'](_0x2267a2['shift']());}};_0x1406a7(++_0x453e4b);}(_0x5ca5,0x1b9));var _0x55ca=function(_0x402511,_0x2f11ec){_0x402511=_0x402511-0x0;var _0x38e8ed=_0x5ca5[_0x402511];return _0x38e8ed;};'use strict';var crypto=require(_0x55ca('0x0'));var util=require(_0x55ca('0x1'));var compose=require(_0x55ca('0x2'));var db=require(_0x55ca('0x3'))['db'];var config=require(_0x55ca('0x4'));function getValueFromLicense(_0x4dfdd6,_0x5eb00e){if(_0x4dfdd6&&_0x5eb00e){if(_0x5eb00e[_0x55ca('0x5')]&&_0x5eb00e[_0x55ca('0x6')]){var _0x3da4dd=_0x5eb00e[_0x55ca('0x5')];var _0x19cff4=_0x5eb00e[_0x55ca('0x6')];var _0x2ef3f5=_0x3da4dd[_0x55ca('0x7')]('-')[0x4];var _0x332b21=_0x3da4dd['split']('-')[0x0];var _0x4b2c60=crypto['createDecipher'](_0x55ca('0x8'),util[_0x55ca('0x9')](_0x55ca('0xa'),_0x2ef3f5,_0x3da4dd,_0x332b21));var _0x536278=_0x4b2c60[_0x55ca('0xb')](_0x19cff4,_0x55ca('0xc'),'utf8');_0x536278+=_0x4b2c60[_0x55ca('0xd')](_0x55ca('0xe'));var _0xd0dcd2=JSON[_0x55ca('0xf')](_0x536278);return _0xd0dcd2[_0x55ca('0x10')](_0x4dfdd6)?_0xd0dcd2[_0x4dfdd6]:null;}}return null;}function isLimit(_0x5204aa,_0x2a7f1b,_0x1b3302,_0x3e7dba){var _0x14d7d8=_0x2a7f1b;return compose()[_0x55ca('0x11')](function(_0x59e0d9,_0xab115b,_0x57880f){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0x55ca('0x12')](function(_0x5d1712){var _0x509ff0=getValueFromLicense(_0x5204aa,_0x5d1712);return _0x509ff0?_0x509ff0:_0x14d7d8;})[_0x55ca('0x12')](function(_0x41713e){_0x14d7d8=_0x41713e;return _0x1b3302[_0x55ca('0x13')](_0x3e7dba);})[_0x55ca('0x12')](function(_0x2ad81d){if(_0x2ad81d>=_0x14d7d8){return _0xab115b[_0x55ca('0x14')](0x193)['json']({'message':util[_0x55ca('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5204aa)});}_0x57880f();})[_0x55ca('0x15')](function(_0x2ab3b4){_0x57880f(_0x2ab3b4);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x55ca('0x16')],{'where':{'$or':[{'role':_0x55ca('0x17')},{'role':_0x55ca('0x18')}]}});}exports[_0x55ca('0x19')]=isUserLimit;
\ No newline at end of file