echo "<div class='panel-title'><i class='fa fa-exclamation-circle'></i> Outdated Plugin Error</div>"; } elseif ($api_status == ServerAuthWebAPI::ERR_OUTDATED_WEBAPI) { echo "<div class='panel-title'><i class='fa fa-exclamation-circle'></i> Outdated WebAPI Error</div>"; } else { echo "<div class='panel-title'><i class='fa fa-lock'></i> Login</div>"; } } ?> </div> <div class='panel-content'> <?php if (!$cfg_status) { echo "<div class='alert alert-error square' style='margin-bottom: 0'><i class='fa fa-exclamation-circle'></i> ServerAuth Account Manager is not configured yet.<br><br>Please create a configuration file or rename the existing one.</div>"; } else { if ($api_status == ServerAuthWebAPI::ERR_MYSQL) { echo "<div class='alert alert-error square' style='margin-bottom: 0'><i class='fa fa-exclamation-circle'></i> <b>MySQL Error:</b> " . $api->getDatabase()->connect_error . "</div>"; } elseif ($api_status == ServerAuthWebAPI::ERR_OUTDATED_PLUGIN) { echo "<div class='alert alert-error square' style='margin-bottom: 0'><i class='fa fa-exclamation-circle'></i> ServerAuth plugin is outdated. Please update it.</div>"; } elseif ($api_status == ServerAuthWebAPI::ERR_OUTDATED_WEBAPI) { echo "<div class='alert alert-error square' style='margin-bottom: 0'><i class='fa fa-exclamation-circle'></i> ServerAuth Web API is outdated. Please update it.</div>"; } else { ?> <form action='?action=login' method='POST'> <div class='form'> <div class='col-rs-2'> <label class='form-label' style='margin-left: -5px'>Username:</label> </div> <div class='col-rs-10 ns'> <input type='text' class='input' name='username'> </div> </div>
session_destroy(); header("Location: admin.php"); } ?> <div class='content'> <div class='col-2'></div> <div class='col-8'> <?php //Alerts if (!$cfg_status) { echo "<div class='alert alert-error square'><i class='fa fa-exclamation-circle'></i> ServerAuth Account Manager is not configured yet.<br><br>Please create a configuration file or rename the existing one.</div>"; } else { $api = new ServerAuthWebAPI($config["db_host"], $config["db_port"], $config["db_username"], $config["db_password"], $config["db_database"], $config["db_table_prefix"]); $api_status = $api->getStatus(); if ($api_status == ServerAuthWebAPI::ERR_MYSQL) { echo "<div class='alert alert-error square'><i class='fa fa-exclamation-circle'></i> <b>MySQL Error:</b> " . $api->getDatabase()->connect_error . "</div>"; } elseif ($api_status == ServerAuthWebAPI::ERR_OUTDATED_PLUGIN) { echo "<div class='alert alert-error square'><i class='fa fa-exclamation-circle'></i> ServerAuth plugin is outdated. Please update it.</div>"; } elseif ($api_status == ServerAuthWebAPI::ERR_OUTDATED_WEBAPI) { echo "<div class='alert alert-error square'><i class='fa fa-exclamation-circle'></i> ServerAuth Web API is outdated. Please update it.</div>"; } } ?> <?php echo "<div class='alert alert-info square'><i class='fa fa-info-circle'></i> Welcome, <b>" . $_SESSION["admin_login"] . "</b>.</div>"; if (isset($_GET["action"]) && isset($_GET["account"]) && strtolower($_GET["action"]) == "delete") { if ($api_status == ServerAuthWebAPI::SUCCESS) { if ($api->isPlayerRegistered($_GET["account"])) { echo "<div class='alert alert-success square'><button class='close'><span class='fa fa-close'></span></button><i class='fa fa-info-circle'></i> <b>" . $_GET["account"] . "</b> account deleted!</div>"; $api->unregisterPlayer($_GET["account"]); } else {