[Vtigercrm-commits] [vtiger-commits] r6488 - in /vtigercrm/trunk/modules/Webmails: ListView.php body.php dlAttachments.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri May 26 13:38:46 EDT 2006


Author: mmbrich
Date: Fri May 26 11:38:45 2006
New Revision: 6488

Log:
changed to use getImapMbox

Modified:
    vtigercrm/trunk/modules/Webmails/ListView.php
    vtigercrm/trunk/modules/Webmails/body.php
    vtigercrm/trunk/modules/Webmails/dlAttachments.php

Modified: vtigercrm/trunk/modules/Webmails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/ListView.php (original)
+++ vtigercrm/trunk/modules/Webmails/ListView.php Fri May 26 11:38:45 2006
@@ -187,14 +187,10 @@
 }
 
 $temprow = $adb->fetch_array($mailInfo);
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $box_refresh=$temprow["box_refresh"];
 $mails_per_page=$temprow["mails_per_page"];
 $mail_protocol=$temprow["mail_protocol"];
-$ssltype=$temprow["ssltype"];
-$sslmeth=$temprow["sslmeth"];
 $account_name=$temprow["account_name"];
 $show_hidden=$_REQUEST["show_hidden"];
 ?>
@@ -322,18 +318,8 @@
 //<<<<<customview>>>>>
 
 
-echo "<div id='writeroot'>&nbsp;</div>";
-
- global $mbox,$displayed_msgs;
-if($ssltype == "") {$ssltype = "notls";}
-if($sslmeth == "") {$sslmeth = "novalidate-cert";}
-// bug in windows PHP having to do with SSL not being linked correctly
-// causes this open command to fail.
-if(!preg_match("/windows/i",php_uname()))
-	$mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/".$ssltype."/".$sslmeth."}".$mailbox, $login_username, $secretkey);
-
-if(!$mbox)
-	$mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/}".$mailbox, $login_username, $secretkey) or die("Connection to server failed ".imap_last_error());
+global $mbox,$displayed_msgs;
+$mbox = getImapMbox($mailbox,$temprow);
 	
 
 if($_POST["command"] == "move_msg" && $_POST["ajax"] == "true") {
@@ -550,16 +536,11 @@
 			$box = imap_mailboxmsginfo($mbox);
 			$folders .= '<li><img src="'.$image_path.'/'.$img.'" align="absmiddle" />&nbsp;&nbsp;<a href="javascript:changeMbox(\''.$tmpval.'\');" class="webMnu" onmouseover="show_remfolder(\''.$tmpval.'\');" onmouseout="show_remfolder(\''.$tmpval.'\');">'.$tmpval.'</a>&nbsp;&nbsp;<b>('.$box->Unread.' of '.$box->Nmsgs.')</b>&nbsp;&nbsp;<span id="remove_'.$tmpval.'" style="position:relative;display:none">Remove</span></li>';
 		} else {
-			if($ssltype == "") {$ssltype = "notls";}
-			if($sslmeth == "") {$sslmeth = "novalidate-cert";}
-			if(!preg_match("/windows/i",php_uname()))
-				$tmbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/".$ssltype."/".$sslmeth."}".$tmpval, $login_username, $secretkey) or die("Connection to server failed ".imap_last_error());
-			if(!$tmbox)
-				$tmbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/}".$mailbox, $login_username, $secretkey) or die("Connection to server failed ".imap_last_error());
-			$box = imap_mailboxmsginfo($tmbox);
+			$tmpbox = getImapMbox($tmpval,$temprow);
+			$box = imap_mailboxmsginfo($tmpbox);
                       	$boxes .= '<option value="'.$tmpval.'">'.$tmpval;
 			$folders .= '<li><img src="'.$image_path.'/'.$img.'" align="absmiddle" />&nbsp;&nbsp;<a href="javascript:changeMbox(\''.$tmpval.'\');" class="webMnu">'.$tmpval.'</a>&nbsp;<b>('.$box->Unread.' of '.$box->Nmsgs.')</b></li>';
-			imap_close($tmbox);
+			imap_close($tmpbox);
 		}
  	}
         $boxes .= '</select>';

Modified: vtigercrm/trunk/modules/Webmails/body.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/body.php (original)
+++ vtigercrm/trunk/modules/Webmails/body.php Fri May 26 11:38:45 2006
@@ -3,32 +3,21 @@
 require_once('include/utils/utils.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('modules/Webmails/Webmail.php');
+require_once('modules/Webmails/MailParse.php');
 
 if(!isset($_SESSION["authenticated_user_id"]) || $_SESSION["authenticated_user_id"] != $current_user->id) {echo "ajax failed";flush();exit();}
 
 $mailInfo = getMailServerInfo($current_user);
 $temprow = $adb->fetch_array($mailInfo);
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $box_refresh=$temprow["box_refresh"];
 $mails_per_page=$temprow["mails_per_page"];
-$mail_protocol=$temprow["mail_protocol"];
-$ssltype=$temprow["ssltype"];
-$sslmeth=$temprow["sslmeth"];
 
 $mailid=$_REQUEST["mailid"];
 if(isset($_REQUEST["mailbox"]) && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
 
 global $mbox;
-if($ssltype == "") {$ssltype = "notls";}
-if($sslmeth == "") {$sslmeth = "novalidate-cert";}
-if(!preg_match("/windows/i",php_uname()))
-	$mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/".$ssltype."/".$sslmeth."}".$mailbox, $login_username, $secretkey);
-
-if(!$mbox)
-        $mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/}".$mailbox, $login_username, $secretkey) or die("Connection to server failed ".imap_last_error());
-
+$mbox = getImapMbox($mailbox,$temprow);
 
 $email = new Webmail($mbox,$mailid);
 $email->loadMail();

Modified: vtigercrm/trunk/modules/Webmails/dlAttachments.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/dlAttachments.php (original)
+++ vtigercrm/trunk/modules/Webmails/dlAttachments.php Fri May 26 11:38:45 2006
@@ -2,28 +2,16 @@
 include('config.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('include/utils/utils.php');
-require_once('modules/Webmails/Webmail.php');
-
+require_once('modules/Webmails/Webmail.php');
+require_once('modules/Webmails/MailParse.php');
+
 $mailInfo = getMailServerInfo($current_user);
 $temprow = $adb->fetch_array($mailInfo);
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $box_refresh=$temprow["box_refresh"];
 $mails_per_page=$temprow["mails_per_page"];
-$mail_protocol=$temprow["mail_protocol"];
-$ssltype=$temprow["ssltype"];
-$sslmeth=$temprow["sslmeth"];
 
-if($ssltype == "") {$ssltype = "notls";}
-if($sslmeth == "") {$sslmeth = "novalidate-cert";}
-if(!preg_match("/windows/i",php_uname()))
-	$mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/".$ssltype."/".$sslmeth."}".$mailbox, $login_username, $secretkey);
-
-if(!$mbox)
-        $mbox = @imap_open("{".$imapServerAddress."/".$mail_protocol."/}".$mailbox, $login_username, $secretkey) or die("Connection to server failed ".imap_last_error());
-
-
+$mbox = getImapMbox($mailbox,$temprow);
 
 $mailid=$_REQUEST["mailid"];
 $num=$_REQUEST["num"];





More information about the vtigercrm-commits mailing list