X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_options.php;h=5e99de8f773537534684cfdbf182bddcecd9442d;hp=ce6b230ea994b1703f8e51b4ee194e8006ccaeec;hb=a6d3eff675f7ace3d69f6d9788489ca930333315;hpb=aa7fb30cfbfef6ef28ebde963f6312c79122f411 diff --git a/plugins/squirrelspell/sqspell_options.php b/plugins/squirrelspell/sqspell_options.php index ce6b230e..5e99de8f 100644 --- a/plugins/squirrelspell/sqspell_options.php +++ b/plugins/squirrelspell/sqspell_options.php @@ -1,53 +1,52 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ /** - * Set a couple of constants and defaults. Don't change these, + * Set a couple of constants and defaults. Don't change these, * the configurable stuff is in sqspell_config.php */ -$SQSPELL_DIR='squirrelspell'; +$SQSPELL_DIR='plugins/squirrelspell/'; $SQSPELL_CRYPTO=FALSE; /** - * Load some necessary stuff from squirrelmail. + * Load some necessary stuff from SquirrelMail. + * @ignore */ -chdir('..'); -define('SM_PATH','../'); +define('SM_PATH','../../'); /* SquirrelMail required files. */ require_once(SM_PATH . 'include/validate.php'); -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("$SQSPELL_DIR/sqspell_config.php"); -require_once("$SQSPELL_DIR/sqspell_functions.php"); +include_once(SM_PATH . 'functions/display_messages.php'); +include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_config.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($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."),$color); + echo ''; +} +?> \ No newline at end of file