event.preventDefault();
Roo.Ajax.request({
- url : baseURL + '/Login.php',
- type : 'POST',
- params: Roo.lib.Ajax.serializeForm(Roo.select('.login-form').first().dom),
- success : function(res) {
- var data = false;
- try {
- data = Roo.decode(res.responseText);
- } catch(e) {
- Roo.MessageBox.alert("Error sending : " + res.responseText);
- return;
- }
-
- if (data.success) {
- // we could be clever and use the history here..
- document.location = baseURL;
- return;
- }
- // aghh.. mixing content/data...
- var emap = {
- 'bad_1' : "The username and password does not match our records (1)",
- 'bad_2' : "The username and password does not match our records (2)",
- 'bad_3' : "The username and password does not match our records (3)",
- 'disabled' : "This account has been disabled"
- };
- Roo.MessageBox.alert("Error",
- (typeof(emap[data.message]) == 'undefined' ? data.message : emap[data.message])
- );
+ url : baseURL + '/Login.php',
+ type : 'POST',
+ params: Roo.lib.Ajax.serializeForm(Roo.select('.login-form').first().dom),
+ success : function(res) {
+ var data = false;
+ try {
+ data = Roo.decode(res.responseText);
+ } catch(e) {
+ Roo.MessageBox.alert("Error sending : " + res.responseText);
+ return;
}
+
+ if (data.success) {
+ // we could be clever and use the history here..
+ document.location = baseURL + '/Browse?ts=' + Math.random();
+ return;
+ }
+ // aghh.. mixing content/data...
+ var emap = {
+ 'bad_1' : "The username and password does not match our records (1)",
+ 'bad_2' : "The username and password does not match our records (2)",
+ 'bad_3' : "The username and password does not match our records (3)",
+ 'disabled' : "This account has been disabled"
+ };
+ Roo.MessageBox.alert("Error",
+ (typeof(emap[data.message]) == 'undefined' ? data.message : emap[data.message])
+ );
+ }
+
});
});
\ No newline at end of file