Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / components / license / service.js
index f703ec8..518d56e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x138f=['crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','hasOwnProperty','use','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit'];(function(_0x3799b2,_0x3728da){var _0x1d7571=function(_0x4993b3){while(--_0x4993b3){_0x3799b2['push'](_0x3799b2['shift']());}};_0x1d7571(++_0x3728da);}(_0x138f,0x113));var _0xf138=function(_0x1accf6,_0x4a9854){_0x1accf6=_0x1accf6-0x0;var _0x24e446=_0x138f[_0x1accf6];return _0x24e446;};'use strict';var crypto=require(_0xf138('0x0'));var util=require(_0xf138('0x1'));var compose=require('composable-middleware');var db=require(_0xf138('0x2'))['db'];var config=require(_0xf138('0x3'));function getValueFromLicense(_0x20a792,_0x979b8c){if(_0x20a792&&_0x979b8c){if(_0x979b8c[_0xf138('0x4')]&&_0x979b8c[_0xf138('0x5')]){var _0x5c507=_0x979b8c['data1'];var _0x46296c=_0x979b8c[_0xf138('0x5')];var _0x59fc0b=_0x5c507[_0xf138('0x6')]('-')[0x4];var _0x1dbf9d=_0x5c507[_0xf138('0x6')]('-')[0x0];var _0x381330=crypto[_0xf138('0x7')](_0xf138('0x8'),util[_0xf138('0x9')]('%s:%s:%s',_0x59fc0b,_0x5c507,_0x1dbf9d));var _0x52f52b=_0x381330[_0xf138('0xa')](_0x46296c,_0xf138('0xb'),_0xf138('0xc'));_0x52f52b+=_0x381330[_0xf138('0xd')](_0xf138('0xc'));var _0x13c9e2=JSON[_0xf138('0xe')](_0x52f52b);return _0x13c9e2[_0xf138('0xf')](_0x20a792)?_0x13c9e2[_0x20a792]:null;}}return null;}function isLimit(_0x316cc9,_0x576a20,_0x2e2255,_0x4f82a1){var _0x1e684d=_0x576a20;return compose()[_0xf138('0x10')](function(_0x2704f3,_0x1dd2a9,_0x56b95a){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xf138('0x11')](function(_0x4d91b9){var _0x54f685=getValueFromLicense(_0x316cc9,_0x4d91b9);return _0x54f685?_0x54f685:_0x1e684d;})[_0xf138('0x11')](function(_0x8da97e){_0x1e684d=_0x8da97e;return _0x2e2255['count'](_0x4f82a1);})['then'](function(_0x1c3ceb){if(_0x1c3ceb>=_0x1e684d){return _0x1dd2a9['status'](0x193)[_0xf138('0x12')]({'message':util[_0xf138('0x9')](_0xf138('0x13'),_0x316cc9)});}_0x56b95a();})[_0xf138('0x14')](function(_0x4fb210){_0x56b95a(_0x4fb210);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xf138('0x15')],{'where':{'$or':[{'role':_0xf138('0x16')},{'role':_0xf138('0x17')}]}});}exports[_0xf138('0x18')]=isUserLimit;
\ No newline at end of file
+var _0x9db1=['catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update','utf8','final','hasOwnProperty','findOne','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x3bd876,_0x265b97){var _0x3240af=function(_0x24d342){while(--_0x24d342){_0x3bd876['push'](_0x3bd876['shift']());}};_0x3240af(++_0x265b97);}(_0x9db1,0xf0));var _0x19db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9db1[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x19db('0x0'));var util=require(_0x19db('0x1'));var compose=require(_0x19db('0x2'));var db=require(_0x19db('0x3'))['db'];var config=require(_0x19db('0x4'));function getValueFromLicense(_0x1524d4,_0x320916){if(_0x1524d4&&_0x320916){if(_0x320916['data1']&&_0x320916['license']){var _0x4aecd9=_0x320916[_0x19db('0x5')];var _0x9865a7=_0x320916[_0x19db('0x6')];var _0x163c6f=_0x4aecd9['split']('-')[0x4];var _0x388014=_0x4aecd9[_0x19db('0x7')]('-')[0x0];var _0x26fa2c=crypto[_0x19db('0x8')](_0x19db('0x9'),util['format']('%s:%s:%s',_0x163c6f,_0x4aecd9,_0x388014));var _0x3b9e6e=_0x26fa2c[_0x19db('0xa')](_0x9865a7,'base64',_0x19db('0xb'));_0x3b9e6e+=_0x26fa2c[_0x19db('0xc')](_0x19db('0xb'));var _0x3a7213=JSON['parse'](_0x3b9e6e);return _0x3a7213[_0x19db('0xd')](_0x1524d4)?_0x3a7213[_0x1524d4]:null;}}return null;}function isLimit(_0x1df26e,_0xe71fbd,_0x5a821b,_0x91acb3){var _0x2e8df8=_0xe71fbd;return compose()['use'](function(_0x44ccaa,_0x50891c,_0x498f5b){return db['License'][_0x19db('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x19db('0xf')](function(_0x24f6ad){var _0xd21617=getValueFromLicense(_0x1df26e,_0x24f6ad);return _0xd21617?_0xd21617:_0x2e8df8;})[_0x19db('0xf')](function(_0x5117be){_0x2e8df8=_0x5117be;return _0x5a821b[_0x19db('0x10')](_0x91acb3);})['then'](function(_0x3c6255){if(_0x3c6255>=_0x2e8df8){return _0x50891c['status'](0x193)[_0x19db('0x11')]({'message':util[_0x19db('0x12')](_0x19db('0x13'),_0x1df26e)});}_0x498f5b();})[_0x19db('0x14')](function(_0x198e38){_0x498f5b(_0x198e38);});});}function isUserLimit(){return isLimit(_0x19db('0x15'),0x1,db[_0x19db('0x16')],{'where':{'$or':[{'role':_0x19db('0x17')},{'role':_0x19db('0x18')}]}});}exports[_0x19db('0x19')]=isUserLimit;
\ No newline at end of file