Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / components / license / service.js
index a2ae7d1..2bc1506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6c8=['parse','hasOwnProperty','findOne','then','count','status','json','catch','admin','user','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','base64','utf8'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf6c8,0x16b));var _0x8f6c=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xf6c8[_0x1b349a];return _0x5d1f7c;};'use strict';var crypto=require('crypto');var util=require(_0x8f6c('0x0'));var compose=require(_0x8f6c('0x1'));var db=require(_0x8f6c('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5f3326,_0x600f15){if(_0x5f3326&&_0x600f15){if(_0x600f15[_0x8f6c('0x3')]&&_0x600f15[_0x8f6c('0x4')]){var _0x11ccf2=_0x600f15[_0x8f6c('0x3')];var _0x2779b3=_0x600f15[_0x8f6c('0x4')];var _0x5b03af=_0x11ccf2[_0x8f6c('0x5')]('-')[0x4];var _0x35eb7b=_0x11ccf2['split']('-')[0x0];var _0x36f38c=crypto[_0x8f6c('0x6')](_0x8f6c('0x7'),util[_0x8f6c('0x8')]('%s:%s:%s',_0x5b03af,_0x11ccf2,_0x35eb7b));var _0x150d0f=_0x36f38c['update'](_0x2779b3,_0x8f6c('0x9'),_0x8f6c('0xa'));_0x150d0f+=_0x36f38c['final'](_0x8f6c('0xa'));var _0x53c037=JSON[_0x8f6c('0xb')](_0x150d0f);return _0x53c037[_0x8f6c('0xc')](_0x5f3326)?_0x53c037[_0x5f3326]:null;}}return null;}function isLimit(_0x2d1cec,_0x198ec4,_0x5648ff,_0x146e1a){var _0x542bb2=_0x198ec4;return compose()['use'](function(_0x1b049a,_0x5ed4a1,_0x212896){return db['License'][_0x8f6c('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x59ee82){var _0xdfc5d3=getValueFromLicense(_0x2d1cec,_0x59ee82);return _0xdfc5d3?_0xdfc5d3:_0x542bb2;})[_0x8f6c('0xe')](function(_0x48edf9){_0x542bb2=_0x48edf9;return _0x5648ff[_0x8f6c('0xf')](_0x146e1a);})[_0x8f6c('0xe')](function(_0x1b3466){if(_0x1b3466>=_0x542bb2){return _0x5ed4a1[_0x8f6c('0x10')](0x193)[_0x8f6c('0x11')]({'message':util[_0x8f6c('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x2d1cec)});}_0x212896();})[_0x8f6c('0x12')](function(_0x3cbc63){_0x212896(_0x3cbc63);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x8f6c('0x13')},{'role':_0x8f6c('0x14')}]}});}exports[_0x8f6c('0x15')]=isUserLimit;
\ No newline at end of file
+var _0xda3c=['use','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','crypto','util','composable-middleware','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty'];(function(_0x1216f7,_0x443714){var _0x1a1850=function(_0x2081eb){while(--_0x2081eb){_0x1216f7['push'](_0x1216f7['shift']());}};_0x1a1850(++_0x443714);}(_0xda3c,0x1d1));var _0xcda3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xda3c[_0x321bb2];return _0x9c12ed;};'use strict';var crypto=require(_0xcda3('0x0'));var util=require(_0xcda3('0x1'));var compose=require(_0xcda3('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xcda3('0x3'));function getValueFromLicense(_0x3661c3,_0x49cb57){if(_0x3661c3&&_0x49cb57){if(_0x49cb57[_0xcda3('0x4')]&&_0x49cb57['license']){var _0x884a02=_0x49cb57[_0xcda3('0x4')];var _0x455b81=_0x49cb57[_0xcda3('0x5')];var _0x226c4e=_0x884a02['split']('-')[0x4];var _0x2e568c=_0x884a02[_0xcda3('0x6')]('-')[0x0];var _0x311fa7=crypto['createDecipher'](_0xcda3('0x7'),util[_0xcda3('0x8')](_0xcda3('0x9'),_0x226c4e,_0x884a02,_0x2e568c));var _0x3ce395=_0x311fa7[_0xcda3('0xa')](_0x455b81,_0xcda3('0xb'),_0xcda3('0xc'));_0x3ce395+=_0x311fa7['final'](_0xcda3('0xc'));var _0xe18d69=JSON[_0xcda3('0xd')](_0x3ce395);return _0xe18d69[_0xcda3('0xe')](_0x3661c3)?_0xe18d69[_0x3661c3]:null;}}return null;}function isLimit(_0x490ee7,_0x40246a,_0xee4bc,_0x2a3fa4){var _0x3a4470=_0x40246a;return compose()[_0xcda3('0xf')](function(_0x30cd69,_0x1e4f62,_0xa62158){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xcda3('0x10')](function(_0x1cc848){var _0x589b3b=getValueFromLicense(_0x490ee7,_0x1cc848);return _0x589b3b?_0x589b3b:_0x3a4470;})[_0xcda3('0x10')](function(_0x2c275e){_0x3a4470=_0x2c275e;return _0xee4bc['count'](_0x2a3fa4);})['then'](function(_0x4f2e03){if(_0x4f2e03>=_0x3a4470){return _0x1e4f62[_0xcda3('0x11')](0x193)[_0xcda3('0x12')]({'message':util[_0xcda3('0x8')](_0xcda3('0x13'),_0x490ee7)});}_0xa62158();})[_0xcda3('0x14')](function(_0x1e676f){_0xa62158(_0x1e676f);});});}function isUserLimit(){return isLimit(_0xcda3('0x15'),0x1,db[_0xcda3('0x16')],{'where':{'$or':[{'role':_0xcda3('0x17')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file