cleanup
This commit is contained in:
parent
912b3a59bb
commit
ba02ed8b0f
|
@ -5,8 +5,9 @@ require_once '../../config.php';
|
||||||
# load php dependencies:
|
# load php dependencies:
|
||||||
require_once './backend-libs/autoload.php';
|
require_once './backend-libs/autoload.php';
|
||||||
|
|
||||||
$imap_settings = $config['imap'];
|
$mailbox = new PhpImap\Mailbox($config['imap']['url'],
|
||||||
$mailbox = new PhpImap\Mailbox($imap_settings['url'], $imap_settings['username'], $imap_settings['password']);
|
$config['imap']['username'],
|
||||||
|
$config['imap']['password']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print error and stop program.
|
* print error and stop program.
|
||||||
|
@ -104,12 +105,7 @@ header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
||||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||||
header("Pragma: no-cache");
|
header("Pragma: no-cache");
|
||||||
|
|
||||||
if (!isset($_GET['action'])) {
|
if (isset($_GET['username'])) {
|
||||||
error(400, 'invalid parameter');
|
|
||||||
}
|
|
||||||
$action = $_GET['action'];
|
|
||||||
|
|
||||||
if ($action === "get" && isset($_GET['username'])) {
|
|
||||||
print_inbox($_GET['username']);
|
print_inbox($_GET['username']);
|
||||||
} else {
|
} else {
|
||||||
error(400, 'invalid action');
|
error(400, 'invalid action');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user