phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] felamimail AUTHORS AUTHORS.Squirrelmail compose...


From: Sigurd Nes
Subject: [Phpgroupware-cvs] felamimail AUTHORS AUTHORS.Squirrelmail compose...
Date: Mon, 18 Dec 2006 20:18:24 +0000

CVSROOT:        /sources/phpgroupware
Module name:    felamimail
Changes by:     Sigurd Nes <sigurdne>   06/12/18 20:18:24

Removed files:
        .              : AUTHORS AUTHORS.Squirrelmail compose.php 
                         download.php folders_create.php 
                         folders_delete.php folders.php 
                         folders_rename_do.php 
                         folders_rename_getname.php 
                         folders_subscribe.php preferences_display.php 
                         preferences_email.php preferences_folder.php 
                         preferences_highlight.php 
                         preferences_index_order.php 
                         preferences_translate.php read_body.php 
                         README.Squirrelmail search.php 

Log message:
        removing obsolete files

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/felamimail/AUTHORS?cvsroot=phpgroupware&r1=1.1.1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/AUTHORS.Squirrelmail?cvsroot=phpgroupware&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/compose.php?cvsroot=phpgroupware&r1=1.3&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/download.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders_create.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders_delete.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders_rename_do.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders_rename_getname.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/folders_subscribe.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_display.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_email.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_folder.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_highlight.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_index_order.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/preferences_translate.php?cvsroot=phpgroupware&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/read_body.php?cvsroot=phpgroupware&r1=1.5&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/README.Squirrelmail?cvsroot=phpgroupware&r1=1.2&r2=0
http://cvs.savannah.gnu.org/viewcvs/felamimail/search.php?cvsroot=phpgroupware&r1=1.3&r2=0

Patches:
Index: AUTHORS
===================================================================
RCS file: AUTHORS
diff -N AUTHORS
--- AUTHORS     31 Dec 2001 00:59:03 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
- Developers:
- -----------
-   Luke Ehresman <address@hidden>     http://www.css.tayloru.edu/~lehresma
-   Nathan Ehresman <address@hidden> http://www.css.tayloru.edu/~nehresma
-   Gustav Foseid <address@hidden>  http://www.initio.no
-   Pål Løberg <address@hidden>       http://www.initio.no
-   Shane Wilson
-   Steve Gare                                http://www.xantara.co.uk
-   Gerrit Padgham <address@hidden>
-   Matt Phillips <address@hidden>
-   Lewis Bergman
-   Bryan Stalcup <address@hidden>
-   Tyler Akins
-
- Translations:
- -------------
-   Norwegian:    Gustav Foseid <address@hidden>
-   German:       Chris Thil <address@hidden>
-   Russian:      Konstantin Riabitsev <address@hidden>
-   Polish:       Lukasz Klimek <address@hidden>
-   Swedish:      Tobias Ekbom <address@hidden>    
-   Dutch:        Arjen Halma <address@hidden>
-   Portuguese (Brazil): Henrique Moura <address@hidden>
-   French        Ali Nedjimi <address@hidden>
-   Italian       Aldo Moresco <address@hidden>
-   Spanish       Hernan Collazo <address@hidden>  
-   Korean        Jong-II Kim <address@hidden>
-   Czech         Ondrej Sury <address@hidden>
-   Catalan       Josep Sanz <address@hidden>
-   Serbian       Boris Manojlovic <address@hidden>
-   Taiwan        Ching <address@hidden>
-   Danish        Claus Rasmussen <address@hidden>
-   Finnish       Teemu Junnila <address@hidden>
-
- Significant Contributions:
- --------------------------
-   i18n support:        Sergiusz Pawlowicz 
-   SquirrelMail logo:   Libor Kopecky <address@hidden>
-   Web Site Admin/PR:   Paul Joseph Thompson <address@hidden>
-   FAQ Maintenance:     Peter Hutnick <address@hidden>
-
-   Code contributions:  Konstantin Riabitsev <address@hidden>
-                        Alex Bleeker <address@hidden>
-                        Jan-Pieter Cornet <address@hidden>
-                        John Williams <address@hidden> 
-                        Ondrej Sury <address@hidden>
-                        Damien Sandras <address@hidden>
-                        Martin Jespersen <address@hidden>
-                        David Whittington <address@hidden>
-                        Many others...
-
-(We have tried to keep this up to date to give credit where it is due.
-If you feel that you have wrongfully been left off this list, contact
address@hidden)

Index: AUTHORS.Squirrelmail
===================================================================
RCS file: AUTHORS.Squirrelmail
diff -N AUTHORS.Squirrelmail
Binary files /tmp/cvsnF3EdW and /dev/null differ

