Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmybrancaccio committed Apr 6, 2021
1 parent 3e2dcea commit c2688ee
Show file tree
Hide file tree
Showing 70 changed files with 38,601 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.push.settings.jsonc
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# cmangos-starter-website
A starter website for people using CMaNGOS.

A starter website for people using CMaNGOS. This will allow users to login and register on your CMaNGOS powered server.

## Installation Requirements

- PHP 7.1+
- Web server (ex. Apache or Nginx)
- CMaNGOS instance

## Installation Notes

- You can download this by clicking on the green Code button above. It will download a `.zip` file. Unzip the contents into your web space.
- You do not need to perform any `composer install` command, but you may want to use `composer update` if in the future an update is made to [Laizerox/php-wowemu-auth](https://github.com/Laizerox/php-wowemu-auth).
- Make sure to update the `configuration.php` file with your database settings. In this file you can also set the GM level and expansion pack value you want to give newly registered users.
- You can upload a new image for the site to the `assets/img` directory. If the name of the image is something other than `home-jumbotron.jpg` you'll want to edit the `home-jumbotron` CSS class in `assets/css/custom.css`.
- **You'll likely want to add some input validation and clensing.** Perhaps in the future I will do this via [HTML Purifier](http://htmlpurifier.org).
- I also recommend vieiwng the `register.php` and `login.php` pages and add your own code for handling successful and failed registrations and logins. As they are now they do not handle either, so the user will be presented with a blank white page regardless of whether or not the registration or login is successful or not.
7 changes: 7 additions & 0 deletions assets/css/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/css/bootstrap.min.css.map

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions assets/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
body {
font-family: 'Nunito', sans-serif;
}

.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}

@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}

.home-jumbotron {
background-image: url('../img/home-jumbotron.jpg');
background-size: cover;
height: 400px;
}

.home-jumbotron-text {
text-shadow: 1rem;
}
Binary file added assets/img/home-jumbotron.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/js/bootstrap.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/js/bootstrap.bundle.min.js.map

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"laizerox/php-wowemu-auth": "^1.0"
}
}
173 changes: 173 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* Database connection information.
* This should be updated to the information of your CMaNGOS realmd database!
*/
define('DB_HOST', 'localhost');
define('DB_USERNAME', 'mangos');
define('DB_PASSWORD', 'mangos');
define('DB_DATABASE_NAME', 'realmd');

/**
* Set your GM level, expansion pack and more here.
* GM_LEVEL:
* 0 - Player
* 1 - Moderator
* 2 - Game Master
* 3 - Administrator
*
* EXPANSION_PACK:
* 0 - Classic
* 1 - The Burning Crusade
* 2 - Wrath of the Lich King
*/
define('GM_LEVEL', '0');
define('EXPANSION_PACK', '0');
69 changes: 69 additions & 0 deletions footer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

<footer class="pt-3 mt-4 text-muted border-top">&copy; <?php echo date('Y'); ?></footer>
</div>
</main>

<script type="text/javascript" src="assets/js/bootstrap.bundle.min.js"></script>

<div class="modal fade" id="loginModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Login</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="/login" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" name="password" required>
</div>
<?php $login = sha1(time()); ?>
<input type="hidden" name="login" value="<?php echo $login; ?>">
</form>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-secondary">Login</button>
</div>
</div>
</div>
</div>

<div class="modal fade" id="registerModal" tabindex="-2">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Register</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="/register" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" name="username" required>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email Address</label>
<input type="email" class="form-control" name="email" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" name="password" required>
</div>
<?php $register = sha1(time()); ?>
<input type="hidden" name="register" value="<?php echo $register; ?>">
</form>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-secondary">Register</button>
</div>
</div>
</div>
</div>

</body>
</html>
53 changes: 53 additions & 0 deletions header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php

/* Start up our PHP sessions. */
session_start();

?><!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="CMaNGOS, World of Warcraft, WoW, Warcraft">
<meta name="author" content="jimmybrancaccio">
<title>CMaNGOS - Starter Website</title>

<link rel="canonical" href="/">

<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">

<!-- Custom CSS -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="assets/css/custom.css">

<!-- Favicons -->
<!-- <link rel="icon" href="/docs/5.0/assets/img/favicons/favicon.ico"> -->
</head>

<body>
<main>
<div class="container py-4">
<header class="pb-3 mb-4 border-bottom">
<div class="row">
<div class="col-md-6">
<a href="./" class="d-flex align-items-center text-dark text-decoration-none">
<i class="bi bi-shield-shaded fs-4"></i>&nbsp;&nbsp;
<span class="fs-4">CMaNGOS - Starter Website</span>
</a>
</div>
<div class="col-md-6 align-self-end text">
<div class="dropdown">
<a class="dropdown-toggle float-end text-dark text-decoration-none" href="#" role="button" id="dropdownMenuLink" data-bs-toggle="dropdown" aria-expanded="false">Login / Register
</a>

<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#loginModal"><i class="bi bi-arrow-right-short"></i> Login</a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#registerModal"><i class="bi bi-arrow-right-short"></i> Register</a></li>
</ul>
</div>
</div>
</div>
</header>
Loading

0 comments on commit c2688ee

Please sign in to comment.