a899ad037d1fe688a7fc4c3a4f6a680814e8e4f4
[squirrelmail.git] / plugins / squirrelspell / sqspell_interface.php
1 <?php
2 /**
3 * sqspell_interface.php
4 *
5 * Main wrapper for the pop-up.
6 *
7 * Copyright (c) 1999-2005 The SquirrelMail Project Team
8 * Licensed under the GNU GPL. For full terms see the file COPYING.
9 *
10 * This is a main wrapper for the pop-up window interface of
11 * SquirrelSpell.
12 *
13 * @author Konstantin Riabitsev <icon@duke.edu>
14 * @version $Id$
15 * @package plugins
16 * @subpackage squirrelspell
17 */
18
19 /**
20 * Set up a couple of non-negotiable constants and
21 * defaults. Don't change these, * the setuppable stuff is in
22 * sqspell_config.php
23 */
24 $SQSPELL_DIR='plugins/squirrelspell/';
25 $SQSPELL_CRYPTO=FALSE;
26
27 /**
28 * Load the stuff needed from SquirrelMail
29 * @ignore
30 */
31 define('SM_PATH','../../');
32
33 /* SquirrelMail required files. */
34 require_once(SM_PATH . 'include/validate.php');
35 include_once(SM_PATH . 'functions/display_messages.php');
36 include_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php');
37
38 /**
39 * $MOD is the name of the module to invoke.
40 * If $MOD is unspecified, assign "init" to it. Else check for
41 * security breach attempts.
42 */
43 if(! sqgetGlobalVar('MOD',$MOD,SQ_FORM)) {
44 $MOD = 'init';
45 }
46 sqspell_ckMOD($MOD);
47
48 /* Load the stuff already. */
49 if (file_exists(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod")) {
50 require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod");
51 } else {
52 error_box(_("Invalid SquirrelSpell module."),$color);
53 echo '</body></html>';
54 }
55 ?>