Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / components / license / service.js
index 50cd48b..6c96236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x878c=['split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','License','findOne','then','count','status','json','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','license','data1'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x878c,0xb7));var _0xc878=function(_0xfb3e6f,_0x334293){_0xfb3e6f=_0xfb3e6f-0x0;var _0x3c0ccf=_0x878c[_0xfb3e6f];return _0x3c0ccf;};'use strict';var crypto=require(_0xc878('0x0'));var util=require(_0xc878('0x1'));var compose=require(_0xc878('0x2'));var db=require(_0xc878('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x26294e,_0x4b657f){if(_0x26294e&&_0x4b657f){if(_0x4b657f['data1']&&_0x4b657f[_0xc878('0x4')]){var _0x431cd2=_0x4b657f[_0xc878('0x5')];var _0x3bae16=_0x4b657f[_0xc878('0x4')];var _0x3c9e3f=_0x431cd2[_0xc878('0x6')]('-')[0x4];var _0xb84b65=_0x431cd2['split']('-')[0x0];var _0xccb420=crypto[_0xc878('0x7')](_0xc878('0x8'),util[_0xc878('0x9')](_0xc878('0xa'),_0x3c9e3f,_0x431cd2,_0xb84b65));var _0x5cccea=_0xccb420[_0xc878('0xb')](_0x3bae16,_0xc878('0xc'),_0xc878('0xd'));_0x5cccea+=_0xccb420[_0xc878('0xe')](_0xc878('0xd'));var _0x146575=JSON[_0xc878('0xf')](_0x5cccea);return _0x146575['hasOwnProperty'](_0x26294e)?_0x146575[_0x26294e]:null;}}return null;}function isLimit(_0x1d1905,_0x552be5,_0x5a7024,_0x152861){var _0x1ea689=_0x552be5;return compose()['use'](function(_0x59fff4,_0x1ee9d3,_0x52b01e){return db[_0xc878('0x10')][_0xc878('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xc878('0x12')](function(_0x1e922d){var _0x5dbc6b=getValueFromLicense(_0x1d1905,_0x1e922d);return _0x5dbc6b?_0x5dbc6b:_0x1ea689;})['then'](function(_0x1f6176){_0x1ea689=_0x1f6176;return _0x5a7024[_0xc878('0x13')](_0x152861);})[_0xc878('0x12')](function(_0x39ba4f){if(_0x39ba4f>=_0x1ea689){return _0x1ee9d3[_0xc878('0x14')](0x193)[_0xc878('0x15')]({'message':util[_0xc878('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x1d1905)});}_0x52b01e();})[_0xc878('0x16')](function(_0x2cee0b){_0x52b01e(_0x2cee0b);});});}function isUserLimit(){return isLimit(_0xc878('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0xc878('0x18')},{'role':_0xc878('0x19')}]}});}exports[_0xc878('0x1a')]=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