Index: compose.php
===================================================================
RCS file: compose.php
diff -N compose.php
--- compose.php 27 Mar 2002 22:06:44 -0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,651 +0,0 @@
-<?php
-   /** 
-    ** compose.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    ** This code sends a mail.
-    **
-    ** There are 3 modes of operation:
-    **  - Start new mail
-    **  - Add an attachment
-    **  - Send mail
-    **
-    ** $Id: compose.php,v 1.3 2002/03/27 22:06:44 ceb Exp $
-    **/
-
-   $enablePHPGW = 1;
-
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       if(isset($send))
-       {
-               $phpgw_info["flags"] = array("currentapp" => "felamimail", 
"enable_network_class" => True, 
-                       "enable_nextmatchs_class" => True,"noheader" => True, 
"nonavbar" => True);
-       }
-       else
-       {
-               $phpgw_info["flags"] = array("currentapp" => "felamimail", 
"enable_network_class" => True, 
-                       "enable_nextmatchs_class" => True);
-       }
-       include("../header.inc.php");
-
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-
-       if (!isset($strings_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/strings.php');
-       }
-
-       if (!isset($config_php))
-       {
-               include(PHPGW_APP_ROOT . '/config/config.php');
-       }
-
-       if (!isset($page_header_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/page_header.php');
-       }
-
-       if (!isset($imap_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/imap.php');
-       }
-
-       if (!isset($date_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/date.php');
-       }
-
-       if (!isset($mime_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/mime.php');
-       }
-
-       if (!isset($smtp_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/smtp.php');
-       }
-
-       if (!isset($display_messages_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/display_messages.php');
-       }
-
-       if (!isset($auth_php))
-       {
-               include (PHPGW_APP_ROOT . '/inc/auth.php');
-       }
-
-       if (!isset($plugin_php))
-       {
-               include (PHPGW_APP_ROOT . '/inc/plugin.php');
-       }
-
-       include(PHPGW_APP_ROOT . '/src/load_prefs.php');
-
-       if (!isset($attachments))
-               $attachments = array();
-
-       // This function is used when not sending or adding attachments
-       function newMail () 
-       {
-               global $forward_id, $imapConnection, $msg, $ent_num, $body_ary, 
$body, $query_RB_addr,
-                       $reply_id, $send_to, $send_to_cc, $mailbox, 
$send_to_bcc, $editor_size;
-                       
-               $send_to = sqStripSlashes(decodeHeader($send_to));
-               $send_to_cc = sqStripSlashes(decodeHeader($send_to_cc));
-               $send_to_bcc = sqStripSlashes(decodeHeader($send_to_bcc));
-               
-               if ($forward_id)
-                       $id = $forward_id;
-               elseif ($reply_id)
-                       $id = $reply_id;
-
-               if (isset($id) && !isset($query_RB_addr)) 
-               {
-                       sqimap_mailbox_select($imapConnection, $mailbox);
-                       $message = sqimap_get_message($imapConnection, $id, 
$mailbox);
-                       $orig_header = $message->header;
-                       if ($ent_num)
-                               $message = getEntity($message, $ent_num);
-                               
-                       if ($message->header->type0 == "text" || 
$message->header->type1 == "message") 
-                       {
-                               if ($ent_num)
-                                       $body = 
decodeBody(mime_fetch_body($imapConnection, $id, $ent_num), 
$message->header->encoding);
-                               else
-                                       $body = 
decodeBody(mime_fetch_body($imapConnection, $id, 1), 
$message->header->encoding);
-                       } 
-                       else 
-                       {
-                               $body = "";
-                       }
-                       
-                       if ($message->header->type1 == "html")
-                               $body = strip_tags($body);
-                               
-                       sqUnWordWrap($body);
-                       $body_ary = explode("\n", $body);
-                       $i = count($body_ary) - 1;
-                       while (isset($body_ary[$i]) && ereg("^[>\s]*$", 
$body_ary[$i])) 
-                       {
-                               unset($body_ary[$i]);
-                               $i --;
-                       }
-                       
-                       $body = "";
-                       for ($i=0; $i < count($body_ary); $i++) 
-                       {
-                               if (! $forward_id)
-                               {
-                                       if (ereg('^[\s>]+', $body_ary[$i]))
-                                       {
-                                               $body_ary[$i] = '>' . 
$body_ary[$i];
-                                       }
-                                       else
-                                       {
-                                               $body_ary[$i] = '> ' . 
$body_ary[$i];
-                                       }
-                               }
-                               sqWordWrap($body_ary[$i], $editor_size - 1);
-                               $body .= $body_ary[$i] . "\n";
-                               $body_ary[$i] = '';
-                       }
-                       
-                       if ($forward_id)
-                       {
-                               $bodyTop =  "-------- " . lang("Original 
Message") . " --------\n\n";
-                               $bodyTop .= lang("Subject") . ": " . 
$orig_header->subject . "\n";
-                               $bodyTop .= lang("From") . ": " . 
$orig_header->from . "\n";
-                               $bodyTop .= lang("To") . ": " . 
$orig_header->to[0] . "\n";
-                               if (count($orig_header->to) > 1) 
-                               {
-                                       for ($x=1; $x < 
count($orig_header->to); $x++) 
-                                       {
-                                               $bodyTop .= "         " . 
$orig_header->to[$x] . "\n";
-                                       }
-                               }
-                               $bodyTop .= "\n";
-                               
-                               $bodyBottom  = "\n-------- " . lang("Original 
Message") . " --------\n";
-                               $body = $bodyTop . $body . $bodyBottom;
-                       }
-                       return;
-               }
-               
-               if (!$send_to) 
-               {
-                       $send_to = sqimap_find_email($send_to);
-               }
-               
-               /** This formats a CC string if they hit "reply all" **/
-               if ($send_to_cc != "") 
-               {
-                       $send_to_cc = ereg_replace( '"[^"]*"', "", $send_to_cc);
-                       $send_to_cc = ereg_replace(";", ",", $send_to_cc);
-                       $sendcc = explode(",", $send_to_cc);
-                       $send_to_cc = "";
-                       
-                       for ($i = 0; $i < count($sendcc); $i++) 
-                       {
-                               $sendcc[$i] = trim($sendcc[$i]);
-                               if ($sendcc[$i] == "")
-                                       continue;
-                               
-                               $sendcc[$i] = sqimap_find_email($sendcc[$i]);
-                               $whofrom = 
sqimap_find_displayable_name($msg["HEADER"]["FROM"]);
-                               $whoreplyto = 
sqimap_find_email($msg["HEADER"]["REPLYTO"]);
-                               
-                               if ((strtolower(trim($sendcc[$i])) != 
strtolower(trim($whofrom))) &&
-                                       (strtolower(trim($sendcc[$i])) != 
strtolower(trim($whoreplyto))) &&
-                                       (trim($sendcc[$i]) != "")) 
-                               {
-                                       $send_to_cc .= trim($sendcc[$i]) . ", ";
-                               }
-                       }
-                       $send_to_cc = trim($send_to_cc);
-                       if (substr($send_to_cc, -1) == ",") 
-                       {
-                               $send_to_cc = substr($send_to_cc, 0, 
strlen($send_to_cc) - 1);
-                       }
-               }
-       } // function newMail()
-
-   function getAttachments($message) {
-      global $mailbox, $attachments, $attachment_dir, $imapConnection,
-             $ent_num, $forward_id;
-//address@hidden: added phpgw, $message
-      global $phpgw, $message;
-      
-      if (!$message) {
-           sqimap_mailbox_select($imapConnection, $mailbox);
-           $message = sqimap_get_message($imapConnection, $forward_id, 
$mailbox); }
-      
-      if (!$message->entities) {
-      if ($message->header->entity_id != $ent_num) {
-      $filename = decodeHeader($message->header->filename);
-      
-      if ($filename == "")
-              $filename = "untitled-".$message->header->entity_id;
-      
-      $localfilename = md5($filename.", $REMOTE_IP, REMOTE_PORT, $UNIQUE_ID, 
extra-stuff here" . time());
-      
-//address@hidden: added separator
-       $sep = $phpgw->common->filesystem_separator();
-        // Write File Info
-//address@hidden: added separator ($sep)
-        $fp = fopen ($attachment_dir.$sep.$localfilename.".info", "w");
-        fputs ($fp, 
strtolower($message->header->type0)."/".strtolower($message->header->type1)."\n".$filename."\n");
-        fclose ($fp);
-
-        // Write Attachment to file
-//address@hidden: added separator ($sep)
-        $fp = fopen ($attachment_dir.$sep.$localfilename, "w");
-      fputs ($fp, decodeBody(mime_fetch_body($imapConnection, $forward_id, 
$message->header->entity_id), $message->header->encoding));
-      fclose ($fp);
-      
-      $attachments[$localfilename] = $filename;
-      
-      }
-      } else {
-              for ($i = 0; $i < count($message->entities); $i++) {
-              getAttachments($message->entities[$i]);
-              }       
-      }
-      return;
-      }       
-
-       function showInputForm () 
-       {
-               global $send_to, $send_to_cc, $reply_subj, $forward_subj, $body,
-                       $passed_body, $color, $use_signature, $signature, 
$editor_size,
-                       $attachments, $subject, $newmail, 
$use_javascript_addr_book,
-                       $send_to_bcc, $reply_id, $mailbox, 
$from_htmladdr_search,
-                       $location_of_buttons, $phpgw, $phpgw_info;
-               
-               $subject = sqStripSlashes(decodeHeader($subject));
-               $reply_subj = decodeHeader($reply_subj);
-               $forward_subj = decodeHeader($forward_subj);
-               $body = sqStripSlashes($body);
-               
-               /* RB if ($use_javascript_addr_book) 
-               {
-                       echo "\n<SCRIPT LANGUAGE=JavaScript><!--\n";
-                       echo "function open_abook() { \n";
-                       echo "  var nwin = 
window.open(\"addrbook_popup.php\",\"abookpopup\",";
-                       echo 
"\"width=670,height=300,resizable=yes,scrollbars=yes\");\n";
-                       echo "  if((!nwin.opener) && (document.windows != 
null))\n";
-                       echo "    nwin.opener = document.windows;\n";
-                       echo "}\n";
-                       echo "// --></SCRIPT>\n\n";
-               } */
-
-               
-      echo "\n<FORM name=compose action=\"" . 
$phpgw->link('/felamimail/compose.php') . "\" METHOD=POST 
ENCTYPE=\"multipart/form-data\"";
-      do_hook("compose_form");
-         echo ">\n";
-      if ($reply_id) {
-         echo "<input type=hidden name=reply_id value=$reply_id>\n";
-      }                 
-      printf("<INPUT TYPE=hidden NAME=mailbox VALUE=\"%s\">\n", 
htmlspecialchars($mailbox));
-      echo "<TABLE WIDTH=\"100%\" ALIGN=center CELLSPACING=0 BORDER=0>\n";
-
-      if ($location_of_buttons == 'top') showComposeButtonRow();
-
-      echo "   <TR>\n";
-      echo "      <TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
-      echo lang("to").":";
-      echo "      </TD><TD BGCOLOR=\"$color[4]\">\n";
-      printf("         <INPUT TYPE=text NAME=\"send_to\" VALUE=\"%s\" 
SIZE=60><BR>\n",
-             htmlspecialchars($send_to));
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-      echo "   <TR>\n";
-      echo "      <TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
-      echo lang("cc").":";
-      echo "      </TD><TD BGCOLOR=\"$color[4]\" ALIGN=LEFT>\n";
-      printf("         <INPUT TYPE=text NAME=\"send_to_cc\" SIZE=60 
VALUE=\"%s\"><BR>\n",
-             htmlspecialchars($send_to_cc));
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-      echo "   <TR>\n";
-      echo "      <TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
-      echo lang("BCC").":";
-      echo "      </TD><TD BGCOLOR=\"$color[4]\" ALIGN=LEFT>\n";
-      printf("         <INPUT TYPE=text NAME=\"send_to_bcc\" VALUE=\"%s\" 
SIZE=60><BR>\n",
-             htmlspecialchars($send_to_bcc));
-      echo "</TD></TR>\n";
-
-      echo "   <TR>\n";
-      echo "      <TD BGCOLOR=\"$color[4]\" ALIGN=RIGHT>\n";
-      echo lang("Subject").":";
-      echo "      </TD><TD BGCOLOR=\"$color[4]\" ALIGN=LEFT>\n";
-      if ($reply_subj) {
-         $reply_subj = str_replace("\"", "'", $reply_subj);
-         $reply_subj = sqStripSlashes($reply_subj);
-         $reply_subj = trim($reply_subj);
-         if (substr(strtolower($reply_subj), 0, 3) != "re:")
-            $reply_subj = "Re: $reply_subj";
-         printf("         <INPUT TYPE=text NAME=subject SIZE=60 VALUE=\"%s\">",
-                htmlspecialchars($reply_subj));
-      } else if ($forward_subj) {
-         $forward_subj = str_replace("\"", "'", $forward_subj);
-         $forward_subj = sqStripSlashes($forward_subj);
-         $forward_subj = trim($forward_subj);
-         if ((substr(strtolower($forward_subj), 0, 4) != "fwd:") &&
-             (substr(strtolower($forward_subj), 0, 5) != "[fwd:") &&
-             (substr(strtolower($forward_subj), 0, 6) != "[ fwd:"))
-            $forward_subj = "[Fwd: $forward_subj]";
-         printf("         <INPUT TYPE=text NAME=subject SIZE=60 VALUE=\"%s\">",
-                htmlspecialchars($forward_subj));
-      } else {
-          printf("         <INPUT TYPE=text NAME=subject SIZE=60 
VALUE=\"%s\">",
-                htmlspecialchars($subject));
-      }
-      echo "</td></tr>\n\n";
-
-      if ($location_of_buttons == 'between') showComposeButtonRow();
-
-      echo "   <TR>\n";
-      echo "      <TD BGCOLOR=\"$color[4]\" COLSPAN=2>\n";
-      echo "         &nbsp;&nbsp;<TEXTAREA NAME=body ROWS=20 
COLS=\"$editor_size\" WRAP=HARD>";
-      if ($reply_subj) echo "> ".htmlspecialchars($send_to)." 
".lang("wrote").":\n>\n";
-      echo htmlspecialchars($body);
-      if ($use_signature == true && $newmail == true && 
!isset($from_htmladdr_search)) {
-         echo "\n\n-- \n" . htmlspecialchars($signature);
-      }
-      echo "</TEXTAREA><BR>\n";
-      echo "      </TD>\n";
-      echo "   </TR>\n";
-
-      if ($location_of_buttons == 'bottom') 
-         showComposeButtonRow();
-      else {
-         echo "   <TR><TD>&nbsp;</TD><TD ALIGN=LEFT><INPUT TYPE=SUBMIT 
NAME=send VALUE=\"".lang("Send")."\"></TD></TR>\n";
-      }
-      
-      // This code is for attachments
-      echo "   <tr>\n";
-      echo "     <TD BGCOLOR=\"$color[0]\" VALIGN=TOP ALIGN=RIGHT>\n";
-      echo "      <SMALL><BR></SMALL>".lang("Attach").":";
-      echo "      </td><td ALIGN=left BGCOLOR=\"$color[0]\">\n";
-      echo "      <INPUT NAME=\"attachfile\" SIZE=48 TYPE=\"file\">\n";
-      echo "      &nbsp;&nbsp;<input type=\"submit\" name=\"attach\"";
-      echo " value=\"" . lang("Add") ."\">\n";
-      echo "     </td>\n";
-      echo "   </tr>\n";
-//echo "Attachments:". count($attachments) . "<P>";
-      if (isset($attachments) && count($attachments)>0) {
-         echo "<tr><td bgcolor=\"$color[0]\" align=right>\n";
-         echo "&nbsp;";
-         echo "</td><td align=left bgcolor=\"$color[0]\">";
-         while (list($localname, $remotename) = each($attachments)) {
-            echo "<input type=\"checkbox\" name=\"delete[]\" 
value=\"$localname\">\n";
-            echo "$remotename <input type=\"hidden\" 
name=\"attachments[$localname]\" value=\"$remotename\"><br>\n";
-         }
-         
-         echo "<input type=\"submit\" name=\"do_delete\" 
value=\"".lang("Delete selected attachments")."\">\n";
-         echo "</td></tr>";
-      }
-      // End of attachment code
-
-      echo "</TABLE>\n";
-      echo "</FORM>";
-      do_hook("compose_bottom");
-   }
-   
-       $sb2 = CreateObject('phpgwapi.sbox2');
-       
-       function showComposeButtonRow() 
-       {
-               global $use_javascript_addr_book;
-               echo "   <TR><td>\n   </td><td>\n";
-               
-               /* RB if ($use_javascript_addr_book) 
-               {
-                       echo "      <SCRIPT LANGUAGE=JavaScript><!--\n 
document.write(\"";
-                       echo "         <input type=button 
value=\\\"".lang("Addresses")."\\\" onclick='javascript:open_abook();'>\");";
-                       echo "         // --></SCRIPT><NOSCRIPT>\n";
-                       echo "         <input type=submit 
name=\"html_addr_search\" value=\"".lang("Addresses")."\">";
-                       echo "      </NOSCRIPT>\n";
-               } 
-               else 
-               {
-                       echo "      <input type=submit 
name=\"html_addr_search\" value=\"".lang("Addresses")."\">";
-               } */
-               
-               global $query_RB_addr,$sb2;
-               $arr = $sb2->getEmail('RB_addr',0,$query_RB_addr);
-               while (list($k,$val) = each($arr)) 
-               {
-                       if ($k != 'RB_addr_nojs')
-                               echo $val." &nbsp; \n";
-               }
-               if ($query_RB_addr && isset($arr['RB_addr_OK'])) 
-               {       
-                       // yes we have selectbox with addresses 
-                       echo '<input type=submit name="RB_addr_To" value="To"> 
&nbsp; '."\n";
-                       echo '<input type=submit name="RB_addr_Cc" value="Cc"> 
&nbsp; '."\n";           
-               } 
-               else
-               {
-                       echo $arr['RB_addr_nojs']." &nbsp; \n";
-               }
-               
-               echo "\n    <INPUT TYPE=SUBMIT NAME=send VALUE=\"". 
lang("Send") . "\">\n";
-               
-               do_hook("compose_button_row");
-               
-               echo "   </TD>\n";
-               echo "   </TR>\n\n";
-       }
-
-   function showSentForm () {
-      echo "<BR><BR><BR><CENTER><B>Message Sent!</B><BR><BR>";
-      echo "You will be automatically forwarded.<BR>If not, <A 
HREF=\"index.php\">click here</A>";
-      echo "</CENTER>";
-   }
-
-   function checkInput ($show) {
-      /** I implemented the $show variable because the error messages
-          were getting sent before the page header.  So, I check once
-          using $show=false, and then when i'm ready to display the
-          error message, show=true **/
-      global $send_to, $show, $color;
-
-      if ($send_to == "") {
-         if ($show)
-            plain_error_message(lang("You have not filled in the \"To:\" 
field."), $color);
-         return false;
-      }
-      return true;
-   } // function checkInput()
-
-
-   // True if FAILURE
-   function saveAttachedFiles()
-   {
-      global $HTTP_POST_FILES, $attachments, $phpgw, $phpgw_info;
-      global $failed, $mailbox, $send_to, $send_to_cc, $send_to_bcc, $subject, 
$body, $attachfile, 
-               $imapConnection, $boxes, $send, $reply_id, $color, $id_RB_addr, 
$RB_addr_To, $RB_addr_Cc,
-               $attach, $do_delete, $delete, $smtpErrors, $ent_num, 
$translated_setup;
-      
-      $localfilename = GenerateRandomString(32, '', 7);
-      $sep = $phpgw->common->filesystem_separator();
-
-      $HTTP_POST_FILES['attachfile']['tmp_name'];
-      $phpgw_info["server"]["temp_dir"] . $sep . $localfilename;
-
-      if (address@hidden($HTTP_POST_FILES['attachfile']['tmp_name'], 
$phpgw_info["server"]["temp_dir"] . $sep . $localfilename)) {
-         if (!copy($HTTP_POST_FILES['attachfile']['tmp_name'], 
$phpgw_info["server"]["temp_dir"] . $sep . $localfilename)) {
-            return true;
-         }
-      }
-      
-      if (!isset($failed) || !$failed) {
-         // Write information about the file
-         $fp = fopen ($phpgw_info["server"]["temp_dir"] . $sep . 
$localfilename.".info", "w");
-         fputs ($fp, 
$HTTP_POST_FILES['attachfile']['type']."\n".$HTTP_POST_FILES['attachfile']['name']."\n");
-         fclose ($fp);
-
-         $attachments[$localfilename] = $HTTP_POST_FILES['attachfile']['name'];
-      }
-    }
-
-       if (isset($mailbox))     $mailbox = trim($mailbox);
-       if (isset($send_to))     $send_to = trim($send_to);
-       if (isset($send_to_cc))  $send_to_cc = trim($send_to_cc);
-       if (isset($send_to_bcc)) $send_to_bcc = trim($send_to_bcc);
-       if (isset($subject))     $subject = trim($subject);
-       if (isset($body))        $body = trim($body);
-       if (isset($attachfile))  $attachfile = trim($attachfile);
-
-       if (!isset($mailbox) || $mailbox == "" || ($mailbox == "None"))
-               $mailbox = "INBOX";
-       
-       if (isset($HTTP_POST_VARS["query_RB_addr"]))
-       {
-               // the signature is already included in the body at this stage
-               $use_signature = false;
-       }
-
-       $debugLK = 0;
-       
-
-       //address@hidden: there are cases where boxes is not an array
-       if (!isset($imapConnection))  {
-               // this should be set already lars kneschke 2001-09-09
-               //$key      = 
$phpgw_info['user']['preferences']['email']['passwd'];
-               //$username = 
$phpgw_info['user']['preferences']['email']['userid'];
-               $imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-       }
-       if (!isset($boxes)) {
-               $boxes = sqimap_mailbox_list($imapConnection);
-               $phpgw->session->register("boxes");
-       }
-
-       if(isset($send)) 
-       {
-               if ($debugLK) print '$send set<br>';
-               
-               if (isset($HTTP_POST_FILES['attachfile']) &&
-                       $HTTP_POST_FILES['attachfile']['tmp_name'] &&
-                       $HTTP_POST_FILES['attachfile']['tmp_name'] != 'none' &&
-                       $HTTP_POST_FILES['attachfile']['name'])
-               {
-                       $AttachFailure = saveAttachedFiles();
-               }
-               if (checkInput(false) && !isset($AttachFailure)) 
-               {
-                       $urlMailbox = urlencode (trim($mailbox));
-                       if (! isset($reply_id)) $reply_id = 0;
-                       sendMessage($send_to, $send_to_cc, $send_to_bcc, 
$subject, $body, $reply_id);
-                       header ("Location: " . 
$phpgw->link('/felamimail/index.php',"mailbox=$urlMailbox&sort=$sort&startMessage=1"));
-               } 
-               else 
-               {
-                       //$imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-                       
-                       displayPageHeader($color, $mailbox);
-                       
-                       if ($AttachFailure)
-                               plain_error_message(lang("Could not move/copy 
file. File not attached"), $color);
-                               
-                       checkInput(true);
-                       
-                       showInputForm();
-                       //sqimap_logout($imapConnection);
-               }
-       } 
-       else if ($id_RB_addr && ($RB_addr_To || $RB_addr_Cc)) 
-       {
-               if ($debugLK) print '$id_RB_addr && ($RB_addr_To || 
$RB_addr_Cc<br>';
-               //$imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-               displayPageHeader($color, $mailbox);
-               
-               $send_to = sqStripSlashes($send_to);
-               $send_to_cc = sqStripSlashes($send_to_cc);
-               $send_to_bcc = sqStripSlashes($send_to_bcc);
-      
-               if ($RB_addr_To) 
-               {
-                       if ($send_to) $send_to .= ', ';
-                       $send_to .= $sb2->addr2email($id_RB_addr);
-               } 
-               else 
-               {               
-                       if ($send_to_cc) $send_to_cc .= ', ';
-                       $send_to_cc .= $sb2->addr2email($id_RB_addr);
-               }
-               // the signature is already included in the body at this stage
-               $use_signature = false;
-               showInputForm();
-               //sqimap_logout($imapConnection);
-       } 
-       else if (isset($attach)) 
-       {
-               if (saveAttachedFiles())
-                       plain_error_message(lang("Could not move/copy file. 
File not attached"), $color);
-               //$imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-               displayPageHeader($color, $mailbox);
-               showInputForm();
-               //sqimap_logout($imapConnection);
-       } 
-       else if (isset($do_delete)) 
-       {
-               //$imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-               displayPageHeader($color, $mailbox);
-               
-               $sep = $phpgw->common->filesystem_separator();
-               while (list($lkey, $localname) = each($delete)) 
-               {
-                       unset ($attachments[$localname]);
-                       unlink ($phpgw_info["server"]["temp_dir"] . $sep . 
$localname);
-                       unlink ($phpgw_info["server"]["temp_dir"] . $sep . 
$localname.".info");
-               }
-               
-               showInputForm();
-               //sqimap_logout($imapConnection); 
-       } 
-       else if (isset($smtpErrors)) 
-       {
-               //$imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-               displayPageHeader($color, $mailbox);
-               
-               $newmail = true;
-               if ($forward_id && $ent_num)  getAttachments(0);
-               
-               newMail();
-               showInputForm();
-               //sqimap_logout($imapConnection);
-       } 
-       else 
-       {
-               if ($debugLK) print 'default<br>';
-               $imapConnection = sqimap_login($username, $key, 
$imapServerAddress, $imapPort, 0);
-               displayPageHeader($color, $mailbox);
-               
-               $newmail = true;
-               
-               if (isset($forward_id) && isset($ent_num))  getAttachments(0);
-               
-               newMail();
-               showInputForm();
-               sqimap_logout($imapConnection);
-       }
-/*
-//address@hidden: inserted three next lines
-   if (!isset($translated_setup) && !function_exists('translate_read_form') )
-      include(PHPGW_APP_ROOT . "/inc/translate_setup.php");
-   translate_read_form();
-*/
-
-       $phpgw->session->save();
-       $phpgw->common->phpgw_footer();
-?>

Index: download.php
===================================================================
RCS file: download.php
diff -N download.php
--- download.php        24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,193 +0,0 @@
-<?php
-   /**
-    **  download.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Handles attachment downloads to the users computer.
-    **  Also allows displaying of attachments when possible.
-    **
-    **  $Id: download.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-#   header("Pragma: ");
-#   header("Cache-Control: cache");
-
-       // store the value of $mailbox, because it will overwriten
-       $phpgw_info["flags"] = array(
-               'noheader'    => 'True',
-               'nonavbar'    => 'True',
-               "currentapp" => "felamimail"
-       );
-       include("../header.inc.php");
-       $mailbox = $GLOBALS['HTTP_GET_VARS']['mailbox'];
-       $passed_id = $GLOBALS['HTTP_GET_VARS']['passed_id'];
-       $passed_ent_id = $GLOBALS['HTTP_GET_VARS']['passed_ent_id'];
-
-       $phpgw->session->restore();
-
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . '/inc/strings.php');
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . '/config/config.php');
-   if (!isset($imap_php))
-      include("./inc/imap.php");
-   if (!isset($mime_php))
-      include("./inc/mime.php");
-   if (!isset($date_php))
-      include("./inc/date.php");
-   if (!isset($i18n_php))
-      include("./inc/i18n.php");
-
-
-   include("./src/load_prefs.php");
-
-   function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
-      global $where, $what, $charset, $phpgw;
-      global $startMessage, $imapConnection;
-      
-      //displayPageHeader($imapConnection, $color, "None");
-      displayPageHeader($color, "None");
-
-      echo "<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=2 
ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
-      echo "<B><CENTER>";
-      echo lang("Viewing a text attachment") . " - ";
-      if ($where && $what) {
-         // from a search
-         echo "<a 
href=\"".$phpgw->link('/felamimail/read_body.php',"mailbox=".urlencode($mailbox)."&passed_id=$id&where=".urlencode($where)."&what=".urlencode($what))."\">".
 lang("View message") . "</a>";
-      } else {   
-         echo "<a 
href=\"".$phpgw->link('/felamimail/read_body.php',"mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0")."\">".
 lang("View message") . "</a>";
-      }   
-
-      $urlmailbox = urlencode($mailbox);
-      echo "</b></td><tr><tr><td><CENTER><A 
HREF=\"".$phpgw->link('/felamimail/download.php',"absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox")."\">";
-      echo lang("Download this as a file");
-      echo "</A></CENTER><BR>";
-      echo "</CENTER></B>";
-      echo "</TD></TR></TABLE>";
-
-      echo "<TABLE WIDTH=98% BORDER=0 CELLSPACING=0 CELLPADDING=2 
ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
-      echo "<TR><TD BGCOLOR=\"$color[4]\"><TT>";
-
-      if ($type1 != "html")
-         translateText($body, $wrap_at, $charset);
-      
-      // this will help netscape linux
-      $body = eregi_replace('base href','base hreff',$body);
-       
-      echo $body;
-
-      echo "</TT></TD></TR></TABLE>";
-   }
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-   sqimap_mailbox_select($imapConnection, $mailbox);
-
-   // $message contains all information about the message
-   // including header and body
-   $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
-   $top_header = $message->header;
-
-   // lets redefine message as this particular entity that we wish to display.
-   // it should hold only the header for this entity.  We need to fetch the 
body
-   // yet before we can display anything.
-   $message = getEntity($message, $passed_ent_id);
-
-   $header = $message->header;
-
-   $charset = $header->charset;
-   $type0 = $header->type0;
-   $type1 = $header->type1;
-   $filename = decodeHeader($header->filename);
-
-   if (strlen($filename) < 1) {
-      if ($type1 == "plain" && $type0 == "text")                  $suffix = 
"txt";
-      else if ($type1 == "richtext" && $type0 == "text")          $suffix = 
"rtf";
-      else if ($type1 == "postscript" && $type0 == "application") $suffix = 
"ps";
-      else if ($type1 == "message" && $type0 == "rfc822")         $suffix = 
"msg";
-      else $suffix = $type1;
-
-      $filename = "untitled$passed_ent_id.$suffix";
-   }
-
-   // Note:
-   //    The following sections display the attachment in different
-   //    ways depending on how they choose.  The first way will download
-   //    under any circumstance.  This sets the Content-type to be
-   //    applicatin/octet-stream, which should be interpreted by the
-   //    browser as "download me".
-   //      The second method (view) is used for images or other formats
-   //    that should be able to be handled by the browser.  It will
-   //    most likely display the attachment inline inside the browser.
-   //      And finally, the third one will be used by default.  If it
-   //    is displayable (text or html), it will load them up in a text
-   //    viewer (built in to felamimail).  Otherwise, it sets the
-   //    content-type as application/octet-stream
-   
-   if (isset($absolute_dl) && $absolute_dl == "true") {
-      switch($type0) {
-         case "text":
-            $body = mime_fetch_body($imapConnection, $passed_id, 
$passed_ent_id);
-            $body = decodeBody($body, $header->encoding);
-            header("Content-Disposition: attachment; filename=\"$filename\"");
-            header("Content-type: application/octet-stream; 
name=\"$filename\"");
-            set_up_language(getPref($data_dir, $username, "language"));
-            if ($type1 == "plain") {
-               echo lang("Subject") . ": " . 
decodeHeader(sqStripSlashes($top_header->subject)) . "\n";
-               echo "   " . lang("From") . ": " . 
decodeHeader(sqStripSlashes($top_header->from)) . "\n";
-               echo "     " . lang("To") . ": " . 
decodeHeader(sqStripSlashes(getLineOfAddrs($top_header->to))) . "\n";
-               echo "   " . lang("Date") . ": " . 
getLongDateString($top_header->date) . "\n\n";
-            }
-            echo trim($body);
-            break;
-         default:
-            header("Content-Disposition: attachment; filename=\"$filename\"");
-            header("Content-type: application/octet-stream; 
name=\"$filename\"");
-            mime_print_body_lines ($imapConnection, $passed_id, 
$passed_ent_id, $header->encoding);
-            break;
-      }
-   } else {
-      switch ($type0) {
-         case "text":
-            if ($type1 == "plain" || $type1 == "html") {
-               $phpgw->common->phpgw_header();
-               echo parse_navbar();
-                $body = mime_fetch_body($imapConnection, $passed_id, 
$passed_ent_id);
-                $body = decodeBody($body, $header->encoding);
-                include(PHPGW_APP_ROOT . "/inc/page_header.php");
-                viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, 
$type1, $wrap_at);
-            } else {
-                $body = mime_fetch_body($imapConnection, $passed_id, 
$passed_ent_id);
-                $body = decodeBody($body, $header->encoding);
-                header("Content-Type: $type0/$type1");
-                header("Content-Disposition: filename=\"$filename\"");
-                echo $body;
-            }
-            break;
-         case "message":
-            $phpgw->common->phpgw_header();
-           echo parse_navbar();
-            $body = mime_fetch_body($imapConnection, $passed_id, 
$passed_ent_id);
-            $body = decodeBody($body, $header->encoding);
-            include(PHPGW_APP_ROOT . '/inc/page_header.php');
-            viewText($color, $body, $passed_id, $passed_ent_id, $mailbox, 
$type1, $wrap_at);
-            break;
-         default:
-            header("Content-Type: $type0/$type1");
-            header("Content-Disposition: filename=\"$filename\"");
-           mime_print_body_lines ($imapConnection, $passed_id, $passed_ent_id, 
$header->encoding);
-            break;
-      }
-   }    
-    
-   sqimap_logout($imapConnection);
-       $phpgw->session->save();
-       // vcard doesn't need a footer
-       if ($type1 != 'x-vcard') {
-//address@hidden: disabled; the typical application/octet-stream doesn't want 
this
-               //$phpgw->common->phpgw_footer();
-       }
-
-
-?>

Index: folders_create.php
===================================================================
RCS file: folders_create.php
diff -N folders_create.php
--- folders_create.php  24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,77 +0,0 @@
-<?php
-   /**
-    **  folders_create.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Creates folders on the IMAP server. 
-    **  Called from folders.php
-    **
-    **  $Id: folders_create.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array(
-               "currentapp" => "felamimail", 
-               'noheader'    => 'True',
-               'nonavbar'    => 'True'
-       );
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . "/inc/strings.php");
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . "/inc/page_header.php");
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . "/inc/imap.php");
-   if (!isset($display_messages_php))
-      include(PHPGW_APP_ROOT . "/inc/display_messages.php");
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-   $dm = sqimap_get_delimiter($imapConnection);
-
-   if (strpos($folder_name, "\"") || strpos($folder_name, "\\") ||
-       strpos($folder_name, "'") || strpos($folder_name, "$dm")) {
-               print "<html><body bgcolor=$color[4]>";
-      plain_error_message(lang("Illegal folder name.  Please select a 
different name.")."<BR><A HREF=\"../src/folders.php\">".lang("Click here to go 
back")."</A>.", $color);
-      sqimap_logout($imapConnection);
-      exit;
-   }
-
-   if (isset($contain_subs) && $contain_subs == true)
-      $folder_name = "$folder_name$dm";
-
-   if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) {
-      $folder_prefix = $folder_prefix . $dm;
-   }
-   if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != 
$folder_prefix)){
-      $subfolder_orig = $subfolder;
-      $subfolder = $folder_prefix . $subfolder;
-   } else {
-      $subfolder_orig = $subfolder;
-   }
-
-   if ((trim($subfolder_orig) == "[ None ]") || 
(trim(sqStripSlashes($subfolder_orig)) == "[ None ]")) {
-      sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, "");
-   } else {
-      sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, "");
-   }
-   fputs($imapConnection, "1 logout\n");
-
-   $location = get_location();
-   header ("Location: 
".$phpgw->link('/felamimail/folders.php','success=create'));
-
-   sqimap_logout($imapConnection);
-
-   $phpgw->common->phpgw_footer();
-?>
-

Index: folders_delete.php
===================================================================
RCS file: folders_delete.php
diff -N folders_delete.php
--- folders_delete.php  24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,120 +0,0 @@
-<?php
-   /**
-    **  folders_delete.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Deltes folders from the IMAP server. 
-    **  Called from the folders.php
-    **
-    **  $Id: folders_delete.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array(
-               "currentapp" => "felamimail", 
-               'noheader'    => 'True',
-               'nonavbar'    => 'True'
-       );
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-
-
-   /*
-   *  Incoming values:
-   *     $mailbox - selected mailbox from the form
-   */
-   
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . "/inc/strings.php");
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . "/inc/page_header.php");
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . "/inc/imap.php");
-   if (!isset($array_php))
-      include(PHPGW_APP_ROOT . "/inc/array.php");
-   if (!isset($tree_php))
-      include(PHPGW_APP_ROOT . "/inc/tree.php");
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-   
-   $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 
0);
-   $boxes = sqimap_mailbox_list ($imap_stream);
-   $dm = sqimap_get_delimiter($imap_stream);
-   $mailbox = sqStripSlashes($mailbox);
-   
-   if (substr($mailbox, -1) == $dm)
-      $mailbox_no_dm = substr($mailbox, 0, strlen($mailbox) - 1); 
-   else
-      $mailbox_no_dm = $mailbox;
-
-   /** lets see if we CAN move folders to the trash.. otherwise, 
-    ** just delete them **/
-
-   // Courier IMAP doesn't like subfolders of Trash
-   if (strtolower($imap_server_type) == "courier") {
-      $can_move_to_trash = false;
-   } 
-
-   // If it's already a subfolder of trash, we'll have to delete it
-   else if(eregi("^".$trash_folder.".+", $mailbox)) {
-
-      $can_move_to_trash = false;
-
-   }
-
-   // Otherwise, check if trash folder exits and support sub-folders
-   else {
-      for ($i = 0; $i < count($boxes); $i++) {
-         if ($boxes[$i]["unformatted"] == $trash_folder) {
-            $can_move_to_trash = true;
-            for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-               if (strtolower($boxes[$i]["flags"][$j]) == "noinferiors")
-                 $can_move_to_trash = false;
-            }
-         }
-      }
-   }
-
-   /** First create the top node in the tree **/
-   for ($i = 0;$i < count($boxes);$i++) {
-      if (($boxes[$i]["unformatted-dm"] == $mailbox) && 
(strlen($boxes[$i]["unformatted-dm"]) == strlen($mailbox))) {
-         $foldersTree[0]["value"] = $mailbox;
-         $foldersTree[0]["doIHaveChildren"] = false;
-         continue;
-      }
-   }
-   // Now create the nodes for subfolders of the parent folder 
-   // You can tell that it is a subfolder by tacking the mailbox delimiter
-   //    on the end of the $mailbox string, and compare to that.
-   $j = 0;
-   for ($i = 0;$i < count($boxes);$i++) {
-      if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox_no_dm . $dm)) 
== ($mailbox_no_dm . $dm)) {
-         addChildNodeToTree($boxes[$i]["unformatted"], 
$boxes[$i]["unformatted-dm"], $foldersTree);
-      }
-   }
-//   simpleWalkTreePre(0, $foldersTree);
-
-   /** Lets start removing the folders and messages **/
-   if (($move_to_trash == true) && ($can_move_to_trash == true)) { /** if they 
wish to move messages to the trash **/
-      walkTreeInPostOrderCreatingFoldersUnderTrash(0, $imap_stream, 
$foldersTree, $dm, $mailbox);
-      walkTreeInPreOrderDeleteFolders(0, $imap_stream, $foldersTree);
-   } else { /** if they do NOT wish to move messages to the trash (or 
cannot)**/
-      walkTreeInPreOrderDeleteFolders(0, $imap_stream, $foldersTree);
-   }
-
-   /** Log out this session **/
-   sqimap_logout($imap_stream);
-
-   $location = get_location();
-   header ("Location: 
".$phpgw->link('/felamimail/folders.php','success=delete'));
-
-?>

Index: folders.php
===================================================================
RCS file: folders.php
diff -N folders.php
--- folders.php 24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,339 +0,0 @@
-<?php
-   /**
-    **  folders.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Handles all interaction between the user and the other folder
-    **  scripts which do most of the work. Also handles the Special
-    **  Folders.
-    **
-    **  $Id: folders.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-
-   $enablePHPGW = 1;
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array("currentapp" => "felamimail", 
"enable_network_class" => True, 
-                       "enable_nextmatchs_class" => True);
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . "/inc/strings.php");
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . "/inc/page_header.php");
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . "/inc/imap.php");
-   if (!isset($array_php))
-      include(PHPGW_APP_ROOT . "/inc/array.php");
-   if (!isset($plugin_php))
-      include(PHPGW_APP_ROOT . "/inc/plugin.php");
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-#   displayPageHeader($imapConnection, $color, "None");
-
-   echo "<br>";
-   echo "<TABLE WIDTH=95% COLS=1 ALIGN=CENTER>\n";
-   echo "   <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><b>\n";
-   echo lang("Folders");
-   echo "   </b></TD></TR>\n";
-   echo "</TABLE>\n";
-
-   if ((isset($success) && $success) || 
-       (isset($sent_create) && $sent_create == "true") || 
-       (isset($trash_create) && $trash_create == "true")) {
-      echo "<table width=100% align=center cellpadding=3 cellspacing=0 
border=0>\n";
-      echo "   <tr><td><center>\n";
-      if ($success == "subscribe") {
-         echo "<b>" . lang("Subscribed successfully!") . "</b><br>";
-      } else if ($success == "unsubscribe") {
-         echo "<b>" . lang("Unsubscribed successfully!") . "</b><br>";
-      } else if ($success == "delete") {
-         echo "<b>" . lang("Deleted folder successfully!") . "</b><br>";
-      } else if ($success == "create") {
-         echo "<b>" . lang("Created folder successfully!") . "</b><br>";
-      } else if ($success == "rename") {
-         echo "<b>" . lang("Renamed successfully!") . "</b><br>";
-      } else if (($sent_create == "true") || ($trash_create == "true")) {
-         $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-         if ($sent_create == "true") {
-            sqimap_mailbox_create ($imapConnection, $sent_folder, "");  
-         }
-         if ($trash_create == "true") {
-            sqimap_mailbox_create ($imapConnection, $trash_folder, "");
-         }
-         sqimap_logout($imapConnection);
-         echo lang("Folders created successfully!");
-      }
-
-      echo "   </center></td></tr>\n";
-      echo "</table><br>\n";
-   }
-   $imapConnection = sqimap_login ($username, $key, $imapServerAddress, 
$imapPort, 0);
-   $boxes = sqimap_mailbox_list($imapConnection);
-
-   //display form option for creating Sent and Trash folder
-   if ($imap_server_type == "cyrus" && ($sent_folder != "none" || 
$trash_folder != "none")) {
-      if ((!sqimap_mailbox_exists ($imapConnection, $sent_folder)) || 
-         (!sqimap_mailbox_exists ($imapConnection, $trash_folder))) {
-         echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 
cellspacing=0 border=0>\n";
-         echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
-         echo lang("Special Folder Options");
-         echo "</B></TD></TR>";
-         echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-         echo lang("In order for SquirrelMail to provide the full set of 
options you need to create the special folders listed below.  Just click the 
check box and hit the create button.");
-         echo "<FORM ACTION=\"".$phpgw->link('/felamimail/folders.php')."\" 
METHOD=\"POST\">\n";
-         if (!sqimap_mailbox_exists ($imapConnection, $sent_folder) && 
$sent_folder != "none") {
-            echo lang("Create Sent") . "<INPUT TYPE=checkbox NAME=sent_create 
value=true><br>\n";
-         }
-         if (!sqimap_mailbox_exists ($imapConnection, $trash_folder) && 
$trash_folder != "none"){
-            echo lang("Create Trash") . "<INPUT TYPE=checkbox 
NAME=trash_create value=true><br>\n";
-         }
-         echo "<INPUT TYPE=submit VALUE=".lang("Create").">";
-         echo "</FORM></TD></TR></TABLE><br>";
-      }
-   }
-
-   /** DELETING FOLDERS **/
-   echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 cellspacing=0 
border=0>\n";
-   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
-   echo lang("Delete Folder");
-   echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-
-   $count_special_folders = 0;
-       $num_max = 1;
-       if (strtolower($imap_server_type) == "courier" || $move_to_trash)
-               $num_max++;
-       if ($move_to_sent)
-               $num_max++;
-
-   for ($p = 0; $p < count($boxes) && $count_special_folders < $num_max; $p++) 
{                                                                               
  
-      if (strtolower($boxes[$p]["unformatted"]) == "inbox")
-         $count_special_folders++;
-      else if (strtolower($imap_server_type) == "courier" &&
-               strtolower($boxes[$p]["unformatted"]) == "inbox.trash")
-         $count_special_folders++;
-      else if ($boxes[$p]["unformatted"] == $trash_folder && $trash_folder)
-         $count_special_folders++;
-      else if ($boxes[$p]["unformatted"] == $sent_folder && $sent_folder)
-         $count_special_folders++;
-   }   
-
-   if ($count_special_folders < count($boxes)) {
-      echo "<FORM 
ACTION=\"".$phpgw->link('/felamimail/folders_delete.php')."\" 
METHOD=\"POST\">\n";
-      echo "<TT><SELECT NAME=mailbox>\n";
-      for ($i = 0; $i < count($boxes); $i++) {
-         $use_folder = true;
-        if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
-            ($boxes[$i]["unformatted"] != $trash_folder) && 
-            ($boxes[$i]["unformatted"] != $sent_folder) &&
-            (strtolower($imap_server_type) != "courier" ||
-             strtolower($boxes[$i]["unformatted"]) != "inbox.trash"))
-           {
-              $box = $boxes[$i]["unformatted-dm"];
-              $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-              echo "         <OPTION VALUE=\"$box\">$box2\n";
-           }
-      }
-      echo "</SELECT></TT>\n";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"";
-      echo lang("Delete");
-      echo "\">\n";
-      echo "</FORM></TD></TR>\n";
-   } else {
-      echo lang("No folders found") . "<br><br></td><tr>";
-   }
-
-   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
-
-   /** CREATING FOLDERS **/
-   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
-   echo lang("Create Folder");
-   echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-   echo "<FORM NAME=cf 
ACTION=\"".$phpgw->link('/felamimail/folders_create.php')."\" 
METHOD=\"POST\">\n";
-   echo "<INPUT TYPE=TEXT SIZE=25 NAME=folder_name><BR>\n";
-   echo lang("as a subfolder of");
-   echo "<BR>";
-   echo "<TT><SELECT NAME=subfolder>\n";
-   if (strtolower($imap_server_type) != "courier"){
-     if ($default_sub_of_inbox == false)
-       echo "<OPTION SELECTED>[ None ]\n";
-     else
-       echo "<OPTION>[ None ]\n";
-   }
-
-   for ($i = 0; $i < count($boxes); $i++) {
-      if (count($boxes[$i]["flags"]) > 0) {
-         $noinf = false;
-         for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-            if ($boxes[$i]["flags"][$j] == "noinferiors") {
-               $noinf = true;
-               continue;
-            }
-         }    
-         if ($noinf == false) {
-            if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && 
($default_sub_of_inbox == true)) {
-               $box = $boxes[$i]["unformatted"];
-               $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-               echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-            } else {
-               $box = $boxes[$i]["unformatted"];
-               $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-               if (strtolower($imap_server_type) != "courier" ||
-                  strtolower($box) != "inbox.trash")
-                echo "<OPTION VALUE=\"$box\">$box2\n";
-            }
-         }
-      } else {
-         if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && 
($default_sub_of_inbox == true)) {
-            $box = $boxes[$i]["unformatted"];
-            $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-            echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-         } else {
-            $box = $boxes[$i]["unformatted"];
-            $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-           if (strtolower($imap_server_type) != "courier" ||
-               strtolower($box) != "inbox.trash")
-             echo "<OPTION VALUE=\"$box\">$box2\n";
-         }
-      }
-   }
-   echo "</SELECT></TT><BR>\n";
-   if ($show_contain_subfolders_option) {
-      echo "<INPUT TYPE=CHECKBOX NAME=\"contain_subs\"> &nbsp;";
-      echo lang("Let this folder contain subfolders");
-      echo "<BR>";
-   }   
-   echo "<INPUT TYPE=SUBMIT VALUE=\"".lang("Create")."\">\n";
-   echo "</FORM></TD></TR>\n";
-
-   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr>\n";
-
-   /** RENAMING FOLDERS **/
-   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER><B>";
-   echo lang("Rename a Folder");
-   echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>";
-   if ($count_special_folders < count($boxes)) {
-      echo "<FORM 
ACTION=\"".$phpgw->link('/felamimail/folders_rename_getname.php')."\" 
METHOD=\"POST\">\n";
-      echo "<TT><SELECT NAME=old>\n";
-      for ($i = 0; $i < count($boxes); $i++) {
-         $use_folder = true;
-
-        if ((strtolower($boxes[$i]["unformatted"]) != "inbox") && 
-            ($boxes[$i]["unformatted"] != $trash_folder)  &&
-            ($boxes[$i]["unformatted"] != $sent_folder)) 
-           {   
-              $box = $boxes[$i]["unformatted-dm"];
-              $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-              if (strtolower($imap_server_type) != "courier" || 
strtolower($box) != "inbox.trash")
-                 echo "<OPTION VALUE=\"$box\">$box2\n";
-           }
-      }
-      echo "</SELECT></TT>\n";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"";
-      echo lang("Rename");
-      echo "\">\n";
-      echo "</FORM></TD></TR>\n";
-   } else {
-      echo lang("No folders found") . "<br><br></td></tr>";
-   }
-   $boxes_sub = $boxes;
-
-   echo "<tr><td bgcolor=\"$color[4]\">&nbsp;</td></tr></table>\n";
-   
-   /** UNSUBSCRIBE FOLDERS **/
-   echo "<TABLE WIDTH=70% COLS=1 ALIGN=CENTER cellpadding=2 cellspacing=0 
border=0>\n";
-   echo "<TR><TD BGCOLOR=\"$color[9]\" ALIGN=CENTER colspan=3><B>";
-   echo lang("Unsubscribe") . "/" . lang("Subscribe");
-   echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" width=49% ALIGN=CENTER>";
-   if ($count_special_folders < count($boxes)) {
-      echo "<FORM 
ACTION=\"".$phpgw->link('/felamimail/folders_subscribe.php','method=unsub')."\" 
METHOD=\"POST\">\n";
-      echo "<TT><SELECT NAME=mailbox[] multiple size=8>\n";
-      for ($i = 0; $i < count($boxes); $i++) {
-         $use_folder = true;
-        if ((strtolower($boxes[$i]["unformatted"]) != "inbox") &&
-            ($boxes[$i]["unformatted"] != $trash_folder) &&
-            ($boxes[$i]["unformatted"] != $sent_folder)) 
-           {   
-              $box = $boxes[$i]["unformatted-dm"];
-              $box2 = replace_spaces($boxes[$i]["unformatted-disp"]);
-              echo "         <OPTION VALUE=\"$box\">$box2\n";
-           }
-      }
-      echo "</SELECT></TT><br>\n";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"";
-      echo lang("Unsubscribe");
-      echo "\">\n";
-      echo "</FORM></TD>\n";
-   } else {
-      echo lang("No folders were found to unsubscribe from!") . "</td>";
-   }
-   $boxes_sub = $boxes;
-
-   echo "<td bgcolor=\"$color[9]\" width=2%>&nbsp;</td>";
-   
-   /** SUBSCRIBE TO FOLDERS **/
-   echo "<TD BGCOLOR=\"$color[0]\" widtn=49% ALIGN=CENTER>";
-   $imap_stream = sqimap_login ($username, $key, $imapServerAddress, 
$imapPort, 1);
-   $boxes_all = sqimap_mailbox_list_all ($imap_stream);
-
-   $box = "";
-   $box2 = "";
-   for ($i = 0, $q = 0; $i < count($boxes_all); $i++) {
-      $use_folder = true;
-      for ($p = 0; $p < count ($boxes); $p++) {
-        if ($boxes_all[$i]["unformatted"] == $boxes[$p]["unformatted"]) {
-           $use_folder = false;
-           continue;
-        } else if ($boxes_all[$i]["unformatted-dm"] == $folder_prefix) {
-           $use_folder = false;
-        }
-      }
-      if ($use_folder == true) {       
-        $box[$q] = $boxes_all[$i]["unformatted-dm"];
-        $box2[$q] = $boxes_all[$i]["unformatted-disp"];
-        $q++;
-      }
-   }
-   sqimap_logout($imap_stream);
-
-   if ($box && $box2) {
-      echo "<FORM 
ACTION=\"".$phpgw->link('/felamimail/folders_subscribe.php','method=sub')."\" 
METHOD=\"POST\">\n";
-      echo "<tt><select name=mailbox[] multiple size=8>";
-
-      for ($q = 0; $q < count($box); $q++) {      
-         echo "         <OPTION VALUE=\"$box[$q]\">".$box2[$q]."\n";
-      }      
-      echo "</select></tt><br>";
-      echo "<INPUT TYPE=SUBMIT VALUE=\"". lang("Subscribe") . "\">\n";
-      echo "</FORM></TD></TR></TABLE><BR>\n";
-   } else {
-      echo lang("No folders were found to subscribe to!") . 
"</td></tr></table>";
-   }
-
-   do_hook("folders_bottom");
-   sqimap_logout($imapConnection);
-
-   if ($enablePHPGW)
-   {
-       $phpgw->session->save();
-       $phpgw->common->phpgw_footer();
-   }
-   else
-   {
-       print "</BODY></HTML>";
-   }
-
-?>

Index: folders_rename_do.php
===================================================================
RCS file: folders_rename_do.php
diff -N folders_rename_do.php
--- folders_rename_do.php       24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,91 +0,0 @@
-<?php
-   /**
-    **  folders_rename_do.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Does the actual renaming of files on the IMAP server. 
-    **  Called from the folders.php
-    **
-    **  $Id: folders_rename_do.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array(
-               'noheader'    => 'True',
-               'nonavbar'    => 'True',
-               "currentapp" => "felamimail"
-       );
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . '/inc/strings.php');
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . '/inc/page_header.php');
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . '/inc/imap.php');
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-
-   if($old_name == $new_name) {
-      $location = get_location();
-      header ("Location: $location/folders.php");
-      exit;
-   }
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-   $dm = sqimap_get_delimiter($imapConnection);
-
-   if (strpos($orig, $dm))
-      $old_dir = substr($orig, 0, strrpos($orig, $dm));
-   else
-      $old_dir = "";
-
-   if ($old_dir != "")
-      $newone = "$old_dir$dm$new_name";
-   else
-      $newone = "$new_name";
-
-   $orig = sqStripSlashes($orig);
-   $newone = sqStripSlashes($newone);
-
-   fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\r\n");
-   $data = sqimap_read_data($imapConnection, ".", true, $a, $b);
-
-   // Renaming a folder doesn't renames the folder but leaves you unsubscribed
-   //    at least on Cyrus IMAP servers.
-   if (isset($isfolder)) {
-      $newone = $newone.$dm;
-      $orig = $orig.$dm;
-   }   
-   sqimap_unsubscribe($imapConnection, $orig);
-   sqimap_subscribe($imapConnection, $newone);
-
-       fputs ($imapConnection, "a001 LIST \"\" \"$newone*\"\r\n");
-   $data = sqimap_read_data($imapConnection, "a001", true, $a, $b);
-   for ($i=0; $i < count($data); $i++)
-   {
-      $name = find_mailbox_name($data[$i]);
-
-      if ($name != $newone) // don't try to resubscribe when renaming ab to abc
-      {
-        sqimap_unsubscribe($imapConnection, $name);
-        $name = substr($name, strlen($orig));
-        $name = $newone . $name;
-        sqimap_subscribe($imapConnection, $name);
-      }
-   }
-
-   /** Log out this session **/
-   sqimap_logout($imapConnection);
-   header ("Location: 
".$phpgw->link('/felamimail/folders.php','success=rename'));
-
-?>

Index: folders_rename_getname.php
===================================================================
RCS file: folders_rename_getname.php
diff -N folders_rename_getname.php
--- folders_rename_getname.php  24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,75 +0,0 @@
-<?php
-   /**
-    **  folders_rename_getname.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Gets folder names and enables renaming
-    **  Called from folders.php
-    **
-    **  $Id: folders_rename_getname.php,v 1.4 2002/11/24 00:32:13 lkneschke 
Exp $
-    **/
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array("currentapp" => "felamimail", 
"enable_network_class" => True, "enable_nextmatchs_class" => True);
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . "/inc/strings.php");
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . "/inc/page_header.php");
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . "/inc/imap.php");
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-
-   $dm = sqimap_get_delimiter($imapConnection);
-   if (substr($old, strlen($old) - strlen($dm)) == $dm) {
-      $isfolder = true;
-      $old = substr($old, 0, strlen($old) - 1);
-   }
-   
-   if (strpos($old, $dm)) {
-      $old_name = substr($old, strrpos($old, $dm)+1, strlen($old));
-      $old_parent = substr($old, 0, strrpos($old, $dm));
-   } else {
-      $old_name = $old;
-      $old_parent = "";
-   }
-
-   $old_name = sqStripSlashes($old_name);
-
-   displayPageHeader($imapConnection, $color, "None");
-   echo "<br><TABLE align=center border=0 WIDTH=95% COLS=1>";
-   echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
-   echo lang("Rename a folder");
-   echo "</B></TD></TR>";
-   echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
-   echo "<FORM 
ACTION=\"".$phpgw->link('/felamimail/folders_rename_do.php')."\" 
METHOD=\"POST\">\n";
-   echo lang("New name:");
-   echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name 
VALUE=\"$old_name\"><BR>\n";
-   if (isset($isfolder))
-      echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
-   printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
-   printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);
-   echo "<INPUT TYPE=SUBMIT VALUE=\"".lang("Submit")."\">\n";
-   echo "</FORM><BR></TD></TR>";
-   echo "</TABLE>";
-
-   /** Log out this session **/
-   sqimap_logout($imapConnection);
-
-       $phpgw->common->phpgw_footer();
-
-?>
-
-

Index: folders_subscribe.php
===================================================================
RCS file: folders_subscribe.php
diff -N folders_subscribe.php
--- folders_subscribe.php       24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,59 +0,0 @@
-<?php
-   /**
-    **  folders_subscribe.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  Subscribe and unsubcribe form folders. 
-    **  Called from folders.php
-    **
-    **  $Id: folders_subscribe.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $
-    **/
-
-       // store the value of $mailbox, because it will overwriten
-       $MAILBOX = $mailbox;
-       $phpgw_info["flags"] = array(
-               'noheader'    => 'True',
-               'nonavbar'    => 'True',
-               "currentapp" => "felamimail"
-       );
-       include("../header.inc.php");
-       $mailbox = $MAILBOX;
-
-       $phpgw->session->restore();
-
-   if (!isset($strings_php))
-      include(PHPGW_APP_ROOT . "/inc/strings.php");
-   if (!isset($config_php))
-      include(PHPGW_APP_ROOT . "/config/config.php");
-   if (!isset($page_header_php))
-      include(PHPGW_APP_ROOT . "/inc/page_header.php");
-   if (!isset($imap_php))
-      include(PHPGW_APP_ROOT . "/inc/imap.php");
-   if (!isset($display_messages_php))
-      include(PHPGW_APP_ROOT . "/inc/display_messages.php");
-
-   include(PHPGW_APP_ROOT . "/src/load_prefs.php");
-
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-   $dm = sqimap_get_delimiter($imapConnection);
-
-   $location = get_location();
-   if ($method == "sub") {
-      for ($i=0; $i < count($mailbox); $i++) {
-         $mailbox[$i] = trim($mailbox[$i]);
-         sqimap_subscribe ($imapConnection, $mailbox[$i]);
-        header("Location: 
".$phpgw->link('/felamimail/folders.php','success=subscribe'));
-      }
-   } else {
-      for ($i=0; $i < count($mailbox); $i++) {
-         $mailbox[$i] = trim($mailbox[$i]);
-         sqimap_unsubscribe ($imapConnection, $mailbox[$i]);
-        header("Location: 
".$phpgw->link('/felamimail/folders.php','success=unsubscribe'));
-      }
-   }
-   sqimap_logout($imapConnection);
-   $phpgw->common->phpgw_footer();
-?>
-

Index: preferences_display.php
===================================================================
RCS file: preferences_display.php
diff -N preferences_display.php
--- preferences_display.php     24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,74 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-  /* $Id: preferences_display.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $ */
-
-  $phpgw_info["flags"] = array("currentapp" => "felamimail","noheader" => 
True, "nonavbar" => True,
-                                                                               
                                                "enable_nextmatchs_class" => 
True);
-
-  include("../header.inc.php");
-
-  if ($submit) {
-     $phpgw->preferences->read_repository();
-     
-     $phpgw->preferences->add("felamimail","wrapat");
-     $phpgw->preferences->add("felamimail","editorsize");
-     $phpgw->preferences->add("felamimail","button_new_location");
-
-     $phpgw->preferences->save_repository();
-
-     Header("Location: " . $phpgw->link("/preferences/index.php"));
-  }
-
-  $phpgw->common->phpgw_header();
-  echo parse_navbar();
-
-  if ($totalerrors) {  
-     echo "<p><center>" . $phpgw->common->error_list($errors) . "</center>";
-  }
-
-       $tmpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       #$tmpl->set_unknowns('remove');
-
-       $tmpl->set_file(array('body' => 'preferences_display.tpl'));
-       
-       $var = Array
-       (
-               'th_bg'                 => $phpgw_info["theme"]["th_bg"],
-               'tr_color1'             => $phpgw_info['theme']['row_on'],
-               'tr_color2'             => $phpgw_info['theme']['row_off'],
-               'link'                  => 
$phpgw->link('/felamimail/preferences_display.php'),
-               'wrapat'                => 
$phpgw_info["user"]["preferences"]["felamimail"]["wrapat"],
-               'editorsize'            => 
$phpgw_info["user"]["preferences"]["felamimail"]["editorsize"],
-               
$phpgw_info["user"]["preferences"]["felamimail"]["button_new_location"].'_selected'
 => 'SELECTED'
-       );
-       
-       $tmpl->set_var($var);
-       
-       $translations = Array
-       (
-               'lang_save'             => lang('save'),
-               'lang_wrap_at'          => lang('Wrap incoming text at'),
-               'lang_size_editor'      => lang('Size of editor window'),
-               'lang_location_button'  => lang('Location of buttons when 
composing'),
-               'lang_option_1'         => lang('Before headers'),
-               'lang_option_2'         => lang('Between headers and message 
body'),
-               'lang_option_3'         => lang('After message body'),
-               'lang_display_prefs'    => lang('Display Preferences')
-       );
-       $tmpl->set_var($translations);
-
-       $tmpl->pparse('out','body');
-       
-       
-       
-       
-       $phpgw->common->phpgw_footer(); ?>

Index: preferences_email.php
===================================================================
RCS file: preferences_email.php
diff -N preferences_email.php
--- preferences_email.php       24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,359 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-       /* $Id: preferences_email.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $ 
*/
-
-       $GLOBALS['phpgw_info']["flags"] = array(
-               'currentapp' => 'felamimail',
-               'noheader'                => True, 
-               'nonavbar'                => True, 
-               'enable_nextmatchs_class' => True);
-
-       include("../header.inc.php");
-
-       // ----  Save Preferences to Repository  (if this is a submit)  -----
-       if ($GLOBALS['HTTP_POST_VARS']['submit'])
-       {
-               if($GLOBALS['HTTP_POST_VARS']['use_custom_settings'])
-                       $use_custom_settings    = 
$GLOBALS['HTTP_POST_VARS']['use_custom_settings'];
-               if($GLOBALS['HTTP_POST_VARS']['userid'])
-                       $userid                 = 
$GLOBALS['HTTP_POST_VARS']['userid'];
-               if($GLOBALS['HTTP_POST_VARS']['passwd'])
-                       $passwd                 = 
$GLOBALS['HTTP_POST_VARS']['passwd'];
-               if($GLOBALS['HTTP_POST_VARS']['address'])
-                       $address                = 
$GLOBALS['HTTP_POST_VARS']['address'];
-               if($GLOBALS['HTTP_POST_VARS']['mail_server'])
-                       $mail_server            = 
$GLOBALS['HTTP_POST_VARS']['mail_server'];
-               if($GLOBALS['HTTP_POST_VARS']['mail_server_type'])
-                       $mail_server_type       = 
$GLOBALS['HTTP_POST_VARS']['mail_server_type'];
-               if($GLOBALS['HTTP_POST_VARS']['imap_server_type'])
-                       $imap_server_type       = 
$GLOBALS['HTTP_POST_VARS']['imap_server_type'];
-               if($GLOBALS['HTTP_POST_VARS']['mail_folder'])
-                       $mail_folder            = 
$GLOBALS['HTTP_POST_VARS']['mail_folder'];
-               
-               $GLOBALS['phpgw']->preferences->read_repository();
-
-               // ----  Typical (Non-Custom) Preferences   -----
-
-               
$GLOBALS['phpgw']->preferences->delete("felamimail","mainscreen_showmail");
-               if ($GLOBALS['HTTP_POST_VARS']['mainscreen_showmail'])
-               {
-                       
$GLOBALS['phpgw']->preferences->add("felamimail","mainscreen_showmail");
-               }
-
-               $GLOBALS['phpgw']->preferences->add("email","default_sorting");
-
-               /* email sig must not have  '  nor  "  in it, as they screw up 
the preferences in class session
-                   not an sql error, but the core bug lies somewhere in 
session caching */
-               if (!is_object($GLOBALS['phpgw']->msg))
-               {
-                       $GLOBALS['phpgw']->msg = CreateObject('email.mail_msg');
-               }
-               
-               if ($email_sig != '')
-               {
-                       /* get rid of the escape \ that magic_quotes HTTP POST 
will add, " becomes \" and  '  becomes  \'  */
-                       $email_sig_clean = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($email_sig);
-                       /*// replace  '  and  "  with htmlspecialchars */
-                       $email_sig_clean = 
$GLOBALS['phpgw']->msg->html_quotes_encode($email_sig_clean);
-                       
$GLOBALS['phpgw']->preferences->add("email","email_sig",$email_sig_clean);
-               }
-               else
-               {
-                       // have it set, but be empty
-                       
$GLOBALS['phpgw']->preferences->add("email","email_sig");
-               }
-               
-               // ----  Custom Preferences   -----
-               // differ from account defaults set by administrator, should be 
unset if not using custom prefs
-               
$GLOBALS['phpgw']->preferences->delete("email","use_custom_settings");
-               if (! $use_custom_settings)
-               {
-                       
$GLOBALS['phpgw']->preferences->delete("email","userid");
-                       
$GLOBALS['phpgw']->preferences->delete("email","passwd");
-                       
$GLOBALS['phpgw']->preferences->delete("email","address");
-                       
$GLOBALS['phpgw']->preferences->delete("email","mail_server");
-                       
$GLOBALS['phpgw']->preferences->delete("email","mail_server_type");
-                       
$GLOBALS['phpgw']->preferences->delete("email","imap_server_type");
-                       
$GLOBALS['phpgw']->preferences->delete("email","mail_folder");
-               }
-               else
-               {
-                       
$GLOBALS['phpgw']->preferences->add("email","use_custom_settings");
-                       if ($userid)
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","userid");
-                       }
-                       else
-                       {
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","userid");
-                       }
-                       if ($passwd)
-                       {
-                               // INTERIM WORKAROUND: requires NO change to 
phpgwapi
-                               // there were multiple problems with previous 
custom email passwd handling
-                               //echo 'in pref page b4 strip: '.$passwd.'<br>';
-                               $encrypted_passwd = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($passwd);
-                               //echo 'in pref page after strip: 
'.$encrypted_passwd.'<br>';
-                               $encrypted_passwd = 
$GLOBALS['phpgw']->msg->encrypt_email_passwd($encrypted_passwd);
-                               //echo 'encrypted_passwd: 
'.$encrypted_passwd.'<br>';
-                               
$GLOBALS['phpgw']->preferences->add("email","passwd",$encrypted_passwd);
-                               //$test_str = 'a test string';
-                               //echo 'test_str before base64 decode: 
'.$test_str.'<br>';
-                               //$test_str = base64_decode($test_str);
-                               //echo 'test_str after base64 decode: 
'.$test_str.'<br>';
-
-                               /* // CURRENT: does not need class common 
change, 
-                               // BUT CURRENT CODE IS BROKEN - waiting for api 
change to implement the above fix
-                               //  get rid of the escape \ that magic_quotes 
HTTP POST will add, " becomes \" and  '  becomes  \' 
-                               $encrypted_passwd = 
$GLOBALS['phpgw']->msg->stripslashes_gpc($passwd);
-                               $encrypted_passwd = 
$GLOBALS['phpgw']->common->encrypt($encrypted_passwd);
-                               
$GLOBALS['phpgw']->preferences->add("email","passwd",$encrypted_passwd); */
-                       }
-                       else
-                       {
-                               // is not specified, LEAVE PASSWD ALONE, retain 
previous setting
-                       }
-                       if ($address)
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","address");
-                       }
-                       else
-                       {
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","address");
-                       }
-                       if ($mail_server)
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","mail_server");
-                       }
-                       else
-                       {
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","mail_server");
-                       }
-                       if ($mail_server_type)
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","mail_server_type");
-                       }
-                       else
-                       {
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","mail_server_type");
-                       }
-                       if ($imap_server_type)
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","imap_server_type");
-                       }
-                       else
-                       {
-                               // if ( (mail_server_type=='imap') || 
(mail_server_type=='imaps') ) then
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","imap_server_type");
-                       }
-                       if ($mail_folder) 
-                       {
-                               
$GLOBALS['phpgw']->preferences->add("email","mail_folder");
-                       }
-                       else
-                       {
-                               // if (imap_server_type=='UW-Maildir')  then
-                               // should probably be an error message here
-                               
$GLOBALS['phpgw']->preferences->delete("email","mail_folder");
-                       }
-               }
-
-               $GLOBALS['phpgw']->preferences->save_repository();
-
-               Header("Location: " . 
$GLOBALS['phpgw']->link("/preferences/index.php"));
-       }
-
-// ----  Show The Preferences Page   -----
-       $GLOBALS['phpgw']->common->phpgw_header();
-       echo parse_navbar();
-
-       $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       $t->set_file(array(             
-               'T_preferences_out' => 'preferences_email.tpl'
-       ));
-
-       if ($totalerrors)
-       {
-               //echo "<p><center>" . 
$GLOBALS['phpgw']->common->error_list($errors) . "</center>";
-               $pref_errors = '<p><center>"' 
.$GLOBALS['phpgw']->common->error_list($errors) .'"</center></p>';
-       }
-       else
-       {
-               $pref_errors = '';
-       }
-
-       $t->set_var('pref_errors',$pref_errors);
-       $t->set_var('page_title',lang("E-Mail preferences"));
-
-       // setup the form
-       
$t->set_var('form_action',$GLOBALS['phpgw']->link('/felamimail/preferences_email.php'));
-       // the "table header" row color
-       $t->set_var('th_bg',$GLOBALS['phpgw_info']["theme"]["th_bg"]);
-
-// ----  Typical (Non-Custom) Settings - Fill in HTML form -----
-       // row1 = Email Sig
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row1',$tr_color);
-       $t->set_var('email_sig_blurb',lang("email signature"));
-       $t->set_var('email_sig_textarea_name','email_sig');
-       
//$t->set_var('email_sig_textarea_content',rawurldecode($GLOBALS['phpgw_info']["user"]["preferences"]["email"]["email_sig"]));
-       
$t->set_var('email_sig_textarea_content',$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["email_sig"]);
-
-       // row2 = Sort Order 
-       // old_new means "lowest to highest", and new_old means "highest to 
lowest", which is imap-speak for reverse sorting
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       
$default_order_selected[$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["default_sorting"]]
 = " selected";
