[Vtigercrm-commits] [vtiger-commits] r6489 - in /vtigercrm/trunk/modules/Webmails: CallRelatedList.php DetailView.php EditView.php Save.php WebmailsAjax.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Fri May 26 13:42:53 EDT 2006


Author: mmbrich
Date: Fri May 26 11:42:52 2006
New Revision: 6489

Log:
all files using getImapMbox() and upgraded to rev 6445 for new ajax mail fetch

Modified:
    vtigercrm/trunk/modules/Webmails/CallRelatedList.php
    vtigercrm/trunk/modules/Webmails/DetailView.php
    vtigercrm/trunk/modules/Webmails/EditView.php
    vtigercrm/trunk/modules/Webmails/Save.php
    vtigercrm/trunk/modules/Webmails/WebmailsAjax.php

Modified: vtigercrm/trunk/modules/Webmails/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Webmails/CallRelatedList.php Fri May 26 11:42:52 2006
@@ -9,7 +9,8 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 require_once('modules/Webmails/Webmail.php');
-
+require_once('modules/Webmails/MailParse.php');
+
 global $log;
 global $app_strings;
 global $mod_strings;
@@ -18,26 +19,15 @@
 
 $mailInfo = getMailServerInfo($current_user);
 $temprow = $adb->fetch_array($mailInfo);
-
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $start_message=$_REQUEST["start_message"];
 $box_refresh=$temprow["box_refresh"];
 $mails_per_page=$temprow["mails_per_page"];
-$mail_protocol=$temprow["mail_protocol"];
-$ssltype=$temprow["ssltype"];
-$sslmeth=$temprow["sslmeth"];
-
+
 if($_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());
+global $mbox;
+$mbox = getImapMbox($mailbox,$temprow);
 
 
 $email = new Webmail($mbox, $mailid);

Modified: vtigercrm/trunk/modules/Webmails/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/DetailView.php (original)
+++ vtigercrm/trunk/modules/Webmails/DetailView.php Fri May 26 11:42:52 2006
@@ -8,6 +8,7 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 require_once('modules/Webmails/Webmail.php');
+require_once('modules/Webmails/MailParse.php');
 
 global $log;
 global $app_strings;
@@ -15,26 +16,14 @@
 if($_REQUEST["record"]) {$mailid=$_REQUEST["record"];} else {$mailid=$_REQUEST["mailid"];}
 $mailInfo = getMailServerInfo($current_user);
 $temprow = $adb->fetch_array($mailInfo);
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $start_message=$_REQUEST["start_message"];
 $box_refresh=$temprow["box_refresh"];
 $mails_per_page=$temprow["mails_per_page"];
-$mail_protocol=$temprow["mail_protocol"];
-$ssltype=$temprow["ssltype"];
-$sslmeth=$temprow["sslmeth"];
 
 if($_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);
 
 
 echo ' after  in DetailView ';

Modified: vtigercrm/trunk/modules/Webmails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/EditView.php (original)
+++ vtigercrm/trunk/modules/Webmails/EditView.php Fri May 26 11:42:52 2006
@@ -8,6 +8,8 @@
 require_once('modules/Emails/Forms.php');
 require_once('include/utils/utils.php');
 require_once('include/FormValidationUtil.php');
+require_once('modules/Webmails/MailParse.php');
+
 if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
 
 if($_REQUEST["record"] && $_REQUEST["record"] != "") {$mailid=$_REQUEST["record"];} else {$mailid=$_REQUEST["mailid"];}
@@ -67,24 +69,12 @@
 
 $mailInfo = getMailServerInfo($current_user);
 $temprow = $adb->fetch_array($mailInfo);
-$login_username= $temprow["mail_username"];
-$secretkey=$temprow["mail_password"];
 $imapServerAddress=$temprow["mail_servername"];
 $start_message=$_REQUEST["start_message"];
 $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);
 
 $webmail = new Webmail($mbox,$mailid);
 $webmail->loadMail();

Modified: vtigercrm/trunk/modules/Webmails/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/Save.php (original)
+++ vtigercrm/trunk/modules/Webmails/Save.php Fri May 26 11:42:52 2006
@@ -6,6 +6,7 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('include/utils/CommonUtils.php');
+require_once('modules/Webmails/MailParse.php');
 global $current_user;
 
 
@@ -28,26 +29,16 @@
 }
 
 $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"];
 
 if($_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);
 
 
 

Modified: vtigercrm/trunk/modules/Webmails/WebmailsAjax.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/WebmailsAjax.php (original)
+++ vtigercrm/trunk/modules/Webmails/WebmailsAjax.php Fri May 26 11:42:52 2006
@@ -18,6 +18,7 @@
 require_once('include/logging.php');
 require_once('include/utils/utils.php');
 require_once('include/utils/UserInfoUtil.php');
+require_once('modules/Webmails/MailParse.php');
 
 global $adb,$mbox,$current_user;
 
@@ -30,33 +31,16 @@
 }
 
 $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"];
 
+$mbox = getImapMbox($mailbox,$temprow);
 
-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."}".$_REQUEST["mailbox"], $login_username, $secretkey);
-
-
-$check = imap_check($mbox);
-
-//if($check->Recent > 0) {
 $search = imap_search($mbox, "NEW ALL");
 if($search === false) {echo "";flush();exit();}
-
-//echo $search[0];flush();exit();
 
 $data = imap_fetch_overview($mbox,implode(',',$search));
 $num=sizeof($data);





More information about the vtigercrm-commits mailing list