Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / license / service.js
index 92804eb..6c96236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f93=['aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','split','createDecipher'];(function(_0x6b0731,_0x4ff682){var _0x462a9e=function(_0x168ae3){while(--_0x168ae3){_0x6b0731['push'](_0x6b0731['shift']());}};_0x462a9e(++_0x4ff682);}(_0x3f93,0xac));var _0x33f9=function(_0x2f4755,_0x72c913){_0x2f4755=_0x2f4755-0x0;var _0x375bd0=_0x3f93[_0x2f4755];return _0x375bd0;};'use strict';var crypto=require(_0x33f9('0x0'));var util=require(_0x33f9('0x1'));var compose=require(_0x33f9('0x2'));var db=require(_0x33f9('0x3'))['db'];var config=require(_0x33f9('0x4'));function getValueFromLicense(_0x2f4998,_0x7d945c){if(_0x2f4998&&_0x7d945c){if(_0x7d945c[_0x33f9('0x5')]&&_0x7d945c['license']){var _0x2cf7be=_0x7d945c[_0x33f9('0x5')];var _0x577163=_0x7d945c['license'];var _0x18c271=_0x2cf7be[_0x33f9('0x6')]('-')[0x4];var _0x26cc20=_0x2cf7be[_0x33f9('0x6')]('-')[0x0];var _0x452631=crypto[_0x33f9('0x7')](_0x33f9('0x8'),util[_0x33f9('0x9')](_0x33f9('0xa'),_0x18c271,_0x2cf7be,_0x26cc20));var _0x1747da=_0x452631[_0x33f9('0xb')](_0x577163,_0x33f9('0xc'),_0x33f9('0xd'));_0x1747da+=_0x452631[_0x33f9('0xe')]('utf8');var _0x12061e=JSON[_0x33f9('0xf')](_0x1747da);return _0x12061e[_0x33f9('0x10')](_0x2f4998)?_0x12061e[_0x2f4998]:null;}}return null;}function isLimit(_0xb78d10,_0x773313,_0x92e6da,_0x273981){var _0x4d8071=_0x773313;return compose()[_0x33f9('0x11')](function(_0xaf9874,_0x3d3f13,_0x5c6046){return db[_0x33f9('0x12')][_0x33f9('0x13')]({'where':{'id':0x1},'raw':!![]})[_0x33f9('0x14')](function(_0x10ec70){var _0xd85528=getValueFromLicense(_0xb78d10,_0x10ec70);return _0xd85528?_0xd85528:_0x4d8071;})['then'](function(_0x5952ac){_0x4d8071=_0x5952ac;return _0x92e6da[_0x33f9('0x15')](_0x273981);})['then'](function(_0x31205c){if(_0x31205c>=_0x4d8071){return _0x3d3f13[_0x33f9('0x16')](0x193)[_0x33f9('0x17')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0xb78d10)});}_0x5c6046();})[_0x33f9('0x18')](function(_0x43ab30){_0x5c6046(_0x43ab30);});});}function isUserLimit(){return isLimit(_0x33f9('0x19'),0x1,db[_0x33f9('0x1a')],{'where':{'$or':[{'role':_0x33f9('0x1b')},{'role':_0x33f9('0x1c')}]}});}exports[_0x33f9('0x1d')]=isUserLimit;
\ No newline at end of file
+var _0xaf26=['../../mysqldb','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','crypto','util','composable-middleware'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xaf26,0x142));var _0x6af2=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xaf26[_0x30a31e];return _0x170879;};'use strict';var crypto=require(_0x6af2('0x0'));var util=require(_0x6af2('0x1'));var compose=require(_0x6af2('0x2'));var db=require(_0x6af2('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x40c2ad,_0x26a557){if(_0x40c2ad&&_0x26a557){if(_0x26a557[_0x6af2('0x4')]&&_0x26a557['license']){var _0x8f051f=_0x26a557[_0x6af2('0x4')];var _0x1f0db6=_0x26a557['license'];var _0x198a60=_0x8f051f[_0x6af2('0x5')]('-')[0x4];var _0x362115=_0x8f051f[_0x6af2('0x5')]('-')[0x0];var _0x46b310=crypto[_0x6af2('0x6')](_0x6af2('0x7'),util['format'](_0x6af2('0x8'),_0x198a60,_0x8f051f,_0x362115));var _0x506352=_0x46b310[_0x6af2('0x9')](_0x1f0db6,_0x6af2('0xa'),_0x6af2('0xb'));_0x506352+=_0x46b310[_0x6af2('0xc')](_0x6af2('0xb'));var _0x554345=JSON[_0x6af2('0xd')](_0x506352);return _0x554345[_0x6af2('0xe')](_0x40c2ad)?_0x554345[_0x40c2ad]:null;}}return null;}function isLimit(_0x49fb33,_0x2a3279,_0x1678e6,_0x2931f5){var _0x5e3728=_0x2a3279;return compose()[_0x6af2('0xf')](function(_0x497569,_0x3ac6ea,_0x1ad265){return db['License'][_0x6af2('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x6af2('0x11')](function(_0x35ec73){var _0x110ecb=getValueFromLicense(_0x49fb33,_0x35ec73);return _0x110ecb?_0x110ecb:_0x5e3728;})[_0x6af2('0x11')](function(_0xa47a1a){_0x5e3728=_0xa47a1a;return _0x1678e6[_0x6af2('0x12')](_0x2931f5);})['then'](function(_0x9d2ec3){if(_0x9d2ec3>=_0x5e3728){return _0x3ac6ea['status'](0x193)[_0x6af2('0x13')]({'message':util[_0x6af2('0x14')](_0x6af2('0x15'),_0x49fb33)});}_0x1ad265();})[_0x6af2('0x16')](function(_0x45538b){_0x1ad265(_0x45538b);});});}function isUserLimit(){return isLimit(_0x6af2('0x17'),0x1,db[_0x6af2('0x18')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file