Removed unnecessary extensions from the routes

... almost. restore.pl was left temporarily (namely for two days) so that users could safely restore their passwords if they needed to.
This commit is contained in:
Ilya Prokopenko 2021-12-31 11:28:57 +07:00
parent c2588d18dc
commit 8863ededf1
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56
22 changed files with 41 additions and 37 deletions

View file

@ -94,7 +94,7 @@
<tr> <tr>
<td> <td>
<center> <center>
<a href="http://{$_SERVER['HTTP_HOST']}/restore.pl?act=finish&key={rawurlencode($key)}" align="center" class="float-center">Сбросить пароль!</a> <a href="http://{$_SERVER['HTTP_HOST']}/restore?act=finish&key={rawurlencode($key)}" align="center" class="float-center">Сбросить пароль!</a>
</center> </center>
</td> </td>
</tr> </tr>
@ -118,8 +118,8 @@
<table class="callout"> <table class="callout">
<tr> <tr>
<th class="callout-inner primary"> <th class="callout-inner primary">
<a href="http://{$_SERVER['HTTP_HOST']}/restore.pl?act=finish&key={$key}" style="color: #000; text-decoration: none;"> <a href="http://{$_SERVER['HTTP_HOST']}/restore?act=finish&key={$key}" style="color: #000; text-decoration: none;">
http://{$_SERVER['HTTP_HOST']}/restore.pl?act=finish&key={$key} http://{$_SERVER['HTTP_HOST']}/restore?act=finish&key={$key}
</a> </a>
</th> </th>
</tr> </tr>

View file

@ -122,7 +122,7 @@ final class CommentPresenter extends OpenVKPresenter
$this->flashFail( $this->flashFail(
"succ", "succ",
"Успешно", "Успешно",
"Этот комментарий больше не будет показыватся.<br/><a href='/al_comments.pl/spam?$id'>Отметить как спам</a>?" "Этот комментарий больше не будет показыватся.<br/><a href='/al_comments/spam?$id'>Отметить как спам</a>?"
); );
} }
} }

View file

@ -217,7 +217,7 @@
<input type="hidden" name="hash" value="{$csrfToken}" /> <input type="hidden" name="hash" value="{$csrfToken}" />
<input type="submit" value="{_'log_in'}" class="button" style="display: inline-block;" /> <input type="submit" value="{_'log_in'}" class="button" style="display: inline-block;" />
<a n:if="OPENVK_ROOT_CONF['openvk']['preferences']['registration']['enable']" href="/reg" class="button" style="display: inline-block;" >{_registration}</a><br><br> <a n:if="OPENVK_ROOT_CONF['openvk']['preferences']['registration']['enable']" href="/reg" class="button" style="display: inline-block;" >{_registration}</a><br><br>
<a href="/restore.pl">{_"forgot_password"}</a> <a href="/restore">{_"forgot_password"}</a>
</form> </form>
{/ifset} {/ifset}
</div> </div>

View file

@ -7,7 +7,7 @@
{block content} {block content}
<div class="container_gray"> <div class="container_gray">
<form method="POST" enctype="multipart/form-data" action="/club{$club->getId()}/setAdmin.jsp"> <form method="POST" enctype="multipart/form-data" action="/club{$club->getId()}/setAdmin">
<table cellspacing="7" cellpadding="0" width="40%" border="0" align="center"> <table cellspacing="7" cellpadding="0" width="40%" border="0" align="center">
<tbody> <tbody>
<tr> <tr>

View file

