<?php require 'includes/header-no-nav.php'; //Checking to see if we've already submitted registration if (isset($_POST['username'])) { //We have, registering the account $keyAddition = new ApiKey($_POST['keyID'], $_POST['vCode'], 0, $db); $success = User::doRegistration($_POST['username'], $_POST['password'], $_POST['password_verify'], $_POST['default_id'], $db); if ($success) { $stmt = $db->prepare('SELECT * FROM user_accounts WHERE username = ? LIMIT 1'); $stmt->execute(array($_POST['username'])); $accountInfo = $stmt->fetch(); $keyAddition = new ApiKey($_POST['keyID'], $_POST['vCode'], $accountInfo['uid'], $db); $keyAddition->updateAPIKey(); $char = new Character($_POST['default_id'], $keyAddition->getKeyID(), $keyAddition->getVCode(), $keyAddition->getAccessMask(), $db, $accountInfo['uid']); if ($char->getExistance() or $char->getExistance() == FALSE) { $char->updateCharacterInfo(); } $register_success = TRUE; } else { $register_success = FALSE; } } ?> <div class="opaque-container" style="height: 100%; padding-bottom: 50px; margin-top: 10%"> <div class="row" style="width: 100%;"> <?php if ($request['action'] == '1' or !$request['action']) { ?>
// Confirming that the API server is responding if ($eve->getAPIStatus()) { // Setting the lookup cache limit to 1 hour / 3600 seconds $cacheLimit = time() - 3600; // Getting the oldest key that isn't set to 999 (disabled) and $stmt = $db->prepare('SELECT * FROM core_cron WHERE cron_updated < ? AND cron_status = 1 ORDER BY cron_updated ASC LIMIT 1'); $stmt->execute(array($cacheLimit)); $apiLookup = $stmt->fetch(PDO::FETCH_ASSOC); // Checking to see if anything is out of cache if (isset($apiLookup['api_keyID'])) { // Checking the API key $key = new ApiKey($apiLookup['api_keyID'], $apiLookup['api_vCode'], $apiLookup['uid'], $db); // Checking to see if the key is valid if ($key->getKeyStatus() == 1) { // Key is valid, updating it $updateKey = $key->updateAPIKey(); // Checking the access mask for the key if ($key->accessMaskCheck()) { // Looping through the characters foreach ($key->getCharacters() as $character) { $char = new Character($character['characterID'], $key->getKeyID(), $key->getVCode(), $key->getAccessMask(), $db, $apiLookup['uid']); if ($char->getExistance() or $char->getExistance() == FALSE) { $char->updateCharacterInfo(); /* * SKILLS UPDATE SECTION */ $skills = $char->updateCharacterSkills(); // Checking for skills update success if ($skills === "SDE Failure") { echo date('Ymd H:i:s', time()) . " - cron_update.php - FAILURE - Skill detected that does not exist in SDE for charid " . $character['characterID'] . "\n"; } elseif ($skills === FALSE) {