X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_options.php;h=01e29087f0b10265fc5966f539dea37f2c8402b0;hp=636a50a9f9e76690e02cf0f0e861d5ef5e8a7ac6;hb=353d074afac6827c90f4bb03e846c5e453d3b5b1;hpb=91e0dccca7b2452d8b450791cae3aa4125e8889e diff --git a/plugins/squirrelspell/sqspell_options.php b/plugins/squirrelspell/sqspell_options.php index 636a50a9..01e29087 100644 --- a/plugins/squirrelspell/sqspell_options.php +++ b/plugins/squirrelspell/sqspell_options.php @@ -1,59 +1,50 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @copyright 1999-2018 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package plugins * @subpackage squirrelspell */ +/** + * Include the SquirrelMail initialization file. + */ +require('../../include/init.php'); + /** * Set a couple of constants and defaults. Don't change these, * the configurable stuff is in sqspell_config.php + * @todo do we really need $SQSPELL_DIR var? */ $SQSPELL_DIR='plugins/squirrelspell/'; $SQSPELL_CRYPTO=FALSE; -/** - * Load some necessary stuff from squirrelmail. - * @ignore - */ -define('SM_PATH','../../'); -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'include/load_prefs.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'functions/page_header.php'); -require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_config.php'); -require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php'); + +include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php'); /** * $MOD is the name of the module to invoke. - * If $MOD is unspecified, assign "init" to it. Else check for + * If $MOD is unspecified, assign "options_main" to it. Else check for * security breach attempts. */ -if(isset($_POST['MOD'])) { - $MOD = $_POST['MOD']; -} elseif (isset($_GET['MOD'])) { - $MOD = $_GET['MOD']; +if(! sqgetGlobalVar('MOD',$MOD,SQ_FORM)) { + $MOD = 'options_main'; } +sqspell_ckMOD($MOD); -if(!isset($MOD) || !$MOD) { - $MOD = 'options_main'; +/* Load the stuff already. */ +if (file_exists(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod")) { + require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod"); } else { - sqspell_ckMOD($MOD); + error_box(_("Invalid SquirrelSpell module.")); + // display footer (closes html tags) + $oTemplate->display('footer.tpl'); } - -/* Load the stuff already. */ -require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod"); - -?> \ No newline at end of file