@ -109,7 +109,7 @@
{var user = $x instanceof $Manager ? $x->getUser() : $x} {var user = $x instanceof $Manager ? $x->getUser() : $x}
{var manager = $x instanceof $Manager ? $x : $club->getManager($user, !$club->canBeModifiedBy($thisUser))} {var manager = $x instanceof $Manager ? $x : $club->getManager($user, !$club->canBeModifiedBy($thisUser))}
{if $club->canBeModifiedBy($thisUser ?? NULL)} {if $club->canBeModifiedBy($thisUser ?? NULL)}
<a class="profile_link" href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hash={rawurlencode($csrfToken)}" n:if="$club->getOwner()->getId() !== $user->getId()"> <a class="profile_link" href="/club{$club->getId()}/setAdmin?user={$user->getId()}&hash={rawurlencode($csrfToken)}" n:if="$club->getOwner()->getId() !== $user->getId()">
{if $manager} {if $manager}
{_devote} {_devote}
{else} {else}
@ -130,12 +130,12 @@
{_set_comment} {_set_comment}
</a> </a>
{if $manager} {if $manager}
<a class="profile_link" href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hidden={(int) !$manager->isHidden()}&hash={rawurlencode($csrfToken)}"> <a class="profile_link" href="/club{$club->getId()}/setAdmin?user={$user->getId()}&hidden={(int) !$manager->isHidden()}&hash={rawurlencode($csrfToken)}">
{if $manager->isHidden()}{_hidden_yes}{else}{_hidden_no}{/if} {if $manager->isHidden()}{_hidden_yes}{else}{_hidden_no}{/if}
</a> </a>
{/if} {/if}
{if $club->getOwner()->getId() == $user->getId()} {if $club->getOwner()->getId() == $user->getId()}
<a class="profile_link" href="/club{$club->getId()}/setAdmin.jsp?user={$user->getId()}&hidden={(int) !$club->isOwnerHidden()}&hash={rawurlencode($csrfToken)}"> <a class="profile_link" href="/club{$club->getId()}/setAdmin?user={$user->getId()}&hidden={(int) !$club->isOwnerHidden()}&hash={rawurlencode($csrfToken)}">
{if $club->isOwnerHidden()}{_hidden_yes}{else}{_hidden_no}{/if} {if $club->isOwnerHidden()}{_hidden_yes}{else}{_hidden_no}{/if}
</a> </a>
{/if} {/if}

View file

@ -35,7 +35,7 @@
<div class="album-photo"> <div class="album-photo">
<a <a
n:if="!is_null($thisUser) && $album->canBeModifiedBy($thisUser)" n:if="!is_null($thisUser) && $album->canBeModifiedBy($thisUser)"
href="/album{$album->getPrettyId()}/remove_photo.pl/{$photo->getId()}" class="album-photo--delete"> href="/album{$album->getPrettyId()}/remove_photo/{$photo->getId()}" class="album-photo--delete">
&times; &times;
</a> </a>

View file

@ -39,6 +39,6 @@
</form> </form>
<hr/> <hr/>
<center> <center>
{_"you_can_also"} <a href="/album{$album->getOwner()->getId()}_{$album->getId()}/delete.pl?hash={rawurlencode($csrfToken)}">{_"delete_album"}</a>. {_"you_can_also"} <a href="/album{$album->getOwner()->getId()}_{$album->getId()}/delete?hash={rawurlencode($csrfToken)}">{_"delete_album"}</a>.
</center> </center>
{/block} {/block}

View file

@ -23,7 +23,7 @@
<a href="/support/delete/{$id}?hash={$csrfToken}">{_delete}</a> <a href="/support/delete/{$id}?hash={$csrfToken}">{_delete}</a>
</div><br/> </div><br/>
<div> <div>
<form action="/al_comments.pl/create/support/reply/{$id}" method="post" style="margin:0;"> <form action="/al_comments/create/support/reply/{$id}" method="post" style="margin:0;">
<textarea name="text" id="answer_text" style="width: 100%;resize: vertical;"></textarea> <textarea name="text" id="answer_text" style="width: 100%;resize: vertical;"></textarea>
<div> <div>
<!-- padding to fix <br/> bug --> <!-- padding to fix <br/> bug -->

View file

@ -48,7 +48,7 @@
{if $ticket->getType() !== 2} {if $ticket->getType() !== 2}
<br> <br>
<div> <div>
<form action="/al_comments.pl/create/support/{$id}" method="post" style="margin:0;"> <form action="/al_comments/create/support/{$id}" method="post" style="margin:0;">
<textarea name="text" style="width: 100%;resize: vertical;"></textarea> <textarea name="text" style="width: 100%;resize: vertical;"></textarea>
<div> <div>
<!-- padding to fix <br/> bug --> <!-- padding to fix <br/> bug -->

