X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Foptions.php;h=c6dd5c7d31c8b2c1010702723637f6acc9d9b9da;hb=1d461a185142e93a21845550100bdcd09ff080b1;hp=65fd9cdb65b71107dd31e7a1e0262995910e86a4;hpb=8672576304f4da444b9b1e0e4ca81505af0267ec;p=squirrelmail.git diff --git a/src/options.php b/src/options.php index 65fd9cdb..c6dd5c7d 100644 --- a/src/options.php +++ b/src/options.php @@ -3,7 +3,7 @@ /** * options.php * - * Copyright (c) 1999-2002 The SquirrelMail Project Team + * Copyright (c) 1999-2003 The SquirrelMail Project Team * Licensed under the GNU GPL. For full terms see the file COPYING. * * Displays the options page. Pulls from proper user preference files @@ -16,10 +16,10 @@ define('SM_PATH','../'); /* SquirrelMail required files. */ -require_once(SM_PATH . 'src/validate.php'); +require_once(SM_PATH . 'include/validate.php'); +require_once(SM_PATH . 'functions/global.php'); require_once(SM_PATH . 'functions/display_messages.php'); require_once(SM_PATH . 'functions/imap.php'); -require_once(SM_PATH . 'functions/array.php'); require_once(SM_PATH . 'functions/options.php'); require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'functions/html.php'); @@ -115,9 +115,22 @@ function print_optionpages_row($leftopt, $rightopt = false) { /* ---------------------------- main ---------------------------- */ +/* get the globals that we may need */ +sqgetGlobalVar('key', $key, SQ_COOKIE); +sqgetGlobalVar('username', $username, SQ_SESSION); +sqgetGlobalVar('onetimepad',$onetimepad, SQ_SESSION); +sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); + +sqgetGlobalVar('optpage', $optpage); +sqgetGlobalVar('optmode', $optmode, SQ_POST); +sqgetGlobalVar('optpage_data',$optpage_data, SQ_POST); +/* end of getting globals */ + /* Make sure we have an Option Page set. Default to main. */ -if (!isset($optpage)) { - $optpage = 'main'; +if ( !isset($optpage) || $optpage == '' ) { + $optpage = SMOPT_PAGE_MAIN; +} else { + $optpage = strip_tags( $optpage ); } /* Make sure we have an Option Mode set. Default to display. */ @@ -136,34 +149,35 @@ $optpage_loader = ''; /* Set the load information for each page. */ switch ($optpage) { - case SMOPT_PAGE_MAIN: break; + case SMOPT_PAGE_MAIN: + break; case SMOPT_PAGE_PERSONAL: $optpage_name = _("Personal Information"); - $optpage_file = '../src/options_personal.php'; + $optpage_file = SM_PATH . 'include/options/personal.php'; $optpage_loader = 'load_optpage_data_personal'; $optpage_loadhook = 'optpage_loadhook_personal'; break; case SMOPT_PAGE_DISPLAY: $optpage_name = _("Display Preferences"); - $optpage_file = '../src/options_display.php'; + $optpage_file = SM_PATH . 'include/options/display.php'; $optpage_loader = 'load_optpage_data_display'; $optpage_loadhook = 'optpage_loadhook_display'; break; case SMOPT_PAGE_HIGHLIGHT: $optpage_name = _("Message Highlighting"); - $optpage_file = '../src/options_highlight.php'; + $optpage_file = SM_PATH . 'include/options/highlight.php'; $optpage_loader = 'load_optpage_data_highlight'; $optpage_loadhook = 'optpage_loadhook_highlight'; break; case SMOPT_PAGE_FOLDER: $optpage_name = _("Folder Preferences"); - $optpage_file = '../src/options_folder.php'; + $optpage_file = SM_PATH . 'include/options/folder.php'; $optpage_loader = 'load_optpage_data_folder'; $optpage_loadhook = 'optpage_loadhook_folder'; break; case SMOPT_PAGE_ORDER: $optpage_name = _("Index Order"); - $optpage_file = '../src/options_order.php'; + $optpage_file = SM_PATH . 'include/options/order.php'; $optpage_loader = 'load_optpage_data_order'; $optpage_loadhook = 'optpage_loadhook_order'; break; @@ -174,8 +188,11 @@ switch ($optpage) { /*** Second, load the option information for this page. ***/ /**********************************************************/ -if ($optpage != SMOPT_PAGE_MAIN) { +if ( !@is_file( $optpage_file ) ) { + $optpage = SMOPT_PAGE_MAIN; +} else if ($optpage != SMOPT_PAGE_MAIN ) { /* Include the file for this optionpage. */ + require_once($optpage_file); /* Assemble the data for this option page. */