Built motion from commit (unavailable).|2.5.17
[motion2.git] / server / components / license / service.js
index 8cb0fa1..198c0fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b36=['update','utf8','final','hasOwnProperty','License','findOne','then','count','status','catch','User','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s'];(function(_0xf9e6c4,_0x103d7d){var _0x5b7700=function(_0x1ac35c){while(--_0x1ac35c){_0xf9e6c4['push'](_0xf9e6c4['shift']());}};_0x5b7700(++_0x103d7d);}(_0x9b36,0x108));var _0x69b3=function(_0x586abe,_0x15ef91){_0x586abe=_0x586abe-0x0;var _0x258bcf=_0x9b36[_0x586abe];return _0x258bcf;};'use strict';var crypto=require(_0x69b3('0x0'));var util=require(_0x69b3('0x1'));var compose=require('composable-middleware');var db=require(_0x69b3('0x2'))['db'];var config=require(_0x69b3('0x3'));function getValueFromLicense(_0x5b9d20,_0x4682e2){if(_0x5b9d20&&_0x4682e2){if(_0x4682e2[_0x69b3('0x4')]&&_0x4682e2[_0x69b3('0x5')]){var _0x3dd912=_0x4682e2['data1'];var _0x4c167e=_0x4682e2['license'];var _0x3f8401=_0x3dd912[_0x69b3('0x6')]('-')[0x4];var _0x34803d=_0x3dd912[_0x69b3('0x6')]('-')[0x0];var _0x141329=crypto[_0x69b3('0x7')](_0x69b3('0x8'),util[_0x69b3('0x9')](_0x69b3('0xa'),_0x3f8401,_0x3dd912,_0x34803d));var _0x399056=_0x141329[_0x69b3('0xb')](_0x4c167e,'base64',_0x69b3('0xc'));_0x399056+=_0x141329[_0x69b3('0xd')](_0x69b3('0xc'));var _0x58abdb=JSON['parse'](_0x399056);return _0x58abdb[_0x69b3('0xe')](_0x5b9d20)?_0x58abdb[_0x5b9d20]:null;}}return null;}function isLimit(_0x48d2ef,_0x10d695,_0x3f6685,_0x22555b){var _0x3d8ac1=_0x10d695;return compose()['use'](function(_0xaac011,_0x2304e7,_0x1c85a6){return db[_0x69b3('0xf')][_0x69b3('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0xd1dc1){var _0x15699a=getValueFromLicense(_0x48d2ef,_0xd1dc1);return _0x15699a?_0x15699a:_0x3d8ac1;})[_0x69b3('0x11')](function(_0x5cb219){_0x3d8ac1=_0x5cb219;return _0x3f6685[_0x69b3('0x12')](_0x22555b);})[_0x69b3('0x11')](function(_0x140e1a){if(_0x140e1a>=_0x3d8ac1){return _0x2304e7[_0x69b3('0x13')](0x193)['json']({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x48d2ef)});}_0x1c85a6();})[_0x69b3('0x14')](function(_0x172707){_0x1c85a6(_0x172707);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x69b3('0x15')],{'where':{'$or':[{'role':_0x69b3('0x16')},{'role':_0x69b3('0x17')}]}});}exports[_0x69b3('0x18')]=isUserLimit;
\ No newline at end of file
+var _0xe807=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','util','composable-middleware','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','License','findOne','then','count','status','json'];(function(_0x260deb,_0x592463){var _0x47daec=function(_0x56f7c4){while(--_0x56f7c4){_0x260deb['push'](_0x260deb['shift']());}};_0x47daec(++_0x592463);}(_0xe807,0xd4));var _0x7e80=function(_0x531079,_0x26830b){_0x531079=_0x531079-0x0;var _0x1235f5=_0xe807[_0x531079];return _0x1235f5;};'use strict';var crypto=require('crypto');var util=require(_0x7e80('0x0'));var compose=require(_0x7e80('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x27b6c8,_0x53bdea){if(_0x27b6c8&&_0x53bdea){if(_0x53bdea[_0x7e80('0x2')]&&_0x53bdea[_0x7e80('0x3')]){var _0x178622=_0x53bdea[_0x7e80('0x2')];var _0x3c25db=_0x53bdea[_0x7e80('0x3')];var _0x14dd4f=_0x178622[_0x7e80('0x4')]('-')[0x4];var _0x5b6cc3=_0x178622[_0x7e80('0x4')]('-')[0x0];var _0x29ea8d=crypto['createDecipher'](_0x7e80('0x5'),util[_0x7e80('0x6')](_0x7e80('0x7'),_0x14dd4f,_0x178622,_0x5b6cc3));var _0x2aadfe=_0x29ea8d[_0x7e80('0x8')](_0x3c25db,_0x7e80('0x9'),_0x7e80('0xa'));_0x2aadfe+=_0x29ea8d[_0x7e80('0xb')](_0x7e80('0xa'));var _0xfd795d=JSON['parse'](_0x2aadfe);return _0xfd795d['hasOwnProperty'](_0x27b6c8)?_0xfd795d[_0x27b6c8]:null;}}return null;}function isLimit(_0x2da39c,_0x2cded2,_0x2278f5,_0xe151){var _0x38a683=_0x2cded2;return compose()['use'](function(_0x2bbaec,_0x288f7a,_0xaa1e17){return db[_0x7e80('0xc')][_0x7e80('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x2096ea){var _0x533fbb=getValueFromLicense(_0x2da39c,_0x2096ea);return _0x533fbb?_0x533fbb:_0x38a683;})[_0x7e80('0xe')](function(_0x523b82){_0x38a683=_0x523b82;return _0x2278f5[_0x7e80('0xf')](_0xe151);})[_0x7e80('0xe')](function(_0x49f96d){if(_0x49f96d>=_0x38a683){return _0x288f7a[_0x7e80('0x10')](0x193)[_0x7e80('0x11')]({'message':util['format'](_0x7e80('0x12'),_0x2da39c)});}_0xaa1e17();})[_0x7e80('0x13')](function(_0x43b424){_0xaa1e17(_0x43b424);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x7e80('0x14')],{'where':{'$or':[{'role':_0x7e80('0x15')},{'role':_0x7e80('0x16')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file