require php 7

This commit is contained in:
Synox 2018-02-23 21:19:35 +01:00
parent 4775a190b0
commit ee18dd0581
2 changed files with 12 additions and 17 deletions

View File

@ -14,13 +14,13 @@ A **self-hosted** disposable mailbox service (aka trash mail) :cloud: :envelop
* Automatic refresh. Download and delete your emails. * Automatic refresh. Download and delete your emails.
* Display emails as text or html with sanitization filter. * Display emails as text or html with sanitization filter.
* Display emails based on one [catch-all imap mailbox](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). * Display emails based on one [catch-all imap mailbox](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox).
* Only requires PHP >=5.3.0 and [imap extension](http://php.net/manual/book.imap.php) * Only requires PHP >=7.2 and [imap extension](http://php.net/manual/book.imap.php)
## Usage ## Usage
### Requirements ### Requirements
* webserver with php >=5.3.0 * webserver with php >=7.2
* php [imap extension](http://php.net/manual/book.imap.php) * php [imap extension](http://php.net/manual/book.imap.php)
* IMAP account and a domain with [catch-all configuration](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). (all emails go to one mailbox). * IMAP account and a domain with [catch-all configuration](https://www.google.ch/search?q=how+to+setup+catch-all+imap+mailbox). (all emails go to one mailbox).

View File

@ -18,7 +18,6 @@ class RedirectToAddressPage extends Page {
function invoke() { function invoke() {
$user = User::parseUsernameAndDomain($this->username, $this->domain); $user = User::parseUsernameAndDomain($this->username, $this->domain);
header("location: ?" . $user->username . "@" . $user->domain); header("location: ?" . $user->username . "@" . $user->domain);
exit();
} }
} }
@ -40,10 +39,9 @@ class DownloadEmailPage extends Page {
$download_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT); $download_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT);
if ($user->isInvalid()) { if ($user->isInvalid()) {
redirect_to_random($this->config_domains); redirect_to_random($this->config_domains);
exit(); } else {
}
download_email($download_email_id, $user); download_email($download_email_id, $user);
exit(); }
} }
} }
@ -64,11 +62,10 @@ class DeleteEmailPage extends Page {
$delete_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT); $delete_email_id = filter_var($this->email_id, FILTER_SANITIZE_NUMBER_INT);
if ($user->isInvalid()) { if ($user->isInvalid()) {
redirect_to_random($this->all_domains); redirect_to_random($this->all_domains);
exit(); } else {
}
delete_email($delete_email_id, $user); delete_email($delete_email_id, $user);
header("location: ?" . $user->address); header("location: ?" . $user->address);
exit(); }
} }
} }
@ -81,7 +78,6 @@ class RedirectToRandomAddressPage extends Page {
function invoke() { function invoke() {
redirect_to_random($this->all_domains); redirect_to_random($this->all_domains);
exit();
} }
} }
@ -101,13 +97,12 @@ class DisplayEmailsPage extends Page {
$user = User::parseDomain($this->address); $user = User::parseDomain($this->address);
if ($user->isInvalid()) { if ($user->isInvalid()) {
redirect_to_random($this->config['domains']); redirect_to_random($this->config['domains']);
exit(); } else {
}
global $emails; global $emails;
global $config; global $config;
$emails = get_emails($user); $emails = get_emails($user);
require "frontend.template.php"; require "frontend.template.php";
}
} }
} }