Skip to content
Snippets Groups Projects
Commit 161e6408 authored by Jared Hancock's avatar Jared Hancock
Browse files

Properly define ROOT_PATH

parent a2b70b49
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
vim: expandtab sw=4 ts=4 sts=4: vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/ **********************************************************************/
define('ROOT_PATH','../');
require_once('../client.inc.php'); require_once('../client.inc.php');
require_once(INCLUDE_DIR.'class.faq.php'); require_once(INCLUDE_DIR.'class.faq.php');
/* Bail out if knowledgebase is disabled or if we have no public-published FAQs. */ /* Bail out if knowledgebase is disabled or if we have no public-published FAQs. */
......
...@@ -60,7 +60,12 @@ ...@@ -60,7 +60,12 @@
} }
#Set Dir constants #Set Dir constants
if(!defined('ROOT_PATH')) define('ROOT_PATH','./'); //root path. Damn directories $here = substr(realpath(dirname(__file__)),
strlen($_SERVER['DOCUMENT_ROOT']));
// Determine the path in the URI used as the base of the osTicket
// installation
if (!defined('ROOT_PATH'))
define('ROOT_PATH', str_replace('\\', '/', $here.'/')); //root path. Damn directories
define('ROOT_DIR',str_replace('\\\\', '/', realpath(dirname(__FILE__))).'/'); #Get real path for root dir ---linux and windows define('ROOT_DIR',str_replace('\\\\', '/', realpath(dirname(__FILE__))).'/'); #Get real path for root dir ---linux and windows
define('INCLUDE_DIR',ROOT_DIR.'include/'); //Change this if include is moved outside the web path. define('INCLUDE_DIR',ROOT_DIR.'include/'); //Change this if include is moved outside the web path.
...@@ -127,8 +132,8 @@ ...@@ -127,8 +132,8 @@
require(INCLUDE_DIR.'mysql.php'); require(INCLUDE_DIR.'mysql.php');
#Cookies #Cookies
session_set_cookie_params(86400, dirname($_SERVER['PHP_SELF']), session_set_cookie_params(86400, ROOT_PATH, $_SERVER['HTTP_HOST'],
$_SERVER['HTTP_HOST'], osTicket::is_https()); osTicket::is_https());
#CURRENT EXECUTING SCRIPT. #CURRENT EXECUTING SCRIPT.
define('THISPAGE', Misc::currentURL()); define('THISPAGE', Misc::currentURL());
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
vim: expandtab sw=4 ts=4 sts=4: vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/ **********************************************************************/
@chdir(realpath(dirname(__file__).'/../')); @chdir(realpath(dirname(__file__).'/../'));
define('ROOT_PATH','../');
require_once('client.inc.php'); require_once('client.inc.php');
require_once(INCLUDE_DIR.'class.format.php'); require_once(INCLUDE_DIR.'class.format.php');
......
...@@ -17,7 +17,6 @@ if(basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) die('Access denied'); ...@@ -17,7 +17,6 @@ if(basename($_SERVER['SCRIPT_NAME'])==basename(__FILE__)) die('Access denied');
if(!file_exists('../main.inc.php')) die('Fatal error... get technical support'); if(!file_exists('../main.inc.php')) die('Fatal error... get technical support');
define('ROOT_PATH','../'); //Path to the root dir.
require_once('../main.inc.php'); require_once('../main.inc.php');
if(!defined('INCLUDE_DIR')) die('Fatal error... invalid setting.'); if(!defined('INCLUDE_DIR')) die('Fatal error... invalid setting.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment