Feature/new router (#165)

* Remove unneeded escape

* Fix guild back buttons (change logo & motd)

* small adjustment in news.php

* Fix create character when admin (any case is allowed now)

* Fix forum table style (boards & thread view)

* Small improvement to plugins.enabled check

* [WIP] nikic/fast-route implementation

I will describe it more in Pull Request

* Optimisations & fixes.

* Fix path - should not be absolute

* Add PLUGINS to Twig path

* Don't hide "Install Plugin" Box by default

* Update package-lock.json

* nothing important, just early exit & fixes

Fix creature display

* fix premium_ends_at for tfs 1.3+

* Move pages

* Move pages tbc

* $db->select: make $where parameter optional, allows to get all records

* Add some error box to error

* fix parse error

* Rewriting the router v2

To be more flexible

* small fixes

* fix & add admin icons

* Move mass_* pages to correct folder

* fix logout hook 2

* Delete accountmanagement.php

* This code wasn't used

* Add missing var

* Add redirect_from && redirect_to to router options

+ Also add * for all methods shortcut

* Remove comments

Not allowed in normal json

* Allow admin pages included into plugins dir

* block access to some files

* Fix admin logout

* Fix #178

* feature: mail confirmed reward

Suggested by @EPuncker

# Conflicts:
#	system/hooks.php

* remove misleading comment

* adjust required version according to composer.json

* fix duplicated word

* Adjustments & fixed to mass actions

* Add password confirm, and change text type to password

* Add list of Open Source Software MyAAC is using

* Fix signature

* Show First, Second instead of numbers

* fix base dir detection

* fix double ACTION define + undefined URI in template

* new function> escapeHtml + fix css in admin menus

* fix changelog add

* fix news adding, rename const to NEWS_*

* Add verify to pages, add messages, limits, fix add

* fix "Please fill all input"

* add required input to admin pages

* shorten some expressions with ??

* shorten code + fix conversion (int)

* Move account_types to config, account.web_flags to common.php

* Update example.json

* feature: router aliases

* shorten some code + const convert

* remove wrong char

* fix signature on custom basedir

* fix: mass teleport position validation (#214)

* fix: mass teleport position validation

* fix: max position

* Fix execute in CLI

* fix warning in reload cache in dev mode

* Configurable admin panel folder

* feature: plugin require more options with comma

* $config_account_salt -> USE_ACCOUNT_SALT

* fix forum show_thread

* Update show_thread.php

---------

Co-authored-by: Gabriel Pedro <gpedro@users.noreply.github.com>
This commit is contained in:
slawkens
2023-02-07 11:41:05 +01:00
committed by GitHub
parent a2fb9a183b
commit f3745a2752
147 changed files with 1943 additions and 1142 deletions

View File

@@ -1,4 +1,4 @@
Please enter your account {{ account|lower }} and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/>
Please enter your account {{ account|lower }} and your password.<br/><a href="{{ getLink('account/create') }}">Create an account</a> if you do not have one yet.<br/><br/>
<form action="{{ getLink('account/manage') }}" method="post" >
{% if redirect is not null %}
<input type="hidden" name="redirect" value="{{ redirect }}" />

View File

@@ -11,12 +11,12 @@
<div class="form-group row">
<label for="body">Content</label>
<textarea class="form-control" id="body" name="body" maxlength="600" cols="50" rows="5">{{ body|raw }}</textarea>
<textarea class="form-control" id="body" name="body" maxlength="600" cols="50" rows="5" required>{{ body|raw }}</textarea>
</div>
<div class="form-group row">
<div class="col-12 col-sm-12 col-lg-6">
<label for="createdate" class="control-label">Date:</label>
<input type="text" class="form-control" id="createdate" name="createdate" autocomplete="off" maxlength="20" value="{{ create_date|date("M d Y, H:i:s") }}"/>
<input type="text" class="form-control" id="createdate" name="createdate" autocomplete="off" maxlength="20" value="{{ create_date|date("M d Y, H:i:s") }}" required/>
</div>
<div class="col-sm-6 pl-0">
<label for="player_id">Author</label>

View File

@@ -18,7 +18,7 @@
<div class="card-body">
<p class="login-box-msg">Please login.</p>
<form method="post">
<form method="post" action="{{ constant('ADMIN_URL') }}">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>

View File

@@ -11,7 +11,7 @@
<div class="form-group row">
<label for="title">Title</label>
<input type="text" id="title" name="title" class="form-control" autocomplete="off" style="cursor: auto;" value="{{ title }}">
<input type="text" id="title" name="title" class="form-control" autocomplete="off" style="cursor: auto;" value="{{ title }}" required>
</div>
<label for="editor">Content</label>

View File

@@ -0,0 +1,32 @@
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Open Source Software</h5>
</div>
<div class="card-body">
MyAAC uses following Open Source libraries:<br/><br/>
<b>HTML/Javascript/CSS:</b>
<ul>
<li>Admin LTE - <a href="https://adminlte.io">https://adminlte.io</a> (MIT License)</li>
<li>Bootstrap - <a href="https://getbootstrap.com">https://getbootstrap.com</a> (MIT License)</li>
<li>jQuery - <a href="https://jquery.com">https://jquery.com</a> (MIT License)</li>
<li>jQuery UI - <a href="http://jqueryui.com">http://jqueryui.com</a> (MIT License)</li>
<li>TinyMCE - <a href="https://www.tiny.cloud">https://www.tiny.cloud</a> (MIT License)</li>
<li>Font Awesome - <a href="https://fontawesome.com">https://fontawesome.com</a> (MIT License)</li>
<li>DataTables - <a href="https://datatables.net">https://datatables.net</a> (MIT License)</li>
<li>jQuery DateTimePicker - <a href="http://xdsoft.net/jqplugins/datetimepicker">http://xdsoft.net/jqplugins/datetimepicker</a> (MIT License)</li>
<li>jquery.qtip - <a href="http://craigsworks.com">http://craigsworks.com</a> (MIT License)</li>
<li>Respond.js - <a href="https://github.com/scottjehl/Respond">https://github.com/scottjehl/Respond</a> (MIT License)</li>
<li>Spectrum Colorpicker - <a href="https://github.com/bgrins/spectrum">https://github.com/bgrins/spectrum</a> (MIT License)</li>
</ul>
<b>PHP:</b>
<ul>
<li>Twig - <a href="https://twig.symfony.com">https://twig.symfony.com/</a> (3-Clause BSD License)</li>
<li>PHPMailer- <a href="https://github.com/PHPMailer/PHPMailer">https://github.com/PHPMailer/PHPMailer</a> (LGPL v2.1 License)</li>
<li>nikic/FastRoute - <a href="https://github.com/nikic/FastRoute">https://github.com/nikic/FastRoute</a> (Custom License, can be found in vendor/nikic/fast-route/LICENSE)</li>
<li>composer/semver - <a href="https://github.com/composer/semver">https://github.com/composer/semver</a> (MIT License)</li>
<li>erusev/parsedown - <a href="https://github.com/erusev/parsedown">https://github.com/erusev/parsedown</a> (MIT License)</li>
<li>PHPOTP - <a href="https://github.com/Voronenko/PHPOTP">https://github.com/Voronenko/PHPOTP</a> (MIT License)</li>
<li>POT - no website (LGPL v3 License)</li>
</ul>
</div>
</div>

View File

@@ -3,22 +3,18 @@
<div class="card-header">
<h5 class="m-0">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h5>
</div>
<form id="form" class="form-horizontal" method="post" action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
<form id="form" class="form-horizontal" method="post" action="?p=pages&action={% if action == 'edit' %}edit{% else %}new{% endif %}">
{% if action == 'edit' %}
<input type="hidden" name="id" value="{{ id }}"/>
{% endif %}
<div class="card-body">
<div class="form-group row">
<label for="title">Page Title</label>
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ title }}">
<input type="text" id="title" name="title" class="form-control" autocomplete="off" maxlength="29" style="cursor: auto;" value="{{ title }}" required>
</div>
<div class="form-group row">
<label for="name">Link/name</label>
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
maxlength="29"
style="cursor: auto;" value="{{ name }}">
<input type="text" id="name" name="name" class="form-control" autocomplete="off" maxlength="29" style="cursor: auto;" value="{{ name }}" required>
</div>
<div class="form-group row">
<label for="access">Access</label>

