1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.BAdminStaffTwoFactorQRCode= function() {}
8 Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype, {
11 'dc7b0c7f9d3941532bda06cd58eec7bd' :"<ol class='qr-list' start=\"1\">\n <li>Open Google Authenticator in your phone, and scan this QR code.</li>\n</ol>",
12 '2194867d6c27ce97cd1f0a5db8d5c95e' :"Setup 2-Factor Authentication",
13 '5d412a3d8de0189df31c8f331e2e6630' :"<ol class='qr-list' start=\"2\">\n <li>After adding this to Google Authenticator, type in the generated number below to confirm.</li>\n</ol>",
14 '131e3875e777f6c9a8e510f96a4d20d2' :"Skip for now",
15 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
16 'ee468f72ab7fe4937fb014d6fcea540b' :"Enter Two factor Authentication code",
17 '70d9be9b139893aa6c69b5e77e614311' :"Confirm"
20 'two_factor_auth_code_fieldLabel' : 'ee468f72ab7fe4937fb014d6fcea540b' /* Enter Two factor Authentication code */
26 show : function(data, cb)
34 this.dialog.show(this.data._el);
37 this.form.setValues(data);
38 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
46 this.dialog = Roo.factory({
50 cls : 'enable-overflow coba-qr-dialog',
51 title : _this._strings['2194867d6c27ce97cd1f0a5db8d5c95e'] /* Setup 2-Factor Authentication */,
53 hide : function (_self)
56 _this.callback.call(_this, false);
60 show : function (_self)
62 if(!Pman.Login.authUser) {
63 Roo.bootstrap.MessageBox.alert('Error', 'Please login again');
69 _this.data.id.length == 0
71 Roo.bootstrap.MessageBox.alert('Error', 'Please select a person again');
75 _this.dialog.closeEl.hide();
77 _this.cancelBtn.hide();
79 if(_this.data.allow_close) {
80 _this.dialog.closeEl.show();
84 if(_this.data.allow_cancel) {
85 _this.cancelBtn.show();
89 url: baseURL + '/Roo/Core_person.php',
97 success : function(res) {
98 _this.qrcode_image.setSrc(res.data.image);
99 _this.secret.setValue(res.data.secret);
102 failure : function(res) {
109 '|xns' : 'Roo.bootstrap',
113 html : _this._strings['131e3875e777f6c9a8e510f96a4d20d2'] /* Skip for now */,
116 click : function (_self, e)
122 render : function (_self)
124 _this.skipBtn = this;
128 '|xns' : 'Roo.bootstrap'
132 html : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
135 click : function (_self, e)
141 render : function (_self)
143 _this.cancelBtn = this;
147 '|xns' : 'Roo.bootstrap'
151 html : _this._strings['70d9be9b139893aa6c69b5e77e614311'] /* Confirm */,
154 click : function (_self, e)
156 _this.form.doAction('submit');
160 '|xns' : 'Roo.bootstrap'
167 '|xns' : 'Roo.bootstrap',
173 '|xns' : 'Roo.bootstrap',
178 '|xns' : 'Roo.bootstrap',
184 '|xns' : 'Roo.bootstrap',
188 html : _this._strings['dc7b0c7f9d3941532bda06cd58eec7bd'] /*
189 <ol class='qr-list' start="1">
190 <li>Open Google Authenticator in your phone, and scan this QR code.</li>
195 '|xns' : 'Roo.bootstrap'
204 '|xns' : 'Roo.bootstrap',
211 '|xns' : 'Roo.bootstrap',
216 imgResponsive : false,
219 render : function (_self)
221 _this.qrcode_image = this;
223 this.el.setVisibilityMode(Roo.Element.DISPLAY);
228 '|xns' : 'Roo.bootstrap'
237 '|xns' : 'Roo.bootstrap',
243 '|xns' : 'Roo.bootstrap',
247 html : _this._strings['5d412a3d8de0189df31c8f331e2e6630'] /*
248 <ol class='qr-list' start="2">
249 <li>After adding this to Google Authenticator, type in the generated number below to confirm.</li>
254 '|xns' : 'Roo.bootstrap'
267 '|xns' : 'Roo.bootstrap',
273 '|xns' : 'Roo.bootstrap',
278 '|xns' : 'Roo.bootstrap',
284 '|xns' : 'Roo.bootstrap',
288 html : _this._strings['dc7b0c7f9d3941532bda06cd58eec7bd'] /*
289 <ol class='qr-list' start="1">
290 <li>Open Google Authenticator in your phone, and scan this QR code.</li>
295 '|xns' : 'Roo.bootstrap'
304 '|xns' : 'Roo.bootstrap',
311 '|xns' : 'Roo.bootstrap',
316 imgResponsive : false,
319 render : function (_self)
321 _this.qrcode_image = this;
323 this.el.setVisibilityMode(Roo.Element.DISPLAY);
328 '|xns' : 'Roo.bootstrap'
337 '|xns' : 'Roo.bootstrap',
343 '|xns' : 'Roo.bootstrap',
347 html : _this._strings['5d412a3d8de0189df31c8f331e2e6630'] /*
348 <ol class='qr-list' start="2">
349 <li>After adding this to Google Authenticator, type in the generated number below to confirm.</li>
354 '|xns' : 'Roo.bootstrap'
367 '|xns' : 'Roo.bootstrap',
373 '|xns' : 'Roo.bootstrap',
378 url : baseURL + '/Roo/Core_person.php',
380 actioncomplete : function (_self, action)
382 if(action.type == 'setdata') {
387 if(action.type == 'submit') {
389 switch(action.result.data) {
392 var cb = function() {
396 Roo.bootstrap.MessageBox.alert('Success', 'Two Factor authentication has been enabled', cb);
400 Roo.log('invalid usage');
405 actionfailed : function (_self, action)
407 if(action.type == 'submit') {
409 switch(action.result.errorMsg) {
410 case '_invalid_auth_code':
411 Roo.bootstrap.MessageBox.alert(
412 'Invalid authentication code',
413 'Please re-enter the latest authentication code.'
417 Roo.log('invalid usage');
422 render : function (_self)
428 '|xns' : 'Roo.bootstrap',
431 xtype : 'NumberField',
433 allowDecimals : false,
434 allowNegative : false,
436 decimalPrecision : 0,
437 fieldLabel : _this._strings['ee468f72ab7fe4937fb014d6fcea540b'] /* Enter Two factor Authentication code */,
438 indicatorpos : 'right',
441 name : 'two_factor_auth_code',
444 '|xns' : 'Roo.bootstrap'
448 inputType : 'hidden',
451 '|xns' : 'Roo.bootstrap'
463 Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode, Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype);