Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / components / license / service.js
index 7d33b3a..9ece359 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfada=['admin','user','crypto','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0xfada,0xc6));var _0xafad=function(_0x379fa3,_0x45f2a3){_0x379fa3=_0x379fa3-0x0;var _0x2ac20e=_0xfada[_0x379fa3];return _0x2ac20e;};'use strict';var crypto=require(_0xafad('0x0'));var util=require(_0xafad('0x1'));var compose=require(_0xafad('0x2'));var db=require(_0xafad('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x1fa1c4,_0x530f42){if(_0x1fa1c4&&_0x530f42){if(_0x530f42[_0xafad('0x4')]&&_0x530f42[_0xafad('0x5')]){var _0x1f5251=_0x530f42[_0xafad('0x4')];var _0x2f37a7=_0x530f42[_0xafad('0x5')];var _0x766c47=_0x1f5251[_0xafad('0x6')]('-')[0x4];var _0x37ead1=_0x1f5251[_0xafad('0x6')]('-')[0x0];var _0x1182a0=crypto[_0xafad('0x7')](_0xafad('0x8'),util[_0xafad('0x9')](_0xafad('0xa'),_0x766c47,_0x1f5251,_0x37ead1));var _0xf656bf=_0x1182a0[_0xafad('0xb')](_0x2f37a7,_0xafad('0xc'),_0xafad('0xd'));_0xf656bf+=_0x1182a0[_0xafad('0xe')](_0xafad('0xd'));var _0x548295=JSON[_0xafad('0xf')](_0xf656bf);return _0x548295[_0xafad('0x10')](_0x1fa1c4)?_0x548295[_0x1fa1c4]:null;}}return null;}function isLimit(_0x35d08e,_0x39a4d9,_0x212624,_0x32f59f){var _0x38c3f4=_0x39a4d9;return compose()['use'](function(_0x2fe1a6,_0x342f30,_0x12c42e){return db[_0xafad('0x11')][_0xafad('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xafad('0x13')](function(_0x1a5a92){var _0x16c2a0=getValueFromLicense(_0x35d08e,_0x1a5a92);return _0x16c2a0?_0x16c2a0:_0x38c3f4;})[_0xafad('0x13')](function(_0x183064){_0x38c3f4=_0x183064;return _0x212624[_0xafad('0x14')](_0x32f59f);})[_0xafad('0x13')](function(_0x2d02f4){if(_0x2d02f4>=_0x38c3f4){return _0x342f30['status'](0x193)[_0xafad('0x15')]({'message':util['format'](_0xafad('0x16'),_0x35d08e)});}_0x12c42e();})[_0xafad('0x17')](function(_0x3248b6){_0x12c42e(_0x3248b6);});});}function isUserLimit(){return isLimit(_0xafad('0x18'),0x1,db[_0xafad('0x19')],{'where':{'$or':[{'role':_0xafad('0x1a')},{'role':_0xafad('0x1b')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0xc2f0=['admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update','utf8','final','parse','hasOwnProperty','use','License','findOne','count','then','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User'];(function(_0x41e9e0,_0x198dc6){var _0x34611e=function(_0x3a5297){while(--_0x3a5297){_0x41e9e0['push'](_0x41e9e0['shift']());}};_0x34611e(++_0x198dc6);}(_0xc2f0,0xaa));var _0x0c2f=function(_0x25c5c1,_0x25a347){_0x25c5c1=_0x25c5c1-0x0;var _0x271cc4=_0xc2f0[_0x25c5c1];return _0x271cc4;};'use strict';var crypto=require(_0x0c2f('0x0'));var util=require(_0x0c2f('0x1'));var compose=require(_0x0c2f('0x2'));var db=require(_0x0c2f('0x3'))['db'];var config=require(_0x0c2f('0x4'));function getValueFromLicense(_0x166643,_0x42da1f){if(_0x166643&&_0x42da1f){if(_0x42da1f[_0x0c2f('0x5')]&&_0x42da1f[_0x0c2f('0x6')]){var _0x448274=_0x42da1f[_0x0c2f('0x5')];var _0x564641=_0x42da1f[_0x0c2f('0x6')];var _0x2c66b1=_0x448274[_0x0c2f('0x7')]('-')[0x4];var _0x412fca=_0x448274[_0x0c2f('0x7')]('-')[0x0];var _0x1ea7de=crypto[_0x0c2f('0x8')](_0x0c2f('0x9'),util['format']('%s:%s:%s',_0x2c66b1,_0x448274,_0x412fca));var _0x3558bc=_0x1ea7de[_0x0c2f('0xa')](_0x564641,'base64',_0x0c2f('0xb'));_0x3558bc+=_0x1ea7de[_0x0c2f('0xc')](_0x0c2f('0xb'));var _0x3c39f9=JSON[_0x0c2f('0xd')](_0x3558bc);return _0x3c39f9[_0x0c2f('0xe')](_0x166643)?_0x3c39f9[_0x166643]:null;}}return null;}function isLimit(_0x11f0fb,_0x8cd08,_0x23dcbd,_0x46cb3d){var _0x3015be=_0x8cd08;return compose()[_0x0c2f('0xf')](function(_0x247d6c,_0x45efa3,_0x1adaa6){return db[_0x0c2f('0x10')][_0x0c2f('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3b172f){var _0x29578d=getValueFromLicense(_0x11f0fb,_0x3b172f);return _0x29578d?_0x29578d:_0x3015be;})['then'](function(_0x329581){_0x3015be=_0x329581;return _0x23dcbd[_0x0c2f('0x12')](_0x46cb3d);})[_0x0c2f('0x13')](function(_0x4deaf7){if(_0x4deaf7>=_0x3015be){return _0x45efa3[_0x0c2f('0x14')](0x193)[_0x0c2f('0x15')]({'message':util[_0x0c2f('0x16')](_0x0c2f('0x17'),_0x11f0fb)});}_0x1adaa6();})[_0x0c2f('0x18')](function(_0x3db901){_0x1adaa6(_0x3db901);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x0c2f('0x19')],{'where':{'$or':[{'role':_0x0c2f('0x1a')},{'role':_0x0c2f('0x1b')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file