Esempio n. 1
0
<?php

$root = realpath(dirname(__FILE__));
include_once "{$root}/includes/functions.php";
include_once "{$root}/includes/common.php";
if (isset($_POST['username']) && isset($_POST['password'])) {
    $_SESSION['username'] = $_POST['username'];
    $_SESSION['password'] = $_POST['password'];
    if ($mbox = gtLogin()) {
        @imap_close($mbox);
        gtRedirect('index');
    }
    gtLogout();
}
include_once "{$root}/includes/theme.php";
Esempio n. 2
0
<?php

$root = realpath(dirname(__FILE__));
include_once "{$root}/includes/functions.php";
include_once "{$root}/includes/common.php";
$i = isset($_GET['i']) ? $_GET['i'] : 0;
$t = isset($_GET['t']) ? $_GET['t'] : 'Inbox';
$p = isset($_GET['p']) ? $_GET['p'] : 1;
if (!($mbox = gtLogin($t))) {
    gtLogout();
    gtRedirect('login');
}
$tags = imap_list($mbox, $ref, '%');
foreach ($tags as $key => $tag) {
    $tags[$key] = $tag = str_replace($ref, '', $tag);
    if ($tag == 'INBOX') {
        unset($tags[$key]);
    }
}
// $last7days = imap_search($mbox, 'BEFORE "22-May-2008"');
if ($i) {
    $structure = imap_fetchstructure($mbox, $i);
    $mailsOverview = imap_fetch_overview($mbox, "{$i}:{$i}");
    $mailOverview = $mailsOverview[0];
    $subject = trim($mailOverview->subject);
    $from = trim(strip_tags($mailOverview->from));
    $date = $mailOverview->date;
    $message = '';
    foreach ($structure->parts as $partNum => $part) {
        if ($part->type == 0 && ($part->ifsubtype && strtolower($part->subtype) == 'plain')) {
            $message = imap_fetchbody($mbox, $i, $partNum + 1);