This commit is contained in:
Synox 2016-11-26 19:12:08 +01:00
parent 912b3a59bb
commit ba02ed8b0f

View file

@ -5,8 +5,9 @@ require_once '../../config.php';
# load php dependencies:
require_once './backend-libs/autoload.php';
$imap_settings = $config['imap'];
$mailbox = new PhpImap\Mailbox($imap_settings['url'], $imap_settings['username'], $imap_settings['password']);
$mailbox = new PhpImap\Mailbox($config['imap']['url'],
$config['imap']['username'],
$config['imap']['password']);
/**
* 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("Pragma: no-cache");
if (!isset($_GET['action'])) {
error(400, 'invalid parameter');
}
$action = $_GET['action'];
if ($action === "get" && isset($_GET['username'])) {
if (isset($_GET['username'])) {
print_inbox($_GET['username']);
} else {
error(400, 'invalid action');