Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / user / user.model.js
index e58bbd5..663bf72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf430=['chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','push','Authenticate','password','ChanSpy','name','options','wav','gsm','system','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','exports','models','User','users','utf8','utf8_bin','changed','updateMd5Password','updatePassword','bulkCreate','VoiceExtension','resolve','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt',':asterisk:','md5secret','bluebird','crypto','util','lodash','./user.attributes','length','context','from-sip','%s%s','prefix','Set','format','CDR(type)=%s'];(function(_0x210ccc,_0x18a85a){var _0x334164=function(_0x2fd28a){while(--_0x2fd28a){_0x210ccc['push'](_0x210ccc['shift']());}};_0x334164(++_0x18a85a);}(_0xf430,0x1e4));var _0x0f43=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0xf430[_0xd63e3a];return _0x19c178;};'use strict';var BPromise=require(_0x0f43('0x0'));var crypto=require(_0x0f43('0x1'));var util=require(_0x0f43('0x2'));var md5=require('md5');var _=require(_0x0f43('0x3'));var attributes=require(_0x0f43('0x4'));var authTypes=['google'];var validatePresenceOf=function(_0x4e2851){return _0x4e2851&&_0x4e2851[_0x0f43('0x5')];};var getChanSpyApplications=function(_0x52c285,_0x260266,_0x47926f){var _0x5edfba={'context':_0x52c285[_0x0f43('0x6')]||_0x0f43('0x7'),'type':'system','isApp':![],'UserId':_0x52c285['id']};var _0x2e8f68=[];for(var _0x39bc4c=0x0,_0x18e735=0x1;_0x39bc4c<_0x47926f['length'];_0x39bc4c++,_0x18e735=0x1){var _0xd12ce1={'exten':util['format'](_0x0f43('0x8'),_0x47926f[_0x39bc4c][_0x0f43('0x9')],_0x260266),'ChanSpyId':_0x47926f[_0x39bc4c]['id']};_0x2e8f68['push'](_['merge']({'app':_0x0f43('0xa'),'appdata':util[_0x0f43('0xb')](_0x0f43('0xc'),_0x0f43('0xd')),'priority':_0x18e735++},_0x5edfba,_0xd12ce1));if(_0x47926f[_0x39bc4c][_0x0f43('0xe')]){_0x2e8f68['push'](_[_0x0f43('0xf')]({'app':_0x0f43('0x10'),'appdata':util[_0x0f43('0xb')](_0x0f43('0x11'),_0x47926f[_0x39bc4c][_0x0f43('0x12')]),'priority':_0x18e735++},_0x5edfba,_0xd12ce1));}if(_0x47926f[_0x39bc4c][_0x0f43('0x13')]){_0x2e8f68[_0x0f43('0x14')](_[_0x0f43('0xf')]({'app':_0x0f43('0x15'),'appdata':_0x47926f[_0x39bc4c][_0x0f43('0x16')],'priority':_0x18e735++},_0x5edfba,_0xd12ce1));}_0x2e8f68[_0x0f43('0x14')](_['merge']({'app':_0x0f43('0x17'),'appdata':util[_0x0f43('0xb')]('SIP/%s,%s',_0x52c285[_0x0f43('0x18')],_0x47926f[_0x39bc4c][_0x0f43('0x19')]?_0x47926f[_0x39bc4c][_0x0f43('0x19')]['join'](''):''),'priority':_0x18e735++},_0x5edfba,_0xd12ce1));if(_0x47926f[_0x39bc4c][_0x0f43('0xe')]){_0x2e8f68['push'](_[_0x0f43('0xf')]({'app':'StopMixMonitor','priority':_0x18e735++},_0x5edfba,_0xd12ce1));}}return _0x2e8f68;};var getUserApplications=function(_0x4e294b,_0x3e25fa){var _0x5a7351=[_0x0f43('0x1a'),'WAV',_0x0f43('0x1b')];var _0x2263ab={'context':_0x4e294b[_0x0f43('0x6')]||_0x0f43('0x7'),'exten':_0x3e25fa,'type':_0x0f43('0x1c'),'isApp':![],'UserId':_0x4e294b['id']};var _0x3b9785=[{'app':'Set','appdata':_0x0f43('0x1d')}];if(_0x4e294b[_0x0f43('0x1e')]&&_[_0x0f43('0x1f')](_0x5a7351,_0x4e294b[_0x0f43('0x1e')])){_0x3b9785[_0x0f43('0x14')]({'app':_0x0f43('0xa'),'appdata':_0x0f43('0x20')});_0x3b9785[_0x0f43('0x14')]({'app':'Set','appdata':util['format'](_0x0f43('0x21'),_0x4e294b['extensionMonitor'])});_0x3b9785[_0x0f43('0x14')]({'app':_0x0f43('0x22'),'appdata':util[_0x0f43('0xb')](_0x0f43('0x23'),_0x4e294b['name'])});}else{_0x3b9785[_0x0f43('0x14')]({'app':_0x0f43('0x22'),'appdata':util[_0x0f43('0xb')]('SIP/%s,,tTxX',_0x4e294b['name'])});}_0x3b9785['push']({'app':'Hangup'});for(var _0xe3704e=0x0;_0xe3704e<_0x3b9785[_0x0f43('0x5')];_0xe3704e++){_0x3b9785[_0xe3704e][_0x0f43('0x24')]=_0xe3704e+0x1;_0x3b9785[_0xe3704e]=_[_0x0f43('0x25')](_0x3b9785[_0xe3704e],_0x2263ab);}return _0x3b9785;};var getChanSpyPromise=function(_0x17696d,_0x1a70d0){return new BPromise(function(_0x499b6b,_0x417bd7){return _0x17696d[_0x0f43('0x26')][_0x0f43('0x27')]()[_0x0f43('0x28')](function(_0x191444){if(_0x191444){var _0x5e462a=getChanSpyApplications(_0x1a70d0,_0x1a70d0[_0x0f43('0x29')],_0x191444);if(_0x1a70d0[_0x0f43('0x29')]!=_0x1a70d0[_0x0f43('0x18')]){_0x5e462a=_0x5e462a[_0x0f43('0x2a')](getChanSpyApplications(_0x1a70d0,_0x1a70d0['name'],_0x191444));}return _0x499b6b(_0x5e462a);}return _0x499b6b([]);})[_0x0f43('0x2b')](function(_0x37e5f7){_0x417bd7(_0x37e5f7);});});};module[_0x0f43('0x2c')]=function(_0x33b34d,_0x547c3d){var _0x472667=_0x33b34d[_0x0f43('0x2d')];return _0x33b34d['define'](_0x0f43('0x2e'),attributes,{'tableName':_0x0f43('0x2f'),'charset':_0x0f43('0x30'),'collate':_0x0f43('0x31'),'hooks':{'beforeCreate':function(_0x534c55,_0x2fdfa1,_0x4be7d4){_0x534c55['updateMd5Password']();_0x534c55['updatePassword'](_0x4be7d4);},'beforeUpdate':function(_0x82b437,_0x298d93,_0x502708){if(_0x82b437[_0x0f43('0x32')](_0x0f43('0x16'))){_0x82b437[_0x0f43('0x33')]();return _0x82b437[_0x0f43('0x34')](_0x502708);}_0x502708();},'afterCreate':function(_0x55fc57,_0x17ff50,_0x5830a2){var _0x39a414=getUserApplications(_0x55fc57,_0x55fc57[_0x0f43('0x29')]);if(_0x55fc57['internal']!=_0x55fc57[_0x0f43('0x18')]){_0x39a414=_0x39a414['concat'](getUserApplications(_0x55fc57,_0x55fc57[_0x0f43('0x18')]));}return _0x472667['VoiceExtension'][_0x0f43('0x35')](_0x39a414)[_0x0f43('0x28')](function(){if(_0x55fc57[_0x0f43('0xd')]){return getChanSpyPromise(_0x472667,_0x55fc57);}})[_0x0f43('0x28')](function(_0x5cadd5){if(_0x5cadd5&&_0x5cadd5[_0x0f43('0x5')]){return _0x472667[_0x0f43('0x36')][_0x0f43('0x35')](_0x5cadd5);}})[_0x0f43('0x28')](function(){_0x5830a2();})[_0x0f43('0x2b')](function(_0x530dd8){_0x5830a2(_0x530dd8);});},'afterUpdate':function(_0x4ad9f5,_0x2fb351,_0x105b73){return BPromise[_0x0f43('0x37')]()['then'](function(){if(_0x4ad9f5[_0x0f43('0x32')](_0x0f43('0xd'))||_0x4ad9f5['changed'](_0x0f43('0x6'))){return _0x472667[_0x0f43('0x36')][_0x0f43('0x38')]({'where':{'UserId':_0x4ad9f5['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x0f43('0x28')](function(){if(_0x4ad9f5[_0x0f43('0xd')]){return getChanSpyPromise(_0x472667,_0x4ad9f5)[_0x0f43('0x28')](function(_0x198678){if(_0x198678&&_0x198678['length']){return _0x472667[_0x0f43('0x36')][_0x0f43('0x35')](_0x198678);}});}});}})[_0x0f43('0x28')](function(){if(_0x4ad9f5['changed']('extensionMonitor')||_0x4ad9f5[_0x0f43('0x32')](_0x0f43('0x6'))){return _0x472667[_0x0f43('0x36')][_0x0f43('0x38')]({'where':{'UserId':_0x4ad9f5['id'],'type':'system','ChanSpyId':null}})[_0x0f43('0x28')](function(){var _0x35e7a5=getUserApplications(_0x4ad9f5,_0x4ad9f5['internal']);if(_0x4ad9f5[_0x0f43('0x29')]!=_0x4ad9f5[_0x0f43('0x18')]){_0x35e7a5=_0x35e7a5['concat'](getUserApplications(_0x4ad9f5,_0x4ad9f5[_0x0f43('0x18')]));}return _0x472667[_0x0f43('0x36')]['bulkCreate'](_0x35e7a5);});}})[_0x0f43('0x28')](function(){_0x105b73();})[_0x0f43('0x2b')](function(_0x27af32){_0x105b73(_0x27af32);});},'afterDestroy':function(_0x2d71d8,_0x3d53d1){return _0x472667[_0x0f43('0x36')][_0x0f43('0x38')]({'where':{'UserId':_0x2d71d8['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x259f5b,_0x4a865e){if(!_0x4a865e){return this['password']===this[_0x0f43('0x39')](_0x259f5b);}var _0x11ba49=this;this[_0x0f43('0x39')](_0x259f5b,function(_0x50d64e,_0x36e207){if(_0x50d64e){_0x4a865e(_0x50d64e);}if(_0x11ba49['password']===_0x36e207){_0x4a865e(null,!![]);}else{_0x4a865e(null,![]);}});},'makeSalt':function(_0x5b5dfe,_0x4581f8){var _0x2cb23d=0x10;if(typeof arguments[0x0]===_0x0f43('0x3a')){_0x4581f8=arguments[0x0];_0x5b5dfe=_0x2cb23d;}else if(typeof arguments[0x1]===_0x0f43('0x3a')){_0x4581f8=arguments[0x1];}else{throw new Error(_0x0f43('0x3b'));}if(!_0x5b5dfe){_0x5b5dfe=_0x2cb23d;}return crypto[_0x0f43('0x3c')](_0x5b5dfe,function(_0x51d589,_0x485d8f){if(_0x51d589){_0x4581f8(_0x51d589);}return _0x4581f8(null,_0x485d8f[_0x0f43('0x3d')](_0x0f43('0x3e')));});},'encryptPassword':function(_0x3e7b46,_0xf73ca6){if(!_0x3e7b46||!this[_0x0f43('0x3f')]){return _0xf73ca6?_0xf73ca6(null):null;}var _0x5e851d=0x2710;var _0x28c16c=0x40;var _0x2a559d=new Buffer(this[_0x0f43('0x3f')],'base64');if(!_0xf73ca6){return crypto['pbkdf2Sync'](_0x3e7b46,_0x2a559d,_0x5e851d,_0x28c16c,_0x0f43('0x40'))[_0x0f43('0x3d')]('base64');}return crypto[_0x0f43('0x41')](_0x3e7b46,_0x2a559d,_0x5e851d,_0x28c16c,_0x0f43('0x40'),function(_0x3cfe49,_0x5361ca){if(_0x3cfe49){_0xf73ca6(_0x3cfe49);}return _0xf73ca6(null,_0x5361ca[_0x0f43('0x3d')]('base64'));});},'updatePassword':function(_0x29495a){if(!this[_0x0f43('0x16')]){return _0x29495a(null);}if(!validatePresenceOf(this[_0x0f43('0x16')])&&authTypes[_0x0f43('0x42')](this['provider'])===-0x1){_0x29495a(new Error(_0x0f43('0x43')));}var _0x3d627e=this;this[_0x0f43('0x44')](function(_0xd9bfff,_0x2ffc56){if(_0xd9bfff){return _0x29495a(_0xd9bfff);}_0x3d627e[_0x0f43('0x3f')]=_0x2ffc56;_0x3d627e[_0x0f43('0x39')](_0x3d627e[_0x0f43('0x16')],function(_0x511157,_0x4b51b5){if(_0x511157){_0x29495a(_0x511157);}_0x3d627e[_0x0f43('0x16')]=_0x4b51b5;_0x29495a(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x0f43('0x18')]+_0x0f43('0x45')+this[_0x0f43('0x16')]);return this[_0x0f43('0x46')];}}});};
\ No newline at end of file
+var _0xbe45=['VoiceChanSpy','findAll','then','internal','catch','exports','models','define','User','users','utf8','utf8_bin','updateMd5Password','updatePassword','changed','VoiceExtension','resolve','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','base64','salt','pbkdf2Sync','sha1','toString','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','crypto','md5','lodash','./user.attributes','google','length','context','from-sip','system','format','%s%s','push','chanspy','record','merge','MixMonitor','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','wav','WAV','Set','includes','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxX','priority','defaults'];(function(_0x2bbf27,_0xf0b243){var _0x541e75=function(_0xb903e6){while(--_0xb903e6){_0x2bbf27['push'](_0x2bbf27['shift']());}};_0x541e75(++_0xf0b243);}(_0xbe45,0xf0));var _0x5be4=function(_0x29fc32,_0x41bcc5){_0x29fc32=_0x29fc32-0x0;var _0x5b5e47=_0xbe45[_0x29fc32];return _0x5b5e47;};'use strict';var BPromise=require(_0x5be4('0x0'));var crypto=require(_0x5be4('0x1'));var util=require('util');var md5=require(_0x5be4('0x2'));var _=require(_0x5be4('0x3'));var attributes=require(_0x5be4('0x4'));var authTypes=[_0x5be4('0x5')];var validatePresenceOf=function(_0x67400b){return _0x67400b&&_0x67400b[_0x5be4('0x6')];};var getChanSpyApplications=function(_0x513570,_0x423154,_0x1ddd74){var _0x2681c7={'context':_0x513570[_0x5be4('0x7')]||_0x5be4('0x8'),'type':_0x5be4('0x9'),'isApp':![],'UserId':_0x513570['id']};var _0x2a2e93=[];for(var _0x2301ae=0x0,_0x198689=0x1;_0x2301ae<_0x1ddd74[_0x5be4('0x6')];_0x2301ae++,_0x198689=0x1){var _0x4053e9={'exten':util[_0x5be4('0xa')](_0x5be4('0xb'),_0x1ddd74[_0x2301ae]['prefix'],_0x423154),'ChanSpyId':_0x1ddd74[_0x2301ae]['id']};_0x2a2e93[_0x5be4('0xc')](_['merge']({'app':'Set','appdata':util[_0x5be4('0xa')]('CDR(type)=%s',_0x5be4('0xd')),'priority':_0x198689++},_0x2681c7,_0x4053e9));if(_0x1ddd74[_0x2301ae][_0x5be4('0xe')]){_0x2a2e93['push'](_[_0x5be4('0xf')]({'app':_0x5be4('0x10'),'appdata':util[_0x5be4('0xa')]('${UNIQUEID}.%s,ab',_0x1ddd74[_0x2301ae][_0x5be4('0x11')]),'priority':_0x198689++},_0x2681c7,_0x4053e9));}if(_0x1ddd74[_0x2301ae]['auth']){_0x2a2e93[_0x5be4('0xc')](_[_0x5be4('0xf')]({'app':_0x5be4('0x12'),'appdata':_0x1ddd74[_0x2301ae][_0x5be4('0x13')],'priority':_0x198689++},_0x2681c7,_0x4053e9));}_0x2a2e93[_0x5be4('0xc')](_[_0x5be4('0xf')]({'app':_0x5be4('0x14'),'appdata':util['format'](_0x5be4('0x15'),_0x513570[_0x5be4('0x16')],_0x1ddd74[_0x2301ae][_0x5be4('0x17')]?_0x1ddd74[_0x2301ae][_0x5be4('0x17')][_0x5be4('0x18')](''):''),'priority':_0x198689++},_0x2681c7,_0x4053e9));if(_0x1ddd74[_0x2301ae][_0x5be4('0xe')]){_0x2a2e93[_0x5be4('0xc')](_[_0x5be4('0xf')]({'app':'StopMixMonitor','priority':_0x198689++},_0x2681c7,_0x4053e9));}}return _0x2a2e93;};var getUserApplications=function(_0x175630,_0x50b970){var _0x5172d2=[_0x5be4('0x19'),_0x5be4('0x1a'),'gsm'];var _0x88e373={'context':_0x175630[_0x5be4('0x7')]||'from-sip','exten':_0x50b970,'type':'system','isApp':![],'UserId':_0x175630['id']};var _0x2690be=[{'app':_0x5be4('0x1b'),'appdata':'CDR(type)=internal'}];if(_0x175630['extensionMonitor']&&_[_0x5be4('0x1c')](_0x5172d2,_0x175630[_0x5be4('0x1d')])){_0x2690be[_0x5be4('0xc')]({'app':_0x5be4('0x1b'),'appdata':_0x5be4('0x1e')});_0x2690be['push']({'app':_0x5be4('0x1b'),'appdata':util['format'](_0x5be4('0x1f'),_0x175630[_0x5be4('0x1d')])});_0x2690be['push']({'app':_0x5be4('0x20'),'appdata':util[_0x5be4('0xa')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x175630[_0x5be4('0x16')])});}else{_0x2690be[_0x5be4('0xc')]({'app':_0x5be4('0x20'),'appdata':util[_0x5be4('0xa')](_0x5be4('0x21'),_0x175630[_0x5be4('0x16')])});}_0x2690be[_0x5be4('0xc')]({'app':'Hangup'});for(var _0x50e5be=0x0;_0x50e5be<_0x2690be[_0x5be4('0x6')];_0x50e5be++){_0x2690be[_0x50e5be][_0x5be4('0x22')]=_0x50e5be+0x1;_0x2690be[_0x50e5be]=_[_0x5be4('0x23')](_0x2690be[_0x50e5be],_0x88e373);}return _0x2690be;};var getChanSpyPromise=function(_0x5c489e,_0xd88995){return new BPromise(function(_0x15dec0,_0x3bd842){return _0x5c489e[_0x5be4('0x24')][_0x5be4('0x25')]()[_0x5be4('0x26')](function(_0x4b9029){if(_0x4b9029){var _0x1661c2=getChanSpyApplications(_0xd88995,_0xd88995[_0x5be4('0x27')],_0x4b9029);if(_0xd88995['internal']!=_0xd88995[_0x5be4('0x16')]){_0x1661c2=_0x1661c2['concat'](getChanSpyApplications(_0xd88995,_0xd88995[_0x5be4('0x16')],_0x4b9029));}return _0x15dec0(_0x1661c2);}return _0x15dec0([]);})[_0x5be4('0x28')](function(_0x47ecca){_0x3bd842(_0x47ecca);});});};module[_0x5be4('0x29')]=function(_0x53151d,_0x50d906){var _0x11929e=_0x53151d[_0x5be4('0x2a')];return _0x53151d[_0x5be4('0x2b')](_0x5be4('0x2c'),attributes,{'tableName':_0x5be4('0x2d'),'charset':_0x5be4('0x2e'),'collate':_0x5be4('0x2f'),'hooks':{'beforeCreate':function(_0x3fd82f,_0x1fc0bd,_0x3cb75f){_0x3fd82f[_0x5be4('0x30')]();_0x3fd82f[_0x5be4('0x31')](_0x3cb75f);},'beforeUpdate':function(_0x5c1260,_0x4b267c,_0x31e023){if(_0x5c1260[_0x5be4('0x32')](_0x5be4('0x13'))){_0x5c1260[_0x5be4('0x30')]();return _0x5c1260['updatePassword'](_0x31e023);}_0x31e023();},'afterCreate':function(_0x2645ce,_0x4ae580,_0x262550){var _0x5399b7=getUserApplications(_0x2645ce,_0x2645ce[_0x5be4('0x27')]);if(_0x2645ce[_0x5be4('0x27')]!=_0x2645ce['name']){_0x5399b7=_0x5399b7['concat'](getUserApplications(_0x2645ce,_0x2645ce[_0x5be4('0x16')]));}return _0x11929e['VoiceExtension']['bulkCreate'](_0x5399b7)[_0x5be4('0x26')](function(){if(_0x2645ce[_0x5be4('0xd')]){return getChanSpyPromise(_0x11929e,_0x2645ce);}})[_0x5be4('0x26')](function(_0x55253d){if(_0x55253d&&_0x55253d[_0x5be4('0x6')]){return _0x11929e[_0x5be4('0x33')]['bulkCreate'](_0x55253d);}})[_0x5be4('0x26')](function(){_0x262550();})[_0x5be4('0x28')](function(_0x207f0b){_0x262550(_0x207f0b);});},'afterUpdate':function(_0x2f8442,_0x4e30f8,_0x68cd9){return BPromise[_0x5be4('0x34')]()[_0x5be4('0x26')](function(){if(_0x2f8442[_0x5be4('0x32')](_0x5be4('0xd'))||_0x2f8442[_0x5be4('0x32')](_0x5be4('0x7'))){return _0x11929e[_0x5be4('0x33')]['destroy']({'where':{'UserId':_0x2f8442['id'],'type':_0x5be4('0x9'),'ChanSpyId':{'$ne':null}}})[_0x5be4('0x26')](function(){if(_0x2f8442[_0x5be4('0xd')]){return getChanSpyPromise(_0x11929e,_0x2f8442)[_0x5be4('0x26')](function(_0x304fab){if(_0x304fab&&_0x304fab['length']){return _0x11929e[_0x5be4('0x33')][_0x5be4('0x35')](_0x304fab);}});}});}})['then'](function(){if(_0x2f8442[_0x5be4('0x32')](_0x5be4('0x1d'))||_0x2f8442['changed'](_0x5be4('0x7'))){return _0x11929e[_0x5be4('0x33')][_0x5be4('0x36')]({'where':{'UserId':_0x2f8442['id'],'type':_0x5be4('0x9'),'ChanSpyId':null}})[_0x5be4('0x26')](function(){var _0x14ae03=getUserApplications(_0x2f8442,_0x2f8442[_0x5be4('0x27')]);if(_0x2f8442[_0x5be4('0x27')]!=_0x2f8442[_0x5be4('0x16')]){_0x14ae03=_0x14ae03['concat'](getUserApplications(_0x2f8442,_0x2f8442[_0x5be4('0x16')]));}return _0x11929e['VoiceExtension'][_0x5be4('0x35')](_0x14ae03);});}})[_0x5be4('0x26')](function(){_0x68cd9();})['catch'](function(_0x31047c){_0x68cd9(_0x31047c);});},'afterDestroy':function(_0x48c1db,_0x595656){return _0x11929e[_0x5be4('0x33')][_0x5be4('0x36')]({'where':{'UserId':_0x48c1db['id'],'type':_0x5be4('0x9')}});}},'instanceMethods':{'authenticate':function(_0x2550a9,_0x44fe21){if(!_0x44fe21){return this[_0x5be4('0x13')]===this[_0x5be4('0x37')](_0x2550a9);}var _0x574dc3=this;this[_0x5be4('0x37')](_0x2550a9,function(_0x5ec61d,_0x3343dc){if(_0x5ec61d){_0x44fe21(_0x5ec61d);}if(_0x574dc3['password']===_0x3343dc){_0x44fe21(null,!![]);}else{_0x44fe21(null,![]);}});},'makeSalt':function(_0x23d123,_0x25776f){var _0x5b652a=0x10;if(typeof arguments[0x0]===_0x5be4('0x38')){_0x25776f=arguments[0x0];_0x23d123=_0x5b652a;}else if(typeof arguments[0x1]===_0x5be4('0x38')){_0x25776f=arguments[0x1];}else{throw new Error(_0x5be4('0x39'));}if(!_0x23d123){_0x23d123=_0x5b652a;}return crypto['randomBytes'](_0x23d123,function(_0x17fabd,_0xe0ccbc){if(_0x17fabd){_0x25776f(_0x17fabd);}return _0x25776f(null,_0xe0ccbc['toString'](_0x5be4('0x3a')));});},'encryptPassword':function(_0x4d9bbb,_0x509a62){if(!_0x4d9bbb||!this[_0x5be4('0x3b')]){return _0x509a62?_0x509a62(null):null;}var _0x15226b=0x2710;var _0x5c614d=0x40;var _0x47734f=new Buffer(this['salt'],'base64');if(!_0x509a62){return crypto[_0x5be4('0x3c')](_0x4d9bbb,_0x47734f,_0x15226b,_0x5c614d,_0x5be4('0x3d'))[_0x5be4('0x3e')]('base64');}return crypto['pbkdf2'](_0x4d9bbb,_0x47734f,_0x15226b,_0x5c614d,_0x5be4('0x3d'),function(_0x2fb7cd,_0x117a92){if(_0x2fb7cd){_0x509a62(_0x2fb7cd);}return _0x509a62(null,_0x117a92[_0x5be4('0x3e')]('base64'));});},'updatePassword':function(_0x31de3a){if(!this[_0x5be4('0x13')]){return _0x31de3a(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0x5be4('0x3f')](this[_0x5be4('0x40')])===-0x1){_0x31de3a(new Error(_0x5be4('0x41')));}var _0x5617af=this;this[_0x5be4('0x42')](function(_0x3481c9,_0xc9ca2f){if(_0x3481c9){return _0x31de3a(_0x3481c9);}_0x5617af[_0x5be4('0x3b')]=_0xc9ca2f;_0x5617af[_0x5be4('0x37')](_0x5617af[_0x5be4('0x13')],function(_0x1396ce,_0x1e1565){if(_0x1396ce){_0x31de3a(_0x1396ce);}_0x5617af[_0x5be4('0x13')]=_0x1e1565;_0x31de3a(null);});});},'updateMd5Password':function(){this[_0x5be4('0x43')]=md5(this['name']+_0x5be4('0x44')+this['password']);return this[_0x5be4('0x43')];}}});};
\ No newline at end of file