diff --git a/system/pages/account/change_email.php b/system/pages/account/change-email.php similarity index 97% rename from system/pages/account/change_email.php rename to system/pages/account/change-email.php index 954d596b3d..c97b554197 100644 --- a/system/pages/account/change_email.php +++ b/system/pages/account/change-email.php @@ -57,14 +57,14 @@ $twig->display('error_box.html.twig', array('errors' => $errors)); //show form - $twig->display('account.change_mail.html.twig', array( + $twig->display('account.change-email.html.twig', array( 'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null )); } } else { - $twig->display('account.change_mail.html.twig', array( + $twig->display('account.change-email.html.twig', array( 'new_email' => isset($_POST['new_email']) ? $_POST['new_email'] : null )); } diff --git a/system/pages/account/change_info.php b/system/pages/account/change-info.php similarity index 97% rename from system/pages/account/change_info.php rename to system/pages/account/change-info.php index 2b7234b51d..709dce27a7 100644 --- a/system/pages/account/change_info.php +++ b/system/pages/account/change-info.php @@ -76,7 +76,7 @@ $countries[$code] = $country; } - $twig->display('account.change_info.html.twig', array( + $twig->display('account.change-info.html.twig', array( 'countries' => $countries ?? [], 'account_rlname' => $account_rlname, 'account_location' => $account_location, diff --git a/system/pages/account/change_password.php b/system/pages/account/change-password.php similarity index 96% rename from system/pages/account/change_password.php rename to system/pages/account/change-password.php index 309c8dee13..bf172455e4 100644 --- a/system/pages/account/change_password.php +++ b/system/pages/account/change-password.php @@ -21,7 +21,7 @@ $new_password_confirm = $_POST['newpassword_confirm'] ?? NULL; $old_password = $_POST['oldpassword'] ?? NULL; if(empty($new_password) && empty($new_password_confirm) && empty($old_password)) { - $twig->display('account.change_password.html.twig'); + $twig->display('account.change-password.html.twig'); } else { @@ -52,7 +52,7 @@ $twig->display('error_box.html.twig', array('errors' => $errors)); //show form - $twig->display('account.change_password.html.twig'); + $twig->display('account.change-password.html.twig'); } else { $org_pass = $new_password; diff --git a/system/pages/account/change_comment.php b/system/pages/account/characters/change-comment.php similarity index 94% rename from system/pages/account/change_comment.php rename to system/pages/account/characters/change-comment.php index e4fb6e428c..7fa10c6936 100644 --- a/system/pages/account/change_comment.php +++ b/system/pages/account/characters/change-comment.php @@ -14,7 +14,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Change Comment'; -require __DIR__ . '/base.php'; +require PAGES . 'account/base.php'; if(!$logged) { return; @@ -68,7 +68,7 @@ } if(isset($player) && $player) { - $twig->display('account.change_comment.html.twig', array( + $twig->display('account.characters.change-comment.html.twig', array( 'player' => $player->toArray() )); } diff --git a/system/pages/account/change_name.php b/system/pages/account/characters/change-name.php similarity index 97% rename from system/pages/account/change_name.php rename to system/pages/account/characters/change-name.php index ef82b9add1..4a23131db8 100644 --- a/system/pages/account/change_name.php +++ b/system/pages/account/characters/change-name.php @@ -11,7 +11,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Change Name'; -require __DIR__ . '/base.php'; +require PAGES . 'account/base.php'; if(!$logged) { return; @@ -109,7 +109,7 @@ $twig->display('error_box.html.twig', array('errors' => $errors)); } - $twig->display('account.change_name.html.twig', array( + $twig->display('account.characters.change-name.html.twig', array( 'points' => $points, 'errors' => $errors //'account_players' => $account_logged->getPlayersList() diff --git a/system/pages/account/change_sex.php b/system/pages/account/characters/change-sex.php similarity index 96% rename from system/pages/account/change_sex.php rename to system/pages/account/characters/change-sex.php index 7e43b6fffb..6c95a6e742 100644 --- a/system/pages/account/change_sex.php +++ b/system/pages/account/characters/change-sex.php @@ -11,7 +11,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Change Sex'; -require __DIR__ . '/base.php'; +require PAGES . 'account/base.php'; if(!$logged) { return; @@ -88,7 +88,7 @@ if(!empty($errors)) { $twig->display('error_box.html.twig', array('errors' => $errors)); } - $twig->display('account.change_sex.html.twig', array( + $twig->display('account.characters.change-sex.html.twig', array( 'players' => $account_logged->getPlayersList(false), 'player_sex' => isset($player) ? $player->getSex() : -1, 'points' => $points diff --git a/system/pages/account/create_character.php b/system/pages/account/characters/create.php similarity index 93% rename from system/pages/account/create_character.php rename to system/pages/account/characters/create.php index e68c877351..5ad21dab74 100644 --- a/system/pages/account/create_character.php +++ b/system/pages/account/characters/create.php @@ -14,7 +14,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Create Character'; -require __DIR__ . '/base.php'; +require PAGES . 'account/base.php'; if(!$logged) { return; @@ -43,7 +43,7 @@ } if(!$character_created) { - $twig->display('account.create_character.html.twig', array( + $twig->display('account.characters.create.html.twig', array( 'name' => $character_name, 'sex' => $character_sex, 'vocation' => $character_vocation, diff --git a/system/pages/account/delete_character.php b/system/pages/account/characters/delete.php similarity index 96% rename from system/pages/account/delete_character.php rename to system/pages/account/characters/delete.php index 7804f01de0..af32070b63 100644 --- a/system/pages/account/delete_character.php +++ b/system/pages/account/characters/delete.php @@ -11,7 +11,7 @@ defined('MYAAC') or die('Direct access not allowed!'); $title = 'Delete Character'; -require __DIR__ . '/base.php'; +require PAGES . 'account/base.php'; if(!$logged) { return; @@ -93,5 +93,5 @@ $twig->display('error_box.html.twig', array('errors' => $errors)); } - $twig->display('account.delete_character.html.twig'); + $twig->display('account.characters.delete.html.twig'); } diff --git a/system/pages/account/confirm_email.php b/system/pages/account/confirm-email.php similarity index 100% rename from system/pages/account/confirm_email.php rename to system/pages/account/confirm-email.php diff --git a/system/pages/account/create.php b/system/pages/account/create.php index 58e72356c1..34e4689d14 100644 --- a/system/pages/account/create.php +++ b/system/pages/account/create.php @@ -227,7 +227,7 @@ $hash = md5(generateRandomString(16, true, true) . $email); $new_account->setCustomField('email_hash', $hash); - $verify_url = getLink('account/confirm_email/' . $hash); + $verify_url = getLink('account/confirm-email/' . $hash); $body_html = $twig->render('mail.account.verify.html.twig', array( 'account' => $tmp_account, 'verify_url' => generateLink($verify_url, $verify_url, true) diff --git a/system/pages/account/manage.php b/system/pages/account/manage.php index e3003e25d1..eff71c7849 100644 --- a/system/pages/account/manage.php +++ b/system/pages/account/manage.php @@ -52,7 +52,7 @@ else { if(setting('core.account_generate_new_reckey') && setting('core.mail_enabled')) - $account_registered = 'Yes ( Buy new Recovery Key )'; + $account_registered = 'Yes ( Buy new Recovery Key )'; else $account_registered = 'Yes'; } diff --git a/system/pages/account/register_new.php b/system/pages/account/register-new.php similarity index 100% rename from system/pages/account/register_new.php rename to system/pages/account/register-new.php diff --git a/system/routes.php b/system/routes.php index 576c14b237..c49b16b1fc 100644 --- a/system/routes.php +++ b/system/routes.php @@ -19,16 +19,7 @@ ['*', 'forum/base', '404.php', 10], ['*', 'guilds/base', '404.php', 10], - [['GET', 'POST'], 'account/password', 'account/change_password.php'], - [['GET', 'POST'], 'account/register/new', 'account/register_new.php'], - [['GET', 'POST'], 'account/email', 'account/change_email.php'], - [['GET', 'POST'], 'account/info', 'account/change_info.php'], - [['GET', 'POST'], 'account/character/create', 'account/create_character.php'], - [['GET', 'POST'], 'account/character/name', 'account/change_name.php'], - [['GET', 'POST'], 'account/character/sex', 'account/change_sex.php'], - [['GET', 'POST'], 'account/character/delete', 'account/delete_character.php'], - [['GET', 'POST'], 'account/character/comment[/{name:string}]', 'account/change_comment.php'], - ['GET', 'account/confirm_email/{hash:alphanum}', 'account/confirm_email.php'], + ['GET', 'account/confirm-email/{hash:alphanum}', 'account/confirm-email.php'], ['GET', 'bans/{page:int}', 'bans.php'], [['GET', 'POST'], 'characters[/{name:string}]', 'characters.php'], @@ -56,4 +47,20 @@ '/^polls\/[0-9]+\/?$/' => array('subtopic' => 'polls', 'id' => '$1'), '/^spells\/[A-Za-z0-9-_%]+\/[A-Za-z0-9-_]+\/?$/' => array('subtopic' => 'spells', 'vocation' => '$1', 'order' => '$2'), '/^houses\/view\/?$/' => array('subtopic' => 'houses', 'page' => 'view')*/ + + /** + * Deprecated + * To be removed in next versions + * Kept just for compatibility + */ + [['GET', 'POST'], 'account/password', 'account/change-password.php'], + [['GET', 'POST'], 'account/register/new', 'account/register-new.php'], + [['GET', 'POST'], 'account/email', 'account/change-email.php'], + [['GET', 'POST'], 'account/info', 'account/change-info.php'], + [['GET', 'POST'], 'account/character/create', 'account/characters/create.php'], + [['GET', 'POST'], 'account/character/name', 'account/characters/change-name.php'], + [['GET', 'POST'], 'account/character/sex', 'account/characters/change-sex.php'], + [['GET', 'POST'], 'account/character/delete', 'account/characters/delete.php'], + [['GET', 'POST'], 'account/character/comment[/{name:string}]', 'account/characters/change-comment.php'], + ['GET', 'account/confirm_email/{hash:alphanum}', 'account/confirm-email.php'], ]; diff --git a/system/templates/account.change_mail.html.twig b/system/templates/account.change-email.html.twig similarity index 94% rename from system/templates/account.change_mail.html.twig rename to system/templates/account.change-email.html.twig index 83fe9ce30d..ea627cc744 100644 --- a/system/templates/account.change_mail.html.twig +++ b/system/templates/account.change-email.html.twig @@ -29,7 +29,7 @@ Please enter your password and the new email address. Make sure that you enter a
- |