Esempio n. 1
0
 function MailBox($mailbox = '', $p = '', $s = '')
 {
     global $current_user;
     require_once 'include/utils/encryption.php';
     $oencrypt = new Encryption();
     $this->db = PearDatabase::getInstance();
     $this->db->println("Entering MailBox({$mailbox})");
     $this->mailbox = $mailbox;
     $tmp = getMailServerInfo($current_user);
     if ($this->db->num_rows($tmp) < 1) {
         $this->enabled = 'false';
     } else {
         $this->enabled = 'true';
     }
     $this->boxinfo = $this->db->fetch_array($tmp);
     $this->login_username = trim($this->boxinfo["mail_username"]);
     $this->secretkey = $oencrypt->decrypt(trim($this->boxinfo["mail_password"]));
     $this->imapServerAddress = gethostbyname(trim($this->boxinfo["mail_servername"]));
     $this->mail_protocol = $this->boxinfo["mail_protocol"];
     $this->ssltype = $this->boxinfo["ssltype"];
     $this->sslmeth = $this->boxinfo["sslmeth"];
     $this->box_refresh = trim($this->boxinfo["box_refresh"]);
     $this->mails_per_page = trim($this->boxinfo["mails_per_page"]);
     if ($this->mails_per_page < 1) {
         $this->mails_per_page = 20;
     }
     $this->account_name = $this->boxinfo["account_name"];
     $this->display_name = $this->boxinfo["display_name"];
     //$this->imapServerAddress=$this->boxinfo["mail_servername"];
     $this->db->println("Setting Mailbox Name");
     if ($this->mailbox != "") {
         $this->mailbox = $mailbox;
     }
     $this->db->println("Opening Mailbox");
     if (!$this->mbox && $this->mailbox != "") {
         $this->getImapMbox();
     }
     $this->db->println("Loading mail list");
     $pa = $p;
     $se = $s;
     if ($this->mbox) {
         if ($se != "") {
             $this->mailList = $this->searchMailList($se, $pa);
         } else {
             if ($pa == "") {
                 $this->mailList = $this->customMailList(0);
             } else {
                 $this->mailList = $this->customMailList($pa);
             }
         }
     }
     $this->db->println("Exiting MailBox({$mailbox})");
 }
Esempio n. 2
0
}
if (!empty($_REQUEST['forward'])) {
    $fwdstr = getTranslatedString('Fwd', 'Emails');
    if (!preg_match("/{$fwdstr}:/i", $focus->column_fields['subject'])) {
        $focus->column_fields['subject'] = "{$fwdstr}: " . $focus->column_fields['subject'];
    }
}
// Webmails
if (isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != "") {
    $mailid = $_REQUEST["mailid"];
    $mailbox = $_REQUEST["mailbox"];
    require_once 'include/utils/UserInfoUtil.php';
    require_once "modules/Webmails/Webmails.php";
    require_once "modules/Webmails/MailParse.php";
    require_once 'modules/Webmails/MailBox.php';
    $mailInfo = getMailServerInfo($current_user);
    $temprow = $adb->fetch_array($mailInfo);
    $MailBox = new MailBox($mailbox);
    $mbox = $MailBox->mbox;
    $webmail = new Webmails($mbox, $mailid);
    $array_tab = array();
    $webmail->loadMail($array_tab);
    $hdr = @imap_headerinfo($mbox, $mailid);
    $smarty->assign('WEBMAIL', "true");
    $smarty->assign('mailid', $mailid);
    $smarty->assign('mailbox', $mailbox);
    $temp_id = $MailBox->boxinfo['mail_id'];
    $smarty->assign('from_add', $temp_id);
    $webmail->subject = utf8_decode(utf8_encode(imap_utf8($webmail->subject)));
    if ($_REQUEST["reply"] == "all") {
        $smarty->assign('TO_MAIL', $webmail->from . ",");
?>
"></td>
		<td width="10%" class="moduleListTitle">&nbsp;<b><?php 
echo $mod_strings['Edit'];
?>
</b></td>
		<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="<?php 
echo vtiger_imageurl('blank.gif', $theme);
?>
"></td>
		</tr>
		<tr><td COLSPAN="12" class="blackLine"><IMG SRC="themes/images/blank.gif"></td></tr>
<?php 
global $current_user;
require_once 'include/utils/UserInfoUtil.php';
$result = getMailServerInfo($current_user);
$temprow = $adb->fetch_array($result);
$rowcount = $adb->num_rows($result);
$edit = "Edit  ";
$del = "Del  ";
$bar = "  | ";
$cnt = 1;
if ($rowcount != 0) {
    do {
        if ($cnt % 2 == 0) {
            printf('<tr class="evenListRow"> <td height="25">&nbsp;<input type="checkbox" name="selected_id" value=' . $temprow['account_id'] . '></td>');
        } else {
            printf('<tr class="oddListRow"> <td height="25">&nbsp;<input type="checkbox" name="selected_id" value=' . $temprow['account_id'] . '></td>');
        }
        printf('<td WIDTH="1" class="blackLine" NOWRAP><IMG SRC="themes/images/%s"></td>', 'blank.gif');
        printf("<td height='25'>&nbsp;%s</td>", $temprow["display_name"]);