static function checkApiReturnError($keyID, $vCode) { if (empty($keyID) && !empty($vCode)) { return "vCode without keyID was given."; } if (empty($vCode) && !empty($keyID)) { return "keyID without vCode was given."; } if (empty($vCode) && empty($keyID)) { return null; } $apiResult = checkApi($keyID, $vCode); if ($apiResult != "Verified") { return $apiResult; } return null; }
<table cellspacing="5" cellpadding="5" border="0" width="850" align="center"> <?php if (isset($_POST['submit'])) { $charID = $_GET['charid']; $pilotKeyID = $_POST['form_keyid']; $pilotVCode = $_POST['form_vcode']; //a new api is checked before being saved to db if (checkApi($pilotKeyID, $pilotVCode) == "Verified") { mysql_query("UPDATE ecms_pilots SET pilotKeyID = '{$pilotKeyID}' WHERE pilotCharID = '{$charID}'"); mysql_query("UPDATE ecms_pilots SET pilotVCode = '{$pilotVCode}' WHERE pilotCharID = '{$charID}'"); header('Location: members-db-modifyapi.php'); } else { echo "<img src='../img/warning.gif' />"; echo "<h4>" . checkApi($pilotKeyID, $pilotVCode) . "</h4>"; echo "<br /><br />"; echo "<a href='members-db-modifyapi.php'><<< Try again</a>"; } } else { $myRank = $_SESSION['cLevel']; $q = mysql_query("SELECT * FROM ecms_pilots WHERE pilotStatus='Accepted' AND pilotPrimary='Yes' ORDER BY pilotName ASC"); while ($r = mysql_fetch_array($q)) { $currentPrimaryPilot = $r['pilotName']; $currentPrimaryPilotRank = $r['pilotLevel']; if ($myRank < $currentPrimaryPilotRank) { echo "<form action='members-db-modifyapi.php?charid=" . $r['pilotCharID'] . "' method='POST'>"; echo "<tr>"; echo "<td>"; echo "<img src='../img/icon_primary.png' border='0'> "; echo "<img src='http://image.eveonline.com/Character/" . $r['pilotCharID'] . "_32.jpg' border='0'>";
<!--<a href="ts3server://www.4s-eve.com/?port=9987&nickname=[4S] <?php //echo $_SESSION['cName']; ?> "><img src="img/icon_ts3.png" border="0" title="Server Address: www.4s-eve.com" /></a>--> <img src="img/goldmedal.png" border="0" /> </div> <div style="float: left; margin-left: 10px; text-align: center; width: 740px;"> <br /><br /> <?php if (checkApi($_SESSION['cKeyID'], $_SESSION['cVcode']) != "Verified") { echo "<img src='img/warning.gif' />"; echo "<h3>" . checkApi($_SESSION['cKeyID'], $_SESSION['cVcode']) . "</h3>"; echo "<br /><br />"; } ?> <div id="divRss"></div> <!--<script id="feed-1358732282426692" type="text/javascript" src="http://rss.bloople.net/?url=http%3A%2F%2Fcommunity.eveonline.com%2Ffeed%2Frdfdevblog.asp&showtitle=false&type=js&id=1358732282426692"></script>--> </div> <div style="clear:both" /> <br /><br /> <?php include "footer.php";
<!--main content--> <br/> <h1>PENDING APPLICATIONS</h1> <table cellspacing="5" cellpadding="5" border="0" width="600" align="center"> <?php $q = mysql_query("SELECT * FROM ecms_pilots WHERE pilotStatus = 'Pending'"); if (mysql_num_rows($q) != 0) { while ($r = mysql_fetch_array($q)) { ?> <tr> <td> <?php $keyID = $r['pilotKeyID']; $vCode = $r['pilotVcode']; $apiResult = checkApi($keyID, $vCode); if ($apiResult == "Verified") { echo "<img src='resources/img/keyvalid.png' border='0' title=" . $apiResult . ">"; } else { echo "<img src='resources/img/keyinvalid.png' border='0' title=" . $apiResult . ">"; } ?> </td> <td> <!--TODO fix this link and attached site // link to jacknife? jn_logo.png --> <!--<a href="rctm-candidate.php?id=main&keyID=<?php echo $r['pilotKeyID']; ?> &vCode=<?php echo $r['pilotVcode']; ?>
<h1>ADD ALT ACCOUNT</h1> <br /> <?php if (isset($_POST['submit'])) { $keyID = $_POST['form_keyid']; $vCode = $_POST['form_vcode']; $pilotName = stripslashes($_POST['form_name']); $pilotCharType = $_POST['form_chartype']; if (checkApi($keyID, $vCode) != "Verified") { echo "<img src='img/warning.gif' />"; echo "<h4>" . checkApi($keyID, $vCode) . "</h4>"; echo "<br /><br />"; echo "<a href='member-addaltaccount.php'><<< Try again</a>"; } if (checkApi($keyID, $vCode) == "Verified") { $pilotCheck = ""; $apiURL = "http://api.eveonline.com/account/APIKeyInfo.xml.aspx?keyID=" . $keyID . "&vCode=" . $vCode; $apiXML = new simpleXMLElement($apiURL, NULL, TRUE); $charA = (string) $apiXML->result->key->rowset->row[0]['characterName']; $charAID = (string) $apiXML->result->key->rowset->row[0]['characterID']; $charB = (string) $apiXML->result->key->rowset->row[1]['characterName']; $charBID = (string) $apiXML->result->key->rowset->row[1]['characterID']; $charC = (string) $apiXML->result->key->rowset->row[2]['characterName']; $charCID = (string) $apiXML->result->key->rowset->row[2]['characterID']; if ($pilotName == $charA) { $pilotCharID = $charAID; $pilotCheck = "Verified"; } if ($pilotName == $charB) { $pilotCharID = $charBID;