Пример #1
0
 function GetMessageList($folderid, $cutoffdate)
 {
     debugLog("GetMessageList {$folderid} {$cutoffdate}");
     ///	    $this->moveNewToCur();
     ctdl_goto($folderid);
     #        if($folderid != "root")
     #           return false;
     // return stats of all messages in a dir. We can do this faster than
     // just calling statMessage() on each message; We still need fstat()
     // information though, so listing 10000 messages is going to be
     // rather slow (depending on filesystem, etc)
     // we also have to filter by the specified cutoffdate so only the
     // last X days are retrieved. Normally, this would mean that we'd
     // have to open each message, get the Received: header, and check
     // whether that is in the filter range. Because this is much too slow, we
     // are depending on the creation date of the message instead, which should
     // normally be just about the same, unless you just did some kind of import.
     $message = ctdl_msgs("", "");
     debugLog(print_r($message, true), true);
     $messages = array();
     if ($message[0] > 0) {
         for ($i = 0; $i < $message[0]; $i++) {
             $thismessage["id"] = $message[2][$i];
             $thismessage["flags"] = 0;
             $thismessage["flags"] |= 1;
             // 'seen' aka 'read' is the only flag we want to know about
             array_push($messages, $thismessage);
         }
     }
     return $messages;
     //        $messages = array();
     //        $dirname = $this->getPath();
     //
     //        $dir = opendir($dirname);
     //
     //        if(!$dir)
     //            return false;
     //
     //        while($entry = readdir($dir)) {
     //            if($entry{0} == ".")
     //                continue;
     //
     //            $message = array();
     //
     //            $stat = stat("$dirname/$entry");
     //
     //            if($stat["mtime"] < $cutoffdate) {
     //                // message is out of range for curoffdate, ignore it
     //                continue;
     //            }
     //
     //            $message["mod"] = $stat["mtime"];
     //
     //            $matches = array();
     //
     //            // Flags according to http://cr.yp.to/proto/maildir.html (pretty authoritative - qmail author's website)
     //            if(!preg_match("/([^:]+):2,([PRSTDF]*)/",$entry,$matches))
     //                continue;
     //            $message["id"] = $matches[1];
     //            $message["flags"] = 0;
     //
     //            if(strpos($matches[2],"S") !== false) {
     //                $message["flags"] |= 1; // 'seen' aka 'read' is the only flag we want to know about
     //            }
     //
     //            array_push($messages, $message);
     //        }
     //
     //        return $messages;
 }
Пример #2
0
    die("\nCouldn't find users config in {$configname}\n");
}
$vcardfh = fopen($vcardname, "r");
$vcard = fread($vcardfh, filesize($vcardname));
fclose($vcardfh);
$configfh = fopen($configname, "r");
$config = fread($configfh, filesize($configname));
fclose($configfh);
include "ctdlsession.php";
include "ctdlprotocol.php";
include "ctdlelements.php";
//define(CITADEL_DEBUG_HTML, FALSE);
establish_citadel_session();
create_new_user($user, $password);
ctdl_goto("My Citadel Config");
list($num_msgs, $response, $msgs) = ctdl_msgs("", "");
$Webcit_Preferences = array();
$Webcit_PrefMsgid = 0;
if ($num_msgs > 0) {
    foreach ($msgs as $msgnum) {
        print_r($msgnum);
        // Fetch the message from the server
        list($ok, $response, $fields) = ctdl_fetch_message($msgnum);
        // Bail out gracefully if the message isn't there.
        if (!$ok) {
            echo "Error: " . $response . "\n";
            return false;
        }
        if (isset($fields['part'])) {
            $parts = explode('|', $fields['part']);
            print_r($parts);
Пример #3
0
<?php

include "ctdlheader.php";
bbs_page_header();
list($num_msgs, $response, $msgs) = ctdl_msgs($_REQUEST["mode"], $_REQUEST["count"]);
echo "num_msgs: " . $num_msgs . "<BR>\n";
echo "response: " . htmlspecialchars($response) . "<BR>\n";
if ($num_msgs > 0) {
    foreach ($msgs as $msgnum) {
        display_message($msgnum);
    }
}
?>

<BR>
<a href="welcome.php">Page One</a><BR>
<a href="page3.php">Page Three</a><BR>

<?php 
bbs_page_footer();