Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / components / license / service.js
index 833ae7f..1af0c3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ca5=['composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8','final','hasOwnProperty','License','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto'];(function(_0x549b29,_0x2e2b00){var _0x2b813f=function(_0x43234f){while(--_0x43234f){_0x549b29['push'](_0x549b29['shift']());}};_0x2b813f(++_0x2e2b00);}(_0x2ca5,0xe9));var _0x52ca=function(_0x5aef5a,_0x3ad0db){_0x5aef5a=_0x5aef5a-0x0;var _0xcff0b4=_0x2ca5[_0x5aef5a];return _0xcff0b4;};'use strict';var crypto=require(_0x52ca('0x0'));var util=require('util');var compose=require(_0x52ca('0x1'));var db=require(_0x52ca('0x2'))['db'];var config=require(_0x52ca('0x3'));function getValueFromLicense(_0x4e159f,_0x352068){if(_0x4e159f&&_0x352068){if(_0x352068['data1']&&_0x352068[_0x52ca('0x4')]){var _0x2d7051=_0x352068[_0x52ca('0x5')];var _0xc23b16=_0x352068[_0x52ca('0x4')];var _0x2a04b0=_0x2d7051['split']('-')[0x4];var _0x1a38f6=_0x2d7051[_0x52ca('0x6')]('-')[0x0];var _0x2c85d3=crypto[_0x52ca('0x7')](_0x52ca('0x8'),util['format'](_0x52ca('0x9'),_0x2a04b0,_0x2d7051,_0x1a38f6));var _0x360d6b=_0x2c85d3[_0x52ca('0xa')](_0xc23b16,'base64',_0x52ca('0xb'));_0x360d6b+=_0x2c85d3[_0x52ca('0xc')](_0x52ca('0xb'));var _0x576426=JSON['parse'](_0x360d6b);return _0x576426[_0x52ca('0xd')](_0x4e159f)?_0x576426[_0x4e159f]:null;}}return null;}function isLimit(_0x24683c,_0x1c19da,_0x40f21d,_0x17e9c5){var _0x43d799=_0x1c19da;return compose()['use'](function(_0x210c53,_0x478c56,_0x4d5dab){return db[_0x52ca('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x52ca('0xf')](function(_0x2c2962){var _0xaa94ee=getValueFromLicense(_0x24683c,_0x2c2962);return _0xaa94ee?_0xaa94ee:_0x43d799;})[_0x52ca('0xf')](function(_0x73f6bd){_0x43d799=_0x73f6bd;return _0x40f21d[_0x52ca('0x10')](_0x17e9c5);})['then'](function(_0xa03b11){if(_0xa03b11>=_0x43d799){return _0x478c56[_0x52ca('0x11')](0x193)[_0x52ca('0x12')]({'message':util[_0x52ca('0x13')](_0x52ca('0x14'),_0x24683c)});}_0x4d5dab();})[_0x52ca('0x15')](function(_0x5c767e){_0x4d5dab(_0x5c767e);});});}function isUserLimit(){return isLimit(_0x52ca('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x52ca('0x17')},{'role':_0x52ca('0x18')}]}});}exports[_0x52ca('0x19')]=isUserLimit;
\ No newline at end of file
+var _0x6ae8=['hasOwnProperty','use','License','findOne','then','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x6ae8,0xa1));var _0x86ae=function(_0x33c9d7,_0x65cd8f){_0x33c9d7=_0x33c9d7-0x0;var _0x99cd88=_0x6ae8[_0x33c9d7];return _0x99cd88;};'use strict';var crypto=require(_0x86ae('0x0'));var util=require('util');var compose=require(_0x86ae('0x1'));var db=require(_0x86ae('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x2ecc5d,_0x3035e0){if(_0x2ecc5d&&_0x3035e0){if(_0x3035e0[_0x86ae('0x3')]&&_0x3035e0[_0x86ae('0x4')]){var _0x1cdcd4=_0x3035e0[_0x86ae('0x3')];var _0x23453b=_0x3035e0['license'];var _0x53397a=_0x1cdcd4['split']('-')[0x4];var _0x4fff39=_0x1cdcd4['split']('-')[0x0];var _0x16a10d=crypto[_0x86ae('0x5')](_0x86ae('0x6'),util[_0x86ae('0x7')](_0x86ae('0x8'),_0x53397a,_0x1cdcd4,_0x4fff39));var _0x90f2e5=_0x16a10d[_0x86ae('0x9')](_0x23453b,_0x86ae('0xa'),_0x86ae('0xb'));_0x90f2e5+=_0x16a10d[_0x86ae('0xc')]('utf8');var _0x52666f=JSON[_0x86ae('0xd')](_0x90f2e5);return _0x52666f[_0x86ae('0xe')](_0x2ecc5d)?_0x52666f[_0x2ecc5d]:null;}}return null;}function isLimit(_0x37aac7,_0x1c202c,_0x2bb965,_0x2bde9d){var _0x4373c7=_0x1c202c;return compose()[_0x86ae('0xf')](function(_0xefc78b,_0x816166,_0x3cf0d9){return db[_0x86ae('0x10')][_0x86ae('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x86ae('0x12')](function(_0x49e9fd){var _0x308fd2=getValueFromLicense(_0x37aac7,_0x49e9fd);return _0x308fd2?_0x308fd2:_0x4373c7;})[_0x86ae('0x12')](function(_0x5926b6){_0x4373c7=_0x5926b6;return _0x2bb965['count'](_0x2bde9d);})['then'](function(_0x3b2cb4){if(_0x3b2cb4>=_0x4373c7){return _0x816166[_0x86ae('0x13')](0x193)['json']({'message':util[_0x86ae('0x7')](_0x86ae('0x14'),_0x37aac7)});}_0x3cf0d9();})['catch'](function(_0x20e111){_0x3cf0d9(_0x20e111);});});}function isUserLimit(){return isLimit(_0x86ae('0x15'),0x1,db[_0x86ae('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x86ae('0x17')}]}});}exports[_0x86ae('0x18')]=isUserLimit;
\ No newline at end of file