[WIP] nikic/fast-route implementation

I will describe it more in Pull Request
This commit is contained in:
slawkens
2021-06-08 19:17:38 +02:00
parent cf04c1df02
commit e52a301d9e
65 changed files with 1075 additions and 668 deletions

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
//set rights in guild
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : null;
@@ -124,4 +126,4 @@ else {
}
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
$rank_name = isset($_REQUEST['rank_name']) ? $_REQUEST['rank_name'] : null;
if(!Validator::guildName($guild_name)) {
@@ -74,4 +76,4 @@ else
}
}
?>
?>

View File

@@ -0,0 +1,17 @@
<?php
/**
* Guilds base
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2021 MyAAC
* @link https://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
if($db->hasTable('guild_members'))
define('GUILD_MEMBERS_TABLE', 'guild_members');
else
define('GUILD_MEMBERS_TABLE', 'guild_membership');
define('MOTD_EXISTS', $db->hasColumn('guilds', 'motd'));

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();
@@ -122,4 +124,4 @@ if(!empty($errors)) {
'action' => '?subtopic=guilds'
));
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(!MOTD_EXISTS)
return;
@@ -74,4 +76,4 @@ if(!empty($errors)) {
));
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(!$logged) {
$errors[] = "You are not logged in. You can't change nick.";
$twig->display('error_box.html.twig', array('errors' => $errors));

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(!$logged) {
$errors[] = "You are not logged in. You can't change rank.";
}

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(!$logged)
{
echo "You are not logged in.";
@@ -64,4 +66,4 @@ else
echo "0 guilds found.";
$twig->display('guilds.back_button.html.twig');
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
if(!$logged)
{
echo "You are not logged in.";
@@ -66,4 +68,4 @@ else
echo "0 players found.";
$twig->display('guilds.back_button.html.twig');
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : NULL;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : NULL;
$todo = isset($_REQUEST['todo']) ? $_REQUEST['todo'] : NULL;
@@ -131,4 +133,4 @@ else {
));
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();
@@ -65,4 +67,4 @@ if(!empty($errors)) {
));
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();
@@ -77,4 +79,4 @@ if(!empty($errors)) {
));
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
$name = stripslashes($_REQUEST['name']);
@@ -113,4 +115,4 @@ else
'guild_name' => $guild->getName()
));
}
}
}

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
$rank_to_delete = isset($_REQUEST['rankid']) ? (int) $_REQUEST['rankid'] : null;

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
//set rights in guild
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : NULL;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : NULL;
@@ -122,4 +124,4 @@ if($show) {
$twig->display('guilds.back_button.html.twig', array(
'action' => getLink('guilds') . '/' . $guild_name
));
));

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
//set rights in guild
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : null;
@@ -118,4 +120,4 @@ else
));
}
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
//set rights in guild
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : NULL;
$name = isset($_REQUEST['name']) ? stripslashes($_REQUEST['name']) : NULL;

View File

@@ -11,6 +11,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guilds_list = new OTS_Guilds_List();
$guilds_list->orderBy("name");

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();
@@ -56,5 +58,3 @@ if(empty($errors)) {
if(!empty($errors)) {
$twig->display('error_box.html.twig', array('errors' => $errors));
}
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : NULL;
$pass_to = isset($_REQUEST['player']) ? stripslashes($_REQUEST['player']) : NULL;
if(!Validator::guildName($guild_name)) {
@@ -116,4 +118,4 @@ if(!empty($guild_errors)) {
echo '<br/><div style="text-align:center"><form action="?subtopic=guilds" method="post">' . $twig->render('buttons.back.html.twig') . '</form></div>';
}
?>
?>

View File

@@ -10,6 +10,8 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name)) {
$errors[] = Validator::getLastError();

View File

@@ -12,6 +12,9 @@
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Guilds';
require __DIR__ . '/base.php';
$guild_name = isset($_REQUEST['guild']) ? urldecode($_REQUEST['guild']) : null;
if(!Validator::guildName($guild_name))
$errors[] = Validator::getLastError();
@@ -159,4 +162,4 @@ $twig->display('guilds.view.html.twig', array(
'invited_list' => $invited_list,
'show_accept_invite' => $show_accept_invite,
'useGuildNick' => $useGuildNick
));
));