Built motion from commit cb845558.|2.6.34
[motion2.git] / server / components / license / service.js
index 7c8d0f6..16b870b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8c4=['format','update','utf8','final','parse','License','findOne','then','count','User','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr'];(function(_0x1efd6f,_0x539485){var _0x44c2d9=function(_0x59e226){while(--_0x59e226){_0x1efd6f['push'](_0x1efd6f['shift']());}};_0x44c2d9(++_0x539485);}(_0xf8c4,0x1a9));var _0x4f8c=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0xf8c4[_0x4492af];return _0x216729;};'use strict';var crypto=require('crypto');var util=require(_0x4f8c('0x0'));var compose=require(_0x4f8c('0x1'));var db=require(_0x4f8c('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xd934b1,_0x25db0f){if(_0xd934b1&&_0x25db0f){if(_0x25db0f[_0x4f8c('0x3')]&&_0x25db0f[_0x4f8c('0x4')]){var _0x53f4e1=_0x25db0f[_0x4f8c('0x3')];var _0x543f00=_0x25db0f[_0x4f8c('0x4')];var _0x4f4f97=_0x53f4e1[_0x4f8c('0x5')]('-')[0x4];var _0x5241a9=_0x53f4e1[_0x4f8c('0x5')]('-')[0x0];var _0x51bc78=crypto['createDecipher'](_0x4f8c('0x6'),util[_0x4f8c('0x7')]('%s:%s:%s',_0x4f4f97,_0x53f4e1,_0x5241a9));var _0x38d5b9=_0x51bc78[_0x4f8c('0x8')](_0x543f00,'base64',_0x4f8c('0x9'));_0x38d5b9+=_0x51bc78[_0x4f8c('0xa')](_0x4f8c('0x9'));var _0x1f869a=JSON[_0x4f8c('0xb')](_0x38d5b9);return _0x1f869a['hasOwnProperty'](_0xd934b1)?_0x1f869a[_0xd934b1]:null;}}return null;}function isLimit(_0x39bd19,_0x3347f4,_0x2a73e8,_0x55d1c5){var _0x2be9bd=_0x3347f4;return compose()['use'](function(_0x41bc01,_0x57a6e9,_0x4e0db4){return db[_0x4f8c('0xc')][_0x4f8c('0xd')]({'where':{'id':0x1},'raw':!![]})[_0x4f8c('0xe')](function(_0xb411d2){var _0x1536be=getValueFromLicense(_0x39bd19,_0xb411d2);return _0x1536be?_0x1536be:_0x2be9bd;})[_0x4f8c('0xe')](function(_0x3825f0){_0x2be9bd=_0x3825f0;return _0x2a73e8[_0x4f8c('0xf')](_0x55d1c5);})[_0x4f8c('0xe')](function(_0xff0a82){if(_0xff0a82>=_0x2be9bd){return _0x57a6e9['status'](0x193)['json']({'message':util[_0x4f8c('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x39bd19)});}_0x4e0db4();})['catch'](function(_0x480534){_0x4e0db4(_0x480534);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x4f8c('0x10')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x4f8c('0x11')]=isUserLimit;
\ No newline at end of file
+var _0x0093=['parse','hasOwnProperty','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update','utf8'];(function(_0x36749d,_0x1c87cd){var _0x4cd973=function(_0x1d9b42){while(--_0x1d9b42){_0x36749d['push'](_0x36749d['shift']());}};_0x4cd973(++_0x1c87cd);}(_0x0093,0x1d7));var _0x3009=function(_0x2ecf1c,_0x4cfaa9){_0x2ecf1c=_0x2ecf1c-0x0;var _0x5ca267=_0x0093[_0x2ecf1c];return _0x5ca267;};'use strict';var crypto=require(_0x3009('0x0'));var util=require(_0x3009('0x1'));var compose=require(_0x3009('0x2'));var db=require(_0x3009('0x3'))['db'];var config=require(_0x3009('0x4'));function getValueFromLicense(_0x16c84d,_0x57105f){if(_0x16c84d&&_0x57105f){if(_0x57105f[_0x3009('0x5')]&&_0x57105f[_0x3009('0x6')]){var _0x477ab2=_0x57105f[_0x3009('0x5')];var _0x311ee1=_0x57105f['license'];var _0x1c94a5=_0x477ab2['split']('-')[0x4];var _0x33758d=_0x477ab2[_0x3009('0x7')]('-')[0x0];var _0x291793=crypto[_0x3009('0x8')](_0x3009('0x9'),util['format']('%s:%s:%s',_0x1c94a5,_0x477ab2,_0x33758d));var _0xdefa7=_0x291793[_0x3009('0xa')](_0x311ee1,'base64',_0x3009('0xb'));_0xdefa7+=_0x291793['final'](_0x3009('0xb'));var _0x52d8a0=JSON[_0x3009('0xc')](_0xdefa7);return _0x52d8a0[_0x3009('0xd')](_0x16c84d)?_0x52d8a0[_0x16c84d]:null;}}return null;}function isLimit(_0x399dae,_0x1532d7,_0x3f1c6c,_0x5e4b7a){var _0x430ca3=_0x1532d7;return compose()['use'](function(_0x1fbbcc,_0x585fa2,_0x5508a4){return db[_0x3009('0xe')][_0x3009('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x3009('0x10')](function(_0x4cf957){var _0x50b3e5=getValueFromLicense(_0x399dae,_0x4cf957);return _0x50b3e5?_0x50b3e5:_0x430ca3;})[_0x3009('0x10')](function(_0x58088a){_0x430ca3=_0x58088a;return _0x3f1c6c[_0x3009('0x11')](_0x5e4b7a);})[_0x3009('0x10')](function(_0x162742){if(_0x162742>=_0x430ca3){return _0x585fa2['status'](0x193)[_0x3009('0x12')]({'message':util['format'](_0x3009('0x13'),_0x399dae)});}_0x5508a4();})[_0x3009('0x14')](function(_0x555514){_0x5508a4(_0x555514);});});}function isUserLimit(){return isLimit(_0x3009('0x15'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0x3009('0x16')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file