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.Login= function() {}
8 Roo.apply(Pman.Dialog.Login.prototype, {
11 'e50b62fb8271673bacc2cfd9d80fbe7a' :"Login to the Management Portal",
12 '99dea78007133396a7b8ed70578ac6ae' :"Login",
13 'cfcd208495d565ef66e7dff9f98764da' :"0",
14 'cd4bcecae78474ea24c3f28350758a8c' :"Forgot your password ?",
15 'dc647eb65e6711e155375218212b3964' :"Password",
16 '06cf692a8d2bb0ab8318dc6c839ae931' :"Two-Factor Authentication Number (if relevant)",
17 '11163ed17ad9afc7680bb9e92f15d6fd' :"We have sent you a link to reset your password",
18 '24efa7ee4511563b16144f39706d594f' :"Notice",
19 '643a860f992333b8600ea264aca7c4fc' :"Email Address"
22 'username_placeholder' : '643a860f992333b8600ea264aca7c4fc' /* Email Address */ ,
23 '_force_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ ,
24 'password_placeholder' : 'dc647eb65e6711e155375218212b3964' /* Password */ ,
25 'oath_password_placeholder' : '06cf692a8d2bb0ab8318dc6c839ae931' /* Two-Factor Authentication Number (if relevant) */ ,
26 'OK_html' : '99dea78007133396a7b8ed70578ac6ae' /* Login */
32 show : function(data, cb)
40 this.dialog.show(this.data._el);
43 this.form.setValues(data);
44 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
52 this.dialog = Roo.factory({
55 buttonPosition : 'center',
56 cls : 'enable-overflow login-dialog padding-bottom-trim',
57 _dialog_title_login : _this._strings['e50b62fb8271673bacc2cfd9d80fbe7a'] /* Login to the Management Portal */,
59 btnclick : function (e)
66 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
67 _this.form.doAction('submit');
69 render : function (_self) {
72 _this.dialog.el.select('.modal-content', true).first().unmask();
78 show : function (_self)
80 this.setTitle( _this.dialog._dialog_title_login );
86 '|xns' : 'Roo.bootstrap',
90 html : _this._strings['99dea78007133396a7b8ed70578ac6ae'] /* Login */,
92 style : 'float: right',
95 '|xns' : 'Roo.bootstrap'
99 cls : 'login-forgot-pass-btn',
100 _forgot_passwd_success_body : _this._strings['11163ed17ad9afc7680bb9e92f15d6fd'] /* We have sent you a link to reset your password */,
101 _forgot_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
103 html : _this._strings['cd4bcecae78474ea24c3f28350758a8c'] /* Forgot your password ? */,
105 style : 'float: left',
109 click : function () {
113 var email = _this.form.findField('username').getValue();
117 Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){
118 Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {
126 '|xns' : 'Roo.bootstrap'
133 render : function (_self)
137 this.el.setVisibilityMode(Roo.Element.DISPLAY);
141 '|xns' : 'Roo.bootstrap',
147 '|xns' : 'Roo.bootstrap',
152 '|xns' : 'Roo.bootstrap',
158 '|xns' : 'Roo.bootstrap',
165 url : baseURL + '/Login',
167 actioncomplete : function (_self, action) {
170 if (!Roo.state.Manager.getProvider().expires) {
171 Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
174 _this.lastLogin = Roo.state.Manager.get('Pman.Login', {});
175 _this.form.findField('username').focus();
178 if(action.type == 'setdata'){
180 this.findField('username').show();
181 this.findField('password').show();
182 this.findField('oath_password').hide();
185 _this.errorRow.hide();
186 _this.dialog.el.select('.modal-content', true).first().unmask();
190 _this.lastLogin.username != ''
193 _this.form.findField('username').setValue(_this.lastLogin.username);
194 _this.form.findField('password').focus();
199 if(action.type == 'load'){
204 if (action.type =='submit') {
209 if (_this.callback) {
210 _this.callback.call(_this, action.result);
219 !action.result.data.oath_key_enable &&
220 action.result.data.require_oath * 1 == 1
222 Roo.bootstrap.MessageBox.show({
223 title : "Two Factor Authentication is required",
225 msg : "This system requires that you use Google Two Factor Authentication.",
226 buttons : {yes:'Setup Two Factor Authentication'},
232 Pman.Dialog.BAdminStaffTwoFactorQRCode.show(
233 {id: action.result.data.id, allow_close : true },
241 // store only username
242 Roo.state.Manager.set('Pman.Login', {
243 username : this.findField('username').getValue()
248 actionfailed : function (_self, action) {
249 Roo.log('action failed?!');
252 _this.dialog.el.select('.modal-content', true).first().unmask();
254 if (typeof(action) != 'undefined' && action.failureType == 'server') {
256 switch (action.result.code) {
258 case 'Authenticated' :
261 Roo.bootstrap.MessageBox.alert("Error",action.result.errorMsg);
262 _this.alert.setHtml(action.result.errorMsg);
265 case 'NEW-IP-ADDRESS' :
266 case 'PENDING-IP-ADDRESS' :
267 case 'BAD-IP-ADDRESS' :
268 case 'BLOCKED-IP-ADDRESS' :
271 Roo.bootstrap.MessageBox.alert("Error", action.result.errorMsg);
272 //Pman.Dialog.LoginNotice.show({
273 // status : action.result.errorMsg,
274 // ip : action.result.errors.ip
279 this.findField('username').hide();
280 this.findField('password').hide();
281 this.findField('oath_password').show();
282 return; // no way back from here..
285 _this.errorRow.show();
286 _this.alert.setHtml(action.result.errorMsg);
293 _this.alert.setHtml( "Fill in all the required fields");
295 render : function (_self) {
300 '|xns' : 'Roo.bootstrap',
306 '|xns' : 'Roo.bootstrap',
313 placeholder : _this._strings['643a860f992333b8600ea264aca7c4fc'] /* Email Address */,
316 specialkey : function (_self, e)
318 if(e.getKey() == 13){
319 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
320 _this.form.doAction('submit');
326 '|xns' : 'Roo.bootstrap'
331 inputType : 'password',
333 placeholder : _this._strings['dc647eb65e6711e155375218212b3964'] /* Password */,
335 specialkey : function (_self, e)
337 if(e.getKey() == 13){
338 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
339 _this.form.doAction('submit');
344 '|xns' : 'Roo.bootstrap'
347 xtype : 'NumberField',
349 allowDecimals : false,
350 allowNegative : false,
352 decimalPrecision : 0,
355 name : 'oath_password',
356 placeholder : _this._strings['06cf692a8d2bb0ab8318dc6c839ae931'] /* Two-Factor Authentication Number (if relevant) */,
358 specialkey : function (_self, e)
360 if(e.getKey() == 13){
361 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
362 _this.form.doAction('submit');
367 '|xns' : 'Roo.bootstrap'
371 inputType : 'hidden',
375 '|xns' : 'Roo.bootstrap'
388 render : function (_self)
390 _this.errorRow = this;
394 '|xns' : 'Roo.bootstrap',
400 '|xns' : 'Roo.bootstrap',
406 render : function (_self)
412 '|xns' : 'Roo.bootstrap'
426 Roo.apply(Pman.Dialog.Login, Pman.Dialog.Login.prototype);