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 '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>",
13 '131e3875e777f6c9a8e510f96a4d20d2' :"Skip for now",
14 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
15 'ee468f72ab7fe4937fb014d6fcea540b' :"Enter Two factor Authentication code",
16 '4674ee874911c910f2356ef9ec6ab7f9' :"Scan this into Google Authenticator",
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['4674ee874911c910f2356ef9ec6ab7f9'] /* Scan this into Google Authenticator */,
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) {
99 _this.qrcode_image.setSrc(res.data.image);
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',
177 html : _this._strings['dc7b0c7f9d3941532bda06cd58eec7bd'] /*
178 <ol class='qr-list' start="1">
179 <li>Open Google Authenticator in your phone, and scan this QR code.</li>
184 '|xns' : 'Roo.bootstrap'
193 '|xns' : 'Roo.bootstrap',
200 '|xns' : 'Roo.bootstrap',
205 imgResponsive : false,
208 render : function (_self)
210 _this.qrcode_image = this;
212 this.el.setVisibilityMode(Roo.Element.DISPLAY);
217 '|xns' : 'Roo.bootstrap'
226 '|xns' : 'Roo.bootstrap',
232 '|xns' : 'Roo.bootstrap',
236 html : _this._strings['5d412a3d8de0189df31c8f331e2e6630'] /*
237 <ol class='qr-list' start="2">
238 <li>After adding this to Google Authenticator, type in the generated number below to confirm.</li>
243 '|xns' : 'Roo.bootstrap'
252 '|xns' : 'Roo.bootstrap',
258 '|xns' : 'Roo.bootstrap',
263 url : baseURL + '/Roo/Core_person.php',
265 actioncomplete : function (_self, action)
267 if(action.type == 'setdata') {
272 if(action.type == 'submit') {
274 switch(action.result.data) {
277 var cb = function() {
281 Roo.bootstrap.MessageBox.alert('Success', 'Two Factor authentication has been enabled', cb);
285 Roo.log('invalid usage');
290 actionfailed : function (_self, action)
292 if(action.type == 'submit') {
294 switch(action.result.errorMsg) {
295 case '_invalid_auth_code':
296 Roo.bootstrap.MessageBox.alert(
297 'Invalid authentication code',
298 'Please re-enter the latest authentication code.'
302 Roo.log('invalid usage');
307 render : function (_self)
313 '|xns' : 'Roo.bootstrap',
316 xtype : 'NumberField',
318 allowDecimals : false,
319 allowNegative : false,
321 decimalPrecision : 0,
322 fieldLabel : _this._strings['ee468f72ab7fe4937fb014d6fcea540b'] /* Enter Two factor Authentication code */,
323 indicatorpos : 'right',
326 name : 'two_factor_auth_code',
329 '|xns' : 'Roo.bootstrap'
333 inputType : 'hidden',
336 '|xns' : 'Roo.bootstrap'
348 Roo.apply(Pman.Dialog.BAdminStaffTwoFactorQRCode, Pman.Dialog.BAdminStaffTwoFactorQRCode.prototype);