Need chdir in plugins when data_dir is relative
[squirrelmail.git] / plugins / squirrelspell / sqspell_interface.php
1 <?php
2
3 /**
4 * sqspell_interface.php
5 *
6 * Main wrapper for the pop-up.
7 *
8 * Copyright (c) 1999-2002 The SquirrelMail development team
9 * Licensed under the GNU GPL. For full terms see the file COPYING.
10 *
11 * This is a main wrapper for the pop-up window interface of
12 * SquirrelSpell.
13 *
14 * $Id$
15 *
16 * @author Konstantin Riabitsev <icon@duke.edu> ($Author$)
17 * @version $Date$
18 */
19
20 /**
21 * Set up a couple of non-negotiable constants and
22 * defaults. Don't change these, * the setuppable stuff is in
23 * sqspell_config.php
24 */
25 $SQSPELL_DIR='plugins/squirrelspell/';
26 $SQSPELL_CRYPTO=FALSE;
27
28 /**
29 * Load the stuff needed from squirrelmail
30 */
31
32 chdir('..');
33 define('SM_PATH','../');
34
35 /* SquirrelMail required files. */
36 require_once(SM_PATH . 'include/validate.php');
37 require_once(SM_PATH . 'include/load_prefs.php');
38 require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_config.php');
39 require_once(SM_PATH . $SQSPELL_DIR . 'sqspell_functions.php');
40
41 /**
42 * $MOD is the name of the module to invoke.
43 * If $MOD is undefined, use "init", else check for security
44 * breaches.
45 */
46 if (!isset($MOD) || !$MOD){
47 $MOD='init';
48 } else {
49 sqspell_ckMOD($MOD);
50 }
51
52 /* Include the module. */
53 require_once(SM_PATH . $SQSPELL_DIR . "modules/$MOD.mod");
54
55 ?>