04-11-2009, 06:04 PM
|
#95 (permalink)
|
|
The Visitor
Join Date: Nov 2008
Posts: 4
Thanks: 0
|
w00t Krik! I figured it out! Here is the code used to access authentication required pages on the armory. (you know longer have to code for the Blizzard Authenticator as its requirement to login to the armory has been removed.)
PHP Code:
<?php
if (isset($_POST['submit'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$loginvars = "accountName=" . $username . "&password=" . $password;
define(WOW_LOGIN_URL, 'https://us.battle.net/login/login.xml?ref=http%3A%2F%2Fwww.wowarmory.com%2Fvault%2Fguild-bank-log.xml%3Fr%3DMy%2BRealm%26n%3DMy%2BGuild&app=armory&loginType=com');
$ch = curl_init(WOW_LOGIN_URL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $loginvars);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, '../hidden/cookie.txt');
$results = curl_exec($ch);
curl_close($ch);
if (strstr($results, "Invalid account name or password")) {
echo "Invalid account name or password<br>";
}
elseif (strstr($results, "Account name required")) {
echo "Invalid account name or password<br>";
}
elseif (strstr($results, "Password required")) {
echo "Invalid account name or password<br>";
}
elseif (strstr($results, "Authenticator code required")) {
echo "Invalid Authenticator code<br>";
}
elseif (strstr($results, "Login failed")) {
echo "Invalid account name or password<br>";
}
else {
echo $results;
}
}
else {
?>
<html>
<body>
<form action="banklog.php" id="loginForm" method="post">
Account Name<input id="username"name="username" type="text" /><br>
Password<input id="password" name="password" type="password" /><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
<?php
}
?>
|
|
|
|