use actions
This commit is contained in:
parent
92ee25dbf6
commit
e66fd86dc7
|
@ -88,7 +88,7 @@ $purifier = new HTMLPurifier($purifier_config);
|
|||
mailbox:
|
||||
</small>
|
||||
|
||||
<form id="header-form" data-turbolinks-permanent action="?" method="post">
|
||||
<form id="header-form" data-turbolinks-permanent action="?action=redirect" method="post">
|
||||
<div class="form-group row">
|
||||
|
||||
<div class="col-lg-5 col-md-4 col-sm-6 col-xs-12">
|
||||
|
@ -177,7 +177,7 @@ $purifier = new HTMLPurifier($purifier_config);
|
|||
<div class="col-sm-4 text-right">
|
||||
<a class="btn btn-sm btn-outline-primary " download="true"
|
||||
role="button"
|
||||
href="?download_email_id=<?php echo $safe_email_id; ?>&address=<?php echo $user->address ?>">Download
|
||||
href="?action=download_email&download_email_id=<?php echo $safe_email_id; ?>&address=<?php echo $user->address ?>">Download
|
||||
</a>
|
||||
|
||||
<a class="btn btn-sm btn-outline-danger"
|
||||
|
|
|
@ -29,10 +29,10 @@ class Router {
|
|||
|
||||
function route(): Page {
|
||||
// TODO: use $this->action
|
||||
if (isset($this->post_vars['username']) && isset($this->post_vars['domain'])) {
|
||||
if ($this->action === "redirect" && isset($this->post_vars['username']) && isset($this->post_vars['domain'])) {
|
||||
return new RedirectToAddressPage($this->post_vars['username'], $this->post_vars['domain']);
|
||||
|
||||
} elseif (isset($this->get_vars['download_email_id']) && isset($this->get_vars['address'])) {
|
||||
} elseif ($this->action === "download_email" && isset($this->get_vars['download_email_id']) && isset($this->get_vars['address'])) {
|
||||
return new DownloadEmailPage($this->get_vars['download_email_id'], $this->get_vars['address'], $this->config['domains']);
|
||||
|
||||
} elseif (isset($this->get_vars['delete_email_id']) && isset($this->get_vars['address'])) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user