1<?php
2/* $Id: container.inc.php,v 1.25 2006/04/27 11:42:28 k-fish Exp $ */
3
4if (!defined('ROOTPATH')) die("This is a library.");
5
6//error_reporting(E_ERROR | E_WARNING | E_PARSE);
7//error_reporting(E_ALL);
8if (isset($myEnv["debug"])) {
9   error_reporting($myEnv["debug"]);
10   if (isset($myEnv["debug_to_screen"])) {
11      ini_set("display_errors",1);
12   }
13} else {
14   error_reporting(0);
15   ini_set("display_errors",0);
16}
17
18define('UACTIVE', 9);
19define('UDISABLED', 3);
20define('UDELETED', 0);
21
22require_once(SMARTY_DIR . "Smarty.class.php");
23
24// definition of moregroupware class, holding application vars
25include(INCLUDEPATH . 'mgw.class.php');
26
27// define path to JPGraph
28if(PHP_VERSION >= 5)
29    define('JPGRAPHPATH', INCLUDEPATH . 'jpgraph2/');
30else
31    define('JPGRAPHPATH', INCLUDEPATH . 'jpgraph1/');
32
33// tar functions
34require(INCLUDEPATH . 'tar/tar.class.php');
35
36// functions for translation
37include(INCLUDEPATH . 'lang.inc.php');
38
39// array for tracking file revision number used in sql error report screen
40$Revisions_array = Array();
41
42// important functions like connect to database
43include(INCLUDEPATH . 'userfunc.inc.php');
44
45// definition of moregroupware version and label
46include(INCLUDEPATH . 'version.inc.php');
47
48// Logging facilities
49include(INCLUDEPATH . 'log.inc.php');
50
51// Notify
52include(INCLUDEPATH . 'notify.inc.php');
53
54// Auto-Assigns for template engine and global definitions
55include(INCLUDEPATH . 'appconfig.inc.php');
56
57// check SSL status and redirect if needed
58if($appconf['forcessl'] == 1 && !(isset($_SERVER['HTTPS']))){
59    header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
60    exit();
61}
62
63// include module specific functions if present (they are now in module/inc)
64// must be named module_func.inc.php (i.e. calendar_func.inc.php)
65if(file_exists(ROOTPATH . "/modules/" . $myEnv["module"]. "/inc/" . $myEnv["module"] . "_func.inc.php")) {
66    include(ROOTPATH . "/modules/" . $myEnv["module"] . "/inc/" . $myEnv["module"] . "_func.inc.php");
67}
68
69// help system
70/*
71if(file_exists(ROOTPATH."/docs/html/".$_SESSION["MGW"]->spkz."/modules_".$myEnv["module"].".html"))
72    $smarty->assign("helpurl", ROOTURL."docs/html/".$_SESSION["MGW"]->spkz."/modules_".$myEnv["module"].".html");
73elseif(file_exists(ROOTPATH."/docs/html/en/modules_".$myEnv["module"].".html"))
74    $smarty->assign("helpurl", ROOTURL."docs/html/en/modules_".$myEnv["module"].".html");
75elseif(file_exists(ROOTPATH."/docs/html/nohelp.".$_SESSION["MGW"]->spkz.".html"))
76    $smarty->assign("helpurl", ROOTURL."docs/html/nohelp.".$_SESSION["MGW"]->spkz.".html");
77else
78    $smarty->assign("helpurl", ROOTURL."docs/html/nohelp.en.html");
79*/
80$smarty->assign("helpurl","http://www.moregroupware.com/wiki/");
81
82// include module autoexecution of several things like translation, authentication, and more
83include(INCLUDEPATH . 'module_exec.inc.php');
84?>
85