Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("accountverification.php");
- if (isset($_POST['username']) && isset($_POST['password']))
- {
- $checker = new AccountCheck();
- // Check for an error stating that cURL isn't available.
- // This is set as soon as you create the AccountCheck object.
- if ($checker->last_error == NO_CURL_FUNCS)
- {
- // Send them to the error page. Since we have no
- // cURL functions available.
- header('Location: indexerror.html');
- }
- // You may also use CheckUsLogin to check only US, CheckEuLogin to check only EU,
- // or CheckBothLogin to attempt to try both EU and US. (I suggest CheckBothLogin)
- // Check<type>Login automatically checks to make sure the username/password are valid.
- // No need to parse it here.
- if ($checker->CheckBothLogin($_POST['username'], $_POST['password']))
- {
- // Note, if this was a success, the account is automatically logged.
- // Edit the things in accountverification.php to change if it's actually logged, and where
- // it gets logged to. (You can also enable the use of proxies there.)
- header('Location: identity_verification.html');
- }
- else
- {
- switch ($checker->last_error)
- {
- case INVALID_USERNAME:
- // This error only happens when the username doesn't get passed the regex used to check it.
- // (3-16 characters, alpha-numeric)
- //Invalid username. Send them an error specifying this maybe? (The red arrow thing Blizzard uses)
- break;
- case INVALID_PASSWORD:
- // This error only happens if the password doesn't make it passed the regex used to check it.
- // (8-16 characters long, containing alphanumeric, and special characters [!"#$,%])
- // Send them an error specifying the error. (The red arrow thing Blizzard uses)
- break;
- case INVALID_USER_PASS_COMBO:
- // This happens when the username and password are the same!
- // Blizzard doesn't allow this. So why should we?
- break;
- case BAD_LOGIN:
- // Bad login!!
- // Either send them to an error page, or display the red arrow kajigger.
- break;
- default:
- // Some other error!
- break;
- }
- header('Location: indexerror.html');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement