Example #1
0
// We have an error while logging in. Tell the user
if ($status) {
    print $atmail->parse("html/{$atmail->Language}/auth_misc.html", array('status' => "Remote mail-server not responding - Check connection - {$status}"));
    $mail->quit();
    $atmail->end();
}
// Receive the list of mailbox folders
$folders = GetMail::_sort_folders($mail->listfolders());
// Make sure the requested folder exists (help avoid XSS etc)
if (!empty($var['folder']) && !in_array($var['folder'], $folders)) {
    die("requested folder does not exist");
}
$fol = array();
// Create the select box for moving messages to another folder
$var['folderbox'] = $mail->folder_select($var['folder'], $folders);
$var['folderbox'] = $mail->folder_select_lang($var['folderbox'], $atmail->Language);
// By default, we want to move to Trash
$var['folderbox'] = str_replace("value=\"Trash\"", "value=\"Trash\" selected", $var['folderbox']);
// If the user has set the messages to another flag; update the UIDL database.
if ($var['flag'] && $msgs[0]) {
    $c = 0;
    foreach ($msgs as $id) {
        $folder = urldecode($_REQUEST['folders'][$c]);
        // Load a hash containing the message headers
        $db = $mail->gethead($id, $folder, 5);
        $mail->updateuidl($db['EmailUIDL'], $var['flag'], '1', $folder, $id);
        $c++;
    }
    print <<<EOF
<?xml version="1.0" ?>
<MovedMsgs>