View File

@@ -1,4 +1,4 @@
<div class="collapse" id="install_plugin">
<div id="install_plugin">
<div class="card card-info card-outline">
<div class="card-header">
<h5 class="m-0">Install plugin</h5>

View File

@@ -5,7 +5,7 @@
<div class="card-header">
<h5 class="m-0">Give Premium Points</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_account">
<div class="card-body">
<div class="form-group">
<label>Premium Points</label>
@@ -27,7 +27,7 @@
<div class="card-header">
<h5 class="m-0">Give Coins</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_account">
<div class="card-body">
<div class="form-group">
<label>Coins</label>
@@ -49,7 +49,7 @@
<div class="card-header">
<h5 class="m-0">Give Premium Days</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=account">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_account">
<div class="card-body">
<div class="form-group">
<label>Premium Days</label>

View File

@@ -4,11 +4,11 @@
<div class="card-header">
<h5 class="m-0">Set Town</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_teleport">
<div class="card-body">
<div class="form-group">
<label>Town</label>
<select name="value" class="form-control">
<select name="town_id" class="form-control">
{% if config.towns|length > 0 %}
{% for town_id, town_name in config.towns %}
<option value="{{ town_id }}">{{ town_name }}</option>
@@ -31,25 +31,25 @@
<div class="card-header">
<h5 class="m-0">Set Position</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_teleport">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>Position X</label>
<input type="number" name="posx" value="" class="form-control">
<input type="number" min="0" max="65535" required name="posx" value="" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Position Y</label>
<input type="number" name="posy" value="" class="form-control">
<input type="number" min="0" max="65535" required name="posy" value="" class="form-control">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Position Z</label>
<input type="number" name="posz" value="" class="form-control">
<input type="number" min="0" max="16" required name="posz" value="" class="form-control">
</div>
</div>
</div>
@@ -66,12 +66,13 @@
<div class="card-header">
<h5 class="m-0">Teleport to Temple</h5>
</div>
<form method="post" action="{{ constant('ADMIN_URL') }}?p=tools&tool=teleport">
<form method="post" action="{{ constant('ADMIN_URL') }}?p=mass_teleport">
<div class="card-footer">
<input type="hidden" name="action" value="set-position">
<input type="hidden" name="posx" value="0">
<input type="hidden" name="posy" value="0">
<input type="hidden" name="posz" value="0">
<input type="hidden" name="to_temple" value="yes">
<button type="submit" class="btn btn-info">Teleport to Temple</button>
</div>
</form>

View File

@@ -7,7 +7,7 @@
</script>
{% set rows = 0 %}
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td><img src="<{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0"></td>
<td><img src="{{ template_path }}/images/general/blank.gif" width="10" height="1" border="0"></td>
<td>
{{ hook(constant('HOOK_CHARACTERS_BEFORE_INFORMATIONS')) }}
{% if canEdit %}

View File

@@ -8,8 +8,8 @@
<meta name="description" content="myaac">
<meta name="generator" content="MyAAC">
<link rel="stylesheet" href="/tools/css/messages.css">
<link rel="shortcut icon" href="/images/error.ico">
<link rel="stylesheet" href="tools/css/messages.css">
<link rel="shortcut icon" href="images/error.ico">
<base href="{{ BASE_URL }}" />
<style>
@@ -57,7 +57,7 @@
}
</style>
<!--[if lt IE 9]>
<script src="/tools/js/html5shiv.min.js"></script>
<script src="tools/js/html5shiv.min.js"></script>
<![endif]-->
</head>
<body>

View File

@@ -8,12 +8,12 @@
<form action="{{ constant('BASE_URL') }}install/" method="post" autocomplete="off">
<input type="hidden" name="step" id="step" value="finish" />
{% for value in ['email', account, 'password', 'player_name'] %}
{% for value in ['email', 'account', 'password', 'password_confirm', 'player_name'] %}
<div class="form-group mb-2">
<label for="vars_{{ value }}">{{ locale['step_admin_' ~ value] }}</label>
<input class="form-control" type="text" name="vars[{{ value }}]" id="vars_{{ value }}"{% if session['var_' ~ value] is not null %} value="{{ session['var_' ~ value] }}"{% endif %}/>
<input class="form-control" type="{% if value in ['password', 'password_confirm'] %}password{% else %}text{% endif %}" name="vars[{{ value }}]" id="vars_{{ value }}"{% if session['var_' ~ value] is not null %} value="{{ session['var_' ~ value] }}"{% endif %}/>
<small class="form-text text-muted">{{ locale['step_admin_' ~ value ~ '_desc']|raw }}</small>
</div>

View File

@@ -85,14 +85,14 @@
<table border="0" cellspacing="1" cellpadding="4" width="100%">
<tr bgcolor="{{ config.vdarkborder }}">
{% if config.account_country %}
<td width="11px"><a href="?subtopic=online&order=country" class="white">#</A></td>
<td width="11px"><a href="{{ getLink('online?order=country') }}" class="white">#</A></td>
{% endif %}
{% if config.online_outfit %}
<td class="white"><b>Outfit</b></td>
{% endif %}
<td width="60%"><a href="?subtopic=online&order=name" class="white">Name</A></td>
<td width="20%"><a href="?subtopic=online&order=level" class="white">Level</A></td>
<td width="20%"><a href="?subtopic=online&order=vocation" class="white">Vocation</td>
<td width="60%"><a href="{{ getLink('online?order=name') }}" class="white">Name</A></td>
<td width="20%"><a href="{{ getLink('online?order=level') }}" class="white">Level</A></td>
<td width="20%"><a href="{{ getLink('online?order=vocation') }}" class="white">Vocation</td>
</tr>
{% set i = 0 %}
{% for player in players %}