X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fsqspell_interface.php;h=6e3b71be3903471fe9b35898c5d74acbe1285df2;hp=8f42804083bddbff6e06186d15028601e3f580c6;hb=9f07fa5d6c1a2e29691fac9772bc4e7cf980b9ff;hpb=cd7fc9e62a5b4a32a4f75df7555ef6575f7956f9 diff --git a/plugins/squirrelspell/sqspell_interface.php b/plugins/squirrelspell/sqspell_interface.php index 8f428040..6e3b71be 100644 --- a/plugins/squirrelspell/sqspell_interface.php +++ b/plugins/squirrelspell/sqspell_interface.php @@ -1,54 +1,56 @@ ($Author$) - * @version $Date$ + * @author Konstantin Riabitsev + * @version $Id$ + * @package plugins + * @subpackage squirrelspell */ -/** +/** * Set up a couple of non-negotiable constants and * defaults. Don't change these, * the setuppable stuff is in * sqspell_config.php */ $SQSPELL_DIR='plugins/squirrelspell/'; $SQSPELL_CRYPTO=FALSE; - + /** - * Load the stuff needed from squirrelmail + * Load the stuff needed 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 . $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_config.php'); +include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php'); + /** * $MOD is the name of the module to invoke. - * If $MOD is undefined, use "init", else check for security - * breaches. + * If $MOD is unspecified, assign "init" to it. Else check for + * security breach attempts. */ -if (!isset($MOD) || !$MOD){ - $MOD='init'; -} else { - sqspell_ckMOD($MOD); +if(! sqgetGlobalVar('MOD',$MOD,SQ_FORM)) { + $MOD = 'init'; } +sqspell_ckMOD($MOD); -/* Include the module. */ -require_once(SM_PATH . $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