XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
mainfile.dist.php
Go to the documentation of this file.
1 <?php
17 if (!defined("XOOPS_MAINFILE_INCLUDED")) {
18  define("XOOPS_MAINFILE_INCLUDED", 1);
19 
20  // XOOPS Physical Paths
21 
22  // Physical path to the XOOPS documents (served) directory WITHOUT trailing slash
23  define("XOOPS_ROOT_PATH", "");
24 
25  // For forward compatibility
26  // Physical path to the XOOPS library directory WITHOUT trailing slash
27  define("XOOPS_PATH", "");
28  // Physical path to the XOOPS datafiles (writable) directory WITHOUT trailing slash
29  define("XOOPS_VAR_PATH", "");
30  // Alias of XOOPS_PATH, for compatibility, temporary solution
31  define("XOOPS_TRUST_PATH", XOOPS_PATH);
32 
33  // URL Association for SSL and Protocol Compatibility
34  $http = 'http://';
35  if (!empty($_SERVER['HTTPS'])) {
36  $http = ($_SERVER['HTTPS']=='on') ? 'https://' : 'http://';
37  }
38  define('XOOPS_PROT', $http);
39 
40  // XOOPS Virtual Path (URL)
41  // Virtual path to your main XOOPS directory WITHOUT trailing slash
42  // Example: define("XOOPS_URL", "http://url_to_xoops_directory");
43  define("XOOPS_URL", "http://");
44 
45  // Shall be handled later, don't forget!
46  define("XOOPS_CHECK_PATH", 0);
47  // Protect against external scripts execution if safe mode is not enabled
48  if (XOOPS_CHECK_PATH && !@ini_get("safe_mode")) {
49  if (function_exists("debug_backtrace")) {
50  $xoopsScriptPath = debug_backtrace();
51  if (!count($xoopsScriptPath)) {
52  die("XOOPS path check: this file cannot be requested directly");
53  }
54  $xoopsScriptPath = $xoopsScriptPath[0]["file"];
55  } else {
56  $xoopsScriptPath = isset($_SERVER["PATH_TRANSLATED"]) ? $_SERVER["PATH_TRANSLATED"] : $_SERVER["SCRIPT_FILENAME"];
57  }
58  if (DIRECTORY_SEPARATOR != "/") {
59  // IIS6 may double the \ chars
60  $xoopsScriptPath = str_replace(strpos($xoopsScriptPath, "\\\\", 2) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $xoopsScriptPath);
61  }
62  if (strcasecmp(substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace(DIRECTORY_SEPARATOR, "/", XOOPS_ROOT_PATH))) {
63  exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
64  }
65  }
66 
67  // Secure file
68  require XOOPS_VAR_PATH . '/data/secure.php';
69 
70  define("XOOPS_GROUP_ADMIN", "1");
71  define("XOOPS_GROUP_USERS", "2");
72  define("XOOPS_GROUP_ANONYMOUS", "3");
73 
74  if (!isset($xoopsOption["nocommon"]) && XOOPS_ROOT_PATH != "") {
75  include XOOPS_ROOT_PATH."/include/common.php";
76  }
77 
78 }
79 
80 ?>