-       $sorting_select_options =
-                '<option value="old_new"' .$default_order_selected["old_new"] 
.'>oldest -> newest</option>' ."\n"
-               .'<option value="new_old"' .$default_order_selected["new_old"] 
.'>newest -> oldest</option>' ."\n";
-       $t->set_var('bg_row2',$tr_color);
-       $t->set_var('sorting_blurb',lang("Default sorting order"));
-       $t->set_var('sorting_select_name','default_sorting');
-       $t->set_var('sorting_select_options',$sorting_select_options);
-
-       // row3 = show sender's email address with name options
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       
$show_addresses_selected[$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["show_addresses"]]
 = " selected";
-       $show_addresses_select_options =
-                '<option value="none"' .$show_addresses_selected["none"] .'>' 
.lang('none') .'</option>' ."\n"
-               .'<option value="from"' .$show_addresses_selected["from"] .'>' 
.lang('From') .'</option>' ."\n"
-               .'<option value="replyto"' .$show_addresses_selected["replyto"] 
.'>' .lang('ReplyTo') .'</option>' ."\n";
-       $t->set_var('bg_row3',$tr_color);
-       $t->set_var('show_addresses_blurb',lang("Show sender's email address 
with name"));
-       $t->set_var('show_addresses_select_name','show_addresses');
-       
$t->set_var('show_addresses_select_options',$show_addresses_select_options);
-
-       // row4 = show new messages on  main screen
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       if 
($GLOBALS['phpgw_info']["user"]["preferences"]["felamimail"]["mainscreen_showmail"])
-       {
-               $mainscreen_showmail_checked = 'checked';
-       }
-       else
-       {
-               $mainscreen_showmail_checked = '';
-       }
-       $t->set_var('bg_row4',$tr_color);
-       $t->set_var('mainscreen_showmail_blurb',lang("show new messages on main 
screen"));
-       $t->set_var('mainscreen_showmail_checkbox_name','mainscreen_showmail');
-       $t->set_var('mainscreen_showmail_checkbox_value','True');
-       $t->set_var('mainscreen_showmail_checked',$mainscreen_showmail_checked);
-
-       // row5 = Send deleted messages to the trash
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       if 
($GLOBALS['phpgw_info']["user"]["preferences"]["email"]["use_trash_folder"])
-       {
-               $use_trash_folder_checked = 'checked';
-       }
-       else
-       {
-               $use_trash_folder_checked = '';
-       }
-       $t->set_var('bg_row5',$tr_color);
-       $t->set_var('use_trash_folder_blurb',lang("Send deleted messages to the 
trash"));
-       $t->set_var('use_trash_folder_checkbox_name','use_trash_folder');
-       $t->set_var('use_trash_folder_checkbox_value','True');
-       $t->set_var('use_trash_folder_checked',$use_trash_folder_checked);
-
-       // next section: Custom Email Settings
-       $t->set_var('section_title',lang("Custom Email settings"));
-
-// ----  Custom Settings - Fill in HTML form -----
-       // row6 = use custon settings
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       if 
($GLOBALS['phpgw_info']["user"]["preferences"]["email"]["use_custom_settings"])
-       {
-               $use_custom_settings_checked = 'checked';
-       }
-       else
-       {
-               $use_custom_settings_checked = '';
-       }
-       $t->set_var('bg_row6',$tr_color);
-       $t->set_var('use_custom_settings_blurb',lang("Use custom settings") .' 
- ' .lang("Non-Standard"));
-       $t->set_var('use_custom_settings_checkbox_name','use_custom_settings');
-       $t->set_var('use_custom_settings_checkbox_value','True');
-       $t->set_var('use_custom_settings_checked',$use_custom_settings_checked);
-
-       // row7 = Email Account Name
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row7',$tr_color);
-       $t->set_var('userid_blurb',lang("Email Account Name"));
-       $t->set_var('userid_text_name','userid');
-       
$t->set_var('userid_text_value',$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["userid"]);
-
-       // row8 = Email Password
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row8',$tr_color);
-       $t->set_var('passwd_blurb',lang("Email Password"));
-       $t->set_var('passwd_text_name','passwd');
-       // FIXME: bug
-       $t->set_var('passwd_text_value','');
-
-       // row9 = Email Address
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row9',$tr_color);
-       $t->set_var('address_blurb',lang("Email address"));
-       $t->set_var('address_text_name','address');
-       
$t->set_var('address_text_value',$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["address"]);
-
-       // row10 = Mail Server
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row10',$tr_color);
-       $t->set_var('mail_server_blurb',lang("Mail Server"));
-       $t->set_var('mail_server_text_name','mail_server');
-       
$t->set_var('mail_server_text_value',$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["mail_server"]);
-
-       // row11 = Mail Server type
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       
$mail_server_type_selected[$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["mail_server_type"]]
 = " selected";
-       $mail_server_type_select_options =
-                '<option value="imap"' .$mail_server_type_selected["imap"] 
.'>IMAP</option>' ."\n"
-               .'<option value="imaps-encr-only"' 
.$mail_server_type_selected["imaps-encr-only"] .'>IMAPS Encryption 
only</option>' ."\n"
-               .'<option value="imaps-encr-auth"' 
.$mail_server_type_selected["imaps-encr-auth"] .'>IMAPS 
Authentication</option>' ."\n";
-       $t->set_var('bg_row11',$tr_color);
-       $t->set_var('mail_server_type_blurb',lang("Mail Server type"));
-       $t->set_var('mail_server_type_select_name','mail_server_type');
-       
$t->set_var('mail_server_type_select_options',$mail_server_type_select_options);
-
-       // row12 = IMAP Server Type
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       
$imap_server_type_selected[$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["imap_server_type"]]
 = " selected";
-       $imap_server_type_select_options =
-                '<option value="Cyrus"' .$imap_server_type_selected["Cyrus"] 
.'>Cyrus or Courier</option>' ."\n"
-               .'<option value="UWash"' .$imap_server_type_selected["UWash"] 
.'>UWash</option>' ."\n"
-               .'<option value="UW-Maildir"' 
.$imap_server_type_selected["UW-Maildir"] .'>UW-Maildir</option>' ."\n";
-       $t->set_var('bg_row12',$tr_color);
-       $t->set_var('imap_server_type_blurb',lang("IMAP Server Type") .' - ' 
.lang("If Applicable"));
-       $t->set_var('imap_server_type_select_name','imap_server_type');
-       
$t->set_var('imap_server_type_select_options',$imap_server_type_select_options);
-
-       // row13 = Mail Folder(UW-Maildir)
-       $tr_color = 
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
-       $t->set_var('bg_row13',$tr_color);
-       $t->set_var('mail_folder_blurb',lang("Mail Folder(UW-Maildir)"));
-       $t->set_var('mail_folder_text_name','mail_folder');
-       
$t->set_var('mail_folder_text_value',$GLOBALS['phpgw_info']["user"]["preferences"]["email"]["mail_folder"]);
-
-       // the submit button for the form 
-       $t->set_var('btn_submit_name','submit');
-       $t->set_var('btn_submit_value',lang("submit"));
-
-       $t->pparse('out','T_preferences_out');
-
-       $GLOBALS['phpgw']->common->phpgw_footer();
-?>

Index: preferences_folder.php
===================================================================
RCS file: preferences_folder.php
diff -N preferences_folder.php
--- preferences_folder.php      24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,179 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-  /* $Id: preferences_folder.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $ */
-
-// store the value of $mailbox, because it will overwriten
-        $MAILBOX = $mailbox;
-        
-       $phpgw_info["flags"] = array("currentapp" => "felamimail","noheader" => 
True, "nonavbar" => True,
-               "enable_nextmatchs_class" => True, "enable_network_class" => 
True);
-               
-       include("../header.inc.php");
-       
-       $mailbox = $MAILBOX;
-       
-       
-       
-
-       
-       if ($submit) 
-       {
-               $phpgw->preferences->read_repository();
-
-               $phpgw->preferences->add("felamimail","deleteOptions", 
$GLOBALS['HTTP_POST_VARS']['deleteOptions']);
-               
-               $phpgw->preferences->add("felamimail","trashFolder", 
$GLOBALS['HTTP_POST_VARS']['trashFolder']);
-                               
-               if ($sent != "none") 
-               {
-                       $phpgw->preferences->add("felamimail","move_to_sent", 
"true");
-                       $phpgw->preferences->add("felamimail","sent_folder", 
$sent);
-               } 
-               else 
-               {
-                       $phpgw->preferences->add("felamimail","move_to_sent", 
"0");
-                       $phpgw->preferences->add("felamimail","sent_folder", 
"none");
-               }
-               
-               $phpgw->preferences->add("felamimail","unseennotify");
-               $phpgw->preferences->add("felamimail","unseentype");
-
-
-               $phpgw->preferences->save_repository();
-               
-               Header("Location: " . $phpgw->link("/preferences/index.php"));
-       }
-
-       $phpgw->common->phpgw_header();
-       echo parse_navbar();
-          if (!isset($strings_php))
-             include(PHPGW_APP_ROOT . "/inc/strings.php");
-          if (!isset($config_php))
-             include(PHPGW_APP_ROOT . '/config/config.php');
-          if (!isset($page_header_php))
-             include(PHPGW_APP_ROOT . "/inc/page_header.php");
-          if (!isset($display_messages_php))
-             include(PHPGW_APP_ROOT . "/inc/display_messages.php");
-          if (!isset($imap_php))
-             include(PHPGW_APP_ROOT . "/inc/imap.php");
-          if (!isset($array_php))
-             include(PHPGW_APP_ROOT . "/inc/array.php");
-          if (!isset($i18n_php))
-             include(PHPGW_APP_ROOT . "/inc/i18n.php");
-          if (!isset($plugin_php))
-             include(PHPGW_APP_ROOT . "/inc/plugin.php");
-
-       $load_prefs_php=1;
-       
-       if ($totalerrors) 
-       {
-               echo "<p><center>" . $phpgw->common->error_list($errors) . 
"</center>";
-       }
-       
-       $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-       $boxes = sqimap_mailbox_list($imapConnection);
-       sqimap_logout($imapConnection);
-       
-       
-       
-       if ($phpgw_info["user"]["preferences"]["felamimail"]["deleteOptions"] 
!= 'move_to_trash')
-               $trashOptions = "<option value=none>" . lang("Don't use Trash");
-       else
-               $trashOptions = "<option value=none selected>" . lang("Don't 
use Trash");
-               
-       for ($i = 0; $i < count($boxes); $i++) 
-       {
-               $use_folder = true;
-               if (strtolower($boxes[$i]["unformatted"]) == "inbox") 
-               {
-                       $use_folder = false;
-               }
-               
-               if ($use_folder == true) 
-               {
-                       $box = $boxes[$i]["unformatted-dm"];
-                       $box2 = replace_spaces($boxes[$i]["formatted"]);
-                       if (($boxes[$i]["unformatted"] == 
$phpgw_info["user"]["preferences"]["felamimail"]["trashFolder"]) &&
-                               
$phpgw_info["user"]["preferences"]["felamimail"]["deleteOptions"] == 
'move_to_trash')
-                               $trashOptions .= "         <OPTION SELECTED 
VALUE=\"$box\">$box2\n";
-                       else
-                               $trashOptions .= "         <OPTION 
VALUE=\"$box\">$box2\n";
-               }
-       }
-       
-       
-       
-       if ($phpgw_info["user"]["preferences"]["felamimail"]["move_to_sent"] == 
true)
-               $sentOptions = "<option value=none>" . lang("Don't use Sent");
-       else
-               $sentOptions = "<option value=none selected>" . lang("Don't use 
Sent");
-
-       for ($i = 0; $i < count($boxes); $i++) 
-       {
-               $use_folder = true;
-               if (strtolower($boxes[$i]["unformatted"]) == "inbox") 
-               {
-                       $use_folder = false;
-               }
-               if ($use_folder == true) 
-               {       
-                       $box = $boxes[$i]["unformatted-dm"];
-                       $box2 = replace_spaces($boxes[$i]["formatted"]);
-                       if (($boxes[$i]["unformatted"] == 
$phpgw_info["user"]["preferences"]["felamimail"]["sent_folder"]) &&
-                               
($phpgw_info["user"]["preferences"]["felamimail"]["move_to_sent"] == true))
-                               $sentOptions .= "         <OPTION SELECTED 
VALUE=\"$box\">$box2\n";
-                       else
-                               $sentOptions .= "         <OPTION 
VALUE=\"$box\">$box2\n";
-               }
-       }
-
-
-         
-       $tmpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       #$tmpl->set_unknowns('remove');
-
-       $tmpl->set_file(array('body' => 'preferences_folder.tpl'));
-       
-       $var = Array
-       (
-               'th_bg'                 => $phpgw_info["theme"]["th_bg"],
-               'tr_color1'             => $phpgw_info['theme']['row_on'],
-               'tr_color2'             => $phpgw_info['theme']['row_off'],
-               'link'                  => 
$phpgw->link('/felamimail/preferences_folder.php'),
-               'wrapat'                => 
$phpgw_info["user"]["preferences"]["felamimail"]["wrapat"],
-               'trash_options'         => $trashOptions,
-               'sent_options'          => $sentOptions,
-               
"notify".$phpgw_info["user"]["preferences"]["felamimail"]["unseennotify"]."_checked"
    => 'checked',
-               
"type".$phpgw_info["user"]["preferences"]["felamimail"]["unseentype"]."_checked"
        => 'checked',
-               
$phpgw_info["user"]["preferences"]["felamimail"]["deleteOptions"]."_selected"   
=> 'selected'
-       );
-       
-       $tmpl->set_var($var);
-       
-       $translations = Array
-       (
-               'lang_save'             => lang('save'),
-               'lang_folder_prefs'     => lang('Folder Preferences'),
-               'lang_when_deleting'    => lang('when deleting messages'),
-               'lang_move_to_trash'    => lang('move to trash'),
-               'lang_mark_as_deleted'  => lang('mark as deleted'),
-               'lang_remove_immediately'       => lang('remove immediately')
-       );
-       $tmpl->set_var($translations);
-
-       $tmpl->pparse('out','body');
-       
-       
-       
-       
-       $phpgw->common->phpgw_footer(); 
-?>

Index: preferences_highlight.php
===================================================================
RCS file: preferences_highlight.php
diff -N preferences_highlight.php
--- preferences_highlight.php   24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,254 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-  /* $Id: preferences_highlight.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp $ 
*/
-
-// store the value of $mailbox, because it will overwriten
-        $MAILBOX = $mailbox;
-        
-       $phpgw_info["flags"] = array("currentapp" => "felamimail","noheader" => 
True, "nonavbar" => True,
-               "enable_nextmatchs_class" => True, "enable_network_class" => 
True);
-               
-       include("../header.inc.php");
-       
-       $mailbox = $MAILBOX;
-       
-
-       $phpgw->common->phpgw_header();
-       echo parse_navbar();
-
-       if ($totalerrors) 
-       {
-               echo "<p><center>" . $phpgw->common->error_list($errors) . 
"</center>";
-       }
-
-       include "src/load_prefs.php";
-       
-       if (! isset($action))
-               $action = '';
-               
-       if (! isset($message_highlight_list))
-               $message_highlight_list = array();
-               
-       if ($action == "delete" && isset($theid)) 
-       {
-               removePref($data_dir, $username, "highlight$theid");
-               $phpgw->preferences->delete("felamimail", "highlight$theid");
-               $phpgw->preferences->save_repository();
-       } 
-       else if ($action == "save") 
-       {
-               if (!$theid) $theid = 0;
-               $identname = ereg_replace(",", " ", $identname);
-               $identname = str_replace("\\\\", "\\", $identname);
-               $identname = str_replace("\\\"", "\"", $identname);
-               $identname = str_replace("\"", "&quot;", $identname);
-               if ($color_type == 1) 
-                       $newcolor = $newcolor_choose;
-               else 
-                       $newcolor = $newcolor_input;
-                       
-               $newcolor = ereg_replace(",", "", $newcolor);
-               $newcolor = ereg_replace("#", "", $newcolor);
-               $newcolor = "$newcolor";
-               $value = ereg_replace(",", " ", $value);
-               $value = str_replace("\\\\", "\\", $value);
-               $value = str_replace("\\\"", "\"", $value);
-               $value = str_replace("\"", "&quot;", $value);
-               
-               #setPref($data_dir, $username, "highlight$theid", 
$identname.",".$newcolor.",".$value.",".$match_type);
-               $phpgw->preferences->add("felamimail","highlight$theid", 
$identname.",".$newcolor.",".$value.",".$match_type);
-               $phpgw->preferences->save_repository();
-               $message_highlight_list[$theid]["name"] = $identname;
-               $message_highlight_list[$theid]["color"] = $newcolor;
-               $message_highlight_list[$theid]["value"] = $value;
-               $message_highlight_list[$theid]["match_type"] = $match_type;
-       } 
-
-       include "src/load_prefs.php";
-
-#      $tmpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       #$tmpl->set_unknowns('remove');
-
-#      $tmpl->set_file(array('body' => 'preferences_index_order.tpl'));
-       
-       $var = Array
-       (
-               'th_bg'                 => $phpgw_info["theme"]["th_bg"],
-               'tr_color1'             => $phpgw_info['theme']['row_on'],
-               'tr_color2'             => $phpgw_info['theme']['row_off'],
-               'link'                  => 
$phpgw->link('/felamimail/preferences_index_order.php'),
-               'link_back'             => 
$phpgw->link('/preferences/index.php'),
-               'tablerows'             => $tableRows,
-               'options'               => $options
-       );
-       
-#      $tmpl->set_var($var);
-       
-       $translations = Array
-       (
-               'lang_return'           => lang('Return to options page'),
-               'lang_description'      => lang("The index order is the order 
that the columns are arranged in the message index.  You can add, remove, and 
move columns around to customize them to fit your needs.")
-       );
-#      $tmpl->set_var($translations);
-
-#      $tmpl->pparse('out','body');
-?>
-   <br>
-
-<p><b><?php echo lang("Message Highlighting"); ?></b><hr><p>
-
-
-<?php
-   echo "<br><center>[<a href=\"". 
$phpgw->link('/felamimail/preferences_highlight.php','action=add')."\">" . 
lang("New") . "</a>]";
-   echo " - [<a href=\"". 
$phpgw->link('/preferences/index.php')."\">".lang("Done")."</a>]</center><br>\n";
-   if (count($message_highlight_list) >= 1) {
-      echo "<table border=0 cellpadding=3 cellspacing=0 align=center 
width=80%>\n";
-      for ($i=0; $i < count($message_highlight_list); $i++) {
-         echo "<tr>\n";
-         echo "   <td width=1% bgcolor=" . $color[4] . ">\n";
-         echo "<nobr><small>[<a 
href=\"".$phpgw->link('/felamimail/preferences_highlight.php',"action=edit&theid=$i")."\">"
 . lang("Edit") . "</a>]&nbsp;[<a 
href=\"".$phpgw->link('/felamimail/preferences_highlight.php',"action=delete&theid=$i")."\">".lang("Delete")."</a>]</small></nobr>\n";
-         echo "   </td>";
-         echo "   <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
-         echo "      " . $message_highlight_list[$i]["name"];
-         echo "   </td>\n";
-         echo "   <td bgcolor=" . $message_highlight_list[$i]["color"] . ">\n";
-         echo "      ".$message_highlight_list[$i]["match_type"]." = " . 
$message_highlight_list[$i]["value"];
-         echo "   </td>\n";
-         echo "</tr>\n";
-      }
-      echo "</table>\n";
-      echo "<br>\n";
-   } else {
-      echo "<center>" . lang("No highlighting is defined") . "</center><br>\n";
-      echo "<br>\n";
-   }
-   if ($action == "edit" || $action == "add") {
-      if (!isset($theid)) $theid = count($message_highlight_list);
-          $message_highlight_list[$theid] = array();
- 
-      $color_list[0] = "4444aa";
-      $color_list[1] = "44aa44";
-      $color_list[2] = "aaaa44";
-      $color_list[3] = "44aaaa";
-      $color_list[4] = "aa44aa";
-      $color_list[5] = "aaaaff";
-      $color_list[6] = "aaffaa";
-      $color_list[7] = "ffffaa";
-      $color_list[8] = "aaffff";
-      $color_list[9] = "ffaaff";
-      $color_list[10] = "aaaaaa";
-      $color_list[11] = "bfbfbf";
-      $color_list[12] = "dfdfdf";
-      $color_list[13] = "ffffff";               
-      
-      $selected_input = "";
-      
-      for ($i=0; $i < 14; $i++) {
-         ${"selected".$i} = "";
-      }
-      if (isset($message_highlight_list[$theid]["color"])) {
-         for ($i=0; $i < 14; $i++) {
-            if ($color_list[$i] == $message_highlight_list[$theid]["color"]) {
-               $selected_choose = " checked";
-               ${"selected".$i} = " selected";
-               continue;
-            }
-            }
-      }
-      if (!isset($message_highlight_list[$theid]["color"]))
-         $selected_choose = " checked";
-      else if (!isset($selected_choose))
-         $selected_input = " checked";
- 
-      echo "<form name=f method=post action=\"". 
$phpgw->link('/felamimail/preferences_highlight.php')."\">\n";
-      echo "<input type=\"hidden\" value=\"save\" name=\"action\">\n";
-      echo "<input type=\"hidden\" value=\"$theid\" name=\"theid\">\n";
-      echo "<table width=80% align=center cellpadding=3 cellspacing=0 
border=0>\n";
-      echo "   <tr bgcolor=\"$color[0]\">\n";
-      echo "      <td align=right width=25%><b>\n";
-      echo lang("Identifying name") . ":";
-      echo "      </b></td>\n";
-      echo "      <td width=75%>\n";
-      if (isset($message_highlight_list[$theid]["name"]))
-          $disp = $message_highlight_list[$theid]["name"];
-      else
-          $disp = "";
-      $disp = str_replace("\\\\", "\\", $disp);
-      $disp = str_replace("\\\"", "\"", $disp);
-      $disp = str_replace("\"", "&quot;", $disp);
-      echo "         <input type=\"text\" value=\"".$disp."\" 
name=\"identname\">";
-      echo "      </td>\n";
-      echo "   </tr>\n";
-      echo "   <tr><td><small><small>&nbsp;</small></small></td></tr>\n";
-      echo "   <tr bgcolor=\"$color[0]\">\n";
-      echo "      <td align=right width=25%><b>\n";
-      echo lang("Color") . ":";
-      echo "      </b></td>\n";
-      echo "      <td width=75%>\n";
-      echo "         <input type=\"radio\" name=color_type 
value=1$selected_choose> &nbsp;<select name=newcolor_choose>\n";
-      echo "            <option value=\"$color_list[0]\"$selected0>" . 
lang("Dark Blue") . "\n";
-      echo "            <option value=\"$color_list[1]\"$selected1>" . 
lang("Dark Green") . "\n";
-      echo "            <option value=\"$color_list[2]\"$selected2>" . 
lang("Dark Yellow") . "\n";
-      echo "            <option value=\"$color_list[3]\"$selected3>" . 
lang("Dark Cyan") . "\n";
-      echo "            <option value=\"$color_list[4]\"$selected4>" . 
lang("Dark Magenta") . "\n";
-      echo "            <option value=\"$color_list[5]\"$selected5>" . 
lang("Light Blue") . "\n";
-      echo "            <option value=\"$color_list[6]\"$selected6>" . 
lang("Light Green") . "\n";
-      echo "            <option value=\"$color_list[7]\"$selected7>" . 
lang("Light Yellow") . "\n";
-      echo "            <option value=\"$color_list[8]\"$selected8>" . 
lang("Light Cyan") . "\n";
-      echo "            <option value=\"$color_list[9]\"$selected9>" . 
lang("Light Magenta") . "\n";
-      echo "            <option value=\"$color_list[10]\"$selected10>" . 
lang("Dark Gray") . "\n";
-      echo "            <option value=\"$color_list[11]\"$selected11>" . 
lang("Medium Gray") . "\n";
-      echo "            <option value=\"$color_list[12]\"$selected12>" . 
lang("Light Gray") . "\n";
-      echo "            <option value=\"$color_list[13]\"$selected13>" . 
lang("White") . "\n";
-      echo "         </select><br>\n";
-      echo "         <input type=\"radio\" name=color_type 
value=2$selected_input> &nbsp;". lang("Other:") ."<input type=\"text\" 
value=\"";
-      if ($selected_input) echo $message_highlight_list[$theid]["color"];
-      echo "\" name=\"newcolor_input\" size=7> ".lang("Ex: 63aa7f")."<br>\n";
-      echo "      </td>\n";
-      echo "   </tr>\n";
-      echo "   <tr><td><small><small>&nbsp;</small></small></td></tr>\n";
-      echo "   <tr bgcolor=\"$color[0]\">\n";
-      echo "      <td align=right width=25%><b>\n";
-      echo lang("Match") . ":";
-      echo "      </b></td>\n";
-      echo "      <td width=75%>\n";
-      echo "         <select name=match_type>\n";
-      if (isset($message_highlight_list[$theid]["match_type"]) && 
$message_highlight_list[$theid]["match_type"] == "from")    echo "            
<option value=\"from\" selected>From\n";
-      else                                                         echo "      
      <option value=\"from\">From\n";
-      if (isset($message_highlight_list[$theid]["match_type"]) && 
$message_highlight_list[$theid]["match_type"] == "to")      echo "            
<option value=\"to\" selected>To\n";
-      else                                                         echo "      
      <option value=\"to\">To\n";
-      if (isset($message_highlight_list[$theid]["match_type"]) && 
$message_highlight_list[$theid]["match_type"] == "cc")      echo "            
<option value=\"cc\" selected>Cc\n";
-      else                                                         echo "      
      <option value=\"cc\">Cc\n";
-      if (isset($message_highlight_list[$theid]["match_type"]) && 
$message_highlight_list[$theid]["match_type"] == "to_cc")   echo "            
<option value=\"to_cc\" selected>To or Cc\n";
-      else                                                         echo "      
      <option value=\"to_cc\">To or Cc\n";
-      if (isset($message_highlight_list[$theid]["match_type"]) && 
$message_highlight_list[$theid]["match_type"] == "subject") echo "            
<option value=\"subject\" selected>Subject\n";
-      else                                                         echo "      
      <option value=\"subject\">Subject\n";
-      echo "         </select>\n";
-      if (isset($message_highlight_list[$theid]["value"]))
-          $disp = $message_highlight_list[$theid]["value"];
-      else
-          $disp = '';
-      $disp = str_replace("\\\\", "\\", $disp);
-      $disp = str_replace("\\\"", "\"", $disp);
-      $disp = str_replace("\"", "&quot;", $disp);
-      echo "         <nobr><input type=\"text\" value=\"".$disp."\" 
name=\"value\">";
-      echo "        <nobr></td>\n";
-      echo "   </tr>\n";
-      echo "</table>\n";
-      echo "<center><input type=\"submit\" value=\"" . lang("Submit") . 
"\"></center>\n";
-      echo "</form>\n";
-      do_hook("options_highlight_bottom");
-   } 
-?>
-<?php  
-       $phpgw->common->phpgw_footer(); 
-?>

Index: preferences_index_order.php
===================================================================
RCS file: preferences_index_order.php
diff -N preferences_index_order.php
--- preferences_index_order.php 24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,181 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-  /* $Id: preferences_index_order.php,v 1.4 2002/11/24 00:32:13 lkneschke Exp 
$ */
-
-       // store the value of $mailbox, because it will overwriten
-        $MAILBOX = $mailbox;
-        
-       $phpgw_info["flags"] = array("currentapp" => "felamimail","noheader" => 
True, "nonavbar" => True,
-               "enable_nextmatchs_class" => True, "enable_network_class" => 
True);
-               
-       include("../header.inc.php");
-       
-       $mailbox = $MAILBOX;
-       
-       $phpgw->common->phpgw_header();
-       echo parse_navbar();
-
-       if ($totalerrors) 
-       {
-               echo "<p><center>" . $phpgw->common->error_list($errors) . 
"</center>";
-       }
-
-       include "src/load_prefs.php";
-
-       $available = array
-               (
-                       '1'     => lang("Checkbox"),
-                       '2'     => lang("From"),
-                       '3'     => lang("Date"),
-                       '4'     => lang("Subject"),
-                       '5'     => lang("Flags"),
-                       '6'     => lang("Size")
-               );
-       
-       if (! isset($method)) { $method = ""; }
-       
-       if ($method == "up" && $num > 1) 
-       {
-               $prev = $num-1;
-               $tmp = $index_order[$prev];
-               $index_order[$prev] = $index_order[$num];
-               $index_order[$num] = $tmp;
-       } 
-       else if ($method == "down" && $num < count($index_order)) 
-       {
-               $next = $num++;
-               $tmp = $index_order[$next];
-               $index_order[$next] = $index_order[$num];
-               $index_order[$num] = $tmp;
-       } 
-       else if ($method == "remove" && $num) 
-       {
-               for ($i=1; $i < 8; $i++) 
-               {
-                       $phpgw->preferences->delete("felamimail","order$i");
-               }
-               $phpgw->preferences->save_repository();
-               for ($j=1,$i=1; $i <= count($index_order); $i++) 
-               {
-                       if ($i != $num) 
-                       {
-                               $new_ary[$j] = $index_order[$i];
-                               $j++;
-                       }
-               }
-               $index_order = array();
-               $index_order = $new_ary;
-               if (count($index_order) < 1) 
-               {
-                       include "src/load_prefs.php";
-               }
-       } 
-       else if ($method == "add" && $add) 
-       {
-               $index_order[count($index_order)+1] = $add;
-       }
-       
-       if ($method) 
-       {
-               for ($i=1; $i <= count($index_order); $i++) 
-               {
-                       $phpgw->preferences->add("felamimail","order$i", 
$index_order[$i]);
-               }
-               $phpgw->preferences->save_repository();
-       }
-       
-       $colors = Array
-       (
-               '0'     => $phpgw_info['theme']['row_on'],
-               '1'     => $phpgw_info['theme']['row_off']
-       );
-
-       
-       if (count($index_order))
-       {
-               for ($i=1; $i <= count($index_order); $i++) 
-               {
-                       $tmp = $index_order[$i];
-                       $tableRows .= sprintf("<tr 
bgcolor=\"%s\">",$colors[$i%2]);
-                       $link = 
$phpgw->link('/felamimail/preferences_index_order.php',"method=up&num=$i");
-                       $tableRows .= "<td><small><a href=\"$link\">". 
lang("up") ."</a></small></td>\n";
-                       $tableRows .= "<td><small>&nbsp;|&nbsp;</small></td>\n";
-                       $link = 
$phpgw->link('/felamimail/preferences_index_order.php',"method=down&num=$i");
-                       $tableRows .= "<td><small><a href=\"$link\">". 
lang("down") . "</a></small></td>\n";
-                       $tableRows .= "<td><small>&nbsp;|&nbsp;</small></td>\n";
-                       $tableRows .= "<td>";
-                       // Always show the subject
-                       if ($tmp != 4)
-                       {
-                               $link = 
$phpgw->link('/felamimail/preferences_index_order.php',"method=remove&num=$i");
-                               $tableRows .= "<small><a href=\"$link\">" . 
lang("remove") . "</a></small>";
-                       }
-                       $tableRows .= "</td>\n";
-                       $tableRows .= "<td><small>&nbsp;-&nbsp;</small></td>\n";
-                       $tableRows .= "<td>" . $available[$tmp] . "</td>\n";
-                       $tableRows .= "</tr>\n";
-               }
-       }
-       
-       if (count($index_order) != count($available)) 
-       {
-               $options = "<select name=add>\n";
-               for ($i=1; $i <= count($available); $i++) 
-               {
-                       $found = false;
-                       for ($j=1; $j <= count($index_order); $j++) 
-                       {
-                               if ($index_order[$j] == $i) 
-                               {
-                                       $found = true;
-                               }
-                       }
-                       if (!$found) 
-                       {
-                               $options .= "<option 
value=$i>$available[$i]</option>\n";
-                       }
-               }
-               $options .= "</select>\n";
-               $options .= "<input type=hidden value=add name=method>\n";
-               $options .= sprintf("<input type=submit value=\"%s\" 
name=\"submit\">\n",lang('add'));
-       }
-       
-       $tmpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       #$tmpl->set_unknowns('remove');
-
-       $tmpl->set_file(array('body' => 'preferences_index_order.tpl'));
-       
-       $var = Array
-       (
-               'th_bg'                 => $phpgw_info["theme"]["th_bg"],
-               'tr_color1'             => $phpgw_info['theme']['row_on'],
-               'tr_color2'             => $phpgw_info['theme']['row_off'],
-               'link'                  => 
$phpgw->link('/felamimail/preferences_index_order.php'),
-               'link_back'             => 
$phpgw->link('/preferences/index.php'),
-               'tablerows'             => $tableRows,
-               'options'               => $options
-       );
-       
-       $tmpl->set_var($var);
-       
-       $translations = Array
-       (
-               'lang_return'           => lang('Return to options page'),
-               'lang_index_order'      => lang('Index Order'),
-               'lang_description'      => lang("index_what_is")
-       );
-       $tmpl->set_var($translations);
-
-       $tmpl->pparse('out','body');
-       
-       $phpgw->common->phpgw_footer(); 
-?>

Index: preferences_translate.php
===================================================================
RCS file: preferences_translate.php
diff -N preferences_translate.php
--- preferences_translate.php   24 Nov 2002 00:32:13 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,176 +0,0 @@
-<?php
-  /**************************************************************************\
-  * phpGroupWare - E-Mail                                                    *
-  * http://www.phpgroupware.org                                              *
-  * --------------------------------------------                             *
-  *  This program is free software; you can redistribute it and/or modify it *
-  *  under the terms of the GNU General Public License as published by the   *
-  *  Free Software Foundation; either version 2 of the License, or (at your  *
-  *  option) any later version.                                              *
-  \**************************************************************************/
-
-       /* $Id: preferences_translate.php,v 1.4 2002/11/24 00:32:13 lkneschke 
Exp $ */
-
-       $phpgw_info["flags"] = array(
-               "currentapp" => "felamimail",
-               "noheader" => True, 
-               "nonavbar" => True,
-               "enable_nextmatchs_class" => True
-       );
-
-       include("../header.inc.php");
-
-       if ($submit) {
-               $phpgw->preferences->read_repository();
-               $phpgw->preferences->add("felamimail","translate_server", 
$translate_server);
-               $phpgw->preferences->add("felamimail","translate_location", 
$translate_location);
-               $phpgw->preferences->add("felamimail","translate_show_read", 
$translate_show_read);
-               $phpgw->preferences->add("felamimail","translate_show_send", 
$translate_show_send);
-               $phpgw->preferences->add("felamimail","translate_same_window", 
$translate_same_window);
-               $phpgw->preferences->save_repository();
-               Header("Location: " . $phpgw->link("/preferences/index.php"));
-       }
-
-       if (!isset($config_php))
-               include(PHPGW_APP_ROOT . '/config/config.php');
-
-       // preps
-        $translate_server = 
$phpgw_info["user"]["preferences"]["felamimail"]["translate_server"];
-        $translate_location = 
$phpgw_info["user"]["preferences"]["felamimail"]["translate_location"];
-       $translate_show_read = 
$phpgw_info["user"]["preferences"]["felamimail"]["translate_show_read"];
-       $translate_show_send = 
$phpgw_info["user"]["preferences"]["felamimail"]["translate_show_send"];
-       $translate_same_window = 
$phpgw_info["user"]["preferences"]["felamimail"]["translate_same_window"];
-
-       $translate_intro = '<ul>
-          <li><b>Babelfish</b> -
-              13 language pairs,
-              maximum of 1000 characters translated,
-              powered by Systran
-              [ <a href="http://babelfish.altavista.com/"; 
-              target="_blank">Babelfish</a> ]</li>
-          <li><b>Go.com</b> -
-              10 language pairs,
-              maximum of 25 kilobytes translated,
-              powered by Systran
-              [ <a href="http://translator.go.com/";
-              target="_blank">Translator.Go.com</a> ]</li>
-          <li><b>Dictionary.com</b> -
-              12 language pairs,
-              no known limits,
-              powered by Systran
-              [ <a href="http://www.dictionary.com/translate";
-              target="_blank">Dictionary.com</a> ]</li>
-          <li><b>InterTran</b> -
-              767 language pairs,
-              no known limits,
-              powered by Translation Experts\'s InterTran
-              [ <a href="http://www.tranexp.com/";
-              target="_blank">Translation Experts</a> ]</li>
-          <li><b>GPLTrans</b> -
-              8 language pairs,
-              no known limits,
-              powered by GPLTrans (free, open source)
-              [ <a href="http://www.translator.cx/";
-              target="_blank">GPLTrans</a> ]</li>
-          <li><b>Free Translation</b> -
-              10 language pairs,
-              10 KBytes,
-              rapid translations,
-              [ <a href="http://www.freetranslation.com/";
-              target="_blank">Free Translation</a> ]</li>
-       </ul>';
-
-        function TServerSelect($value, $Desc, $sel)
-        {
-              $val .= '<option value="' . $value . '"';
-              if ($sel == $value) $val .= ' SELECTED';
-              $val .= '>' . $Desc . "</option>\n";
-              return $val;
-       }
-        $str = '<select name="translate_server">';
-        $str .= TServerSelect('babelfish',     'Babelfish',    
$translate_server);
-       $str .= TServerSelect('go',             'Go.com',       
$translate_server);
-       $str .= TServerSelect('dictionary',     'Dictionary.com', 
$translate_server);
-       $str .= TServerSelect('intertran',      'Intertran',    
$translate_server);
-       $str .= TServerSelect('gpltrans',       'GPLTrans',     
$translate_server);
-       $str .= TServerSelect('freetrans',      'FreeTrans',    
$translate_server);
-        $str .= '</select>';
-        $disp_translate_servers = $str;
-
-        function TLocSelect($value, $Desc, $sel)
-        {
-              $val .= '<option value="' . $value . '"';
-              if ($sel == $value) $val .= ' SELECTED';
-              $val .= '>' . $Desc . "</option>\n";
-              return $val;
-       }
-        $str = '<select name="translate_location">';
-        $str .= TLocSelect('left',   lang('to the left'),   
$translate_location);
-       $str .= TLocSelect('center', lang('in the center'), 
$translate_location);
-       $str .= TLocSelect('right',  lang('to the right'),  
$translate_location);
-        $str .= '</select>';
-        $disp_translate_locations = $str;
-
-       $str = '<input type=checkbox name="translate_show_read"';
-       if ($translate_show_read) $str .=" CHECKED";
-       $str .= '> When reading';
-        $disp_translate_show_read = $str;
-
-       $str = '<input type=checkbox name="translate_show_send"';
-       if ($translate_show_send) $str .=" CHECKED";
-       $str .= '> When composing';
-        $disp_translate_show_send = $str;
-
-       $str = '<input type=checkbox name="translate_same_window"';
-        if ($translate_same_window) $str .=" CHECKED";
-       $str .= '> Translate inside the SquirrelMail frames';
-        $disp_translate_same_window = $str;
-
-
-       // display and template 
-       $phpgw->common->phpgw_header();
-       echo parse_navbar();
-
-       if ($totalerrors) {  
-               echo "<p><center>" . $phpgw->common->error_list($errors) . 
"</center>";
-       }
-
-       $tmpl = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-       #$tmpl->set_unknowns('remove');
-
-       $tmpl->set_file(array('body' => 'preferences_translate.tpl'));
-
-       // var
-       $var = Array
-       (
-               'th_bg'                 => $phpgw_info["theme"]["th_bg"],
-               'tr_color1'             => $phpgw_info['theme']['row_on'],
-               'tr_color2'             => $phpgw_info['theme']['row_off'],
-               'link'                  => 
$phpgw->link('/felamimail/preferences_translate.php'),
-               'translate_intro'       => $translate_intro,
-               'translate_servers'     => $disp_translate_servers,             
-               'translate_locations'   => $disp_translate_locations,           
-               'translate_show_read'   => $disp_translate_show_read,           
-               'translate_show_send'   => $disp_translate_show_send,           
-               'translate_same_window' => $disp_translate_same_window,         
-       );
-
-       $tmpl->set_var($var);
-
-       // translations
-       $translations = Array
-       (
-               'lang_translate_prefs'          => lang('Translation 
Preferences'),
-               'lang_translation_server'       => lang('Translation server'),
-               'lang_translation_location'     => lang('Translation location'),
-               'lang_translation_show_read'    => lang('For received mail'),
-               'lang_translation_show_send'    => lang('For mail to be send - 
not functional yet'),
-               'lang_translation_same_window'  => lang('Same Window - not 
functional yet'),
-               'lang_save'                     => lang('save'),
-       );
-       $tmpl->set_var($translations);
-
-       $tmpl->pparse('out','body');
-
-       $phpgw->common->phpgw_footer(); 
-?>

Index: read_body.php
===================================================================
RCS file: read_body.php
diff -N read_body.php
--- read_body.php       24 Nov 2002 00:32:13 -0000      1.5
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,656 +0,0 @@
-<?php
-  /**
-   ** read_body.php
-   **
-   **  Copyright (c) 1999-2000 The SquirrelMail development team
-   **  Licensed under the GNU GPL. For full terms see the file COPYING.
-   **
-   **  This file is used for reading the msgs array and displaying
-   **  the resulting emails in the right frame.
-   **
-   **  $Id: read_body.php,v 1.5 2002/11/24 00:32:13 lkneschke Exp $
-   **/
-
-       $enablePHPGW = 1;
-
-       // store the value of $mailbox, because it will overwriten
-       $phpgw_info['flags'] = array('currentapp' => 'felamimail');
-       include('../header.inc.php');
-       $mailbox = $GLOBALS['HTTP_GET_VARS']['mailbox'];
-       $passed_id = $GLOBALS['HTTP_GET_VARS']['passed_id'];
-       $uid = $GLOBALS['HTTP_GET_VARS']['uid'];
-       $show_more = $GLOBALS['HTTP_GET_VARS']['show_more'];
-       $view_hdr = $GLOBALS['HTTP_GET_VARS']['view_hdr'];
-
-       $phpgw->session->restore();
-
-       if (!isset($strings_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/strings.php');
-       }
-       
-       if (!isset($config_php))
-       {
-               include(PHPGW_APP_ROOT . '/config/config.php');
-       }
-
-       if (!isset($page_header_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/page_header.php');
-       }
-
-       if (!isset($imap_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/imap.php');
-       }
-
-       if (!isset($mime_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/mime.php');
-       }
-
-       if (!isset($date_php))
-       {
-               include(PHPGW_APP_ROOT . '/inc/date.php');
-       }
-
-       if (!isset($url_parser_php)) 
-       {
-               include(PHPGW_APP_ROOT . '/inc/url_parser.php');
-       }
-
-       include(PHPGW_APP_ROOT . '/src/load_prefs.php');
-       
-
-       function createAddressbookButton($_addressString)
-       {
-               global $phpgw, $phpgw_info, $PHP_SELF, $QUERY_STRING;
-
-               $addressParts = imap_rfc822_parse_adrlist($_addressString,'');
-               if(count($addressParts)<1)
-               {
-                       return false;
-               }
-               
-               $email = $addressParts[0]->mailbox.'@'.$addressParts[0]->host;
-               $name = $addressParts[0]->personal;
-               
-               if(!empty($name))
-               {
-                       $linkData = array
-                       (
-                               'menuaction'    => 
'addressbook.uiaddressbook.add_email',
-                               'add_email'     => urlencode($email),
-                               'name'          => urlencode($name),
-                               'referer'       => 
urlencode($PHP_SELF.'?'.$QUERY_STRING)
-                       );
-               }
-               else
-               {
-                       $linkData = array
-                       (
-                               'menuaction'    => 
'addressbook.uiaddressbook.add_email',
-                               'add_email'     => urlencode($email),
-                               'referer'       => 
urlencode($PHP_SELF.'?'.$QUERY_STRING)
-                       );
-               }
-               $link = $phpgw->link('/index.php',$linkData);
-               $image = '<img src="'.PHPGW_IMAGES.
-                               '/sm_envelope.gif" width="10" height="8" 
-                               alt="'.lang("Add to address book").'" 
border="0" align="absmiddle">';
-               return sprintf('&nbsp;<a href="%s">%s</a>', $link, $image);
-       }
-
-       function fillDataArray($_imapConnection, $_passed_id, $_mailbox)
-       {
-               global $phpgw, $where, $what, $show_more, $sort, $startMessage, 
$show_more_cc;
-       
-               // $message contains all information about the message
-               // including header and body
-               $message = sqimap_get_message($_imapConnection, $_passed_id, 
$_mailbox);
-               $data["passed_id"] = $passed_id = $_passed_id;
-               $data["mailbox"] = $_mailbox;
-               
-               /** translate the subject and mailbox into url-able text **/
-               $data["subject"] = $message->header->subject;
-               $data["url_subj"] = 
urlencode(trim(sqStripSlashes($message->header->subject)));
-               $data["urlMailbox"] = $urlMailbox = urlencode($_mailbox);
-               $data["url_replyto"] = urlencode($message->header->replyto);
-               $data["url_replytoall"] = urlencode($message->header->replyto);
-               
-               // If we are replying to all, then find all other addresses and
-               // add them to the list.  Remove duplicates.
-               // This is somewhat messy, so I'll explain:
-               // 1) Take all addresses (from, to, cc) (avoid nasty join 
errors here)
-               $url_replytoall_extra_addrs = 
array_merge(array($message->header->from),
-                                               $message->header->to, 
$message->header->cc);
-                                                       
-               // 2) Make one big string out of them
-               $url_replytoall_extra_addrs = join(';', 
$url_replytoall_extra_addrs);
-               
-               // 3) Parse that into an array of addresses
-               $url_replytoall_extra_addrs = 
parseAddrs($url_replytoall_extra_addrs);
-               
-               // 4) Make them unique -- weed out duplicates
-               // (Coded for PHP 4.0.0)
-               $url_replytoall_extra_addrs = 
array_keys(array_flip($url_replytoall_extra_addrs));
-               $data["url_replytoall_extra_addrs"] = 
array_keys(array_flip($url_replytoall_extra_addrs));
-               
-               // 5) Remove the addresses we'll be sending the message 'to'
-               $url_replytoall_avoid_addrs = 
parseAddrs($message->header->replyto);
-               foreach ($url_replytoall_avoid_addrs as $addr)
-               {
-                       foreach (array_keys($url_replytoall_extra_addrs, $addr) 
as $key_to_delete)
-                       {
-                               
unset($url_replytoall_extra_addrs[$key_to_delete]);
-                       }
-               }
-               $data["url_replytoall_avoid_addrs"] = 
$url_replytoall_extra_addrs;
-               
-               // 6) Smoosh back into one nice line
-               $url_replytoallcc = getLineOfAddrs($url_replytoall_extra_addrs);
-               
-               // 7) urlencode() it
-               $data["url_replytoallcc"] = urlencode($url_replytoallcc);
-               
-               #$data["dateString"] = 
getLongDateString($message->header->date);
-               $data["dateString"] = 
$phpgw->common->show_date($message->header->date);
-               
-               $ent_num = findDisplayEntity($message);
-               $data["ent_num"] = findDisplayEntity($message);
-               
-               /** TEXT STRINGS DEFINITIONS **/
-               $echo_more = lang("more");
-               $echo_less = lang("less");
-               
-               /** FORMAT THE TO STRING **/
-               $i = 0;
-               $to_string = "";
-               $to_ary = $message->header->to;
-               while ($i < count($to_ary)) 
-               {
-                       $currentVal = decodeHeader($to_ary[$i]);
-                       $to_ary[$i] = 
htmlspecialchars(decodeHeader($to_ary[$i]));
-                       
-                       if ($to_string)
-                               $to_string = 
"$to_string<BR>$to_ary[$i]".createAddressbookButton($currentVal);
-                       else
-                               $to_string = 
"$to_ary[$i]".createAddressbookButton($currentVal);
-                               
-                       $i++;
-                       if (count($to_ary) > 1) 
-                       {
-                               if ($show_more == false) 
-                               {
-                                       if ($i == 1) 
-                                       {
-                                               if (isset($where) && 
isset($what)) 
-                                               {
-                                                       // from a search
-                                                       $to_string = 
"$to_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=1&show_more_cc=$show_more_cc")
 . "\">$echo_more</A>)";
-                                               } 
-                                               else 
-                                               {
-                                                       $to_string = 
"$to_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc")
 . "\">$echo_more</A>)";
-                                               }
-                                               $i = count($to_ary);
-                                       }
-                               } 
-                               else if ($i == 1) 
-                               {
-                                       if (isset($where) && isset($what)) 
-                                       {
-                                               // from a search
-                                               $to_string = 
"$to_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=0&show_more_cc=$show_more_cc")
 . "\">$echo_less</A>)";
-                                       } 
-                                       else 
-                                       {
-                                               $to_string = 
"$to_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc")
 . "\">$echo_less</A>)";
-                                       }
-                               }
-                       }
-               }
-               $data["to_string"] = $to_string;
-               
-               /** FORMAT THE CC STRING **/
-               $i = 0;
-               if (isset ($message->header->cc[0]) && 
trim($message->header->cc[0]))
-               {
-                       $cc_string = "";
-                       $cc_ary = $message->header->cc;
-                       while ($i < count(decodeHeader($cc_ary))) 
-                       {
-                               $currentVal = decodeHeader($cc_ary[$i]);
-                               $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
-                               if ($cc_string)
-                                       $cc_string = 
"$cc_string<BR>$cc_ary[$i]".createAddressbookButton($currentVal);
-                               else
-                                       $cc_string = 
"$cc_ary[$i]".createAddressbookButton($currentVal);
-                                       
-                               $i++;
-                               if (count($cc_ary) > 1) 
-                               {
-                                       if ($show_more_cc == false) 
-                                       {
-                                               if ($i == 1) 
-                                               {
-                                                       if (isset($where) && 
isset($what)) 
-                                                       {
-                                                               // from a search
-                                                               $cc_string = 
"$cc_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more")
 . "\">$echo_more</A>)";
-                                                       } 
-                                                       else 
-                                                       {
-                                                               $cc_string = 
"$cc_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more")
 . "\">$echo_more</A>)";
-                                                       }
-                                                       $i = count($cc_ary);
-                                               }
-                                       } 
-                                       else if ($i == 1) 
-                                       {
-                                               if (isset($where) && 
isset($what)) 
-                                               {
-                                                       // from a search
-                                                       $cc_string = 
"$cc_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more")
 . "\">$echo_less</A>)";
-                                               } 
-                                               else 
-                                               {
-                                                       $cc_string = 
"$cc_string&nbsp;(<A HREF=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more")
 . "\">$echo_less</A>)";
-                                               }
-                                       }
-                               }
-                       }
-               }
-               $data["cc_string"] = $cc_string;
-               /** make sure everything will display in HTML format **/
-               $data["from_name"] = 
decodeHeader(htmlspecialchars($message->header->from));
-               $data["from_name"] .= 
createAddressbookButton($message->header->from);
-               $data["subject"] = 
decodeHeader(htmlspecialchars($message->header->subject));
-               
-               return $data;
-       
-       }
-
-       // given an IMAP message id number, this will look it up in the cached 
and sorted msgs array and
-       //    return the index.  used for finding the next and previous messages
-       
-       // returns the index of the next valid message from the array or -1 if 
not found
-       function findNextMessage($_mailboxStatus, $_mailbox, 
$_currentArrayIndex) 
-       {
-               $sortedList = $_mailboxStatus["$_mailbox"]["sortedList"];
-               
-               for ($i = 0; $i < count($sortedList); $i++)
-               {
-                       if ($sortedList[$i] == $_currentArrayIndex && 
$sortedList[$i+1])
-                       {
-                               #print (count($sortedList)-$i)-1;
-                               #print "&nbsp;&nbsp;&nbsp;&nbsp;";
-                               return $sortedList[$i+1];
-                       }
-               }
-               return -1;
-       }
-       
-       // returns the index of the previous message from the array or -1 if 
not found
-       function findPreviousMessage($_mailboxStatus, $_mailbox, 
$_currentArrayIndex) 
-       {
-               $sortedList = $_mailboxStatus["$_mailbox"]["sortedList"];
-               
-               for ($i = 0; $i < count($sortedList); $i++)
-               {
-                       if ($sortedList[$i] == $_currentArrayIndex && 
$sortedList[$i-1])
-                       {
-                               #print $i."&nbsp;|&nbsp;";
-                               return $sortedList[$i-1];
-                       }
-               }
-               #print "0&nbsp;|&nbsp;";
-               return -1;
-       }
-
-       function viewMessageHeader($_data)
-       {
-               global $phpgw, $phpgw_info, $imapConnection, $startMessage, 
$show_more;
-               
-               $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-               $t->set_file(array('view_message' => 'view_message.tpl'));
-               $t->set_block('view_message','message_header','message_header');
-               $t->set_block('view_message','B_cc_data','B_cc_data');
-               
-               $t->set_var('th_bg', $phpgw_info['theme']['th_bg']);
-               $t->set_var('row_on', $phpgw_info['theme']['row_on']);
-               $t->set_var('row_off', $phpgw_info['theme']['row_off']);
-               $t->set_var('bg01', $phpgw_info['theme']['bg01']);
-               $t->set_var('bg02', $phpgw_info['theme']['bg02']);
-               $t->set_var('bg03', $phpgw_info['theme']['bg03']);
-               
-               $t->set_var('lang_from', lang('from'));
-               $t->set_var('lang_to', lang('to'));
-               $t->set_var('lang_cc', lang('cc'));
-               $t->set_var('lang_date', lang('date'));
-               $t->set_var('lang_files', lang('files'));
-               $t->set_var('lang_subject', lang('subject'));
-               
-               $t->set_var('from_data', $_data["from_name"]);
-               $t->set_var('to_data_final', $_data["to_string"]);
-               $t->set_var('subject_data', $_data["subject"]);
-               $t->set_var('date_data', $_data["dateString"]);
-               
-               $urlMailbox = $_data["urlMailbox"];
-               $where = $_data["where"];
-               $what = $_data["what"];
-               $passed_id = $_data["passed_id"];
-               
-               if (isset($where) && isset($what)) 
-               {
-                       // Got here from a search
-                       $string = "<a href=\""
-                       . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&view_hdr=1")
 . "\">" . lang("View full header") . "</a>";
-               } 
-               else 
-               {
-                       $string =  "<a class=\"body_link\" href=\""
-                       . 
$phpgw->link('/felamimail/read_body.php',"mailbox=$urlMailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&view_hdr=1")
 . "\">" . lang("View full header") . "</a>";
-                       $t->set_var('view_header', $string);
-               }
-
-               if ($_data["cc_string"])
-               {
-                       $t->set_var('cc_data_final',$_data["cc_string"]);
-                       $cc_data = $t->parse('out','B_cc_data');
-                       $t->set_var('cc_data',$cc_data);
-                       $t->set_var('bg_date', $phpgw_info['theme']['row_off']);
-                       $t->set_var('bg_subject', 
$phpgw_info['theme']['row_on']);
-               }
-               else
-               {
-                       $t->set_var('cc_data','');
-                       $t->set_var('bg_date', $phpgw_info['theme']['row_on']);
-                       $t->set_var('bg_subject', 
$phpgw_info['theme']['row_off']);
-               }
-
-               return $t->parse('out','message_header');
-       }
-
-       function viewMessageNavbar($_mailbox, $_mailboxStatus, $_data, 
$_currentArrayIndex, $_sort, $_startMessage, $_uid)
-       {
-               global $phpgw, $phpgw_info, $imapConnection, $sent_folder;
-               
-               $svr_image_dir = PHPGW_IMAGES_DIR;
-       
-               $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
-               $t->set_file(array('view_message' => 'view_message.tpl'));
-               $t->set_block('view_message','message_navbar','message_navbar');
-               #$t->set_block('view_message','column','column');
-               
-               $where = $_data["where"];
-               $what = $_data["what"];
-               $urlMailbox = $_data["urlMailbox"];
-               $passed_id = $_data["passed_id"];
-               $ent_num = $_data["ent_num"];
-               $url_replyto = $_data["url_replyto"];
-               $url_replytoall = $_data["url_replytoall"];
-               $url_replytoallcc = $_data["url_replytoallcc"];
-               $subject = $_data["subject"];
-               $url_subj = $_data["url_subj"];
-               
-               if (isset($_where) && isset($_what))
-               {
-                       // search filter
-                       
$t->set_var('link_messagelist',$phpgw->link('/felamimail/search.php',"where=".urlencode($where)."&what=".urlencode($what)."&mailbox=$urlMailbox"));
-                       
$t->set_var('link_delete',$phpgw->link('/felamimail/src/delete_message.php',"mailbox=$urlMailbox&message=$passed_id&where=".urlencode($where)."&what=".urlencode($what)));
              
-                       $t->set_var('left_arrow','');
-                       $t->set_var('right_arrow','');
-               }
-               else
-               {
-
-                       
$t->set_var('link_messagelist',$phpgw->link('/felamimail/index.php',"sort=$_sort&startMessage=$_startMessage&mailbox=$urlMailbox"));
-                       $linkData = array
-                       (
-                               'menuaction'    => 
'felamimail.uifelamimail.deleteMessage',
-                               'message'       => $_uid
-                               
-                       );
-                       
$t->set_var('link_delete',$phpgw->link('/index.php',$linkData));
-
-                       if ($_currentArrayIndex == -1)
-                       {
-                               $t->set_var('left_arrow',"<img border=\"0\" 
src=\"$svr_image_dir/left-grey.gif\" alt=\"".lang("no previous Message")."\" 
title=\"".lang("no previous Message")."\">");
-                               $t->set_var('right_arrow',"<img border=\"0\" 
src=\"$svr_image_dir/right-grey.gif\" alt=\"".lang("no previous Message")."\" 
title=\"".lang("no previous Message")."\">");
-                       }
-                       else
-                       {
-                               $prev = findPreviousMessage($_mailboxStatus, 
$_mailbox, $_currentArrayIndex);
-                               $next = findNextMessage($_mailboxStatus, 
$_mailbox, $_currentArrayIndex);
-                               
-                               if ($prev != -1)
-                               {
-                                       #$message = 
sqimap_get_message_header($imapConnection, $prev, $mailbox);
-                                       if($mailbox == $sent_folder)
-                                               $hdr = sqimap_get_small_header 
($imapConnection, $prev, true);
-                                       else
-                                               $hdr = sqimap_get_small_header 
($imapConnection, $prev, false);
-                                       $purl_subj = 
decodeHeader($hdr->subject);
-                                       $leftArrow  = "<a href=\"" . 
$phpgw->link('/felamimail/read_body.php',"passed_id=$prev&mailbox=$urlMailbox&sort=$_sort&startMessage=$_startMessage&show_more=0")
 . "\">";
-                                       $leftArrow .= "<img border=\"0\" 
src=\"$svr_image_dir/left.gif\" alt=\"$purl_subj\" title=\"$purl_subj\">";
-                                       $leftArrow .= "</a>";
-                                       $t->set_var('left_arrow',$leftArrow);
-                               }
-                               else
-                               {
-                                       $t->set_var('left_arrow',"<img 
border=\"0\" src=\"$svr_image_dir/left-grey.gif\" alt=\"".lang("no previous 
Message")."\" title=\"".lang("no previous Message")."\">");
-                               }
-                               
-                               if ($next != -1)
-                               {
-                                       #$message = 
sqimap_get_message_header($imapConnection, $next, $mailbox);
-                                       if($mailbox == $sent_folder)
-                                               $hdr = sqimap_get_small_header 
($imapConnection, $next, true);
-                                       else
-                                               $hdr = sqimap_get_small_header 
($imapConnection, $next, false);
-                                       $nurl_subj = 
decodeHeader($hdr->subject);
-                                       $rightArrow  = "<a href=\"" . 
$phpgw->link('/felamimail/read_body.php',"passed_id=$next&mailbox=$urlMailbox&sort=$_sort&startMessage=$_startMessage&show_more=0")
 . "\">";
-                                       $rightArrow .= "<img border=\"0\" 
src=\"$svr_image_dir/right.gif\" alt=\"$nurl_subj\" title=\"$nurl_subj\">";
-                                       $rightArrow .= "</a>";
-                                       $t->set_var('right_arrow',$rightArrow);
-                               }
-                               else
-                               {
-                                       $t->set_var('right_arrow',"<img 
border=\"0\" src=\"$svr_image_dir/right-grey.gif\" alt=\"".lang("no next 
Message")."\" title=\"".lang("no next Message")."\">");
-                               }
-                       }
-               }
-               
-               $linkData = array
-               (
-                       'menuaction'    => 'felamimail.uicompose.compose'
-               );
-               
$t->set_var('link_compose',$GLOBALS['phpgw']->link('/index.php',$linkData));
-               
-               $linkData = array
-               (
-                       'menuaction'    => 
'felamimail.uifelamimail.viewMainScreen'
-               );
-               
$t->set_var("link_message_list",$GLOBALS['phpgw']->link('/index.php',$linkData));
-
-               $linkData = array
-               (
-                       'menuaction'    => 'felamimail.uicompose.reply',
-                       'reply_id'      => $GLOBALS['HTTP_GET_VARS']['uid']
-               );
-               
$t->set_var("link_reply",$GLOBALS['phpgw']->link('/index.php',$linkData));
-
-               $linkData = array
-               (
-                       'menuaction'    => 'felamimail.uicompose.replyAll',
-                       'reply_id'      => $GLOBALS['HTTP_GET_VARS']['uid']
-               );
-               
$t->set_var("link_reply_all",$GLOBALS['phpgw']->link('/index.php',$linkData));
-
-               $linkData = array
-               (
-                       'menuaction'    => 'felamimail.uicompose.forward',
-                       'reply_id'      => $GLOBALS['HTTP_GET_VARS']['uid']
-               );
-               
$t->set_var("link_forward",$GLOBALS['phpgw']->link('/index.php',$linkData));
-
-               $t->set_var('folder_name',$urlMailbox);
-               $langArray = array
-                       (
-                               'lang_messagelist'      => lang('Message List'),
-                               'lang_compose'          => lang('Compose'),
-                               'lang_delete'           => lang('Delete'),
-                               'lang_forward'          => lang('Forward'),
-                               'lang_reply'            => lang('Reply'),
-                               'lang_reply_all'        => lang('Reply All'),
-                               'lang_back_to_folder'   => lang('back to 
folder'),
-                               'app_image_path'        => PHPGW_IMAGES,
-                               'link_replyy'           => 
$phpgw->link('/felamimail/compose.php',"send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num"),
-                               'link_reply_alll'       => 
$phpgw->link('/felamimail/compose.php',"send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num"),
-                               'link_forwardd'         => 
$phpgw->link('/felamimail/compose.php',"forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox&ent_num=$ent_num")
-                       );
-                       
-               $t->set_var('th_bg', $phpgw_info['theme']['navbar_bg']);
-               $t->set_var($langArray);
-               
-               return $t->parse('out','message_navbar');
-       }
-
-
-// here we go!
-
-       $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-       sqimap_mailbox_select($imapConnection, $mailbox);
-       do_hook("html_top");
-       #displayPageHeader($color, $mailbox);
-       
-       
-       if (isset($view_hdr)) 
-       {
-               fputs ($imapConnection, "a003 FETCH $passed_id 
BODY[HEADER]\r\n");
-               $read = sqimap_read_data ($imapConnection, "a003", true, $a, 
$b);
-               
-               echo "<br>";
-               echo "<table width=100% cellpadding=2 cellspacing=0 border=0 
align=center>\n";
-               echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%><center><b>" 
. lang("Viewing full header") . "</b> - ";
-               if (isset($where) && isset($what)) 
-               {
-                       // Got here from a search
-                       echo "<a href=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=".urlencode($mailbox)."&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what))."\">";
-               } 
-               else 
-               {
-                       echo "<a href=\"" . 
$phpgw->link('/felamimail/read_body.php',"mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more")
 . "\">";
-               }
-               echo "".lang("View message") . 
"</a></b></center></td></tr></table>\n";
-               echo "<table width=99% cellpadding=2 cellspacing=0 border=0 
align=center>\n";
-               echo "<tr><td>";
-               
-               $cnum = 0;
-               for ($i=1; $i < count($read)-1; $i++) 
-               {
-                       $line = htmlspecialchars($read[$i]);
-                       if (eregi("^&gt;", $line)) 
-                       {
-                               $second[$i] = $line;
-                               $first[$i] = "&nbsp;";
-                               $cnum++;
-                       } 
-                       else if (eregi("^[ |\t]", $line)) 
-                       {
-                               $second[$i] = $line;
-                               $first[$i] = "";
-                       } 
-                       else if (eregi("^([^:]+):(.+)", $line, $regs)) 
-                       {
-                               $first[$i] = $regs[1] . ":";
-                               $second[$i] = $regs[2];
-                               $cnum++;
-                       } 
-                       else 
-                       {
-                               $second[$i] = trim($line);
-                               $first[$i] = "";
-                       }
-               }
-               for ($i=0; $i < count($second); $i = $j) 
-               {
-                       if (isset($first[$i])) $f = $first[$i];
-                       if (isset($second[$i])) $s = nl2br($second[$i]);
-                       $j = $i + 1;
-                       while ($first[$j] == "" && $j < count($first)) 
-                       {
-                               $s .= "&nbsp;&nbsp;&nbsp;&nbsp;" . 
nl2br($second[$j]);
-                               $j++;
-                       }
-                       parseEmail($s);
-                       
-                       if (isset($f)) echo "<nobr><tt><b>$f</b>$s</tt></nobr>";
-               }
-               echo "</td></tr></table>\n";
-               echo "</body></html>";
-               $phpgw->common->phpgw_footer();
-               sqimap_logout($imapConnection);
-               exit;
-       }
-
-       $currentArrayIndex = $passed_id;
-       $data = fillDataArray($imapConnection, $passed_id, $mailbox);
-       
-       do_hook("read_body_top");
-
-   echo "<TABLE CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER 
CELLPADDING=0>\n";
-   echo "   <TR><TD>";
-   
-   print viewMessageNavbar($mailbox, $mailboxStatus, $data, 
$currentArrayIndex, $sort, $startMessage, $uid);
-   
-   echo "   </TD></TR>";
-   echo "   <TR><TD CELLSPACING=0 WIDTH=100%>";
-
-       print viewMessageHeader($data);   
-
-   do_hook("read_body_header");
-
-   echo "   </TD></TR>";
-   echo "</table>";
-   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=97% BORDER=0 ALIGN=CENTER 
CELLPADDING=0>\n";
-
-   echo "   <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
-   echo "<BR>";
-
-       if($header->phpgw_type[type]) {
-               echo '<center><h1>THIS IS A 
phpGroupWare-'.strtoupper($header->phpgw_type[type]).' 
EMAIL</h1><hr></center><br>';
-       }
-   
-   $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
-   $body = formatBody($imapConnection, $message, $color, $wrap_at);
-
-   echo $body;
-
-       if($header->phpgw_type[type])
-       {
-               if(isset($header->phpgw_type[id]))
-               {
-                       $calendar_id = intval($header->phpgw_type[id]);
-                       echo '<table align="center" width="100%"><tr><td 
align="center">';
-                       
$phpgw->common->hook_single('email',$header->phpgw_type[type]);
-                       echo '</td></tr></table>';
-               }
-       }
-
-   echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=100% BORDER=0 ALIGN=CENTER 
CELLPADDING=0>\n";
-   echo "   <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>";
-   echo "</TABLE>\n";
-
-//address@hidden: inserted three next lines
-   if (!isset($translated_setup) && !function_exists('translate_read_form') )
-      include(PHPGW_APP_ROOT . "/inc/translate_setup.php");
-   translate_read_form();
-
-   do_hook("read_body_bottom");
-   do_hook("html_bottom");
-   sqimap_logout($imapConnection);
-
-   $phpgw->common->phpgw_footer(); 
-?>

Index: README.Squirrelmail
===================================================================
RCS file: README.Squirrelmail
diff -N README.Squirrelmail
--- README.Squirrelmail 24 Nov 2002 00:36:06 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,58 +0,0 @@
-SquirrelMail
-http://www.felamimail.org
-
-Introduction:
--------------
-SquirrelMail is a standards-based webmail package written in PHP4. It
-includes built-in pure PHP support for the IMAP and SMTP protocols, and all
-pages render in pure HTML 4.0 (with no Javascript) for maximum compatibility
-across browsers. It has very few requirements and is very easy to configure
-and install. SquirrelMail has a all the functionality you would want from an
-email client, including strong MIME support, address books, and folder
-manipulation.  
-
-Why did you guys create SquirrelMail?  The need arose in our organization
-for the access of email and address books from anywhere in the world.
-Obviously a web interface is ideal for this, given that the user has access
-to the Internet.  After reviewing several open source projects, we realized
-that we were going to need to do some fairly major customizations to get
-things to be a nice fit for our needs.  So the decision was made to create
-our own for some of these reasons, and for fun (we really like PHP4).  We
-decided to open source the project to contribute to the community that has
-contributed so much to us.  Since then, it has grown much bigger than we
-ever imagined, and we have an awesome development team who are actively
-working on the project.
-
-We would love to hear from you!  The nature of open source projects make it
-hard to know who all is using your product.  It is always nice when we get
-emails from people just telling us that they're using SquirrelMail.  If you
-have a few minutes, please send us an email to let us know!  You can send it
-to our mailing list:  address@hidden
-
-You can also go to the page below and fill out a small form to get listed
-with the list of people already using SquirrelMail (free advertising).
-
-   http://www.felamimail.org/index.php3?page=16
-
-Contact:
---------
-It is pretty easy to get in contact with the developers if you need help or
-if you find bugs that need to be reported.  The best way to contact us would
-be through our mailing list which is actively monitored.  Just send an email
-to:
-   
-   address@hidden
-
-If you wish to actually subscribe to our mailing list, please visit our web
-page for instructions (http://www.felamimail.org) and go to the section
-titled "Mailing List".
-
-Installation:
--------------
-For detailed instructions on how to install SquirrelMail on your server,
-please refer to the INSTALL document in the same directory as this document.
-
-Licensing: 
-----------
-This product is distributed under the GPL.  Please read through the file
-COPYING for more information about our license.

Index: search.php
===================================================================
RCS file: search.php
diff -N search.php
--- search.php  27 Mar 2002 22:06:44 -0000      1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,134 +0,0 @@
-<?php
-
-   /* $Id: search.php,v 1.3 2002/03/27 22:06:44 ceb Exp $ */
-
-       $MAILBOX = $mailbox;
-       $phpgw_info['flags'] = array(
-               'currentapp'              => 'felamimail',
-               'enable_network_class'    => True,
-               'enable_nextmatchs_class' => True
-       );
-       include('../header.inc.php');
-       $mailbox = $MAILBOX;
-
-       if (!isset($strings_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/strings.php');
-       }
-
-       if (!isset($i18n_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/i18n.php');
-       }
-
-       if (!isset($config_php))
-       {
-               include(PHPGW_APP_ROOT  . '/config/config.php');
-       }
-
-       if (!isset($page_header_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/page_header.php');
-       }
-
-       if (!isset($imap_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/imap.php');
-       }
-
-       if (!isset($imap_search_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/imap_search.php');
-       }
-
-       if (!isset($array_php))
-       {
-               include(PHPGW_APP_ROOT  . '/inc/array.php');
-       }
-
-   include(PHPGW_APP_ROOT  . '/src/load_prefs.php');
-
-//address@hidden: first parm has been supressed and global parm boxes is needed
-   //displayPageHeader($imapConnection, $color, $mailbox);
-   $imapConnection = sqimap_login($username, $key, $imapServerAddress, 
$imapPort, 0);
-   $boxes = sqimap_mailbox_list($imapConnection);  
-   displayPageHeader($color, $mailbox);
-
-   do_hook("search_before_form");
-   echo "<br>\n";
-   echo "      <table width=95% align=center cellpadding=2 cellspacing=0 
border=0>\n";
-   echo "      <tr><td bgcolor=\"$color[0]\">\n";
-   echo "          <center><b>".lang("Search")."</b></center>\n";
-   echo "      </td></tr>\n";
-   echo "      <tr><td align=center>";
-
-   echo "<FORM ACTION=\"" . $phpgw->link('/felamimail/search.php') . "\" 
NAME=s method=\"POST\">\n";
-   echo "   <TABLE WIDTH=75%>\n";
-   echo "     <TR>\n";
-   echo "       <TD WIDTH=33%>\n";
-   echo "         <TT><SMALL><SELECT NAME=\"mailbox\">";
-
-//address@hidden: already needed above in displayPageHeader
-   //$boxes = sqimap_mailbox_list($imapConnection);
-   for ($i = 0; $i < count($boxes); $i++) {
-         if (!in_array("noselect", $boxes[$i]["flags"])) {
-         $box = $boxes[$i]["unformatted"];
-         $box2 = replace_spaces($boxes[$i]["formatted"]);
-         if ($mailbox == $box)
-            echo "         <OPTION VALUE=\"$box\" SELECTED>$box2\n";
-         else
-            echo "         <OPTION VALUE=\"$box\">$box2\n";
-      }
-   }
-   echo "         </SELECT></SMALL></TT>";
-   echo "       </TD>\n";
-   echo "        <TD ALIGN=\"CENTER\" WIDTH=33%>\n";
-   if (!isset($what))
-       $what = "";
-   $what_disp = ereg_replace(",", " ", $what);
-   $what_disp = str_replace("\\\\", "\\", $what_disp);
-   $what_disp = str_replace("\\\"", "\"", $what_disp);
-   $what_disp = str_replace("\"", "&quot;", $what_disp);
-   echo "          <INPUT TYPE=\"TEXT\" SIZE=\"20\" NAME=\"what\" 
VALUE=\"$what_disp\">\n";
-   echo "        </TD>";
-   echo "       <TD ALIGN=\"RIGHT\" WIDTH=33%>\n";
-   echo "         <SELECT NAME=\"where\">";
-   
-   if (isset($where) && $where == "BODY") echo "           <OPTION 
VALUE=\"BODY\" SELECTED>".lang("Body")."\n";
-   else echo "           <OPTION VALUE=\"BODY\">".lang("Body")."\n";
-   
-   if (isset($where) && $where == "TEXT") echo "           <OPTION 
VALUE=\"TEXT\" SELECTED>".lang("Everywhere")."\n";
-   else echo "           <OPTION VALUE=\"TEXT\">".lang("Everywhere")."\n";
-   
-   if (isset($where) && $where == "SUBJECT") echo "           <OPTION 
VALUE=\"SUBJECT\" SELECTED>".lang("Subject")."\n";
-   else echo "           <OPTION VALUE=\"SUBJECT\">".lang("Subject")."\n";
-   
-   if (isset($where) && $where == "FROM") echo "           <OPTION 
VALUE=\"FROM\" SELECTED>".lang("From")."\n";
-   else echo "           <OPTION VALUE=\"FROM\">".lang("From")."\n";
-   
-   if (isset($where) && $where == "CC") echo "           <OPTION VALUE=\"Cc\" 
SELECTED>".lang("Cc")."\n";
-   else echo "           <OPTION VALUE=\"CC\">".lang("Cc")."\n";
-   
-   if (isset($where) && $where == "TO") echo "           <OPTION VALUE=\"TO\" 
SELECTED>".lang("To")."\n";
-   else echo "           <OPTION VALUE=\"TO\">".lang("To")."\n";
-   
-   echo "         </SELECT>\n";
-   echo "        </TD>\n";
-   echo "       <TD COLSPAN=\"3\" ALIGN=\"CENTER\">\n";
-   echo "         <INPUT TYPE=\"submit\" VALUE=\"".lang("Search")."\">\n";
-   echo "       </TD>\n";
-   echo "     </TR>\n";
-   echo "   </TABLE>\n"; 
-   echo "</FORM>";
-   echo "</td></tr></table>";
-   do_hook("search_after_form");
-   if (isset($where) && $where && isset($what) && $what) {   
-      sqimap_mailbox_select($imapConnection, $mailbox);
-      sqimap_search($imapConnection, $where, $what, $mailbox, $color);
-   }
-   do_hook("search_bottom");
-   sqimap_logout ($imapConnection);
-
-       $phpgw->common->phpgw_footer();
-?>
-</body></html>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]