Commit 85db68c1 authored by pedro_morgan's avatar pedro_morgan
Browse files

Check for user/pass client side instead of remote

parent 01d2d115
...@@ -20,8 +20,8 @@ function capp(module) { ...@@ -20,8 +20,8 @@ function capp(module) {
var cappCallback = { var cappCallback = {
success: function(o) { success: function(o) {
if(o.responseText != '') { if(o.responseText != '') {
if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
var parts = o.responseText.split(":"); var parts = o.responseText.split(':');
loadContent(parts[1]); loadContent(parts[1]);
} else { } else {
alert(o.responseText); alert(o.responseText);
...@@ -40,8 +40,8 @@ function submitLoginForm(formname) { ...@@ -40,8 +40,8 @@ function submitLoginForm(formname) {
var submitFormCallback = { var submitFormCallback = {
success: function(o) { success: function(o) {
if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
var parts = o.responseText.split(":"); var parts = o.responseText.split(':');
//alert(parts[1]); //alert(parts[1]);
loadContent(parts[1]); loadContent(parts[1]);
//redirect = parts[1]; //redirect = parts[1];
...@@ -56,6 +56,18 @@ function submitLoginForm(formname) { ...@@ -56,6 +56,18 @@ function submitLoginForm(formname) {
} }
} }
//* Validate form. TODO: username and password with strip();
var frm = document.getElementById(formname);
var userNameObj = frm.username;
if(userNameObj.value == ''){
userNameObj.focus();
return;
}
var passwordObj = frm.passwort;
if(passwordObj.value == ''){
passwordObj.focus();
return;
}
YAHOO.util.Connect.setForm(formname); YAHOO.util.Connect.setForm(formname);
var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', 'content.php', submitFormCallback); var submitFormObj = YAHOO.util.Connect.asyncRequest('POST', 'content.php', submitFormCallback);
/* /*
...@@ -70,8 +82,8 @@ function submitForm(formname,target) { ...@@ -70,8 +82,8 @@ function submitForm(formname,target) {
var submitFormCallback = { var submitFormCallback = {
success: function(o) { success: function(o) {
if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
var parts = o.responseText.split(":"); var parts = o.responseText.split(':');
//alert(parts[1]); //alert(parts[1]);
loadContent(parts[1]); loadContent(parts[1]);
//redirect = parts[1]; //redirect = parts[1];
...@@ -98,7 +110,7 @@ function submitForm(formname,target) { ...@@ -98,7 +110,7 @@ function submitForm(formname,target) {
function loadContent(pagename) { function loadContent(pagename) {
var pageContentCallback2 = { var pageContentCallback2 = {
success: function(o) { success: function(o) {
//alert(o.responseText); alert(o.responseText);
if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) { if(o.responseText.indexOf("HEADER_REDIRECT:") > -1) {
var parts = o.responseText.split(":"); var parts = o.responseText.split(":");
loadContent(parts[1]); loadContent(parts[1]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment