this.fillAuth(res.data);
this.checkFails =0;
- Pman.onload();
+
+
+ if (Pman.onload) {
+ Pman.onload();
+ }
+ if (Pman.Login.callback) {
+ Pman.Login.callback();
+
+ }
return false;
},
//act.result.errorMsg// invalid form element list...
Pman.Login.dialog.el.unmask();
- Roo.MessageBox.alert("Error", act.result.errorMsg ? act.result.errorMsg :
- "Login failed - communication error - try again.");
+ var msg = act.result.errorMsg || act.result.message;
+ msg = msg || "Login failed - communication error - try again.";
+ Roo.MessageBox.alert("Error", msg);
},
actioncomplete: function(re, act) {
//Roo.get('loading').show();
Roo.get('loading-mask').show();
}
-
- Pman.onload();
-
+ if (Pman.onload) {
+ Pman.onload();
+ }
+ if (Pman.Login.callback) {
+ Pman.Login.callback();
+ }
}
}
this.form.render(ef.dom);
// logoprefix comes from base config.
+
+ var img = typeof(appLogo) != 'undefined' && appLogo.length ? appLogo :
+ rootURL + '/Pman/'+appNameShort + '/templates/images/logo.gif' ;
+
Pman.Login.form.el.createChild({
tag: 'img',
- src: rootURL + '/Pman/'+appNameShort + '/templates/images/logo.gif',
+ src: img,
style: 'margin-bottom: 10px;'
},
Pman.Login.form.el.dom.firstChild
- show: function (modal)
+ show: function (modal, cb)
{
if (this.disabled) {
return;
}
+
+
+
+ this.callback = cb; // used for non-pman usage..
modal = modal || false;
if (Pman.Login.authUserId < 0) { // logout!?
return;
}
//incomming._node = tnode;
+ // why we want this non-modal????
this.form.reset();
this.dialog.modal = !modal;
this.dialog.show();
this.dialog.el.unmask();
this.resizeToLogo.defer(1000,this);
+ // if we have not created a provider.. do it now...
+ if (!Roo.state.Manager.getProvider().expires) {
+ Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
+ }
+
this.form.setValues({
'username' : Roo.state.Manager.get('Pman.Login.username.'+appNameShort, ''),