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 '5047040b025ce0295b58d42250014417' :"<div id=\"login-err\" class=\"dialog-err\" style=\"color:red\"></div>",
19 '24efa7ee4511563b16144f39706d594f' :"Notice",
20 '643a860f992333b8600ea264aca7c4fc' :"Email Address"
23 'username_placeholder' : '643a860f992333b8600ea264aca7c4fc' /* Email Address */ ,
24 '_force_value' : 'cfcd208495d565ef66e7dff9f98764da' /* 0 */ ,
25 'password_placeholder' : 'dc647eb65e6711e155375218212b3964' /* Password */ ,
26 'oath_password_placeholder' : '06cf692a8d2bb0ab8318dc6c839ae931' /* Two-Factor Authentication Number (if relevant) */ ,
27 'OK_html' : '99dea78007133396a7b8ed70578ac6ae' /* Login */
33 show : function(data, cb)
41 this.dialog.show(this.data._el);
44 this.form.setValues(data);
45 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
53 this.dialog = Roo.factory({
56 buttonPosition : 'center',
57 cls : 'enable-overflow login-dialog padding-bottom-trim',
58 _dialog_title_login : _this._strings['e50b62fb8271673bacc2cfd9d80fbe7a'] /* Login to the Management Portal */,
60 btnclick : function (e)
67 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
68 _this.form.doAction('submit');
70 render : function (_self) {
72 Roo.get('login-err').dom.innerHTML = "";
73 _this.dialog.el.select('.modal-content', true).first().unmask();
79 show : function (_self)
81 this.setTitle( _this.dialog._dialog_title_login );
83 if (!Roo.state.Manager.getProvider().expires) {
84 Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
87 _this.lastLogin = Roo.state.Manager.get('Pman.Login', {});
88 _this.form.findField('username').focus();
92 '|xns' : 'Roo.bootstrap',
96 html : _this._strings['99dea78007133396a7b8ed70578ac6ae'] /* Login */,
98 style : 'float: right',
101 '|xns' : 'Roo.bootstrap'
105 cls : 'login-forgot-pass-btn',
106 _forgot_passwd_success_body : _this._strings['11163ed17ad9afc7680bb9e92f15d6fd'] /* We have sent you a link to reset your password */,
107 _forgot_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
109 html : _this._strings['cd4bcecae78474ea24c3f28350758a8c'] /* Forgot your password ? */,
111 style : 'float: left',
115 click : function () {
119 var email = _this.form.findField('username').getValue();
123 Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){
124 Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body, function() {
132 '|xns' : 'Roo.bootstrap'
139 render : function (_self)
143 this.el.setVisibilityMode(Roo.Element.DISPLAY);
147 '|xns' : 'Roo.bootstrap',
153 '|xns' : 'Roo.bootstrap',
158 '|xns' : 'Roo.bootstrap',
164 '|xns' : 'Roo.bootstrap',
171 url : baseURL + '/Login',
173 actioncomplete : function (_self, action) {
175 if(action.type == 'setdata'){
179 _this.lastLogin.login_provider == ''
181 _this.form.findField('username').setValue(_this.lastLogin.email);
184 Roo.get('login-err').dom.innerHTML = "";
185 _this.errorRow.hide();
186 _this.dialog.el.select('.modal-content', true).first().unmask();
191 if(action.type == 'load'){
196 if (action.type =='submit') {
201 if (_this.callback) {
202 _this.callback.call(_this, action.result);
211 !action.result.data.oath_key_enable &&
212 action.result.data.require_oath * 1 == 1
214 Roo.bootstrap.MessageBox.show({
215 title : "Two Factor Authentication is required",
217 msg : "This system requires that you use Google Two Factor Authentication.",
218 buttons : {yes:'Setup Two Factor Authentication'},
224 Pman.Dialog.BAdminStaffTwoFactorQRCode.show(
225 {id: action.result.data.id, allow_close : true },
237 actionfailed : function (_self, action) {
238 Roo.log('action failed?!');
241 _this.dialog.el.select('.modal-content', true).first().unmask();
243 if (typeof(action) != 'undefined' && action.failureType == 'server') {
245 switch (action.result.errorMsg) {
247 case 'Authenticated' :
249 var data = Roo.apply(action.result.errors);
251 data.target = _this.form.findField('username').getValue();
253 Roo.bootstrap.MessageBox.alert("Error", "odd error messages");
257 case 'NEW-IP-ADDRESS' :
258 case 'PENDING-IP-ADDRESS' :
259 case 'BAD-IP-ADDRESS' :
260 case 'BLOCKED-IP-ADDRESS' :
264 Pman.Dialog.LoginNotice.show({
265 status : action.result.errorMsg,
266 ip : action.result.errors.ip
272 _this.errorRow.show();
273 Roo.get('login-err').dom.innerHTML = action.result.errorMsg;
280 Roo.get('login-err').dom.innerHTML = "Fill in all the required fields";
282 render : function (_self) {
287 '|xns' : 'Roo.bootstrap',
293 '|xns' : 'Roo.bootstrap',
300 placeholder : _this._strings['643a860f992333b8600ea264aca7c4fc'] /* Email Address */,
303 specialkey : function (_self, e)
305 if(e.getKey() == 13){
306 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
307 _this.form.doAction('submit');
313 '|xns' : 'Roo.bootstrap'
318 inputType : 'password',
320 placeholder : _this._strings['dc647eb65e6711e155375218212b3964'] /* Password */,
322 specialkey : function (_self, e)
324 if(e.getKey() == 13){
325 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
326 _this.form.doAction('submit');
331 '|xns' : 'Roo.bootstrap'
334 xtype : 'NumberField',
336 allowDecimals : false,
337 allowNegative : false,
339 decimalPrecision : 0,
341 name : 'oath_password',
342 placeholder : _this._strings['06cf692a8d2bb0ab8318dc6c839ae931'] /* Two-Factor Authentication Number (if relevant) */,
344 specialkey : function (_self, e)
346 if(e.getKey() == 13){
347 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
348 _this.form.doAction('submit');
353 '|xns' : 'Roo.bootstrap'
357 inputType : 'hidden',
361 '|xns' : 'Roo.bootstrap'
374 render : function (_self)
376 _this.errorRow = this;
380 '|xns' : 'Roo.bootstrap',
386 '|xns' : 'Roo.bootstrap',
391 html : _this._strings['5047040b025ce0295b58d42250014417'] /* <div id="login-err" class="dialog-err" style="color:red"></div> */,
392 style : 'margin-bottom: 15px;\n padding: 5px;',
394 '|xns' : 'Roo.bootstrap'
408 Roo.apply(Pman.Dialog.Login, Pman.Dialog.Login.prototype);