$imap = new imap(); $email1 = new email(); $email2 = new email(); $email1->get_accounts($GO_SECURITY->user_id); while ($email1->next_record()) { if ($email1->f('auto_check') == '1') { $account = $email1->Record; if ($imap->open($account['host'], $account['type'], $account['port'], $account['username'], $GO_CRYPTO->decrypt($account['password']))) { if ($account['type'] == 'imap') { $status = $imap->status('INBOX'); if ($status->unseen > 0) { $_SESSION['new_mail'] += $status->unseen; } $email2->get_folders($email1->f('id')); while ($email2->next_record()) { if ($email2->f('name') != 'INBOX') { $status = $imap->status($email2->f('name')); if ($status->unseen > 0) { $_SESSION['new_mail'] += $status->unseen; } } } } else { $status = $imap->status('INBOX'); if ($status->unseen > 0) { $_SESSION['new_mail'] += $status->unseen; } } } else { $email2->disable_auto_check($account['id']); echo '<script language="javascript" type="text/javascript">alert("' . $account['host'] . ' ' . $ml_host_unreachable . '");</script>';
echo $strDate; ?> : </b></td> <td><?php echo date($_SESSION['GO_SESSION']['date_format'] . ' ' . $_SESSION['GO_SESSION']['time_format'], get_time($content['udate'])); ?> </td> </tr> <?php if ($account['type'] == "imap" && !$print) { echo '<tr><td nowrap><b>' . $ml_folder . ': </b></td><td>'; if ($email->get_all_folders($account['id'], true) > 0) { $dropbox = new dropbox(); $dropbox->add_value('INBOX', $ml_inbox); while ($email->next_record()) { if (!($email->f('attributes') & LATT_NOSELECT)) { $dropbox->add_value($email->f('name'), str_replace('INBOX' . $email->f('delimiter'), '', $email->f('name'))); } } $dropbox->print_dropbox('move_to_mailbox', $mailbox, 'onchange="javascript:move_mail()"'); } } echo '</td></tr>'; ?> </table> </td> </tr> </table> </td> </tr> </table>
} if ($email->get_all_folders($account_id, true) > 0) { echo '<a class="normal" href="filter.php?id=' . $account_id . '">' . $cmdAdd . '</a><br /><br />'; $count = $email->get_filters($account_id); if ($count > 0) { echo '<table border="0" cellpadding="2" cellspacing="0"><tr>'; echo '<td><h3>' . $ml_field . '</h3></td>'; echo '<td><h3>' . $ml_contains . '</h3></td>'; echo '<td><h3>' . $ml_folder . '</h3></td>'; echo '<td> </td>'; echo '<td> </td>'; echo '<td> </td></tr>'; $last_id = 0; $last_pr = 0; while ($email->next_record()) { switch ($email->f("field")) { case "sender": $field = "E-mail"; break; case "subject": $field = $ml_subject; break; case "to": $field = $ml_to; break; default: $field = $email->f("field"); break; } echo '<tr height="18"><td>' . $field . ' </td>'; echo '<td>' . $email->f("keyword") . ' </td>';
</a> <br /> <br /> <table border="0" cellpadding="10" cellspacing="0"> <tr> <td> <table border="0" cellpadding="4" cellspacing="0" width="100%"> <?php $count = $email->get_accounts($GO_SECURITY->user_id); if ($count > 0) { echo '<tr><td align="right"><h3>' . $strDefault . '</h3></td>'; echo '<td><h3>' . $strHost . '</h3></td>'; echo '<td><h3>' . $strEmail . '</h3></td>'; echo '<td> </td></tr>'; while ($email->next_record()) { if ($email->f("standard") == "1") { $checked = "checked"; } else { $checked = ""; } echo '<tr>'; echo '<td align="right"><input type="radio" onclick="javascript:document.forms[0].submit()" name="account_id" value="' . $email->f("id") . '" ' . $checked . ' /></td>'; echo '<td>' . $email->f("host") . '</a></td>'; echo '<td>' . $email->f('email') . '</td>'; echo '<td><a href="account.php?account_id=' . $email->f('id') . '&return_to=' . urlencode($link_back) . '" title="' . $strEdit . ' ' . $email->f('host') . '"><img src="' . $GO_THEME->images['edit'] . '" border="0" /></a></td>'; echo "<td><a href=\"javascript:delete_account('" . $email->f("id") . "','" . div_confirm_id($strDeletePrefix . "'" . $email->f("host") . "'" . $strDeleteSuffix) . "')\" title=\"" . $strDeleteItem . " '" . $email->f("host") . "'\"><img src=\"" . $GO_THEME->images['delete'] . "\" border=\"0\"></a></td>\n"; echo '</tr>'; } } else { echo "<tr><td>" . $ml_no_accounts . "</td></tr>"; }
} if ($_POST['answered'] != '') { $query .= $_POST['answered'] . ' '; } if ($query == '') { echo '<p class="Error">' . $ml_select_one_criteria . '</p>'; } } echo '<table border="0"><tr><td valign="top">'; echo '<table border="0">'; if ($account['type'] == "imap") { if ($email->get_all_folders($account['id'], true) > 0) { $dropbox = new dropbox(); $dropbox->add_value('INBOX', $ml_inbox); while ($email->next_record()) { if (!($email->f('attributes') & LATT_NOSELECT)) { $dropbox->add_value($email->f('name'), str_replace('INBOX' . $email->f('delimiter'), '', $email->f('name'))); } } echo '<tr><td>' . $ml_folder . ':</td><td>'; $dropbox->print_dropbox('mailbox', $mailbox); echo '</td></tr>'; } } echo '<tr><td>' . $ml_subject . ':</td><td>' . '<input type="text" name="subject" size="40" class="textbox" value="' . htmlspecialchars($subject) . '" />' . '</td></tr>'; echo '<tr><td>' . $ml_from . ':</td><td>' . '<input type="text" name="from" size="40" class="textbox" value="' . htmlspecialchars($from) . '" />' . '</td></tr>'; echo '<tr><td>' . $ml_to . ':</td><td>' . '<input type="text" name="to" size="40" class="textbox" value="' . htmlspecialchars($to) . '" />' . '</td></tr>'; echo '<tr><td>CC:</td><td>' . '<input type="text" name="cc" size="40" class="textbox" value="' . htmlspecialchars($cc) . '" />' . '</td></tr>'; echo '<tr><td>' . $ml_body . ':</td><td>' . '<input type="text" name="body" size="40" class="textbox" value="' . htmlspecialchars($body) . '" />' . '</td></tr>'; echo '</table></td><td valign="top"><table border="0">'; echo '<tr><td>' . $ml_before . ':</td><td>';
$tabtable->print_head(); //synchronise Group-Office with the IMAP server $subscribed = $mail->get_subscribed($account['mbroot']); $mailboxes = $mail->get_mailboxes($account['mbroot']); $email->synchronise($account['id'], $mailboxes, $subscribed); //get all the folders and the subscribed folders as an array //and add all missing subscribed folders to Group-Office $mailboxes = array(); $mailboxes = $mail->get_mailboxes($account['mbroot']); //get all the Group-Office folders as an array $account = $email->get_account($account['id']); $email->get_all_folders($account['id']); $go_mailboxes = array(); while ($email->next_record()) { $go_mailboxes[] = $email->Record; $delimiter = $email->f('delimiter'); } $mcount = count($go_mailboxes); ?> <table border="0" cellpadding="0" cellspacing="8" class="normal"> <tr> <td> <?php if (isset($feedback)) { echo $feedback; } ?> <table border="0" cellpadding="2" cellspacing="0"> <tr> <td colspan="2"> <table border="0">
<?php /* */ require "../../Group-Office.php"; require $GO_CONFIG->class_path . 'email.class.inc'; $email = new email(); $email2 = new email(); $email->query("SELECT password, id FROM emAccounts"); while ($email->next_record()) { $email2->query("UPDATE emAccounts SET password='******'password')) . "' WHERE id='" . $email->f('id') . "'"); }