Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / components / license / service.js
index 92804eb..6c643b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f93=['aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher'];(function(_0x6b0731,_0x4ff682){var _0x462a9e=function(_0x168ae3){while(--_0x168ae3){_0x6b0731['push'](_0x6b0731['shift']());}};_0x462a9e(++_0x4ff682);}(_0x3f93,0xac));var _0x33f9=function(_0x2f4755,_0x72c913){_0x2f4755=_0x2f4755-0x0;var _0x375bd0=_0x3f93[_0x2f4755];return _0x375bd0;};'use strict';var crypto=require(_0x33f9('0x0'));var util=require(_0x33f9('0x1'));var compose=require(_0x33f9('0x2'));var db=require(_0x33f9('0x3'))['db'];var config=require(_0x33f9('0x4'));function getValueFromLicense(_0x2f4998,_0x7d945c){if(_0x2f4998&&_0x7d945c){if(_0x7d945c[_0x33f9('0x5')]&&_0x7d945c['license']){var _0x2cf7be=_0x7d945c[_0x33f9('0x5')];var _0x577163=_0x7d945c['license'];var _0x18c271=_0x2cf7be[_0x33f9('0x6')]('-')[0x4];var _0x26cc20=_0x2cf7be[_0x33f9('0x6')]('-')[0x0];var _0x452631=crypto[_0x33f9('0x7')](_0x33f9('0x8'),util[_0x33f9('0x9')](_0x33f9('0xa'),_0x18c271,_0x2cf7be,_0x26cc20));var _0x1747da=_0x452631[_0x33f9('0xb')](_0x577163,_0x33f9('0xc'),_0x33f9('0xd'));_0x1747da+=_0x452631[_0x33f9('0xe')]('utf8');var _0x12061e=JSON[_0x33f9('0xf')](_0x1747da);return _0x12061e[_0x33f9('0x10')](_0x2f4998)?_0x12061e[_0x2f4998]:null;}}return null;}function isLimit(_0xb78d10,_0x773313,_0x92e6da,_0x273981){var _0x4d8071=_0x773313;return compose()[_0x33f9('0x11')](function(_0xaf9874,_0x3d3f13,_0x5c6046){return db[_0x33f9('0x12')][_0x33f9('0x13')]({'where':{'id':0x1},'raw':!![]})[_0x33f9('0x14')](function(_0x10ec70){var _0xd85528=getValueFromLicense(_0xb78d10,_0x10ec70);return _0xd85528?_0xd85528:_0x4d8071;})['then'](function(_0x5952ac){_0x4d8071=_0x5952ac;return _0x92e6da[_0x33f9('0x15')](_0x273981);})['then'](function(_0x31205c){if(_0x31205c>=_0x4d8071){return _0x3d3f13[_0x33f9('0x16')](0x193)[_0x33f9('0x17')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xb78d10)});}_0x5c6046();})[_0x33f9('0x18')](function(_0x43ab30){_0x5c6046(_0x43ab30);});});}function isUserLimit(){return isLimit(_0x33f9('0x19'),0x1,db[_0x33f9('0x1a')],{'where':{'$or':[{'role':_0x33f9('0x1b')},{'role':_0x33f9('0x1c')}]}});}exports[_0x33f9('0x1d')]=isUserLimit;
\ No newline at end of file
+var _0x5559=['data1','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','../../config/environment'];(function(_0x15dc92,_0x45a995){var _0x21a6bb=function(_0x440ecd){while(--_0x440ecd){_0x15dc92['push'](_0x15dc92['shift']());}};_0x21a6bb(++_0x45a995);}(_0x5559,0xbd));var _0x9555=function(_0x5011ce,_0x56cefb){_0x5011ce=_0x5011ce-0x0;var _0x387448=_0x5559[_0x5011ce];return _0x387448;};'use strict';var crypto=require(_0x9555('0x0'));var util=require(_0x9555('0x1'));var compose=require('composable-middleware');var db=require('../../mysqldb')['db'];var config=require(_0x9555('0x2'));function getValueFromLicense(_0x20bdaa,_0x18c021){if(_0x20bdaa&&_0x18c021){if(_0x18c021[_0x9555('0x3')]&&_0x18c021['license']){var _0x4fa20c=_0x18c021['data1'];var _0x46e2b5=_0x18c021['license'];var _0x2ae9f0=_0x4fa20c['split']('-')[0x4];var _0x20c030=_0x4fa20c['split']('-')[0x0];var _0x465721=crypto['createDecipher'](_0x9555('0x4'),util[_0x9555('0x5')](_0x9555('0x6'),_0x2ae9f0,_0x4fa20c,_0x20c030));var _0x185000=_0x465721[_0x9555('0x7')](_0x46e2b5,_0x9555('0x8'),'utf8');_0x185000+=_0x465721['final'](_0x9555('0x9'));var _0x11b062=JSON[_0x9555('0xa')](_0x185000);return _0x11b062[_0x9555('0xb')](_0x20bdaa)?_0x11b062[_0x20bdaa]:null;}}return null;}function isLimit(_0x46eb22,_0x33fb09,_0x260d4c,_0x3b13fa){var _0x37ad4b=_0x33fb09;return compose()[_0x9555('0xc')](function(_0x45f122,_0x506975,_0x21fa25){return db[_0x9555('0xd')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x9555('0xe')](function(_0x220a34){var _0x5c0be7=getValueFromLicense(_0x46eb22,_0x220a34);return _0x5c0be7?_0x5c0be7:_0x37ad4b;})[_0x9555('0xe')](function(_0x35b6bd){_0x37ad4b=_0x35b6bd;return _0x260d4c[_0x9555('0xf')](_0x3b13fa);})[_0x9555('0xe')](function(_0x569f92){if(_0x569f92>=_0x37ad4b){return _0x506975[_0x9555('0x10')](0x193)[_0x9555('0x11')]({'message':util[_0x9555('0x5')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x46eb22)});}_0x21fa25();})[_0x9555('0x12')](function(_0x58c87d){_0x21fa25(_0x58c87d);});});}function isUserLimit(){return isLimit(_0x9555('0x13'),0x1,db[_0x9555('0x14')],{'where':{'$or':[{'role':_0x9555('0x15')},{'role':_0x9555('0x16')}]}});}exports[_0x9555('0x17')]=isUserLimit;
\ No newline at end of file