Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / components / license / service.js
index 05386a2..1b33bbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5626=['count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','../../mysqldb','../../config/environment','data1','split','createDecipher','format','%s:%s:%s','base64','utf8','final','parse','License','then'];(function(_0x349ac1,_0x443243){var _0x77840a=function(_0x3e6a60){while(--_0x3e6a60){_0x349ac1['push'](_0x349ac1['shift']());}};_0x77840a(++_0x443243);}(_0x5626,0x1c1));var _0x6562=function(_0x1103d1,_0x1f980b){_0x1103d1=_0x1103d1-0x0;var _0x197597=_0x5626[_0x1103d1];return _0x197597;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0x6562('0x0'))['db'];var config=require(_0x6562('0x1'));function getValueFromLicense(_0x28b9ba,_0x371989){if(_0x28b9ba&&_0x371989){if(_0x371989[_0x6562('0x2')]&&_0x371989['license']){var _0x251308=_0x371989[_0x6562('0x2')];var _0x3a6e98=_0x371989['license'];var _0x35fe29=_0x251308[_0x6562('0x3')]('-')[0x4];var _0x25ddac=_0x251308[_0x6562('0x3')]('-')[0x0];var _0x5f00dc=crypto[_0x6562('0x4')]('aes-256-ctr',util[_0x6562('0x5')](_0x6562('0x6'),_0x35fe29,_0x251308,_0x25ddac));var _0x4ecc88=_0x5f00dc['update'](_0x3a6e98,_0x6562('0x7'),_0x6562('0x8'));_0x4ecc88+=_0x5f00dc[_0x6562('0x9')]('utf8');var _0x23c185=JSON[_0x6562('0xa')](_0x4ecc88);return _0x23c185['hasOwnProperty'](_0x28b9ba)?_0x23c185[_0x28b9ba]:null;}}return null;}function isLimit(_0x549b11,_0x3df2ac,_0x12a956,_0x367637){var _0x2370dc=_0x3df2ac;return compose()['use'](function(_0x551d8c,_0x18dc76,_0x5659ab){return db[_0x6562('0xb')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x6562('0xc')](function(_0x4f5ec3){var _0x4f7464=getValueFromLicense(_0x549b11,_0x4f5ec3);return _0x4f7464?_0x4f7464:_0x2370dc;})['then'](function(_0x3ae603){_0x2370dc=_0x3ae603;return _0x12a956[_0x6562('0xd')](_0x367637);})[_0x6562('0xc')](function(_0x1b70c7){if(_0x1b70c7>=_0x2370dc){return _0x18dc76[_0x6562('0xe')](0x193)['json']({'message':util[_0x6562('0x5')](_0x6562('0xf'),_0x549b11)});}_0x5659ab();})[_0x6562('0x10')](function(_0x23d402){_0x5659ab(_0x23d402);});});}function isUserLimit(){return isLimit(_0x6562('0x11'),0x1,db[_0x6562('0x12')],{'where':{'$or':[{'role':_0x6562('0x13')},{'role':_0x6562('0x14')}]}});}exports[_0x6562('0x15')]=isUserLimit;
\ No newline at end of file
+var _0xe40d=['update','utf8','parse','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0xe40d,0x1d0));var _0xde40=function(_0x2e2494,_0x5d0cbf){_0x2e2494=_0x2e2494-0x0;var _0x499ce3=_0xe40d[_0x2e2494];return _0x499ce3;};'use strict';var crypto=require('crypto');var util=require(_0xde40('0x0'));var compose=require(_0xde40('0x1'));var db=require(_0xde40('0x2'))['db'];var config=require(_0xde40('0x3'));function getValueFromLicense(_0x599aed,_0x77d1ef){if(_0x599aed&&_0x77d1ef){if(_0x77d1ef[_0xde40('0x4')]&&_0x77d1ef[_0xde40('0x5')]){var _0x3ea1d4=_0x77d1ef[_0xde40('0x4')];var _0x101b2a=_0x77d1ef[_0xde40('0x5')];var _0x5280e6=_0x3ea1d4[_0xde40('0x6')]('-')[0x4];var _0x5130c6=_0x3ea1d4[_0xde40('0x6')]('-')[0x0];var _0x3de81f=crypto[_0xde40('0x7')](_0xde40('0x8'),util[_0xde40('0x9')](_0xde40('0xa'),_0x5280e6,_0x3ea1d4,_0x5130c6));var _0xcb0869=_0x3de81f[_0xde40('0xb')](_0x101b2a,'base64',_0xde40('0xc'));_0xcb0869+=_0x3de81f['final'](_0xde40('0xc'));var _0x576900=JSON[_0xde40('0xd')](_0xcb0869);return _0x576900['hasOwnProperty'](_0x599aed)?_0x576900[_0x599aed]:null;}}return null;}function isLimit(_0x24b729,_0x5d3216,_0x485ca2,_0x2470f6){var _0x1cbfeb=_0x5d3216;return compose()[_0xde40('0xe')](function(_0x2e3c2c,_0x227eaa,_0x1c6614){return db[_0xde40('0xf')][_0xde40('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5b7cf2){var _0x5c5064=getValueFromLicense(_0x24b729,_0x5b7cf2);return _0x5c5064?_0x5c5064:_0x1cbfeb;})[_0xde40('0x11')](function(_0x28cff2){_0x1cbfeb=_0x28cff2;return _0x485ca2[_0xde40('0x12')](_0x2470f6);})[_0xde40('0x11')](function(_0x123bbc){if(_0x123bbc>=_0x1cbfeb){return _0x227eaa[_0xde40('0x13')](0x193)[_0xde40('0x14')]({'message':util[_0xde40('0x9')](_0xde40('0x15'),_0x24b729)});}_0x1c6614();})[_0xde40('0x16')](function(_0x31d69b){_0x1c6614(_0x31d69b);});});}function isUserLimit(){return isLimit(_0xde40('0x17'),0x1,db[_0xde40('0x18')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file