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"
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({
49 buttonPosition : 'center',
50 cls : 'enable-overflow login-dialog',
51 _dialog_title_login : _this._strings['e50b62fb8271673bacc2cfd9d80fbe7a'] /* Login to the Management Portal */,
53 btnclick : function (e)
60 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
61 _this.form.doAction('submit');
63 render : function (_self) {
65 Roo.get('login-err').dom.innerHTML = "";
66 _this.dialog.el.select('.modal-content', true).first().unmask();
72 show : function (_self)
76 this.setTitle( _this.dialog._dialog_title_login );
78 if (!Roo.state.Manager.getProvider().expires) {
79 Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
82 _this.lastLogin = Roo.state.Manager.get('Pman.Login', {});
83 _this.form.findField('username').focus();
89 '|xns' : 'Roo.bootstrap',
93 html : _this._strings['99dea78007133396a7b8ed70578ac6ae'] /* Login */,
95 style : 'float: right',
98 '|xns' : 'Roo.bootstrap'
102 _forgot_passwd_success_body : _this._strings['11163ed17ad9afc7680bb9e92f15d6fd'] /* We have sent you a link to reset your password */,
103 _forgot_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
105 html : _this._strings['cd4bcecae78474ea24c3f28350758a8c'] /* Forgot your password ? */,
107 style : 'float: left',
111 click : function () {
115 var email = _this.form.findField('username').getValue();
119 Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){
120 Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body);
125 '|xns' : 'Roo.bootstrap'
132 render : function (_self)
136 this.el.setVisibilityMode(Roo.Element.DISPLAY);
140 '|xns' : 'Roo.bootstrap',
146 '|xns' : 'Roo.bootstrap',
150 style : 'margin-top:20px;',
152 '|xns' : 'Roo.bootstrap',
158 '|xns' : 'Roo.bootstrap',
165 url : baseURL + '/Login',
167 actioncomplete : function (_self, action) {
169 if(action.type == 'setdata'){
173 _this.lastLogin.login_provider == ''
175 _this.form.findField('username').setValue(_this.lastLogin.email);
178 Roo.get('login-err').dom.innerHTML = "";
179 _this.dialog.el.select('.modal-content', true).first().unmask();
184 if(action.type == 'load'){
189 if (action.type =='submit') {
193 if (_this.callback) {
194 _this.callback.call(_this, action.result);
202 actionfailed : function (_self, action) {
203 Roo.log('action failed?!');
206 _this.dialog.el.select('.modal-content', true).first().unmask();
208 if (typeof(action) != 'undefined' && action.failureType == 'server') {
210 switch (action.result.errorMsg) {
212 case 'Authenticated' :
214 var data = Roo.apply(action.result.errors);
216 data.target = _this.form.findField('username').getValue();
218 Roo.bootstrap.MessageBox.alert("Error", "odd error messages");
222 case 'NEW-IP-ADDRESS' :
223 case 'PENDING-IP-ADDRESS' :
224 case 'BAD-IP-ADDRESS' :
225 case 'BLOCKED-IP-ADDRESS' :
229 Pman.Dialog.LoginNotice.show({
230 status : action.result.errorMsg,
231 ip : action.result.errors.ip
237 Roo.get('login-err').dom.innerHTML = action.result.errorMsg;
244 Roo.get('login-err').dom.innerHTML = "Fill in all the required fields";
246 render : function (_self) {
251 '|xns' : 'Roo.bootstrap',
257 '|xns' : 'Roo.bootstrap',
264 placeholder : _this._strings['643a860f992333b8600ea264aca7c4fc'] /* Email Address */,
267 specialkey : function (_self, e)
269 if(e.getKey() == 13){
270 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
271 _this.form.doAction('submit');
277 '|xns' : 'Roo.bootstrap'
282 inputType : 'password',
284 placeholder : _this._strings['dc647eb65e6711e155375218212b3964'] /* Password */,
286 specialkey : function (_self, e)
288 if(e.getKey() == 13){
289 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
290 _this.form.doAction('submit');
295 '|xns' : 'Roo.bootstrap'
298 xtype : 'NumberField',
301 name : 'oath_password',
302 placeholder : _this._strings['06cf692a8d2bb0ab8318dc6c839ae931'] /* Two-Factor Authentication Number (if relevant) */,
304 specialkey : function (_self, e)
306 if(e.getKey() == 13){
307 _this.dialog.el.select('.modal-content', true).first().mask('Sending...');
308 _this.form.doAction('submit');
313 '|xns' : 'Roo.bootstrap'
317 inputType : 'hidden',
321 '|xns' : 'Roo.bootstrap'
334 '|xns' : 'Roo.bootstrap',
340 '|xns' : 'Roo.bootstrap',
345 html : _this._strings['5047040b025ce0295b58d42250014417'] /* <div id="login-err" class="dialog-err" style="color:red"></div> */,
346 style : 'margin-top:20px;',
348 '|xns' : 'Roo.bootstrap'
362 Roo.apply(Pman.Dialog.Login, Pman.Dialog.Login.prototype);