Added support for using Squirrelmail without frames
authorcigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Dec 2003 18:51:07 +0000 (18:51 +0000)
committercigamit <cigamit@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Dec 2003 18:51:07 +0000 (18:51 +0000)
(With many thanks to Jason Wickers (jwickers at scs.wsu.edu))
----
There are still a few minor things to iron out, but overall
it works fairly well at this point.  Any plugin that calls
DisplayPageHeader() will now have to replace their </body></html>
with a simple call to noframes_bottom() to be compatible...
(Possibly rename that function to DisplayPageFooter in the future)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@6225 7612ce4b-ef26-0410-bec9-ea0150e637f0

54 files changed:
AUTHORS
ChangeLog
config/conf.pl
functions/global.php
functions/mailbox_display.php
functions/page_header.php
include/validate.php
plugins/abook_take/take.php
plugins/administrator/options.php
plugins/bug_report/bug_report.php
plugins/calendar/calendar.php
plugins/calendar/day.php
plugins/calendar/event_create.php
plugins/calendar/event_delete.php
plugins/calendar/event_edit.php
plugins/filters/options.php
plugins/filters/spamoptions.php
plugins/info/options.php
plugins/listcommands/mailout.php
plugins/mail_fetch/fetch.php
plugins/mail_fetch/options.php
plugins/message_details/message_details_top.php
plugins/message_details/setup.php
plugins/newmail/newmail_opt.php
plugins/newmail/sounds/FanFair.wav
plugins/newmail/sounds/Friends.wav
plugins/newmail/sounds/MontyPython.wav
plugins/newmail/sounds/Notify.wav
plugins/spamcop/options.php
plugins/spamcop/spamcop.php
plugins/squirrelspell/sqspell_functions.php
plugins/translate/options.php
src/addrbook_search_html.php
src/addressbook.php
src/compose.php
src/empty_trash.php
src/folders.php
src/help.php
src/image.php
src/left_main.php
src/login.php
src/move_messages.php
src/options.php
src/options_highlight.php
src/options_identities.php
src/options_order.php
src/read_body.php
src/redirect.php
src/right_main.php
src/search.php
src/vcard.php
src/view_header.php
src/view_text.php
src/webmail.php

diff --git a/AUTHORS b/AUTHORS
index 849a704e0c189b965724e3b8f494131d0e91aa01..4d54627ae71143468e644cb2d9d4b8fc751f81dd 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,6 +17,7 @@ THE SQUIRRELMAIL TEAM
    Seth E. Randall     <sethr@missoulafcu.org>
    Thijs Kinkhorst     <kink@squirrelmail.org>
    Tomas Kuliavas      <tokul@users.sourceforge.net>   http://www.topolis.lt
+   Jimmy Conner                <jimmy@advcs.org>               http://sqmail.org
 
  Past Developers, now retired:
  -----------------------------
index a1d2a08e4dd9c1197d3b9f27c3419a6eece1d425..4c27bbe499844813a45518839ab144a7e2f12b1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -110,6 +110,7 @@ Version 1.5.0 -- CVS
     accidentally disappeared in the past.
   - Disabled Quick-email-reporting feature in spamcop plugin. Bug.809452. Admin
     can enable it by setting variable in plugins/spamcop/setup.php
+  - Added support for using Squirrelmail without frames
 
 **************************************
 *** SquirrelMail Stable Series 1.4 ***
