Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / components / license / service.js
index 8ba374b..25040f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05f3=['final','parse','hasOwnProperty','use','License','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','base64','utf8'];(function(_0x512c25,_0x3370e3){var _0x17fe8e=function(_0x487b6b){while(--_0x487b6b){_0x512c25['push'](_0x512c25['shift']());}};_0x17fe8e(++_0x3370e3);}(_0x05f3,0xf0));var _0x305f=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x05f3[_0x5317b5];return _0x3b7ce2;};'use strict';var crypto=require('crypto');var util=require(_0x305f('0x0'));var compose=require(_0x305f('0x1'));var db=require(_0x305f('0x2'))['db'];var config=require(_0x305f('0x3'));function getValueFromLicense(_0x4943ed,_0x5f004d){if(_0x4943ed&&_0x5f004d){if(_0x5f004d['data1']&&_0x5f004d[_0x305f('0x4')]){var _0x1310cc=_0x5f004d[_0x305f('0x5')];var _0x5d7e41=_0x5f004d['license'];var _0x4776ea=_0x1310cc[_0x305f('0x6')]('-')[0x4];var _0x169959=_0x1310cc[_0x305f('0x6')]('-')[0x0];var _0xb1ed32=crypto[_0x305f('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x4776ea,_0x1310cc,_0x169959));var _0xa75618=_0xb1ed32['update'](_0x5d7e41,_0x305f('0x8'),_0x305f('0x9'));_0xa75618+=_0xb1ed32[_0x305f('0xa')](_0x305f('0x9'));var _0x2e5e2c=JSON[_0x305f('0xb')](_0xa75618);return _0x2e5e2c[_0x305f('0xc')](_0x4943ed)?_0x2e5e2c[_0x4943ed]:null;}}return null;}function isLimit(_0x40ed3c,_0x34544e,_0x51c28b,_0x3fbb9c){var _0x4fa2e0=_0x34544e;return compose()[_0x305f('0xd')](function(_0x5bb6db,_0x264dbb,_0x53b283){return db[_0x305f('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x305f('0xf')](function(_0x3a0065){var _0x40cdbd=getValueFromLicense(_0x40ed3c,_0x3a0065);return _0x40cdbd?_0x40cdbd:_0x4fa2e0;})['then'](function(_0x112d0d){_0x4fa2e0=_0x112d0d;return _0x51c28b['count'](_0x3fbb9c);})[_0x305f('0xf')](function(_0x5d38b5){if(_0x5d38b5>=_0x4fa2e0){return _0x264dbb[_0x305f('0x10')](0x193)[_0x305f('0x11')]({'message':util[_0x305f('0x12')](_0x305f('0x13'),_0x40ed3c)});}_0x53b283();})[_0x305f('0x14')](function(_0xd226c8){_0x53b283(_0xd226c8);});});}function isUserLimit(){return isLimit(_0x305f('0x15'),0x1,db[_0x305f('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x305f('0x17')}]}});}exports[_0x305f('0x18')]=isUserLimit;
\ No newline at end of file
+var _0xb6a7=['catch','users','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0xb6a7,0x18e));var _0x7b6a=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0xb6a7[_0x4b4f24];return _0x1c13d4;};'use strict';var crypto=require(_0x7b6a('0x0'));var util=require(_0x7b6a('0x1'));var compose=require('composable-middleware');var db=require(_0x7b6a('0x2'))['db'];var config=require(_0x7b6a('0x3'));function getValueFromLicense(_0x17bdf7,_0x1ed80c){if(_0x17bdf7&&_0x1ed80c){if(_0x1ed80c[_0x7b6a('0x4')]&&_0x1ed80c['license']){var _0x362b88=_0x1ed80c[_0x7b6a('0x4')];var _0x148d5c=_0x1ed80c[_0x7b6a('0x5')];var _0x20ccfa=_0x362b88[_0x7b6a('0x6')]('-')[0x4];var _0x3a087e=_0x362b88[_0x7b6a('0x6')]('-')[0x0];var _0x5649a2=crypto[_0x7b6a('0x7')]('aes-256-ctr',util['format'](_0x7b6a('0x8'),_0x20ccfa,_0x362b88,_0x3a087e));var _0x43ef5c=_0x5649a2['update'](_0x148d5c,_0x7b6a('0x9'),_0x7b6a('0xa'));_0x43ef5c+=_0x5649a2[_0x7b6a('0xb')](_0x7b6a('0xa'));var _0x1cc2fc=JSON[_0x7b6a('0xc')](_0x43ef5c);return _0x1cc2fc[_0x7b6a('0xd')](_0x17bdf7)?_0x1cc2fc[_0x17bdf7]:null;}}return null;}function isLimit(_0x5df7d2,_0x2ce613,_0x431b6b,_0x4b97fb){var _0x5ef4b1=_0x2ce613;return compose()[_0x7b6a('0xe')](function(_0x261bf7,_0x4ec2d1,_0x1dfa3e){return db[_0x7b6a('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x4fda69){var _0x44026d=getValueFromLicense(_0x5df7d2,_0x4fda69);return _0x44026d?_0x44026d:_0x5ef4b1;})[_0x7b6a('0x10')](function(_0x3952b7){_0x5ef4b1=_0x3952b7;return _0x431b6b[_0x7b6a('0x11')](_0x4b97fb);})[_0x7b6a('0x10')](function(_0x15964e){if(_0x15964e>=_0x5ef4b1){return _0x4ec2d1[_0x7b6a('0x12')](0x193)[_0x7b6a('0x13')]({'message':util[_0x7b6a('0x14')](_0x7b6a('0x15'),_0x5df7d2)});}_0x1dfa3e();})[_0x7b6a('0x16')](function(_0x477841){_0x1dfa3e(_0x477841);});});}function isUserLimit(){return isLimit(_0x7b6a('0x17'),0x1,db[_0x7b6a('0x18')],{'where':{'$or':[{'role':_0x7b6a('0x19')},{'role':_0x7b6a('0x1a')}]}});}exports[_0x7b6a('0x1b')]=isUserLimit;
\ No newline at end of file