Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / user / user.model.js
index f8a3334..88ff483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x274f=['internal','catch','exports','define','User','users','utf8','utf8_bin','updateMd5Password','updatePassword','changed','concat','VoiceExtension','bulkCreate','resolve','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','sha1','indexOf','provider','makeSalt','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes','google','context','length','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','chanspy','record','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','wav','WAV','gsm','system','CDR(type)=internal','extensionMonitor','includes','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','name','Hangup','priority','VoiceChanSpy','findAll','then'];(function(_0x419019,_0x50feb8){var _0x2ea012=function(_0x3f000c){while(--_0x3f000c){_0x419019['push'](_0x419019['shift']());}};_0x2ea012(++_0x50feb8);}(_0x274f,0xeb));var _0xf274=function(_0x26f9d0,_0x3f1281){_0x26f9d0=_0x26f9d0-0x0;var _0x5a43f4=_0x274f[_0x26f9d0];return _0x5a43f4;};'use strict';var BPromise=require(_0xf274('0x0'));var crypto=require(_0xf274('0x1'));var util=require(_0xf274('0x2'));var md5=require(_0xf274('0x3'));var _=require(_0xf274('0x4'));var attributes=require(_0xf274('0x5'));var authTypes=[_0xf274('0x6')];var validatePresenceOf=function(_0x590158){return _0x590158&&_0x590158['length'];};var getChanSpyApplications=function(_0xffc7e3,_0x4d0af7,_0x304413){var _0x400e6d={'context':_0xffc7e3[_0xf274('0x7')]||'from-sip','type':'system','isApp':![],'UserId':_0xffc7e3['id']};var _0x48e422=[];for(var _0x303107=0x0,_0x1beaae=0x1;_0x303107<_0x304413[_0xf274('0x8')];_0x303107++,_0x1beaae=0x1){var _0x1a156c={'exten':util['format'](_0xf274('0x9'),_0x304413[_0x303107][_0xf274('0xa')],_0x4d0af7),'ChanSpyId':_0x304413[_0x303107]['id']};_0x48e422[_0xf274('0xb')](_[_0xf274('0xc')]({'app':_0xf274('0xd'),'appdata':util[_0xf274('0xe')](_0xf274('0xf'),_0xf274('0x10')),'priority':_0x1beaae++},_0x400e6d,_0x1a156c));if(_0x304413[_0x303107][_0xf274('0x11')]){_0x48e422[_0xf274('0xb')](_[_0xf274('0xc')]({'app':'MixMonitor','appdata':util[_0xf274('0xe')](_0xf274('0x12'),_0x304413[_0x303107]['recordingFormat']),'priority':_0x1beaae++},_0x400e6d,_0x1a156c));}if(_0x304413[_0x303107]['auth']){_0x48e422[_0xf274('0xb')](_[_0xf274('0xc')]({'app':_0xf274('0x13'),'appdata':_0x304413[_0x303107][_0xf274('0x14')],'priority':_0x1beaae++},_0x400e6d,_0x1a156c));}_0x48e422['push'](_[_0xf274('0xc')]({'app':_0xf274('0x15'),'appdata':util[_0xf274('0xe')](_0xf274('0x16'),_0xffc7e3['name'],_0x304413[_0x303107][_0xf274('0x17')]?_0x304413[_0x303107][_0xf274('0x17')][_0xf274('0x18')](''):''),'priority':_0x1beaae++},_0x400e6d,_0x1a156c));if(_0x304413[_0x303107]['record']){_0x48e422[_0xf274('0xb')](_[_0xf274('0xc')]({'app':_0xf274('0x19'),'priority':_0x1beaae++},_0x400e6d,_0x1a156c));}}return _0x48e422;};var getUserApplications=function(_0x3ff4b4,_0x52472b){var _0x4f7576=[_0xf274('0x1a'),_0xf274('0x1b'),_0xf274('0x1c')];var _0x9ba09c={'context':_0x3ff4b4['context']||'from-sip','exten':_0x52472b,'type':_0xf274('0x1d'),'isApp':![],'UserId':_0x3ff4b4['id']};var _0x1e9e34=[{'app':_0xf274('0xd'),'appdata':_0xf274('0x1e')}];if(_0x3ff4b4[_0xf274('0x1f')]&&_[_0xf274('0x20')](_0x4f7576,_0x3ff4b4['extensionMonitor'])){_0x1e9e34['push']({'app':_0xf274('0xd'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x1e9e34[_0xf274('0xb')]({'app':_0xf274('0xd'),'appdata':util[_0xf274('0xe')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x3ff4b4[_0xf274('0x1f')])});_0x1e9e34[_0xf274('0xb')]({'app':'Dial','appdata':util['format'](_0xf274('0x21'),_0x3ff4b4['name'])});}else{_0x1e9e34['push']({'app':'Dial','appdata':util[_0xf274('0xe')](_0xf274('0x22'),_0x3ff4b4[_0xf274('0x23')])});}_0x1e9e34[_0xf274('0xb')]({'app':_0xf274('0x24')});for(var _0x233c50=0x0;_0x233c50<_0x1e9e34[_0xf274('0x8')];_0x233c50++){_0x1e9e34[_0x233c50][_0xf274('0x25')]=_0x233c50+0x1;_0x1e9e34[_0x233c50]=_['defaults'](_0x1e9e34[_0x233c50],_0x9ba09c);}return _0x1e9e34;};var getChanSpyPromise=function(_0xc497d3,_0x454156){return new BPromise(function(_0x32b513,_0x3216bf){return _0xc497d3[_0xf274('0x26')][_0xf274('0x27')]()[_0xf274('0x28')](function(_0xe93a64){if(_0xe93a64){var _0xb875e=getChanSpyApplications(_0x454156,_0x454156['internal'],_0xe93a64);if(_0x454156[_0xf274('0x29')]!=_0x454156[_0xf274('0x23')]){_0xb875e=_0xb875e['concat'](getChanSpyApplications(_0x454156,_0x454156[_0xf274('0x23')],_0xe93a64));}return _0x32b513(_0xb875e);}return _0x32b513([]);})[_0xf274('0x2a')](function(_0x65a96d){_0x3216bf(_0x65a96d);});});};module[_0xf274('0x2b')]=function(_0x17d8e4,_0xcb9416){var _0x38429a=_0x17d8e4['models'];return _0x17d8e4[_0xf274('0x2c')](_0xf274('0x2d'),attributes,{'tableName':_0xf274('0x2e'),'charset':_0xf274('0x2f'),'collate':_0xf274('0x30'),'hooks':{'beforeCreate':function(_0x108e2f,_0x12486b,_0x3f98d6){_0x108e2f[_0xf274('0x31')]();_0x108e2f[_0xf274('0x32')](_0x3f98d6);},'beforeUpdate':function(_0x505a1c,_0x567308,_0x5562ed){if(_0x505a1c[_0xf274('0x33')](_0xf274('0x14'))){_0x505a1c['updateMd5Password']();return _0x505a1c[_0xf274('0x32')](_0x5562ed);}_0x5562ed();},'afterCreate':function(_0x1116d4,_0x527a8e,_0x1d72df){var _0x15d0c9=getUserApplications(_0x1116d4,_0x1116d4[_0xf274('0x29')]);if(_0x1116d4[_0xf274('0x29')]!=_0x1116d4[_0xf274('0x23')]){_0x15d0c9=_0x15d0c9[_0xf274('0x34')](getUserApplications(_0x1116d4,_0x1116d4['name']));}return _0x38429a[_0xf274('0x35')][_0xf274('0x36')](_0x15d0c9)[_0xf274('0x28')](function(){if(_0x1116d4['chanspy']){return getChanSpyPromise(_0x38429a,_0x1116d4);}})[_0xf274('0x28')](function(_0x2d0d29){if(_0x2d0d29&&_0x2d0d29['length']){return _0x38429a[_0xf274('0x35')][_0xf274('0x36')](_0x2d0d29);}})[_0xf274('0x28')](function(){_0x1d72df();})[_0xf274('0x2a')](function(_0x3f582d){_0x1d72df(_0x3f582d);});},'afterUpdate':function(_0x4b0847,_0x2692bc,_0x19027d){return BPromise[_0xf274('0x37')]()[_0xf274('0x28')](function(){if(_0x4b0847[_0xf274('0x33')]('chanspy')||_0x4b0847[_0xf274('0x33')](_0xf274('0x7'))){return _0x38429a['VoiceExtension'][_0xf274('0x38')]({'where':{'UserId':_0x4b0847['id'],'type':_0xf274('0x1d'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x4b0847[_0xf274('0x10')]){return getChanSpyPromise(_0x38429a,_0x4b0847)[_0xf274('0x28')](function(_0xabbf13){if(_0xabbf13&&_0xabbf13[_0xf274('0x8')]){return _0x38429a[_0xf274('0x35')][_0xf274('0x36')](_0xabbf13);}});}});}})[_0xf274('0x28')](function(){if(_0x4b0847[_0xf274('0x33')]('extensionMonitor')||_0x4b0847[_0xf274('0x33')](_0xf274('0x7'))){return _0x38429a[_0xf274('0x35')]['destroy']({'where':{'UserId':_0x4b0847['id'],'type':'system','ChanSpyId':null}})[_0xf274('0x28')](function(){var _0x30cf32=getUserApplications(_0x4b0847,_0x4b0847[_0xf274('0x29')]);if(_0x4b0847[_0xf274('0x29')]!=_0x4b0847[_0xf274('0x23')]){_0x30cf32=_0x30cf32['concat'](getUserApplications(_0x4b0847,_0x4b0847[_0xf274('0x23')]));}return _0x38429a[_0xf274('0x35')][_0xf274('0x36')](_0x30cf32);});}})[_0xf274('0x28')](function(){_0x19027d();})[_0xf274('0x2a')](function(_0xe623ba){_0x19027d(_0xe623ba);});},'afterDestroy':function(_0x572bdc,_0x52f326){return _0x38429a['VoiceExtension'][_0xf274('0x38')]({'where':{'UserId':_0x572bdc['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x24c189,_0x316d6c){if(!_0x316d6c){return this[_0xf274('0x14')]===this['encryptPassword'](_0x24c189);}var _0xb4199c=this;this[_0xf274('0x39')](_0x24c189,function(_0x4e8e0f,_0x5db85b){if(_0x4e8e0f){_0x316d6c(_0x4e8e0f);}if(_0xb4199c[_0xf274('0x14')]===_0x5db85b){_0x316d6c(null,!![]);}else{_0x316d6c(null,![]);}});},'makeSalt':function(_0x3155b3,_0x316173){var _0x111fe8=0x10;if(typeof arguments[0x0]===_0xf274('0x3a')){_0x316173=arguments[0x0];_0x3155b3=_0x111fe8;}else if(typeof arguments[0x1]==='function'){_0x316173=arguments[0x1];}else{throw new Error(_0xf274('0x3b'));}if(!_0x3155b3){_0x3155b3=_0x111fe8;}return crypto[_0xf274('0x3c')](_0x3155b3,function(_0x273c60,_0x4a30ff){if(_0x273c60){_0x316173(_0x273c60);}return _0x316173(null,_0x4a30ff[_0xf274('0x3d')](_0xf274('0x3e')));});},'encryptPassword':function(_0x23e92e,_0x50faf3){if(!_0x23e92e||!this[_0xf274('0x3f')]){return _0x50faf3?_0x50faf3(null):null;}var _0x1bc8d3=0x2710;var _0xb1d7d7=0x40;var _0x268c52=new Buffer(this[_0xf274('0x3f')],_0xf274('0x3e'));if(!_0x50faf3){return crypto['pbkdf2Sync'](_0x23e92e,_0x268c52,_0x1bc8d3,_0xb1d7d7,_0xf274('0x40'))[_0xf274('0x3d')](_0xf274('0x3e'));}return crypto['pbkdf2'](_0x23e92e,_0x268c52,_0x1bc8d3,_0xb1d7d7,_0xf274('0x40'),function(_0x110bd0,_0x118fa3){if(_0x110bd0){_0x50faf3(_0x110bd0);}return _0x50faf3(null,_0x118fa3['toString'](_0xf274('0x3e')));});},'updatePassword':function(_0x2d5cc7){if(!this['password']){return _0x2d5cc7(null);}if(!validatePresenceOf(this[_0xf274('0x14')])&&authTypes[_0xf274('0x41')](this[_0xf274('0x42')])===-0x1){_0x2d5cc7(new Error('Invalid\x20password'));}var _0x5def38=this;this[_0xf274('0x43')](function(_0x312d57,_0x1f314a){if(_0x312d57){return _0x2d5cc7(_0x312d57);}_0x5def38[_0xf274('0x3f')]=_0x1f314a;_0x5def38['encryptPassword'](_0x5def38[_0xf274('0x14')],function(_0x6b1a7c,_0x596a7a){if(_0x6b1a7c){_0x2d5cc7(_0x6b1a7c);}_0x5def38[_0xf274('0x14')]=_0x596a7a;_0x2d5cc7(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0xf274('0x23')]+':asterisk:'+this[_0xf274('0x14')]);return this[_0xf274('0x44')];}}});};
\ No newline at end of file
+var _0x6051=['sha1','provider','Invalid\x20password',':asterisk:','bluebird','crypto','util','lodash','./user.attributes','length','context','system','%s%s','prefix','push','merge','Set','format','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','options','join','wav','from-sip','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','then','internal','concat','catch','exports','models','define','User','users','utf8','utf8_bin','updateMd5Password','updatePassword','changed','bulkCreate','chanspy','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6051,0x8c));var _0x1605=function(_0x340c09,_0xc08941){_0x340c09=_0x340c09-0x0;var _0x1cc1b6=_0x6051[_0x340c09];return _0x1cc1b6;};'use strict';var BPromise=require(_0x1605('0x0'));var crypto=require(_0x1605('0x1'));var util=require(_0x1605('0x2'));var md5=require('md5');var _=require(_0x1605('0x3'));var attributes=require(_0x1605('0x4'));var authTypes=['google'];var validatePresenceOf=function(_0x3ff256){return _0x3ff256&&_0x3ff256[_0x1605('0x5')];};var getChanSpyApplications=function(_0x3a6094,_0x5e76c2,_0x40932f){var _0x51710a={'context':_0x3a6094[_0x1605('0x6')]||'from-sip','type':_0x1605('0x7'),'isApp':![],'UserId':_0x3a6094['id']};var _0x4fcc48=[];for(var _0x51126b=0x0,_0x4f9645=0x1;_0x51126b<_0x40932f[_0x1605('0x5')];_0x51126b++,_0x4f9645=0x1){var _0x340af3={'exten':util['format'](_0x1605('0x8'),_0x40932f[_0x51126b][_0x1605('0x9')],_0x5e76c2),'ChanSpyId':_0x40932f[_0x51126b]['id']};_0x4fcc48[_0x1605('0xa')](_[_0x1605('0xb')]({'app':_0x1605('0xc'),'appdata':util[_0x1605('0xd')]('CDR(type)=%s','chanspy'),'priority':_0x4f9645++},_0x51710a,_0x340af3));if(_0x40932f[_0x51126b][_0x1605('0xe')]){_0x4fcc48['push'](_[_0x1605('0xb')]({'app':_0x1605('0xf'),'appdata':util[_0x1605('0xd')](_0x1605('0x10'),_0x40932f[_0x51126b][_0x1605('0x11')]),'priority':_0x4f9645++},_0x51710a,_0x340af3));}if(_0x40932f[_0x51126b][_0x1605('0x12')]){_0x4fcc48[_0x1605('0xa')](_['merge']({'app':_0x1605('0x13'),'appdata':_0x40932f[_0x51126b][_0x1605('0x14')],'priority':_0x4f9645++},_0x51710a,_0x340af3));}_0x4fcc48[_0x1605('0xa')](_[_0x1605('0xb')]({'app':_0x1605('0x15'),'appdata':util[_0x1605('0xd')]('SIP/%s,%s',_0x3a6094['name'],_0x40932f[_0x51126b][_0x1605('0x16')]?_0x40932f[_0x51126b][_0x1605('0x16')][_0x1605('0x17')](''):''),'priority':_0x4f9645++},_0x51710a,_0x340af3));if(_0x40932f[_0x51126b][_0x1605('0xe')]){_0x4fcc48['push'](_['merge']({'app':'StopMixMonitor','priority':_0x4f9645++},_0x51710a,_0x340af3));}}return _0x4fcc48;};var getUserApplications=function(_0x335f97,_0x2dc5ba){var _0x339e51=[_0x1605('0x18'),'WAV','gsm'];var _0x5c02ec={'context':_0x335f97[_0x1605('0x6')]||_0x1605('0x19'),'exten':_0x2dc5ba,'type':_0x1605('0x7'),'isApp':![],'UserId':_0x335f97['id']};var _0x1b5cfd=[{'app':_0x1605('0xc'),'appdata':_0x1605('0x1a')}];if(_0x335f97['extensionMonitor']&&_['includes'](_0x339e51,_0x335f97[_0x1605('0x1b')])){_0x1b5cfd['push']({'app':_0x1605('0xc'),'appdata':_0x1605('0x1c')});_0x1b5cfd['push']({'app':'Set','appdata':util[_0x1605('0xd')](_0x1605('0x1d'),_0x335f97[_0x1605('0x1b')])});_0x1b5cfd['push']({'app':_0x1605('0x1e'),'appdata':util['format'](_0x1605('0x1f'),_0x335f97[_0x1605('0x20')])});}else{_0x1b5cfd['push']({'app':_0x1605('0x1e'),'appdata':util['format'](_0x1605('0x21'),_0x335f97['name'])});}_0x1b5cfd[_0x1605('0xa')]({'app':_0x1605('0x22')});for(var _0x11b3c3=0x0;_0x11b3c3<_0x1b5cfd[_0x1605('0x5')];_0x11b3c3++){_0x1b5cfd[_0x11b3c3][_0x1605('0x23')]=_0x11b3c3+0x1;_0x1b5cfd[_0x11b3c3]=_[_0x1605('0x24')](_0x1b5cfd[_0x11b3c3],_0x5c02ec);}return _0x1b5cfd;};var getChanSpyPromise=function(_0x14185a,_0x1495dd){return new BPromise(function(_0x574c7b,_0x51cedc){return _0x14185a[_0x1605('0x25')]['findAll']()[_0x1605('0x26')](function(_0x2eb159){if(_0x2eb159){var _0x1f63c8=getChanSpyApplications(_0x1495dd,_0x1495dd[_0x1605('0x27')],_0x2eb159);if(_0x1495dd[_0x1605('0x27')]!=_0x1495dd[_0x1605('0x20')]){_0x1f63c8=_0x1f63c8[_0x1605('0x28')](getChanSpyApplications(_0x1495dd,_0x1495dd['name'],_0x2eb159));}return _0x574c7b(_0x1f63c8);}return _0x574c7b([]);})[_0x1605('0x29')](function(_0x55c052){_0x51cedc(_0x55c052);});});};module[_0x1605('0x2a')]=function(_0x5c2992,_0x278c7d){var _0x1d2abf=_0x5c2992[_0x1605('0x2b')];return _0x5c2992[_0x1605('0x2c')](_0x1605('0x2d'),attributes,{'tableName':_0x1605('0x2e'),'charset':_0x1605('0x2f'),'collate':_0x1605('0x30'),'hooks':{'beforeCreate':function(_0x5a138d,_0x28005a,_0x19bac4){_0x5a138d[_0x1605('0x31')]();_0x5a138d[_0x1605('0x32')](_0x19bac4);},'beforeUpdate':function(_0x565457,_0x3b34db,_0x3cae7d){if(_0x565457[_0x1605('0x33')]('password')){_0x565457[_0x1605('0x31')]();return _0x565457[_0x1605('0x32')](_0x3cae7d);}_0x3cae7d();},'afterCreate':function(_0x4f1e8c,_0x59bc39,_0x183d2e){var _0x5e6f6d=getUserApplications(_0x4f1e8c,_0x4f1e8c[_0x1605('0x27')]);if(_0x4f1e8c[_0x1605('0x27')]!=_0x4f1e8c[_0x1605('0x20')]){_0x5e6f6d=_0x5e6f6d[_0x1605('0x28')](getUserApplications(_0x4f1e8c,_0x4f1e8c[_0x1605('0x20')]));}return _0x1d2abf['VoiceExtension'][_0x1605('0x34')](_0x5e6f6d)['then'](function(){if(_0x4f1e8c[_0x1605('0x35')]){return getChanSpyPromise(_0x1d2abf,_0x4f1e8c);}})[_0x1605('0x26')](function(_0x32674d){if(_0x32674d&&_0x32674d['length']){return _0x1d2abf[_0x1605('0x36')][_0x1605('0x34')](_0x32674d);}})[_0x1605('0x26')](function(){_0x183d2e();})[_0x1605('0x29')](function(_0x376f5e){_0x183d2e(_0x376f5e);});},'afterUpdate':function(_0x27e25d,_0x41922e,_0x587609){return BPromise['resolve']()['then'](function(){if(_0x27e25d['changed']('chanspy')||_0x27e25d[_0x1605('0x33')]('context')){return _0x1d2abf[_0x1605('0x36')]['destroy']({'where':{'UserId':_0x27e25d['id'],'type':_0x1605('0x7'),'ChanSpyId':{'$ne':null}}})[_0x1605('0x26')](function(){if(_0x27e25d[_0x1605('0x35')]){return getChanSpyPromise(_0x1d2abf,_0x27e25d)['then'](function(_0x5bf930){if(_0x5bf930&&_0x5bf930[_0x1605('0x5')]){return _0x1d2abf[_0x1605('0x36')]['bulkCreate'](_0x5bf930);}});}});}})[_0x1605('0x26')](function(){if(_0x27e25d[_0x1605('0x33')]('extensionMonitor')||_0x27e25d[_0x1605('0x33')]('context')){return _0x1d2abf['VoiceExtension']['destroy']({'where':{'UserId':_0x27e25d['id'],'type':_0x1605('0x7'),'ChanSpyId':null}})[_0x1605('0x26')](function(){var _0x9dc25c=getUserApplications(_0x27e25d,_0x27e25d[_0x1605('0x27')]);if(_0x27e25d[_0x1605('0x27')]!=_0x27e25d[_0x1605('0x20')]){_0x9dc25c=_0x9dc25c[_0x1605('0x28')](getUserApplications(_0x27e25d,_0x27e25d[_0x1605('0x20')]));}return _0x1d2abf['VoiceExtension']['bulkCreate'](_0x9dc25c);});}})['then'](function(){_0x587609();})['catch'](function(_0x127376){_0x587609(_0x127376);});},'afterDestroy':function(_0x2616f3,_0x42abe0){return _0x1d2abf[_0x1605('0x36')][_0x1605('0x37')]({'where':{'UserId':_0x2616f3['id'],'type':_0x1605('0x7')}});}},'instanceMethods':{'authenticate':function(_0x5dfaac,_0x2e3682){if(!_0x2e3682){return this[_0x1605('0x14')]===this[_0x1605('0x38')](_0x5dfaac);}var _0x36c7d7=this;this[_0x1605('0x38')](_0x5dfaac,function(_0x6001d7,_0x4ad371){if(_0x6001d7){_0x2e3682(_0x6001d7);}if(_0x36c7d7['password']===_0x4ad371){_0x2e3682(null,!![]);}else{_0x2e3682(null,![]);}});},'makeSalt':function(_0x12fab2,_0x379a7c){var _0x3dae06=0x10;if(typeof arguments[0x0]===_0x1605('0x39')){_0x379a7c=arguments[0x0];_0x12fab2=_0x3dae06;}else if(typeof arguments[0x1]==='function'){_0x379a7c=arguments[0x1];}else{throw new Error(_0x1605('0x3a'));}if(!_0x12fab2){_0x12fab2=_0x3dae06;}return crypto[_0x1605('0x3b')](_0x12fab2,function(_0x22d4f9,_0x1a68b9){if(_0x22d4f9){_0x379a7c(_0x22d4f9);}return _0x379a7c(null,_0x1a68b9[_0x1605('0x3c')](_0x1605('0x3d')));});},'encryptPassword':function(_0x5d14ac,_0x1d13d1){if(!_0x5d14ac||!this['salt']){return _0x1d13d1?_0x1d13d1(null):null;}var _0x2b1b2e=0x2710;var _0x5efb65=0x40;var _0x71412a=new Buffer(this[_0x1605('0x3e')],_0x1605('0x3d'));if(!_0x1d13d1){return crypto[_0x1605('0x3f')](_0x5d14ac,_0x71412a,_0x2b1b2e,_0x5efb65,_0x1605('0x40'))[_0x1605('0x3c')](_0x1605('0x3d'));}return crypto['pbkdf2'](_0x5d14ac,_0x71412a,_0x2b1b2e,_0x5efb65,_0x1605('0x40'),function(_0x41e1b3,_0x4a2c63){if(_0x41e1b3){_0x1d13d1(_0x41e1b3);}return _0x1d13d1(null,_0x4a2c63['toString'](_0x1605('0x3d')));});},'updatePassword':function(_0x2120b5){if(!this[_0x1605('0x14')]){return _0x2120b5(null);}if(!validatePresenceOf(this[_0x1605('0x14')])&&authTypes['indexOf'](this[_0x1605('0x41')])===-0x1){_0x2120b5(new Error(_0x1605('0x42')));}var _0x10d581=this;this['makeSalt'](function(_0x19de80,_0x527e59){if(_0x19de80){return _0x2120b5(_0x19de80);}_0x10d581[_0x1605('0x3e')]=_0x527e59;_0x10d581[_0x1605('0x38')](_0x10d581[_0x1605('0x14')],function(_0x41338e,_0x27bc6d){if(_0x41338e){_0x2120b5(_0x41338e);}_0x10d581[_0x1605('0x14')]=_0x27bc6d;_0x2120b5(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this['name']+_0x1605('0x43')+this[_0x1605('0x14')]);return this['md5secret'];}}});};
\ No newline at end of file