Site in question: http://tinyurl.com/23oar6z
You can look at the source for the javascript on the JQuery or the main part here:
// validate signup form on keyup and submit
var validator = $("#Register").validate({
rules: {
UserID: {
required: true,
minlength: 2,
remote: {
url: "form_check_user.php",
type: "post",
}
},
....
So it POSTs to form_check_user.php UserID=ValueFromForm
Here is the form_check_user.php code:
<?
if ($_POST['UserID']) {
$User = strtolower($_POST['UserID']);
$htpasswd_array = file("/etc/passwd");
$pattern = "/^$User:/";
foreach ($htpasswd_array as $key => $value) {
if (preg_match($pattern, $value)) {
echo "false";
exit;
}
}
echo "true";
exit;
}
echo "false";
exit;
?>
The function works as it should, I try to use a UserID as root or any valid linux user and it detects that its invalid...
The problem comes if you enter "root" in...It says it's invalid...and you still tab to the next form it then shows [object Object] is already in use
Edit: Should probably include this, as the message seems to be part of the problem:
messages: {
UserID: {
required: "Enter a username",
minlength: jQuery.format("Enter at least {0} characters"),
remote: jQuery.format("{0} is already in use")
},
Update: 8/20
I have confirmed this is a bug in the validation plugin after debugging. (Althought I get lost where the error occurs, I know it has nothing to do with my response.)