X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_options.php;h=a860c923dfa7cfacb7d2178214b134cf0ecba27f;hp=ae1a5160715e018c9a6177e8e234e469e875b78f;hb=4b4abf93a9624311afef0c385023724ee46a2b60;hpb=9eb3fcb302b8e0363760bee586f1c43e7050b365 diff --git a/plugins/squirrelspell/sqspell_options.php b/plugins/squirrelspell/sqspell_options.php index ae1a5160..a860c923 100644 --- a/plugins/squirrelspell/sqspell_options.php +++ b/plugins/squirrelspell/sqspell_options.php @@ -1,16 +1,14 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @copyright © 1999-2005 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ * @package plugins * @subpackage squirrelspell */ @@ -18,6 +16,7 @@ /** * 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; @@ -30,30 +29,24 @@ 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 . 'functions/display_messages.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."),$color); + echo ''; } - -/* Load the stuff already. */ -require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod"); - ?> \ No newline at end of file