Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
45fdfa82
Commit
45fdfa82
authored
11 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
Define ROOT_PATH in chrooted environments too
parent
acd4f06d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/class.misc.php
+10
-14
10 additions, 14 deletions
include/class.misc.php
main.inc.php
+7
-8
7 additions, 8 deletions
main.inc.php
with
17 additions
and
22 deletions
include/class.misc.php
+
10
−
14
View file @
45fdfa82
...
@@ -139,21 +139,17 @@ class Misc {
...
@@ -139,21 +139,17 @@ class Misc {
return
$output
;
return
$output
;
}
}
function
siteBaseUrl
()
{
/* static */
# Detects Alias-ing
function
siteRootPath
(
$main_inc_path
)
{
$paths
=
explode
(
'/'
,
$_SERVER
[
'REQUEST_URI'
]);
$root
=
str_replace
(
'\\'
,
'/'
,
$main_inc_path
);
# Drop the last item -- it will be the php page we're on
$root2
=
str_replace
(
'\\'
,
'/'
,
$_SERVER
[
'DOCUMENT_ROOT'
]);
array_pop
(
$paths
);
$path
=
''
;
$leading
=
array
();
while
(
strpos
(
$_SERVER
[
'DOCUMENT_ROOT'
],
$root
)
===
false
)
{
while
(
count
(
$paths
))
{
$lastslash
=
strrpos
(
$root
,
'/'
);
if
(
in_array
(
$paths
[
0
],
array
(
'scp'
,
'client'
)))
$path
=
substr
(
$root
,
$lastslash
)
.
$path
;
break
;
$root
=
substr
(
$root
,
0
,
$lastslash
);
$leading
[]
=
array_shift
(
$paths
);
}
}
if
(
count
(
$leading
)
>
1
)
return
$path
;
return
implode
(
'/'
,
$leading
);
else
return
''
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
main.inc.php
+
7
−
8
View file @
45fdfa82
...
@@ -60,13 +60,6 @@
...
@@ -60,13 +60,6 @@
}
}
#Set Dir constants
#Set Dir constants
$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.
define
(
'PEAR_DIR'
,
INCLUDE_DIR
.
'pear/'
);
define
(
'PEAR_DIR'
,
INCLUDE_DIR
.
'pear/'
);
...
@@ -75,6 +68,13 @@
...
@@ -75,6 +68,13 @@
define
(
'UPGRADE_DIR'
,
INCLUDE_DIR
.
'upgrader/'
);
define
(
'UPGRADE_DIR'
,
INCLUDE_DIR
.
'upgrader/'
);
define
(
'I18N_DIR'
,
INCLUDE_DIR
.
'i18n/'
);
define
(
'I18N_DIR'
,
INCLUDE_DIR
.
'i18n/'
);
require
(
INCLUDE_DIR
.
'class.misc.php'
);
// Determine the path in the URI used as the base of the osTicket
// installation
if
(
!
defined
(
'ROOT_PATH'
))
define
(
'ROOT_PATH'
,
Misc
::
siteRootPath
(
realpath
(
dirname
(
__file__
)))
.
'/'
);
//root path. Damn directories
/*############## Do NOT monkey with anything else beyond this point UNLESS you really know what you are doing ##############*/
/*############## Do NOT monkey with anything else beyond this point UNLESS you really know what you are doing ##############*/
#Current version && schema signature (Changes from version to version)
#Current version && schema signature (Changes from version to version)
...
@@ -117,7 +117,6 @@
...
@@ -117,7 +117,6 @@
require
(
INCLUDE_DIR
.
'class.pagenate.php'
);
//Pagenate helper!
require
(
INCLUDE_DIR
.
'class.pagenate.php'
);
//Pagenate helper!
require
(
INCLUDE_DIR
.
'class.log.php'
);
require
(
INCLUDE_DIR
.
'class.log.php'
);
require
(
INCLUDE_DIR
.
'class.crypto.php'
);
require
(
INCLUDE_DIR
.
'class.crypto.php'
);
require
(
INCLUDE_DIR
.
'class.misc.php'
);
require
(
INCLUDE_DIR
.
'class.timezone.php'
);
require
(
INCLUDE_DIR
.
'class.timezone.php'
);
require
(
INCLUDE_DIR
.
'class.http.php'
);
require
(
INCLUDE_DIR
.
'class.http.php'
);
require
(
INCLUDE_DIR
.
'class.signal.php'
);
require
(
INCLUDE_DIR
.
'class.signal.php'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment