X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_options.php;h=bde8bcf8cc3a569a17dcc6c0442e33c348b4493d;hp=cc1013c31056962374e2ba823dfecb81a6906ed4;hb=300ea85431defdabaa4c06bec1776790e096eb78;hpb=7e54b3251c709eaa35e3b6d24535b2fac2e5bdd0 diff --git a/plugins/squirrelspell/sqspell_options.php b/plugins/squirrelspell/sqspell_options.php index cc1013c3..bde8bcf8 100644 --- a/plugins/squirrelspell/sqspell_options.php +++ b/plugins/squirrelspell/sqspell_options.php @@ -1,53 +1,50 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @copyright © 1999-2007 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ /** - * Set a couple of constants and defaults. Don't change these, - * the configurable stuff is in sqspell_config.php + * Include the SquirrelMail initialization file. */ -$SQSPELL_DIR='squirrelspell'; -$SQSPELL_CRYPTO=FALSE; +require('../../include/init.php'); /** - * Load some necessary stuff from squirrelmail. + * 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? */ -chdir('..'); -define('SM_PATH','../'); - -/* SquirrelMail required files. */ -require_once(SM_PATH . 'include/validate.php'); -require_once(SM_PATH . 'src/validate.php'); -require_once(SM_PATH . 'src/load_prefs.php'); -require_once(SM_PATH . 'functions/strings.php'); -require_once(SM_PATH . 'functions/page_header.php'); -require_once("$SQSPELL_DIR/sqspell_config.php"); -require_once("$SQSPELL_DIR/sqspell_functions.php"); +$SQSPELL_DIR='plugins/squirrelspell/'; +$SQSPELL_CRYPTO=FALSE; + + + +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($MOD) || !$MOD){ - $MOD = 'options_main'; -} else { - sqspell_ckMOD($MOD); +if(! sqgetGlobalVar('MOD',$MOD,SQ_FORM)) { + $MOD = 'options_main'; } +sqspell_ckMOD($MOD); -/** - * Load the stuff already. - */ -require_once("$SQSPELL_DIR/modules/$MOD.mod"); -?> +/* Load the stuff already. */ +if (file_exists(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod")) { + require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod"); +} else { + error_box(_("Invalid SquirrelSpell module.")); + // display footer (closes html tags) + $oTemplate->display('footer.tpl'); +}