index f2cd40715eeaca3ee203f977a3c4c8c82cb6087d..ed78e0420637993a2eaad7b7f58702018388cb88 100755 (executable)
@@ -354,6 +354,9 @@ if (!$session_name ) {
 if (!$show_alternative_names ) {
        $show_alternative_names = 'false';
 }
+if ( !$allow_frames ) {
+    $allow_frames = 1;
+}
 
 if (!$available_languages ) {
        $available_languages = 'all';
@@ -539,11 +542,25 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
         print "6.  Allow use of priority       : $WHT$default_use_priority$NRM\n";
         print "7.  Hide SM attributions        : $WHT$hide_sm_attributions$NRM\n";
         print "8.  Allow use of receipts       : $WHT$default_use_mdn$NRM\n";
-        print "9. Allow editing of identity   : $WHT$edit_identity$NRM/$WHT$edit_name$NRM\n";
+        print "9.  Allow editing of identity   : $WHT$edit_identity$NRM/$WHT$edit_name$NRM\n";
         print "10. Allow server thread sort    : $WHT$allow_thread_sort$NRM\n";
         print "11. Allow server-side sorting   : $WHT$allow_server_sort$NRM\n";
         print "12. Allow server charset search : $WHT$allow_charset_search$NRM\n";
        print "13. PHP session name            : $WHT$session_name$NRM\n";
+       print "14. HTML Frame Settings         : $WHT";
+        if ( $allow_frames == 1) {
+          print "Force Frames Only";
+        }
+        if ( $allow_frames == 2) {
+           print "Force No Frames Only";
+        }
+        if ( $allow_frames == 3) {
+           print "User Select, Default to Frames";
+        }
+        if ( $allow_frames == 4) {
+           print "User Select, Default to No Frames";
+        }
+        print "$NRM\n";
         print "\n";
         print "R   Return to Main Menu\n";
     } elsif ( $menu == 5 ) {
@@ -758,7 +775,8 @@ while ( ( $command ne "q" ) && ( $command ne "Q" ) ) {
             elsif ( $command == 10 ) { $allow_thread_sort        = command312(); }
             elsif ( $command == 11 ) { $allow_server_sort        = command313(); }
             elsif ( $command == 12 ) { $allow_charset_search     = command314(); }
-                       elsif ( $command == 13 ) { $session_name             = command316(); }
+            elsif ( $command == 13 ) { $session_name             = command316(); }
+            elsif ( $command == 14 ) { $allow_frames             = command317(); }
         } elsif ( $menu == 5 ) {
             if ( $command == 1 ) { command41(); }
             elsif ( $command == 2 ) { $theme_css = command42(); }
@@ -2208,7 +2226,28 @@ sub command316 {
     return $new_session_name;
 }
 
-
+sub command317 {
+    print "This option allows you to select whether to allow or disallow frames\n";
+    print "or no frames usage, and what to default to on the login screen.\n";
+    print "Note: When a user selects to use Frames or No Frames, it is stored\n";
+    print "      in a cookie, which will override the site default when they\n";
+    print "      next visit the login page.\n";
+     if ($allow_frames == 1) { print "--> "; }else{print "    ";}
+    print "1.  Force Frames Only\n";
+    if ($allow_frames == 2) { print "--> "; }else{print "    ";}
+    print "2.  Force No Frames Only\n";
+    if ($allow_frames == 3) { print "--> "; }else{print "    ";}
+    print "3.  User Select, Default to Frames\n";
+    if ($allow_frames == 4) { print "--> "; }else{print "    ";}
+    print "4.  User Select, Default to No Frames\n";
+    print "(1-4): ";
+    $new_allow_frames = <STDIN>;
+    $new_allow_frames =~ tr/1-4//cd;  # only want digits!
+    if ( $new_allow_frames < 1 || $new_allow_frames > 4 ) {
+       $new_allow_frames = $allow_frames;
+    }
+    return $new_allow_frames;
+}
 
 sub command41 {
     print "\nDefine the themes that you wish to use.  If you have added ";
@@ -3096,12 +3135,16 @@ sub save_data {
                print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n";
                print CF "\$imap_auth_mech = '$imap_auth_mech';\n";
        # boolean
-           print CF "\$use_imap_tls = $use_imap_tls;\n";
-               print CF "\$use_smtp_tls = $use_smtp_tls;\n";
+       print CF "\$use_imap_tls = $use_imap_tls;\n";
+       print CF "\$use_smtp_tls = $use_smtp_tls;\n";
+
+       print CF "\$session_name = '$session_name';\n";
 
-               print CF "\$session_name = '$session_name';\n";
+       print CF "\n";
+
+       print CF "\$allow_frames = $allow_frames;\n";
 
-           print CF "\n";
+       print CF "\n";
 
        # boolean
        print CF "\$advanced_tree = $advanced_tree;\n";
index 3b06a8e37190db92a0f53ba9006b813779fa14fc..8ef497c83855c18f2f195e8d6cd206bf59fb389a 100644 (file)
@@ -155,7 +155,7 @@ function sqsession_register ($var, $name) {
     else {
         $_SESSION["$name"] = $var; 
     }
-    session_register("$name");
+    @session_register("$name");
 }
 
 /**
@@ -174,7 +174,7 @@ function sqsession_unregister ($name) {
     else {
         unset($_SESSION[$name]);
     }
-    session_unregister("$name");
+    @session_unregister("$name");
 }
 
 /**
index aa15493bf412d7f4d48290510e4570cd0b9b7ce8..e7b4c39ca6b3aa8ec05d8e6e727764eeab4e894a 100644 (file)
@@ -1001,11 +1001,15 @@ function get_msgcnt_str($start_msg, $end_msg, $num_msgs) {
  * Generate a paginator link.
  */
 function get_paginator_link($box, $start_msg, $use, $text) {
-    global $PHP_SELF;
+    global $PHP_SELF, $use_frames;
+    if ($use_frames)
+        $target = 'right';
+    else
+        $target = '';
 
     $result = "<A HREF=\"right_main.php?use_mailbox_cache=$use"
             . "&amp;startMessage=$start_msg&amp;mailbox=$box\" "
-            . "TARGET=\"right\">$text</A>";
+            . "TARGET=\"$target\">$text</A>";
     return ($result);
 /*
     if (preg_match('/^(.+)\?.+$/',$PHP_SELF,$regs)) {
@@ -1016,7 +1020,7 @@ function get_paginator_link($box, $start_msg, $use, $text) {
 
     $result = '<A HREF="'. $source_url . "?use_mailbox_cache=$use"
             . "&amp;startMessage=$start_msg&amp;mailbox=$box\" "
-            . "TARGET=\"right\">$text</A>";
+            . "TARGET=\"$target\">$text</A>";
     return ($result);
 */
 }
@@ -1026,7 +1030,7 @@ function get_paginator_link($box, $start_msg, $use, $text) {
  */
 function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
                            $show_num, $sort) {
-    global $username, $data_dir, $use_mailbox_cache, $color, $PG_SHOWNUM;
+    global $username, $data_dir, $use_mailbox_cache, $color, $PG_SHOWNUM, $use_frames;
 
     /* Initialize paginator string chunks. */
     $prv_str = '';
@@ -1035,6 +1039,11 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
     $all_str = '';
     $tgl_str = '';
 
+    if ($use_frames)
+        $target = 'right';
+    else
+        $target = '';
+
     $box = urlencode($box);
 
     /* Create simple strings that will be creating the paginator. */
@@ -1188,14 +1197,14 @@ function get_paginator_str($box, $start_msg, $end_msg, $num_msgs,
     } else if ($PG_SHOWNUM == 999999) {
         $pg_str = "<A HREF=\"right_main.php?PG_SHOWALL=0"
                 . "&amp;use_mailbox_cache=$use&amp;startMessage=1&amp;mailbox=$box\" "
-                . "TARGET=\"right\">" ._("Paginate") . '</A>' . $spc;
+                . "TARGET=\"$target\">" ._("Paginate") . '</A>' . $spc;
     }
 
     /* If necessary, compute the 'show all' string. */
     if (($prv_str != '') || ($nxt_str != '')) {
         $all_str = "<A HREF=\"right_main.php?PG_SHOWALL=1"
                  . "&amp;use_mailbox_cache=$use&amp;startMessage=1&amp;mailbox=$box\" "
-                 . "TARGET=\"right\">" . _("Show All") . '</A>';
+                 . "TARGET=\"$target\">" . _("Show All") . '</A>';
     }
 
     /* Last but not least, get the value for the toggle all link. */
index 5aca335a65c778dfddb88579cdf1a8d30e45a952..9999df71b6083b968aeb5cb966cda3ef65443fae 100644 (file)
@@ -87,10 +87,14 @@ ECHO;
  * @param string target the target frame for this link
  */
 function makeInternalLink($path, $text, $target='') {
+    global $use_frames;
     sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
-    if ($target != '') {
-        $target = " target=\"$target\"";
-    }
+    if (isset($use_frames) && $use_frames) {
+        if ($target != '')
+            $target = " target=\"$target\"";
+    } else 
+       $target='';
+
     $hooktext = do_hook_function('internal_link',$text);
     if ($hooktext != '')
         $text = $hooktext;
@@ -275,6 +279,8 @@ function displayPageHeader($color, $mailbox, $xtra='', $session=false) {
     }
 
     echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n";
+    noframes_top();
+
     /** Here is the header and wrapping table **/
     $shortBoxName = imap_utf7_decode_local(
                      readShortMailboxName($mailbox, $delimiter));
@@ -398,6 +404,8 @@ function compose_Header($color, $mailbox) {
     }
 
     echo "<body text=\"$color[8]\" bgcolor=\"$color[4]\" link=\"$color[7]\" vlink=\"$color[7]\" alink=\"$color[7]\" $onload>\n\n";
+
+
 }
 
-?>
+?>
\ No newline at end of file
index 8738cc35f2ff84b56d6675df90666cfa4a14af23..00fbb9cd2b5c8cc4f4c6a00d501b4d658e04a0e4 100644 (file)
@@ -43,6 +43,7 @@ require_once(SM_PATH . 'class/mime.class.php');
 require_once(SM_PATH . 'functions/global.php');
 require_once(SM_PATH . 'functions/strings.php');
 require_once(SM_PATH . 'config/config.php');
+require_once(SM_PATH . 'functions/noframes.php');
 
 /* set the name of the session cookie */
 if(isset($session_name) && $session_name) {
index 8e5e5a88b445e126d3b6a13803b62cfb80eb58f1..ed18e8f66c9723a41af616f59d708139a5707b31 100644 (file)
@@ -113,5 +113,6 @@ echo '<form action="../../src/addressbook.php" name="f_add" method="post">' ."\n
     '</table>';
     }
 ?>
-</form></body>
-</html>
+</form>
+<?php noframes_bottom(); ?>
+
index 7f95e5b6831952b10d28e7c05db70b2509888063..f5ba00d1ee632080b178194943987c5beaad9253 100644 (file)
@@ -606,4 +606,6 @@ if( $fp = @fopen( $cfgfile, 'w' ) ) {
          _("Config file can't be opened. Please check config.php.").
          '</font>';
 }
-?>
+noframes_bottom();
+
+?>
\ No newline at end of file
index ad8fb3bb64960bc8dadd8c44f23028ebd6dd1b73..344b093b1adecb7d3e73019ea777ae428e9ca406 100644 (file)
@@ -196,4 +196,5 @@ $body = htmlspecialchars($body_top . $body);
    </tr>
    </table>
    </form>
-</body></html>
+<?php noframes_bottom(); ?>
+
index 8091cf9e00108535d739286c79438fbb70b54e01..659738c355fa373d0df65f5866851014099a00c0 100644 (file)
@@ -176,5 +176,5 @@ startcalendar();
 drawmonthview();
 endcalendar();
 
+noframes_bottom();
 ?>
-</body></html>
index 3eff1df7ce9d9b4a5fa4af527f9aec7e9133eb44..e3a9a732b72b05b82d8afabbe6b7a4780f5c8995 100644 (file)
@@ -179,4 +179,5 @@ initialize_events();
 display_events();
 ?>
 </table></td></tr></table>
-</body></html>
+<?php noframes_bottom(); ?>
+
index c10aaed78f79a63d05e6a6a7b4078d51e755034c..a439ffc1c439270bf3df362eff2da73c25aee4d7 100644 (file)
@@ -208,4 +208,5 @@ if(!isset($event_text)){
 
 ?>
 </table></td></tr></table>
-</body></html>
+<? php noframes_bottom(); ?>
+
index eee5ab0fb8c74d37a97444148bffe810dcb63e4f..b45863e9b87316767b93748f3c3a210fa29a815f 100644 (file)
@@ -177,4 +177,5 @@ if (isset($dyear) && isset($dmonth) && isset($dday) && isset($dhour) && isset($d
 
 ?>
 </table></td></tr></table>
-</body></html>
+<?php noframes_bottom(); ?>
+
index 9331262cb4f60c5a33ab18b652d8d46b18464d95..a5e6be1667aab0da83d50a511de274b2344a92a6 100644 (file)
@@ -327,4 +327,5 @@ if (!isset($updated)){
 
 ?>
 </table></td></tr></table>
-</body></html>
+<?php noframes_bottom(); ?>
+
index 3d2f60ae6e72b170bc015429ba33369d393a8a0a..74eb85f50183c6081693a35407c0d7a709dd4f6c 100644 (file)
@@ -239,5 +239,6 @@ sqgetGlobalVar('action', $action, SQ_GET);
                 html_tag( 'td', '&nbsp;', 'left' )
             ) ,
         'center', '', 'width="80%" border="0" cellpadding="2" cellspacing="0"' );
-    echo '</body></html>';
+    noframes_bottom();
+
 ?>
\ No newline at end of file
index 7f6491c79fb0df3dffd4c84a067c7add332cbd2a..52c255bcfea129d49f019a07728088a8158ac555 100644 (file)
@@ -178,7 +178,8 @@ if (isset($action) && $action == 'spam') {
         '</table>'.
         '</center>'.
         '</form>';
-    echo '</body></html>';
+        noframes_bottom();
+
 }
 
 if (! isset($_GET['action']) || $_GET['action'] != 'spam') {
@@ -221,7 +222,7 @@ if (! isset($_GET['action']) || $_GET['action'] != 'spam') {
         echo "</td></tr>\n";
     }
     echo '</table>';
-    echo '</body></html>';
+    noframes_bottom();
 }
 
 ?>
\ No newline at end of file
index 9eb2ce69fdb6150fda84bc50b585e222885b5de9..c5f2a352cd4b52754569346f20ea1ebad2274530 100644 (file)
@@ -157,7 +157,9 @@ if ($submit == 'submit') {
         print "</TD><TR></TABLE></CENTER><BR>\n";
     }
 }
-    print "</TD></TR></TABLE></CENTER></BODY></HTML>";
+    print "</TD></TR></TABLE></CENTER>";
+    noframes_bottom();
+
     sqimap_logout($imap_stream);
     do_hook('info_bottom');
 ?>
index 5d08b20b78d992801783f71786dd500c136a5661..4af179fb4458f2bb6545971c5c3ae75030cda68d 100644 (file)
@@ -76,5 +76,7 @@ echo '<br />'
 . '<input type="hidden" name="body" value="' . htmlspecialchars($body) . '">'
 . '<input type="hidden" name="mailbox" value="' . htmlspecialchars($mailbox) . '">'
 . '<input type="submit" name="send" value="' . _("Send Mail") . '"><br /><br /></center>'
-. '</form></td></tr></table></p></body></html>';
-?>
+. '</form></td></tr></table></p>';
+noframes_bottom();
+
+?>
\ No newline at end of file
index 26260ed56d3337a6fc40648767c1973496c76029..0a7c73ba268d6c0449ca3f8fe084108d1a442420 100644 (file)
@@ -127,7 +127,7 @@ sqgetGlobalVar('delimiter',  $delimiter,  SQ_SESSION);
         echo '<p>' . _("No POP3 servers configured yet.") . '</p>';
         displayInternalLink('plugins/mail_fetch/options.php',
             _("Click here to go to the options page.") );
-        echo '</body></html>';
+        noframes_bottom();
         exit();
     }
 
@@ -321,5 +321,4 @@ sqgetGlobalVar('delimiter',  $delimiter,  SQ_SESSION);
 
 ?>
 </center>
-</body>
-</html>
+<?php noframes_bottom(); ?>
index 5ac6ae26ac242cf824cfe74a959a6a85dcddd45f..58e036c876b479ed47c1a7d332cf07f61dc94db4 100644 (file)
@@ -384,6 +384,5 @@ sqgetGlobalVar('submit_mailfetch', $submit_mailfetch, SQ_POST);
             ) ,
         'center', '', 'width="70%"' );
     }
-
-    ?>
-</body></html>
+    noframes_bottom();
+?>
\ No newline at end of file
index e2808f0ecbaae1f5433fa46b0529309ef08a213c..a9e4b2c1361aaf1d38ed07f8338805083bb8f63b 100644 (file)
@@ -47,4 +47,4 @@ echo "<body text=\"$color[8]\" bgcolor=\"$color[3]\" link=\"$color[7]\" vlink=\"
      '</b>'.
      '</body>'.
      "</html>\n";
-?>
+?>
\ No newline at end of file
index 7977da8c24cfe140a63a8bdffe0df00646f51f26..d0999e2316f84be8987683615c234aec4ab08c19 100644 (file)
@@ -52,4 +52,4 @@ function show_message_details() {
     echo $result;
 }
  
-?>
+?>
\ No newline at end of file
index edf59b1e2dc8dac4aee8ce37ecad2d7d3bd26221..01197b4f4a4751bb5d4dd93275c6dbac6180594a 100644 (file)
@@ -158,7 +158,7 @@ if ($allowsound == "true") {
                  ) . "\n" .
       '</table>'. "\n" .
    '</form>'. "\n" .
-   '</td></tr></table>'. "\n" .
-'</body></html>';
+   '</td></tr></table>'. "\n";
+   noframes_bottom();
 
-?>
+?>
\ No newline at end of file
index 697371e21732d80ecf6dba0a813e1e9bb78bb724..c178c9663f183ab933ab9ceca8c7b10116d01c4e 100644 (file)
Binary files a/plugins/newmail/sounds/FanFair.wav and b/plugins/newmail/sounds/FanFair.wav differ
index b9397de08956c56a515ffd02f1f766f5a219ff11..b1d9bd21f8f3803b3fc24ac9c3c7848aecbc4c9d 100644 (file)
Binary files a/plugins/newmail/sounds/Friends.wav and b/plugins/newmail/sounds/Friends.wav differ
index 0dc3655808e91801cf27cfd97a96eaf116e5cbe8..b2a2b6d85fa6cef2861296e0ef802fa2defd9061 100644 (file)
Binary files a/plugins/newmail/sounds/MontyPython.wav and b/plugins/newmail/sounds/MontyPython.wav differ
index 658bc7f03420e02c8a780d520249a57e0584a8a2..cb922c250c84a43c4eb18bd57c6bf67870d2c9de 100644 (file)
Binary files a/plugins/newmail/sounds/Notify.wav and b/plugins/newmail/sounds/Notify.wav differ
index 8c4c1e0e070cd2cb52efc8ed6662475fb5389240..5d3ef5b30fe95797fd79ffab8b0029022f7abedf 100755 (executable)
@@ -172,5 +172,5 @@ echo "</p>\n";
 echo "<p>";
 echo _("<b>For more information</b> about SpamCop, it's services, spam in general, and many related topics, try reading through SpamCop's <a href=\"http://spamcop.net/help.shtml\">Help and Feedback</a> section.");
 echo "</p>\n";
-?>
-</body></html>
+noframes_bottom();
+?>
\ No newline at end of file
index c7b1397c6d20b988fe47a28f8d45d2f9c0dbfe49..0fb65efa78a8d8f02506a24cd287081afb4db1e5 100644 (file)
@@ -189,5 +189,4 @@ echo "</p>";
 </td>
 </tr>
 </table>
-  </body>
-</html>
+<?php noframes_bottom(); ?>
index 43a0313346f890afc1fa0972d6c0002be78cd63b..ffda1b3d05ddea3fb0223d74eb0d6206b6f61a31 100644 (file)
@@ -76,7 +76,7 @@ function sqspell_makePage($title, $scriptsrc, $body){
     . html_tag( 'tr',
           html_tag( 'td', 'SquirrelSpell ' . $SQSPELL_VERSION, 'center', $color[9] )
       ) . "\n</table>\n";
-  echo '</body></html>';
+  noframes_bottom();
 }
 
 /**
index ed6170b7b73807a5743ca8652921c217818e31d8..1636bfb3301366afed19773ca6c443a9dd9a322a 100644 (file)
@@ -185,7 +185,7 @@ require_once(SM_PATH . 'include/load_prefs.php');
         '<input type="submit" value="' . _("Submit") . '" name="submit_translate">'.
         '</td></tr>'.
    '</table>'.
-   '</form>'.
-"</body></html>\n";
+   '</form>';
+   noframes_bottom();
 
 ?>
index 887c93703cfb0275756444a484c92413e5a5c80c..e9702ac5e0637e85ee9e593ed6118554910a0cd2 100644 (file)
@@ -276,14 +276,14 @@ else {
             echo html_tag( 'p', '<b><br>' .
                              _("Your search failed with the following error(s)") .
                             ':<br>' . $abook->error . "</b>\n" ,
-                   'center' ) .
-            "\n</BODY></HTML>\n";
+                   'center' );
+            noframes_bottom();
         } else {
             if (sizeof($res) == 0) {
                 echo html_tag( 'p', '<br><b>' .
                                  _("No persons matching your search was found") . "</b>\n" ,
-                       'center' ) .
-                "\n</BODY></HTML>\n";
+                       'center' );
+                noframes_bottom();
             } else {
                 addr_display_result($res);
             }
@@ -299,5 +299,5 @@ if ($addrquery == '' || sizeof($res) == 0) {
          '</form></center></nobr>';
 }
 
-?>
-</body></html>
+noframes_bottom();
+?>
\ No newline at end of file
index a01466dbc451c6843377ab65ec8cc5e5027ac2ba..d8d53bf12dddb134a3a9c50da67b1a4c9713ab16 100644 (file)
@@ -282,7 +282,7 @@ if(sqgetGlobalVar('REQUEST_METHOD', $req_method, SQ_SERVER) && $req_method == 'P
 
     // Some times we end output before forms are printed
     if($abortform) {
-       echo "</BODY></HTML>\n";
+       noframes_bottom();
        exit();
     }
 }
@@ -436,6 +436,5 @@ echo '</FORM>';
 
 /* Add hook for anything that wants on the bottom */
 do_hook('addressbook_bottom');
-?>
-
-</BODY></HTML>
+noframes_bottom();
+?>
\ No newline at end of file
index 2bdacca4b167a895b9d4c20a3c9134987740d865..36a1fb86869e3614e5dc968b9d2ccbaa8059b1cc 100644 (file)
@@ -1166,7 +1166,8 @@ function showInputForm ($session, $values=false) {
     }
 
     do_hook('compose_bottom');
-    echo '</BODY></HTML>' . "\n";
+    if ($compose_new_win != '1')
+       noframes_bottom();
 }
 
 
index b34af88cd656199bc4d94d6d4efe57e31f7fb10a..8f2c322ffe8eb95a00e7b06024a79fde1a98ee1e 100644 (file)
@@ -67,7 +67,10 @@ for ($i = 0; $i < $numboxes; $i++) {
 walkTreeInPreOrderEmptyTrash(0, $imap_stream, $foldersTree);
 
 $location = get_location();
-header ("Location: $location/left_main.php");
+if (isset($use_frames) && !$use_frames)
+    header ("Location: $location/right_main.php");
+else
+    header ("Location: $location/left_main.php");
 
 sqimap_logout($imap_stream);
 ?>
index 7e4966eeba582d437c50f5c709e29b972a0eac4c..866f9d42aebf733566e8538ed10e91f851baf8f8 100644 (file)
@@ -72,15 +72,25 @@ if ( isset($success) && $success ) {
 
     $td_str .= '</b><br>';        
 
-
-    echo html_tag( 'table',
-                html_tag( 'tr',
-                     html_tag( 'td', $td_str .
-                               '<a href="../src/left_main.php" target=left>' .
-                               _("refresh folder list") . '</a>' ,
-                     'center' )
-                ) ,
-            'center', '', 'width="100%" cellpadding="4" cellspacing="0" border="0"' );
+    if (isset($use_frames) && $use_frames) {
+        echo html_tag( 'table',
+                    html_tag( 'tr',
+                         html_tag( 'td', $td_str .
+                                   '<a href="' . SM_PATH . 'src/left_main.php" target=left>' .
+                                   _("refresh folder list") . '</a>' ,
+                         'center' )
+                    ) ,
+                'center', '', 'width="100%" cellpadding="4" cellspacing="0" border="0"' );
+    } else { 
+        echo html_tag( 'table',
+                    html_tag( 'tr',
+                         html_tag( 'td', $td_str .
+                                   '<a href="' . SM_PATH . 'src/folders.php">' .
+                                   _("refresh folder list") . '</a>' ,
+                         'center' )
+                    ) ,
+                'center', '', 'width="100%" cellpadding="4" cellspacing="0" border="0"' );
+    }
 }
 
 echo "\n<br>";
@@ -336,6 +346,5 @@ do_hook('folders_bottom');
 
 <?php
    sqimap_logout($imapConnection);
-?>
-
-</body></html>
+   noframes_bottom();
+?>
\ No newline at end of file
index 3d9fec9c7bffb847be95c4f7360831291e5996cf..d37b17041dc0287a928c577ba0356ca7c8b27eb9 100644 (file)
@@ -208,5 +208,6 @@ do_hook('help_bottom');
 echo html_tag( 'tr',
             html_tag( 'td', '&nbsp;', 'left', $color[0] )
         ).
-       '</table></body></html>';
-?>
+       '</table>';
+       noframes_bottom();
+?>
\ No newline at end of file
index a91f96a48da4ae8a321131533b09de0fb11d0efe..11d26624c77f2a0abbe9db0b8b3151e69bdf0728 100644 (file)
@@ -61,6 +61,6 @@ echo '</b></td></tr>' . "\n" .
     '<img src="' . $DownloadLink . '">' .
 
     '</TD></TR></TABLE>' . "\n";
-    '</body></html>' . "\n";
+    noframes_bottom();
 
-?>
+?>
\ No newline at end of file
index 4282f5d802ffee297fa82161b17cb1d18bb31c45..5a11258fbdc6da26546dfcaf857a0f86562c77c6 100644 (file)
@@ -14,7 +14,9 @@
  */
 
 /** Path for SquirrelMail required files. */
-define('SM_PATH','../');
+if (!defined('SM_PATH'))
+   define('SM_PATH','../');
+
 
 /* SquirrelMail required files. */
 require_once(SM_PATH . 'include/validate.php');
@@ -36,11 +38,14 @@ function formatMailboxName($imapConnection, $box_array) {
            $color, $move_to_sent, $move_to_trash,
            $unseen_notify, $unseen_type, $collapse_folders,
            $draft_folder, $save_as_draft,
-           $use_special_folder_color;
+           $use_special_folder_color, $use_frames;
     $real_box = $box_array['unformatted'];
     $mailbox = str_replace('&nbsp;','',$box_array['formatted']);
     $mailboxURL = urlencode($real_box);
-
+    if ($use_frames)
+       $target = 'right';
+    else
+       $target = '';
     /* Strip down the mailbox name. */
     if (ereg("^( *)([^ ]*)$", $mailbox, $regs)) {
         $mailbox = $regs[2];
@@ -65,8 +70,8 @@ function formatMailboxName($imapConnection, $box_array) {
 
     /* Create the link for this folder. */
     if ($status !== false) {
-    $line .= '<a href="right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox='.
-                $mailboxURL.'" TARGET="right" STYLE="text-decoration:none">';
+    $line .= '<a href="' . SM_PATH . 'src/right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox='.
+                $mailboxURL.'" TARGET="' . $target . '" STYLE="text-decoration:none">';
     }
     if ($special_color) {
         $line .= "<font color=\"$color[11]\">";
@@ -99,7 +104,7 @@ function formatMailboxName($imapConnection, $box_array) {
         if (($numMessages > 0) or ($box_array['parent'] == 1)) {
             $urlMailbox = urlencode($real_box);
             $line .= "\n<small>\n" .
-                    "&nbsp;&nbsp;(<A HREF=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
+                    "&nbsp;&nbsp;(<A HREF=\"" . SM_PATH . "src/empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</A>)" .
                     "</small>";
         } else {
           $line .= concat_hook_function('left_main_after_each_folder',
@@ -170,9 +175,12 @@ function create_collapse_link($boxnum) {
     global $boxes, $imapConnection, $unseen_notify, $color;
     $mailbox = urlencode($boxes[$boxnum]['unformatted']);
 
+
     /* Create the link for this collapse link. */
+
     $link = '<a target="left" style="text-decoration:none" ' .
-            'href="left_main.php?';
+        'href="' . SM_PATH . 'src/left_main.php?';
+
     if ($boxes[$boxnum]['collapse'] == SM_BOX_COLLAPSED) {
         $link .= "unfold=$mailbox\">+";
     } else {
@@ -287,7 +295,7 @@ function is_parent_box($curbox_name, $parbox_name) {
 
 function ListBoxes ($boxes, $j=0 ) {
     global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
-           $move_to_trash, $trash_folder, $collapse_folders, $imapConnection;
+           $move_to_trash, $trash_folder, $collapse_folders, $imapConnection, $use_frames;
 
     $pre = '<nobr>';
     $end = '';
@@ -343,8 +351,10 @@ function ListBoxes ($boxes, $j=0 ) {
         if (isset($boxes->mbxs[0]) && $collapse_folders) {
             $collapse = getPref($data_dir, $username, 'collapse_folder_' . $mailbox);
             $collapse = ($collapse == '' ? SM_BOX_UNCOLLAPSED : $collapse);
-
-            $link = '<a target="left" style="text-decoration:none" ' .'href="left_main.php?';
+            if ($use_frames)
+                $link = '<a target="left" style="text-decoration:none" ' .'href="' . SM_PATH . 'src/left_main.php?';
+            else
+                $link = '<a style="text-decoration:none" ' .'href="' . SM_PATH . 'src/right_main.php?';
             if ($collapse) {
                 $link .= "unfold=$mailboxURL\">$leader+&nbsp;</tt>";
             } else {
@@ -356,6 +366,11 @@ function ListBoxes ($boxes, $j=0 ) {
             $pre.= $leader . '&nbsp;&nbsp;</tt>';
         }
 
+        if ($use_frames)
+            $target = 'right';
+        else
+            $target = '';
+
         /* If there are unseen message, bold the line. */
         if (($move_to_trash) && ($mailbox == $trash_folder)) {
             if (! isset($boxes->total)) {
@@ -364,7 +379,7 @@ function ListBoxes ($boxes, $j=0 ) {
             if ($unseen > 0) {
                 $pre .= '<b>';
             }
-            $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
+            $pre .= "<a href=\"" . SM_PATH . "src/right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"$target\" style=\"text-decoration:none\">";
             if ($unseen > 0) {
                 $end .= '</b>';
             }
@@ -373,7 +388,7 @@ function ListBoxes ($boxes, $j=0 ) {
                 if ($unseen > 0) {
                     $pre .= '<b>';
                 }
-                $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
+                $pre .= "<a href=\"" . SM_PATH . "src/right_main.php?PG_SHOWALL=0&amp;sort=0;startMessage=1&amp;mailbox=$mailboxURL\" target=\"$target\" style=\"text-decoration:none\">";
                 if ($unseen > 0) {
                     $end .= '</b>';
                 }
@@ -382,7 +397,7 @@ function ListBoxes ($boxes, $j=0 ) {
                     $end .= "&nbsp;<small>$unseen_string</small>";
                 }
                 $end .= "\n<small>\n" .
-                        "&nbsp;&nbsp;(<a href=\"empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</a>)" .
+                        "&nbsp;&nbsp;(<a href=\"" . SM_PATH . "src/empty_trash.php\" style=\"text-decoration:none\">"._("purge")."</a>)" .
                         "</small>";
             }
         } else {
@@ -390,7 +405,7 @@ function ListBoxes ($boxes, $j=0 ) {
                 if ($unseen > 0) {
                     $pre .= '<b>';
                 }
-                $pre .= "<a href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\" style=\"text-decoration:none\">";
+                $pre .= "<a href=\"" . SM_PATH . "src/right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"$target\" style=\"text-decoration:none\">";
                 if ($unseen > 0) {
                     $end .= '</b>';
                 }
@@ -426,11 +441,16 @@ function ListBoxes ($boxes, $j=0 ) {
 
 function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
     global $data_dir, $username, $startmessage, $color, $unseen_notify, $unseen_type,
-           $move_to_trash, $trash_folder, $collapse_folders;
+           $move_to_trash, $trash_folder, $collapse_folders, $use_frames;
 
     if (!$boxes)
        return;
 
+    if ($use_frames)
+        $target = 'right';
+    else
+        $target = '';
+
     /* use_folder_images only works if the images exist in ../images */
     $use_folder_images = true;
 
@@ -497,17 +517,17 @@ function ListAdvancedBoxes ($boxes, $mbx, $j='ID.0000' ) {
         if (! isset($numMessages)) {
             $numMessages = $boxes->total;
         }
-        $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;
+        $pre = "<a class=\"mbx_link\" href=\"" . SM_PATH . "src/right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"$target\">" . $pre;
         $end .= '</a>';
         if ($numMessages > 0) {
             $urlMailbox = urlencode($mailbox);
             $end .= "\n<small>\n" .
-                    "&nbsp;&nbsp;(<a class=\"mbx_link\" href=\"empty_trash.php\">"._("purge")."</a>)" .
+                    "&nbsp;&nbsp;(<a class=\"mbx_link\" href=\"" . SM_PATH . "src/empty_trash.php\">"._("purge")."</a>)" .
                     "</small>";
         }
     } else {
         if (!$boxes->is_noselect) { /* \Noselect boxes can't be selected */
-            $pre = "<a class=\"mbx_link\" href=\"right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"right\">" . $pre;
+            $pre = "<a class=\"mbx_link\" href=\"" . SM_PATH . "src/right_main.php?PG_SHOWALL=0&amp;sort=0&amp;startMessage=1&amp;mailbox=$mailboxURL\" target=\"$target\">" . $pre;
             $end .= '</a>';
         }
     }
@@ -587,6 +607,9 @@ sqgetGlobalVar('unfold', $unfold, SQ_GET);
 /* end globals */
 
 // open a connection on the imap port (143)
+
+
+if (!$imapConnection)
 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); // the 10 is to hide the output
 
 /**
@@ -596,7 +619,7 @@ if (isset($left_refresh) && ($left_refresh != '') &&
     !stristr($left_refresh, 'none')){
     $xtra =  "\n<meta http-equiv=\"Expires\" content=\"Thu, 01 Dec 1994 16:00:00 GMT\" />\n" .
              "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n".
-             "<meta http-equiv=\"REFRESH\" content=\"$left_refresh;URL=left_main.php\" />\n";
+             "<meta http-equiv=\"REFRESH\" content=\"$left_refresh;URL=" . SM_PATH . "src/left_main.php\" />\n";
 } else {
     $xtra = '';
 }
@@ -892,10 +915,10 @@ ECHO;
 }
 
 
-
-
+if ($use_frames)
 displayHtmlHeader( 'SquirrelMail', $xtra );
 
+
 /* If requested and not yet complete, attempt to autocreate folders. */
 if ($auto_create_special && !isset($auto_create_done)) {
     $autocreate = array($sent_folder, $trash_folder, $draft_folder);
@@ -913,29 +936,30 @@ if ($auto_create_special && !isset($auto_create_done)) {
     $auto_create_done = TRUE;
     sqsession_register($auto_create_done, 'auto_create_done');
 }
-
-if ($advanced_tree)
-  echo "\n<body" .
+if ($use_frames) {
+   if ($advanced_tree)
+     echo "\n<body" .
        ' onload="preload(\'../images/minus.png\',\'../images/plus.png\')"' .
-  " bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
-else
-  echo "\n<body bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
-
-do_hook('left_main_before');
-if ($advanced_tree) {
-   /* nice future feature, needs layout !! volunteers?   */
-   $right_pos = $left_size - 20;
-/*   echo '<div style="position:absolute;top:0;border=solid;border-width:0.1em;border-color:blue;"><div ID="hidef" style="width=20;font-size:12"><A HREF="javascript:hideframe(true)"><b><<</b></a></div>';
-   echo '<div ID="showf" style="width=20;font-size:12;display:none;"><a href="javascript:hideframe(false)"><b>>></b></a></div>';
-   echo '<div ID="incrf" style="width=20;font-size:12"><a href="javascript:resizeframe(true)"><b>></b></a></div>';
-   echo '<div ID="decrf" style="width=20;font-size:12"><a href="javascript:resizeframe(false)"><b><</b></a></div></div>';
-   echo '<div ID="leftframe"><br /><br />';*/
+     " bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
+   else
+     echo "\n<body bgcolor=\"$color[3]\" text=\"$color[6]\" link=\"$color[6]\" vlink=\"$color[6]\" alink=\"$color[6]\">\n";
+
+    do_hook('left_main_before');
+    if ($advanced_tree) {
+        /* nice future feature, needs layout !! volunteers?   */
+        $right_pos = $left_size - 20;
+     /*   echo '<div style="position:absolute;top:0;border=solid;border-width:0.1em;border-color:blue;"><div ID="hidef" style="width=20;font-size:12"><A HREF="javascript:hideframe(true)"><b><<</b></a></div>';
+        echo '<div ID="showf" style="width=20;font-size:12;display:none;"><a href="javascript:hideframe(false)"><b>>></b></a></div>';
+        echo '<div ID="incrf" style="width=20;font-size:12"><a href="javascript:resizeframe(true)"><b>></b></a></div>';
+        echo '<div ID="decrf" style="width=20;font-size:12"><a href="javascript:resizeframe(false)"><b><</b></a></div></div>';
+        echo '<div ID="leftframe"><br /><br />';*/
+    }
 }
-
 echo "\n\n" . html_tag( 'table', '', 'left', '', 'border="0" cellspacing="0" cellpadding="0" width="99%"' ) .
     html_tag( 'tr' ) .
-    html_tag( 'td', '', 'left' ) .
-    '<center><font size="4"><b>'. _("Folders") . "</b><br /></font>\n\n";
+    html_tag( 'td', '', 'left' );
+    if ($use_frames != 1)
+       '<center><font size="4"><b>'. _("Folders") . "</b><br /></font>\n\n";
 
 if ($date_format != 6) {
     /* First, display the clock. */
@@ -973,9 +997,17 @@ if ($date_format != 6) {
 }
 
 /* Next, display the refresh button. */
-echo '<small>(<a href="../src/left_main.php" target="left">'.
-     _("refresh folder list") . '</a>)</small></center><br />';
+if ($use_frames) {
+    echo '<small>(<a href="' . SM_PATH . 'src/left_main.php" target="left">'.
+        _("refresh folder list") . '</a>)</small></center><br />';
+} else {
+//    echo '<small>(<a href="' . SM_PATH . 'src/left_main.php">'.
+//        _("refresh folder list") . '</a>)</small></center><br />';
+    echo '</center><br />';
+    $collapse_folders = 0;
+}
 
+global $data_dir;
 /* Lastly, display the folder list. */
 if ( $collapse_folders ) {
     /* If directed, collapse or uncollapse a folder. */
@@ -1065,7 +1097,7 @@ for ($i = 0; $i < count($boxes); $i++) {
 } else {  /* expiremental code */
     $boxes = sqimap_mailbox_tree($imapConnection);
     if (isset($advanced_tree) && $advanced_tree) {
-        echo '<form name="collapse" action="left_main.php" method="post" ' .
+        echo '<form name="collapse" action="' . SM_PATH . 'src/left_main.php" method="post" ' .
              'enctype="multipart/form-data"'."\n";
         echo '<small>';
         echo '<button type="submit" class="button" onmouseover="buttonover(this,true)" onmouseout="buttonover(this,false)" onmousedown="buttonclick(this,true)" onmouseup="buttonclick(this,false)">'. _("Save folder tree") .'</button><br /><br />';
@@ -1081,10 +1113,15 @@ for ($i = 0; $i < count($boxes); $i++) {
         ListBoxes($boxes);
     }
 } /* if ($oldway) else ... */
-do_hook('left_main_after');
-sqimap_logout($imapConnection);
-
-echo '</td></tr></table>' . "\n".
-    "</div></body></html>\n";
+if ($use_frames)
+    do_hook('left_main_after');
+if ($location_of_bar == right && !$use_frames)
+    sqimap_logout($imapConnection);
+
+echo '<br></td></tr></table>' . "\n";
+if ($use_frames)
+    echo "</div></body></html>\n";
+else
+    echo "</div>\n";
 
-?>
+?>
\ No newline at end of file
index 10584e2002ae24c2d419f776a0ed14886e2854bd..fd41eafe33c23557e99e58b0f202d185a7a7a6e0 100644 (file)
@@ -175,10 +175,43 @@ echo html_tag( 'table',
         'center' )
     ) ,
 '', $color[4], 'border="0" cellspacing="0" cellpadding="0" width="100%"' );
+
+switch ($allow_frames) {
+   case 4:    // if $use_frames unset, fall through to case 2
+      if (isset($_COOKIE['set_use_frames'])) {
+         $use_frames = $_COOKIE['set_use_frames'];
+         break;
+      }
+   case 2:    // Do not use frames
+      $use_frames = 0;
+      break;
+   case 3:    // if $use_frames unset, fall through to case 1
+      if (isset($_COOKIE['set_use_frames'])) {
+         $use_frames = $_COOKIE['set_use_frames'];
+         break;
+      }
+   default:   // default is also to use frames
+   case 1:    // use frames
+      $use_frames = 1;
+      break;
+}
+
+if ($allow_frames > 2) {
+   echo "<center><table border=0><tr><td>\n";
+   echo "<small><input type=radio name=set_use_frames value=1";
+   if ($use_frames) echo " checked=true";
+   echo '> ' . _("Frames") . "\n";
+   echo "</small></td><td nowrap>\n";
+   echo "<small><input type=radio name=set_use_frames value=0";
+   if (!$use_frames) echo " checked=true";
+   echo '> ' . _("No Frames") . "\n";
+   echo "</td></tr></table></center>\n";
+}
+
 do_hook('login_form');
 echo '</form>' . "\n";
 
 do_hook('login_bottom');
 echo "</body>\n".
      "</html>\n";
-?>
+?>
\ No newline at end of file
index 7a2ba7e12ef8c54321528418be29384b98b9753c..2cd0f307847411ae885e1483c1e8700eb357cb18 100644 (file)
@@ -238,5 +238,5 @@ if ($exception) {
     header("Location: $location");
     exit;
 }
-?>
-</BODY></HTML>
+noframes_bottom();
+?>
\ No newline at end of file
index 1bf50510e3f1128e7f7d54a1e94b1afef7e52a8e..9d9c45a162a9e7650a15bae66eab975586d8febc 100644 (file)
@@ -291,7 +291,10 @@ if ($optpage == SMOPT_PAGE_MAIN) {
         /* If $max_refresh != SMOPT_REFRESH_NONE, provide a refresh link. */
         if ( !isset( $max_refresh ) ) {
         } else if ($max_refresh == SMOPT_REFRESH_FOLDERLIST) {
-            echo '<a href="../src/left_main.php" target="left">' . _("Refresh Folder List") . '</a><br>';
+            if ($use_frames)
+                echo '<a href="../src/left_main.php" target="left">' . _("Refresh Folder List") . '</a><br>';
+            else
+                echo '<a href="../src/options.php">' . _("Refresh Folder List") . '</a><br>';
         } else if ($max_refresh) {
             echo '<a href="../src/webmail.php?right_frame=options.php" target="' . $frame_top . '">' . _("Refresh Page") . '</a><br>';
         }
@@ -451,7 +454,9 @@ if ($optpage == SMOPT_PAGE_MAIN) {
 echo        '</td></tr>' .
         '</table>'.
         '</td></tr>'.
-     '</table>' .
-     '</body></html>';
+     '</table>';
 
-?>
+noframes_bottom();
+
+
+?>
\ No newline at end of file
index 79e2d2ae8741f0b3fc0e8ca830206e716121dc92..37d9b28e112650bff23c3065c6ef463879126bdd 100644 (file)
@@ -469,4 +469,5 @@ if ($action == 'edit' || $action == 'add') {
 }
 do_hook('options_highlight_bottom');
 ?>
-</table></body></html>
+</table>
+<?php noframes_bottom(); ?>
index 91744c7964225302cc6372fd37878669b17bfeff..bad3b3aff208019718482dd85854b0328c711d4e 100644 (file)
@@ -88,9 +88,8 @@ if (!empty($_POST)) {
                '', '', 'width="100%" border="0" cellpadding="1" cellspacing="1"' ) ,
            'center', $color[0] )
        ) ,
-   'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' ) .
-
-   '</body></html>';
+   'center', '', 'width="95%" border="0" cellpadding="2" cellspacing="0"' );
+   noframes_bottom();
 
     function SaveUpdateFunction() {
         global $username, $data_dir, $full_name, $email_address, $reply_to, $signature;
index 20805e3dafdddd59e1898bd7ab9d957fb3c209de..321983978d016621db53affac899bfa580b344e9 100644 (file)
@@ -149,4 +149,4 @@ displayPageHeader($color, 'None');
 
 </td></tr>
 </table>
-</body></html>
+<?php noframes_bottom(); ?>
index bc267c6b1e91f3aff3461561e2aeb33dcd63ebe1..84144d6b3e10efc53fbf9e73e304151e44047893 100644 (file)
@@ -846,6 +846,5 @@ sqimap_logout($imapConnection);
    them at the end so we avoid double session_register calls */
 sqsession_register($messages,'messages');
 
-?>
-</body>
-</html>
+noframes_bottom();
+?>
\ No newline at end of file
index 4ffa1bae6aaf3a2db4ff8bf965c11541f1f2cbd0..93d61fc6968adb04f59ff57e057910aa8454599f 100644 (file)
@@ -94,6 +94,28 @@ if (!sqsession_is_registered('user_is_logged_in')) {
     $username = $login_username;
     sqsession_register ($username, 'username');
     setcookie('key', $key, 0, $base_uri);
+
+    switch ($allow_frames) {
+        case 4:    // if $use_frames unset, fall through to case 2
+            if (isset($_POST['set_use_frames'])) {
+                $use_frames = $_POST['set_use_frames'];
+                break;
+            }
+        case 2:    // Do not use frames
+            $use_frames = 0;
+            break;
+        case 3:    // if $use_frames unset, fall through to case 1
+            if (isset($_POST['set_use_frames'])) {
+                $use_frames = $_POST['set_use_frames'];
+                break;
+            }
+        default:   // default is also to use frames
+        case 1:    // use frames
+            $use_frames = 1;
+            break;
+    }
+
+    setcookie('use_frames', $use_frames, time()+2592000, $base_uri);
     do_hook ('login_verified');
 
 }
index 1d3ef5e53f0001beda0be67ca1edb1e5aa5d88af..9558cdba6ba4f804f82730e027077a0b5f54c3b3 100644 (file)
@@ -237,7 +237,6 @@ if ($use_mailbox_cache && sqsession_is_registered('msgs')) {
 }
 do_hook('right_main_bottom');
 sqimap_logout ($imapConnection);
+noframes_bottom();
 
-echo '</body></html>';
-
-?>
+?>
\ No newline at end of file
index 11538d923a1df3a8e9d0eb6d89fbc1fb9c884b78..e3805a32c7e154f1de3c715773d6a353d1164c8e 100644 (file)
@@ -1082,6 +1082,6 @@ if ($submit == $search_button_text) {
 
 do_hook('search_bottom');
 sqimap_logout($imapConnection);
-echo '</body></html>';
+noframes_bottom();
 
-?>
+?>
\ No newline at end of file
index c6f3d112afa83cc1d14c6cd370986962c2fdfb05..1d669d1074c21ba44bd893a0165b7a93bb23e19d 100644 (file)
@@ -218,7 +218,7 @@ echo '</select>' .
 
         '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>' .
         '<TR><TD BGCOLOR="' . $color[4] . '">' .
-        '</TD></TR></TABLE>' .
-        '</body></html>';
+        '</TD></TR></TABLE>';
+        noframes_bottom();
 
-?>
+?>
\ No newline at end of file
index 4f86662d13072bb75da76615c82486b52f3ec6e4..29055934efb9555e0b43449607bc0f04652757a8 100644 (file)
@@ -103,7 +103,7 @@ function view_header($header, $mailbox, $color) {
            '</tt></nobr>',
            '</td></tr></table>'."\n" 
          ) );
-    echo '</body></html>';
+    noframes_bottom();
 }
 
 /* get global vars */
index 88210f1cc763f871c2c2f153654754479b7048f3..e15000addc8f021845baa83e4c84a692e9188f8f 100644 (file)
@@ -86,6 +86,6 @@ echo '<BR><TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>
      '</TD></TR></TABLE>' .
      '<TABLE WIDTH="98%" BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR="' . $color[0] . '">' .
      '<TR><TD BGCOLOR="' . $color[4] . '"><TT>' .
-     $body . '</TT></TD></TR></TABLE>' .
-     '</body></html>';
-?>
+     $body . '</TT></TD></TR></TABLE>';
+     noframes_bottom();
+?>
\ No newline at end of file
index 9825da3d2adf59b1e9dc8ad43d0b7c548ac695e1..c4ef5b8c471f685aaa66230b93db635a9a995378 100644 (file)
@@ -37,12 +37,30 @@ sqsession_is_active();
 sqgetGlobalVar('username', $username, SQ_SESSION);
 sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
 sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
-
+sqgetGlobalVar('use_frames', $use_frames, SQ_COOKIE);
 sqgetGlobalVar('right_frame', $right_frame, SQ_GET);
 
 if ( isset($_SESSION['session_expired_post']) ) {
     sqsession_unregister('session_expired_post');
 }
+global $plugins;
+
+switch ($allow_frames) {
+   case 4:    // if $use_frames unset, fall through to case 2
+      if (isset($use_frames))
+         break;
+   case 2:    // Do not use frames
+      $use_frames = 0;
+      break;
+   case 3:    // if $use_frames unset, fall through to case 1
+      if (isset($use_frames))
+         break;
+   default:   // default is also to use frames
+   case 1:    // use frames
+      $use_frames = 1;
+      break;
+}
+
 if(!sqgetGlobalVar('mailto', $mailto)) {
     $mailto = '';
 }
@@ -65,6 +83,25 @@ if ($my_language != $squirrelmail_language) {
 
 set_up_language(getPref($data_dir, $username, 'language'));
 
+if (isset($use_frames) && !$use_frames) {
+    if (!isset($right_frame))
+        $right_frame = '';
+    if ($right_frame == 'right_main.php') {
+        $urlMailbox = urlencode($mailbox);
+        $right_frame_url = "right_main.php?mailbox=$urlMailbox&amp;sort=$sort&amp;startMessage=$startMessage";
+    } elseif ($right_frame == 'options.php') {
+        $right_frame_url = 'options.php';
+    } elseif ($right_frame == 'folders.php') {
+        $right_frame_url = 'folders.php';
+    } else if ($right_frame == '') {
+        $right_frame_url = 'right_main.php';
+    } else {
+        $right_frame_url =  $right_frame;
+    }
+    header("Location: $right_frame_url");
+}
+
+
 echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\">\n".
      "<html><head>\n" .
      "<title>$org_title</title>\n".