Exemple #1
0
                echo "<div class='hint out-success'>Password changed!</div>";
            }
        }
        ?>
							    </div>
							</div>
							<div class='col-rs-12 ns alignment-right'>
								<input type='submit' class='button' value='Change Password'>
							</div>
						</form>
					</div>
				</div>
				<div class='panel panel-error' id='delaccount'>
				<?php 
        if (isset($_GET["action"]) && strtolower($_GET["action"]) == "delaccount") {
            $api->unregisterPlayer($_SESSION["login"]);
            session_destroy();
            header("Location: index.php");
        }
        ?>
					<div class='panel-header'>
						<div class='panel-title'><i class='fa fa-times-circle'></i> Delete Account</div>
					</div>
					<div class='panel-content'>
						<a class='button button-error full-width alignment-center' href='?action=delaccount'>Click here to delete your account (no undo)</a>
					</div>
				</div>
		<?php 
    }
}
?>
Exemple #2
0
            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 {
                    echo "<div class='alert alert-error square'><button class='close'><span class='fa fa-close'></span></button><i class='fa fa-exclamation-circle'></i> Account <b>" . $_GET["account"] . "</b> not found.</div>";
                }
            } else {
                echo "<div class='alert alert-error square'><button class='close'><span class='fa fa-close'></span></button><i class='fa fa-exclamation-circle'></i> Can't delete <b>" . $_GET["account"] . "</b>. An error has occurred.</div>";
            }
        }
        if (isset($_GET["action"]) && strtolower($_GET["action"]) == "chuserpass" && isset($_GET["user"]) && isset($_POST["new_password"])) {
            if ($api_status == ServerAuthWebAPI::SUCCESS) {
                if ($api->isPlayerRegistered($_GET["user"])) {
                    if (preg_match('/\\s/', $_POST["new_password"]) == 0) {
                        if (strlen($_POST["new_password"]) <= $config["min-password-length"]) {
                            echo "<div class='alert alert-error square'><button class='close'><span class='fa fa-close'></span></button><i class='fa fa-exclamation-circle'></i> Password for <b>" . $_GET["user"] . "</b> account too short!</div>";
                        } elseif (strlen($_POST["new_password"]) >= $config["max-password-length"]) {
                            echo "<div class='alert alert-error square'><button class='close'><span class='fa fa-close'></span></button><i class='fa fa-exclamation-circle'></i> Password for <b>" . $_GET["user"] . "</b> account too long!</div>";