From 80e86e941526449e2b21bc532abb870072e5e083 Mon Sep 17 00:00:00 2001 From: teepe Date: Fri, 25 Jan 2002 17:15:57 +0000 Subject: [PATCH] allow sm to be in an embedded frame git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2240 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- config/conf.pl | 24 ++++++++++++++++++++++-- config/config_default.php | 9 +++++++++ functions/auth.php | 6 +++--- functions/display_messages.php | 3 ++- functions/page_header.php | 4 ++-- src/options.php | 2 +- src/signout.php | 2 +- 7 files changed, 40 insertions(+), 10 deletions(-) diff --git a/config/conf.pl b/config/conf.pl index 562605de..3be511ea 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -327,6 +327,7 @@ while (($command ne "q") && ($command ne "Q")) { print "3. Organization Title : $WHT$org_title$NRM\n"; print "4. Signout Page : $WHT$signout_page$NRM\n"; print "5. Default Language : $WHT$squirrelmail_default_language$NRM\n"; + print "6. Top Frame : $WHT$frame_top$NRM\n"; print "\n"; print "R Return to Main Menu\n"; } elsif ($menu == 2) { @@ -503,7 +504,8 @@ while (($command ne "q") && ($command ne "Q")) { elsif ($command == 2) { $org_logo = command2 (); } elsif ($command == 3) { $org_title = command3 (); } elsif ($command == 4) { $signout_page = command4 (); } - elsif ($command == 5) { $squirrelmail_default_language = command5(); } + elsif ($command == 5) { $squirrelmail_default_language = command5(); } + elsif ($command == 6) { $frame_top = command6(); } } elsif ($menu == 2) { if ($command == 1) { $domain = command11 (); } elsif ($command == 2) { $imapServerAddress = command12 (); } @@ -644,6 +646,23 @@ sub command5 { return $new_signout_page; } +# Default top frame +sub command6 { + print "SquirrelMail defaults to using the whole of the browser window.\n"; + print "This allows you to keep it within a specified frame. The default\n"; + print "is '_top'\n"; + print "\n"; + print "[$WHT$frame_top$NRM]: $WHT"; + $new_frame_top = ; + if ($new_frame_top eq "\n") { + $new_frame_top = '_top'; + } else { + $new_frame_top =~ s/[\r|\n]//g; + $new_frame_top =~ s/^\s+$//g; + } + return $new_frame_top; +} + #################################################################################### # domain @@ -1815,11 +1834,12 @@ sub save_data { print CF "\$config_use_color = $config_use_color;\n"; print CF "\n"; - print CF "global \$org_name, \$org_logo, \$org_title, \$signout_page;\n"; + print CF "global \$org_name, \$org_logo, \$org_title, \$signout_page, \$frame_top;\n"; print CF "\$org_name = \"$org_name\";\n"; print CF "\$org_logo = '$org_logo';\n"; print CF "\$org_title = \"$org_title\";\n"; print CF "\$signout_page = '$signout_page';\n"; + print CF "\$frame_top = '$frame_top';\n"; print CF "\n"; print CF "global \$motd;\n"; diff --git a/config/config_default.php b/config/config_default.php index 6cb02a44..afb55a8b 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -431,6 +431,15 @@ $default_unseen_type = 1; global $invert_time; $invert_time = false; +/** + * By default SquirrelMail takes up the whole browser window, + * this allows you to embed it within sites using frames. Set + * this to the frame you want it to stay in. + */ + +global $frame_top; +$frame_top = '_top'; + global $plugins; /** * To install plugins, just add elements to this array that have diff --git a/functions/auth.php b/functions/auth.php index 287be6ce..24c5e150 100644 --- a/functions/auth.php +++ b/functions/auth.php @@ -14,7 +14,7 @@ require_once( '../functions/page_header.php' ); function is_logged_in () { - global $squirrelmail_language; + global $squirrelmail_language, $frame_top; if ( session_is_registered('user_is_logged_in') ) { return; @@ -27,9 +27,9 @@ function is_logged_in () { echo "\n" . '

' . _("You must be logged in to access this page.").'

' . - ""._("Go to the login page")."\n" . + ""._("Go to the login page")."\n" . "
\n"; exit; } -?> \ No newline at end of file +?> diff --git a/functions/display_messages.php b/functions/display_messages.php index 04859428..0025cbf6 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -13,6 +13,7 @@ */ function error_username_password_incorrect() { + global $frame_top; echo '
'. ''. @@ -21,7 +22,7 @@ function error_username_password_incorrect() { '' . ''. diff --git a/functions/page_header.php b/functions/page_header.php index a38f0764..e248728f 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -49,7 +49,7 @@ function displayInternalLink($path, $text, $target='') { function displayPageHeader($color, $mailbox) { - global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF; + global $delimiter, $hide_sm_attributions, $base_uri, $PHP_SELF, $frame_top; displayHtmlHeader (); @@ -111,7 +111,7 @@ function checkForm() { } echo " \n" . " \n" . " \n" . " \n" diff --git a/src/options.php b/src/options.php index dad42827..c010f106 100644 --- a/src/options.php +++ b/src/options.php @@ -235,7 +235,7 @@ if ($optpage == SMOPT_PAGE_MAIN) { if ($max_refresh == SMOPT_REFRESH_FOLDERLIST) { echo '' . _("Refresh Folder List") . '
'; } else if ($max_refresh) { - echo '' . _("Refresh Page") . '
'; + echo '' . _("Refresh Page") . '
'; } } /******************************************/ diff --git a/src/signout.php b/src/signout.php index 9a37ca20..0dcdaef9 100644 --- a/src/signout.php +++ b/src/signout.php @@ -88,7 +88,7 @@ CELLPADDING="2" ALIGN="CENTER"> -- 2.25.1
'. '

' . _("Unknown user or password incorrect.") . - '
' . + '
' . _("Click here to try again") . '.
'. '
\n"; - displayInternalLink ('src/signout.php', _("Sign Out"), '_top'); + displayInternalLink ('src/signout.php', _("Sign Out"), $frame_top); echo "

- +