View file

@ -288,7 +288,7 @@
{elseif $isAvatar} {elseif $isAvatar}
<h4>{_"profile_picture"}</h4> <h4>{_"profile_picture"}</h4>
<form action="/al_avatars.pl" method="POST" enctype="multipart/form-data"> <form action="/al_avatars" method="POST" enctype="multipart/form-data">
<table cellspacing="7" cellpadding="0" width="60%" border="0" align="center"> <table cellspacing="7" cellpadding="0" width="60%" border="0" align="center">
<tbody> <tbody>
<tr> <tr>

View file

@ -507,7 +507,7 @@
(function() { (function() {
res = document.querySelector("#uBanMsgInput").value; res = document.querySelector("#uBanMsgInput").value;
xhr = new XMLHttpRequest(); xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/ban.pl/" + {$user->getId()} + "?reason=" + res + "&hash=" + {rawurlencode($csrfToken)}, true); xhr.open("GET", "/admin/ban/" + {$user->getId()} + "?reason=" + res + "&hash=" + {rawurlencode($csrfToken)}, true);
xhr.onload = (function() { xhr.onload = (function() {
if(xhr.responseText.indexOf("reason") === -1) if(xhr.responseText.indexOf("reason") === -1)
MessageBox("Ошибка", "Не удалось забанить пользователя...", ["OK"], [Function.noop]); MessageBox("Ошибка", "Не удалось забанить пользователя...", ["OK"], [Function.noop]);
@ -529,7 +529,7 @@
(function() { (function() {
res = document.querySelector("#uWarnMsgInput").value; res = document.querySelector("#uWarnMsgInput").value;
xhr = new XMLHttpRequest(); xhr = new XMLHttpRequest();
xhr.open("GET", "/admin/warn.pl/" + {$user->getId()} + "?message=" + res + "&hash=" + {rawurlencode($csrfToken)}, true); xhr.open("GET", "/admin/warn/" + {$user->getId()} + "?message=" + res + "&hash=" + {rawurlencode($csrfToken)}, true);
xhr.onload = (function() { xhr.onload = (function() {
if(xhr.responseText.indexOf("message") === -1) if(xhr.responseText.indexOf("message") === -1)
MessageBox("Ошибка", "Не удалось отправить предупреждение...", ["OK"], [Function.noop]); MessageBox("Ошибка", "Не удалось отправить предупреждение...", ["OK"], [Function.noop]);

View file

@ -1,7 +1,7 @@
<h4 n:if="$showTitle ?? true">{_"comments"} ({$count})</h4> <h4 n:if="$showTitle ?? true">{_"comments"} ({$count})</h4>
<div n:ifset="$thisUser"> <div n:ifset="$thisUser">
{var commentsURL = "/al_comments.pl/create/$model/" . $parent->getId()} {var commentsURL = "/al_comments/create/$model/" . $parent->getId()}
{var club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club} {var club = $parent instanceof \openvk\Web\Models\Entities\Post && $parent->getTargetWall() < 0 ? (new openvk\Web\Models\Repositories\Clubs)->get(abs($parent->getTargetWall())) : $club}
{if !$readOnly} {if !$readOnly}
{include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club} {include "textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), club => $club}

View file

@ -128,7 +128,7 @@
{include "../comment.xml", comment => $comment, $compact => true} {include "../comment.xml", comment => $comment, $compact => true}
{/foreach} {/foreach}
<div n:ifset="$thisUser" id="commentTextArea{$commentTextAreaId}" n:attr="style => ($commentsCount == 0 ? 'display: none;')" class="commentsTextFieldWrap"> <div n:ifset="$thisUser" id="commentTextArea{$commentTextAreaId}" n:attr="style => ($commentsCount == 0 ? 'display: none;')" class="commentsTextFieldWrap">
{var commentsURL = "/al_comments.pl/create/posts/" . $post->getId()} {var commentsURL = "/al_comments/create/posts/" . $post->getId()}
{include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post} {include "../textArea.xml", route => $commentsURL, postOpts => false, graffiti => (bool) ovkGetQuirk("comments.allow-graffiti"), post => $post}
</div> </div>
</div> </div>

View file

@ -19,10 +19,12 @@ routes:
handler: "Support->view" handler: "Support->view"
- url: "/support/comment/{num}/rate/{num}" - url: "/support/comment/{num}/rate/{num}"
handler: "Support->rateAnswer" handler: "Support->rateAnswer"
- url: "/al_comments.pl/create/support/{num}" - url: "/al_comments/create/support/{num}"
handler: "Support->makeComment" handler: "Support->makeComment"
- url: "/al_comments.pl/create/support/reply/{num}" - url: "/al_comments/create/support/reply/{num}"
handler: "Support->AnswerTicketReply" handler: "Support->AnswerTicketReply"
- url: "/al_comments/create/{text}/{num}"
handler: "Comment->makeComment"
- url: "/support/delete/{num}" - url: "/support/delete/{num}"
handler: "Support->delete" handler: "Support->delete"
- url: "/language" - url: "/language"
@ -47,6 +49,10 @@ routes:
handler: "Auth->register" handler: "Auth->register"
- url: "/logout" - url: "/logout"
handler: "Auth->logout" handler: "Auth->logout"
- url: "/restore"
handler: "Auth->restore"
- url: "/restore/internal-finish"
handler: "Auth->finishRestoringPassword"
- url: "/restore.pl" - url: "/restore.pl"
handler: "Auth->restore" handler: "Auth->restore"
- url: "/restore.pl/internal-finish" - url: "/restore.pl/internal-finish"
@ -75,8 +81,6 @@ routes:
handler: "Group->sub" handler: "Group->sub"
- url: "/setSub/v4/club" - url: "/setSub/v4/club"
handler: "Group->attend" handler: "Group->attend"
- url: "/al_comments.pl/create/{text}/{num}"
handler: "Comment->makeComment"
- url: "/groups/{num}/setNewOwner/{num}" - url: "/groups/{num}/setNewOwner/{num}"
handler: "Group->changeOwner" handler: "Group->changeOwner"
- url: "/comment{num}/like" - url: "/comment{num}/like"
@ -123,9 +127,9 @@ routes:
handler: "Photos->album" handler: "Photos->album"
- url: "/album{num}_{num}/edit" - url: "/album{num}_{num}/edit"
handler: "Photos->editAlbum" handler: "Photos->editAlbum"
- url: "/album{num}_{num}/delete.pl" - url: "/album{num}_{num}/delete"
handler: "Photos->deleteAlbum" handler: "Photos->deleteAlbum"
- url: "/album{num}_{num}/remove_photo.pl/{num}" - url: "/album{num}_{num}/remove_photo/{num}"
handler: "Photos->unlinkPhoto" handler: "Photos->unlinkPhoto"
- url: "/photos/upload" - url: "/photos/upload"
handler: "Photos->uploadPhoto" handler: "Photos->uploadPhoto"
@ -137,7 +141,7 @@ routes:
handler: "Photos->editPhoto" handler: "Photos->editPhoto"
- url: "/photo{num}_{num}/delete" - url: "/photo{num}_{num}/delete"
handler: "Photos->deletePhoto" handler: "Photos->deletePhoto"
- url: "/al_avatars.pl" - url: "/al_avatars"
handler: "User->setAvatar" handler: "User->setAvatar"
- url: "/videos{num}" - url: "/videos{num}"
handler: "Videos->list" handler: "Videos->list"
@ -161,7 +165,7 @@ routes:
handler: "Group->followers" handler: "Group->followers"
- url: "/club{num}/followers/{num}" - url: "/club{num}/followers/{num}"
handler: "Group->admin" handler: "Group->admin"
- url: "/club{num}/setAdmin.jsp" - url: "/club{num}/setAdmin"
handler: "Group->modifyAdmin" handler: "Group->modifyAdmin"
- url: "/groups{num}" - url: "/groups{num}"
handler: "User->groups" handler: "User->groups"
@ -253,15 +257,15 @@ routes:
handler: "Admin->giftCategory" handler: "Admin->giftCategory"
- url: "/admin/gifts/{slug}.{num}/" - url: "/admin/gifts/{slug}.{num}/"
handler: "Admin->gifts" handler: "Admin->gifts"
- url: "/admin/ban.pl/{num}" - url: "/admin/ban/{num}"
handler: "Admin->quickBan" handler: "Admin->quickBan"
- url: "/admin/warn.pl/{num}" - url: "/admin/warn/{num}"
handler: "Admin->quickWarn" handler: "Admin->quickWarn"
- url: "/method/{text}.{text}" - url: "/method/{text}.{text}"
handler: "VKAPI->route" handler: "VKAPI->route"
- url: "/token" - url: "/token"
handler: "VKAPI->tokenLogin" handler: "VKAPI->tokenLogin"
- url: "/sandbox_cocksex" - url: "/admin/sandbox"
handler: "About->sandbox" handler: "About->sandbox"
- url: "/internal/wall{num}" - url: "/internal/wall{num}"
handler: "Wall->wallEmbedded" handler: "Wall->wallEmbedded"

View file

@ -185,7 +185,7 @@ function repostPost(id, hash) {
function setClubAdminComment(clubId, adminId, hash) { function setClubAdminComment(clubId, adminId, hash) {
MessageBox("Изменить комментарий к администратору", ` MessageBox("Изменить комментарий к администратору", `
<form action="/club${clubId}/setAdmin.jsp" method="post" id="uClubAdminCommentForm_${clubId}_${adminId}"> <form action="/club${clubId}/setAdmin" method="post" id="uClubAdminCommentForm_${clubId}_${adminId}">
<input type="hidden" name="user" value="${adminId}"> <input type="hidden" name="user" value="${adminId}">
<input type="hidden" name="hash" value="${hash}"> <input type="hidden" name="hash" value="${hash}">
<input type="hidden" name="removeComment" id="uClubAdminCommentRemoveCommentInput_${clubId}_${adminId}" value="0"> <input type="hidden" name="removeComment" id="uClubAdminCommentRemoveCommentInput_${clubId}_${adminId}" value="0">

View file

@ -18,7 +18,7 @@
"forgot_password" = "Մոռացե՞լ եք գաղտնաբառը"; "forgot_password" = "Մոռացե՞լ եք գաղտնաբառը";
"login_failed" = "Չհաջողվեց մուտք գործել"; "login_failed" = "Չհաջողվեց մուտք գործել";
"invalid_username_or_password" = "Սխալ օգտատիրոջ անուն կամ գաղտնաբառ։ Դուք կարող եք <a href='/restore.pl'>վերականգնել ձեր գաղտնաբառը</a>։"; "invalid_username_or_password" = "Սխալ օգտատիրոջ անուն կամ գաղտնաբառ։ Դուք կարող եք <a href='/restore'>վերականգնել ձեր գաղտնաբառը</a>։";
"failed_to_register" = "Չհաջողվեց գրանցվել"; "failed_to_register" = "Չհաջողվեց գրանցվել";
"referral_link_invalid" = "Հրավերքային հղումը սխալ է։"; "referral_link_invalid" = "Հրավերքային հղումը սխալ է։";

View file

@ -15,7 +15,7 @@
"forgot_password" = "Forgot your password?"; "forgot_password" = "Forgot your password?";
"login_failed" = "Login failed"; "login_failed" = "Login failed";
"invalid_username_or_password" = "The username or password you entered is incorrect. <a href='/restore.pl'>Forgot your password?</a>"; "invalid_username_or_password" = "The username or password you entered is incorrect. <a href='/restore'>Forgot your password?</a>";
"failed_to_register" = "Failed to register"; "failed_to_register" = "Failed to register";
"referral_link_invalid" = "The referral link is invalid."; "referral_link_invalid" = "The referral link is invalid.";

View file

@ -17,7 +17,7 @@
"forgot_password" = "Ĉu vi forgesis vian pasvorton?"; "forgot_password" = "Ĉu vi forgesis vian pasvorton?";
"login_failed" = "Ensaluto malsukcesis"; "login_failed" = "Ensaluto malsukcesis";
"invalid_username_or_password" = "La uzantnomo aŭ pasvorto, kiun vi enigis, estas malĝusta. <a href='/restore.pl'>Ĉu vi forgesis vian pasvorton?</a>"; "invalid_username_or_password" = "La uzantnomo aŭ pasvorto, kiun vi enigis, estas malĝusta. <a href='/restore'>Ĉu vi forgesis vian pasvorton?</a>";
"failed_to_register" = "Malsukcesis registri"; "failed_to_register" = "Malsukcesis registri";
"referral_link_invalid" = "La invito ligilo estas malvalida."; "referral_link_invalid" = "La invito ligilo estas malvalida.";

View file

@ -17,7 +17,7 @@
"forgot_password" = "Құпиясөзіңізді ұмыттыңыз ба?"; "forgot_password" = "Құпиясөзіңізді ұмыттыңыз ба?";
"login_failed" = "Жүйеге кіру сәтті аяқталмады"; "login_failed" = "Жүйеге кіру сәтті аяқталмады";
"invalid_username_or_password" = "Қолданушы аты немесе құпиясөз дұрыс емес.<a href='/restore.pl'>Құпиясөзді ұмыттыңыз ба?</a>"; "invalid_username_or_password" = "Қолданушы аты немесе құпиясөз дұрыс емес.<a href='/restore'>Құпиясөзді ұмыттыңыз ба?</a>";
"failed_to_register" = "Жүйеге тіркелу сәтті аяқталмады"; "failed_to_register" = "Жүйеге тіркелу сәтті аяқталмады";
"referral_link_invalid" = "Реферал сілтемесі жарамсыз."; "referral_link_invalid" = "Реферал сілтемесі жарамсыз.";

View file

@ -16,7 +16,7 @@
"forgot_password" = "Забыли пароль?"; "forgot_password" = "Забыли пароль?";
"login_failed" = "Не удалось войти"; "login_failed" = "Не удалось войти";
"invalid_username_or_password" = "Неверное имя пользователя или пароль. <a href='/restore.pl'>Забыли пароль?</a>"; "invalid_username_or_password" = "Неверное имя пользователя или пароль. <a href='/restore'>Забыли пароль?</a>";
"failed_to_register" = "Не удалось зарегистрироваться"; "failed_to_register" = "Не удалось зарегистрироваться";
"referral_link_invalid" = "Пригласительная ссылка недействительна."; "referral_link_invalid" = "Пригласительная ссылка недействительна.";

View file

@ -18,7 +18,7 @@
"forgot_password" = "Запамятовали шифръ?"; "forgot_password" = "Запамятовали шифръ?";
"login_failed" = "Не удалось войти"; "login_failed" = "Не удалось войти";
"invalid_username_or_password" = "Невѣрное имя пользователя или шифръ. <a href='/restore.pl'>Забыли шифръ?</a>"; "invalid_username_or_password" = "Невѣрное имя пользователя или шифръ. <a href='/restore'>Забыли шифръ?</a>";
"failed_to_register" = "Не удалось зарегистрироваться"; "failed_to_register" = "Не удалось зарегистрироваться";
"referral_link_invalid" = "Пригласительная ссылка недѣйствительна."; "referral_link_invalid" = "Пригласительная ссылка недѣйствительна.";

View file

@ -18,7 +18,7 @@
"forgot_password" = "Забули пароль?"; "forgot_password" = "Забули пароль?";
"login_failed" = "Не вдалося увійти"; "login_failed" = "Не вдалося увійти";
"invalid_username_or_password" = "Неправильне ім'я користувача або пароль. <a href='/restore.pl'>Забули пароль?</a>"; "invalid_username_or_password" = "Неправильне ім'я користувача або пароль. <a href='/restore'>Забули пароль?</a>";
"failed_to_register" = "Не вдалося зареєструватися"; "failed_to_register" = "Не вдалося зареєструватися";
"referral_link_invalid" = "Посилання на запрошення недійсне."; "referral_link_invalid" = "Посилання на запрошення недійсне.";