$newpassword = ""; if (isset($_POST['nPass1']) && isset($_POST['nPass2'])) { if ($_POST['nPass1'] == $_POST['nPass2']) { $newpassword = substr($_POST['nPass1'], 0, 12); } else { $user->login_matchFalse(); exit; //To ensure security } } $loginAttempt = $user->login(substr($_POST['user'], 0, 30), substr($_POST['token'], 0, 12), $newpassword); if ($loginAttempt == 1) { $user->login_true(); } else { if ($loginAttempt == 0) { $user->login_false(); } else { if ($loginAttempt == 2) { $user->login_attemptFalse(); } else { if ($loginAttempt == 3) { $user->login_newpass(); } else { if ($loginAttempt == 4) { $user->login_brutforce(); } } } } } } else {