* Displays the options page. Pulls from proper user preference files
* and config.php. Displays preferences as selected and other options.
*
- * @copyright © 1999-2007 The SquirrelMail Project Team
+ * @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
/* get the globals that we may need */
sqgetGlobalVar('optpage', $optpage);
-sqgetGlobalVar('optmode', $optmode, SQ_FORM);
-sqgetGlobalVar('optpage_data',$optpage_data, SQ_POST);
+sqgetGlobalVar('optmode', $optmode, SQ_FORM);
+sqgetGlobalVar('optpage_data',$optpage_data, SQ_POST);
+sqgetGlobalVar('smtoken', $submitted_token, SQ_FORM, '');
/* end of getting globals */
/* Make sure we have an Option Page set. Default to main. */
/*** Next, process anything that needs to be processed. ***/
/***********************************************************/
+// security check before saving anything...
+//FIXME: what about SMOPT_MODE_LINK??
+if ($optmode == SMOPT_MODE_SUBMIT) {
+ sm_validate_security_token($submitted_token, -1, TRUE);
+}
+
$optpage_save_error=array();
if ( isset( $optpage_data ) ) {
$notice.= "</ul>\n" . _("Some of your preference changes were not applied.") . "\n";
} else {
/* Display a message indicating a successful save. */
- $notice = _("Successfully Saved Options") . ": $optpage_name</b><br />\n";
+ // i18n: The %s represents the name of the option page saving the options
+ $notice = sprintf(_("Successfully Saved Options: %s"), $optpage_name) . "<br />\n";
}
/* If $max_refresh != SMOPT_REFRESH_NONE, provide a refresh link. */
$submit_name = 'submit_order';
break;
default:
- $bottom_hook_name = '';
+ $bottom_hook_name = 'options_generic_bottom';
$submit_name = 'submit';
}
// Begin output form
- echo addForm('options.php', 'post', 'option_form')
+ echo addForm('options.php', 'post', 'option_form', '', '', array(), TRUE)
. create_optpage_element($optpage)
. create_optmode_element(SMOPT_MODE_SUBMIT);