getMessage()); \dashboard\primary\error($errorMsg); }); ?> Upgrade

Customer Panel

To access customer panel, you must login, or register. This information is provided to you by the owner of the application. Do not contact KeyAuth support if you can not access the customer panel.

num_rows < 1) { dashboard\primary\error("License doesn't exist!"); return; } // if key does exist elseif ($query->num_rows > 0) { // get key info while ($row = mysqli_fetch_array($query->result)) { $expires = $row['expires']; $status = $row['status']; $level = $row['level']; } // check if used if ($status == "Used") { dashboard\primary\error("License already used!"); return; } // add current time to key time $expiry = $expires + time(); $query = misc\mysql\query("SELECT `name` FROM `subscriptions` WHERE `app` = ? AND `level` = ?", [$_SESSION['panelapp'], $level]); $subName = mysqli_fetch_array($query->result)['name']; $resp = misc\user\extend($username, $subName, $expiry, 0, $_SESSION['panelapp']); switch ($resp) { case 'missing': dashboard\primary\error("User not found!"); break; case 'sub_missing': dashboard\primary\error("Subscription not found for that license level!"); break; case 'failure': dashboard\primary\error("Unknown upgrade error! Please contact support."); break; case 'success': // set key to used, and set usedby misc\mysql\query("UPDATE `keys` SET `status` = 'Used', `usedon` = ?, `usedby` = ? WHERE `key` = ? AND `app` = ?", [time(), $username, $license, $_SESSION['panelapp']]); misc\cache\purge('KeyAuthKeys:' . $_SESSION['panelapp']); dashboard\primary\success("Successfully Upgraded!"); break; default: dashboard\primary\error("Unknown upgrade error! Please contact support."); break; } } } ?>