[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twig-devel
Subject:    [twig-devel] TWIG 2.3.1 with MS Exchange (multi server) - Folder Management co
From:       Valentim Batista <Valentim.Batista () si ! efacec ! pt>
Date:       2000-06-20 11:08:17
[Download RAW message or body]

Looking for imap_open calls I found a error on this setup when using Folder
Management on features/mail/mail.foldover.inc.php3 that uses
TWIGMailOpenMailbox function of lib/mail/php-imap-msex.inc.php3 (calls
imap_open) so I have changed mail.foldover.inc.php3 in a way that I think is
compatible:

...
 if (!$login["imap_server"]) $login["imap_server"]=$config["imap_server"];
 if (!$login["imap_port"]) $login["imap_port"]=$config["imap_port"];
 $result = TWIGMailSubscribedFolders( $mbox, TWIGMailGetFolderString(
$login["imap_server"], $login["imap_port"], "", "" ), $config["imap_path"] .
"*" );
...
 		$tmbox = TWIGMailOpenMailbox( $result[$i],
$login["nt_account"] . $login["username"], $login["password"], OP_READONLY
);
...


Thanks

Valentim Batista


["mail.foldover.inc.php3" (application/octet-stream)]

<?php	// TWIG	Mailbox Susbscribing Feature ?>
<?php

 if( !$session["mailbox"] ) { $session["mailbox"] = "INBOX"; }

 if( CheckMBType( MailboxDecode( $session["mailbox"] ) ) != 0 ) 
	{
  	$session["mailbox"] = "INBOX";
	}

 $mb = MailboxDecode( $session["mailbox"] );
 $mbdisplay = ereg_replace( "^" . $config["imap_path"], "", $mb );

 $mailmenu[0] = array( "command" => "mail", "desc" => $TWIGphrase["Back&nbsp;to"] . \
"&nbsp;\"" . $mbdisplay . "\"", "action" => "main", "options" => "", "target" => "", \
"image" => "backto.gif" );  $mailmenu[1] = array( "command" => "mail", "desc" => \
$TWIGphrase["Back&nbsp;to"] . "&nbsp;" . $TWIGphrase["Folder Management"], "action" \
=> "folders", "options" => "", "target" => "", "image" => "backto.gif" );  echo \
"<table border=0 width=100%><tr><td>";  echo "<B>" . $TWIGphrase["Note: Large folder \
lists may take a long time to load."] . "</B></td><td align=right>";  echo \
TWIGGenerateMenu( $mailmenu, $config["SubMenuType"], "mail" );  echo \
"</td></tr></table><HR>";  flush();

 $headers = array( $TWIGphrase["Folder"], array( "header"=>$TWIGphrase["New"], \
"align"=>"center" ), array( "header"=>$TWIGphrase["Total"], "align"=>"center" ), \
array( "header"=>$TWIGphrase["Size"], "align"=>"center" ) );

// ---- multi server and exchange - changes don't require but are compatible with \
msex setup - start ----  if (!$login["imap_server"]) \
$login["imap_server"]=$config["imap_server"];  if (!$login["imap_port"]) \
$login["imap_port"]=$config["imap_port"];  $result = TWIGMailSubscribedFolders( \
$mbox, TWIGMailGetFolderString( $login["imap_server"], $login["imap_port"], "", "" ), \
$config["imap_path"] . "*" ); // ---- multi server and exchange - changes don't \
require but are compatible with msex setup - end ----  if( is_array( $result ) ) 
	{ 
	sort( $result );

	 for( $i = 0, $j = count( $result ); $i < $j; $i++ )
		{
 		list( $mbserver, $mbport, $mbtype, $mb, $user, $pass ) = \
TWIGMailParseFolderString( $result[$i] );  $mbdisplay = TWIGMailGetDisplayName( $mb \
);

		$contents[$i][0] = twiglink( $mbdisplay, "mail", "main", "newmailbox=" . $mb );
// ---- multi server and exchange - changes don't require but are compatible with \
msex setup - start ----  $tmbox = TWIGMailOpenMailbox( $result[$i], \
$login["nt_account"] . $login["username"], $login["password"], OP_READONLY ); // ---- \
multi server and exchange - changes don't require but are compatible with msex setup \
- end ----

		if( $tmbox )
			{
 			$mboxinfo = TWIGMailFolderInfo( $tmbox );
	
			$contents[$i][1] = array( "contents"=>$mboxinfo->Unread, "align"=>"center" );
			$contents[$i][2] = array( "contents"=>$mboxinfo->Nmsgs, "align"=>"center" );
			$contents[$i][3] = array( "contents"=>$mboxinfo->Size, "align"=>"center" );
	
			$total_new += $mboxinfo->Unread;
			$total_msgs += $mboxinfo->Nmsgs;
			$total_size += $mboxinfo->Size;

 			TWIGCloseMB( $tmbox );
			}
		}
	}

 $contents[$i][0] = array( "contents"=>$TWIGphrase["Totals"] . ":", "align"=>"right" \
);  $contents[$i][1] = array( "contents"=>$total_new, "align"=>"center" );
 $contents[$i][2] = array( "contents"=>$total_msgs, "align"=>"center" );
 $contents[$i][3] = array( "contents"=>$total_size, "align"=>"center" );

 echo TWIGGenerateTable( $headers, $contents );
?>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic