Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / components / license / service.js
index e7e934b..aa5b04a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d8=['format','%s:%s:%s','update','base64','final','utf8','hasOwnProperty','use','License','findOne','then','status','json','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','split','createDecipher'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0xf4d8,0x132));var _0x8f4d=function(_0x151f58,_0x56c0b9){_0x151f58=_0x151f58-0x0;var _0x105143=_0xf4d8[_0x151f58];return _0x105143;};'use strict';var crypto=require(_0x8f4d('0x0'));var util=require(_0x8f4d('0x1'));var compose=require('composable-middleware');var db=require(_0x8f4d('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x34b999,_0x4ca648){if(_0x34b999&&_0x4ca648){if(_0x4ca648[_0x8f4d('0x3')]&&_0x4ca648['license']){var _0x3a479c=_0x4ca648['data1'];var _0x4976e7=_0x4ca648['license'];var _0x1664c5=_0x3a479c['split']('-')[0x4];var _0x389985=_0x3a479c[_0x8f4d('0x4')]('-')[0x0];var _0x2f6c69=crypto[_0x8f4d('0x5')]('aes-256-ctr',util[_0x8f4d('0x6')](_0x8f4d('0x7'),_0x1664c5,_0x3a479c,_0x389985));var _0x1ddc0c=_0x2f6c69[_0x8f4d('0x8')](_0x4976e7,_0x8f4d('0x9'),'utf8');_0x1ddc0c+=_0x2f6c69[_0x8f4d('0xa')](_0x8f4d('0xb'));var _0x1b8557=JSON['parse'](_0x1ddc0c);return _0x1b8557[_0x8f4d('0xc')](_0x34b999)?_0x1b8557[_0x34b999]:null;}}return null;}function isLimit(_0x5da196,_0x3384fa,_0x118258,_0x2fb06d){var _0x4422e7=_0x3384fa;return compose()[_0x8f4d('0xd')](function(_0x4ee49d,_0xcf167d,_0x2c8615){return db[_0x8f4d('0xe')][_0x8f4d('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x8f4d('0x10')](function(_0x560900){var _0x4411e7=getValueFromLicense(_0x5da196,_0x560900);return _0x4411e7?_0x4411e7:_0x4422e7;})['then'](function(_0x22f3c4){_0x4422e7=_0x22f3c4;return _0x118258['count'](_0x2fb06d);})[_0x8f4d('0x10')](function(_0x58b21f){if(_0x58b21f>=_0x4422e7){return _0xcf167d[_0x8f4d('0x11')](0x193)[_0x8f4d('0x12')]({'message':util[_0x8f4d('0x6')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x5da196)});}_0x2c8615();})['catch'](function(_0x2676d0){_0x2c8615(_0x2676d0);});});}function isUserLimit(){return isLimit(_0x8f4d('0x13'),0x1,db[_0x8f4d('0x14')],{'where':{'$or':[{'role':_0x8f4d('0x15')},{'role':_0x8f4d('0x16')}]}});}exports[_0x8f4d('0x17')]=isUserLimit;
\ No newline at end of file
+var _0xa03f=['then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','findOne'];(function(_0x13f526,_0xf0f6ad){var _0x5096e7=function(_0x2e56ec){while(--_0x2e56ec){_0x13f526['push'](_0x13f526['shift']());}};_0x5096e7(++_0xf0f6ad);}(_0xa03f,0x174));var _0xfa03=function(_0x217b47,_0x13c2ac){_0x217b47=_0x217b47-0x0;var _0x2f0a01=_0xa03f[_0x217b47];return _0x2f0a01;};'use strict';var crypto=require(_0xfa03('0x0'));var util=require(_0xfa03('0x1'));var compose=require(_0xfa03('0x2'));var db=require(_0xfa03('0x3'))['db'];var config=require(_0xfa03('0x4'));function getValueFromLicense(_0xf2e0e4,_0x226d46){if(_0xf2e0e4&&_0x226d46){if(_0x226d46['data1']&&_0x226d46[_0xfa03('0x5')]){var _0x297911=_0x226d46[_0xfa03('0x6')];var _0x4b809a=_0x226d46[_0xfa03('0x5')];var _0x24cd75=_0x297911[_0xfa03('0x7')]('-')[0x4];var _0x9b1c32=_0x297911[_0xfa03('0x7')]('-')[0x0];var _0x187419=crypto['createDecipher']('aes-256-ctr',util[_0xfa03('0x8')](_0xfa03('0x9'),_0x24cd75,_0x297911,_0x9b1c32));var _0x3be309=_0x187419[_0xfa03('0xa')](_0x4b809a,_0xfa03('0xb'),_0xfa03('0xc'));_0x3be309+=_0x187419[_0xfa03('0xd')](_0xfa03('0xc'));var _0x40c2ff=JSON[_0xfa03('0xe')](_0x3be309);return _0x40c2ff[_0xfa03('0xf')](_0xf2e0e4)?_0x40c2ff[_0xf2e0e4]:null;}}return null;}function isLimit(_0x4ebf54,_0x507550,_0x10c08b,_0x5f22f3){var _0x13d728=_0x507550;return compose()[_0xfa03('0x10')](function(_0x46ab73,_0xc74e3c,_0x4b29ac){return db['License'][_0xfa03('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xfa03('0x12')](function(_0x29e086){var _0x527254=getValueFromLicense(_0x4ebf54,_0x29e086);return _0x527254?_0x527254:_0x13d728;})[_0xfa03('0x12')](function(_0x4a2769){_0x13d728=_0x4a2769;return _0x10c08b[_0xfa03('0x13')](_0x5f22f3);})['then'](function(_0x5d3e43){if(_0x5d3e43>=_0x13d728){return _0xc74e3c['status'](0x193)[_0xfa03('0x14')]({'message':util['format'](_0xfa03('0x15'),_0x4ebf54)});}_0x4b29ac();})[_0xfa03('0x16')](function(_0xbca71f){_0x4b29ac(_0xbca71f);});});}function isUserLimit(){return isLimit(_0xfa03('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0xfa03('0x18')},{'role':'user'}]}});}exports[_0xfa03('0x19')]=isUserLimit;
\ No newline at end of file