Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
82b10954
Commit
82b10954
authored
12 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
Simplify loading app php script files
parent
5e7086ad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/base.php
+16
-28
16 additions, 28 deletions
lib/base.php
with
16 additions
and
28 deletions
lib/base.php
+
16
−
28
View file @
82b10954
...
@@ -409,10 +409,15 @@ class OC{
...
@@ -409,10 +409,15 @@ class OC{
OC_User
::
logout
();
OC_User
::
logout
();
header
(
"Location: "
.
OC
::
$WEBROOT
.
'/'
);
header
(
"Location: "
.
OC
::
$WEBROOT
.
'/'
);
}
else
{
}
else
{
if
(
is_null
(
OC
::
$REQUESTEDFILE
))
{
$app
=
OC
::
$REQUESTEDAPP
;
self
::
loadapp
();
$file
=
OC
::
$REQUESTEDFILE
;
}
else
{
if
(
is_null
(
$file
))
{
self
::
loadfile
();
$file
=
'index.php'
;
}
$file_ext
=
substr
(
$file
,
-
3
);
if
(
$file_ext
!=
'php'
||
!
self
::
loadAppScriptFile
(
$app
,
$file
))
{
header
(
'HTTP/1.0 404 Not Found'
);
}
}
}
}
return
;
return
;
...
@@ -421,32 +426,15 @@ class OC{
...
@@ -421,32 +426,15 @@ class OC{
self
::
handleLogin
();
self
::
handleLogin
();
}
}
protected
static
function
loadapp
()
{
protected
static
function
loadAppScriptFile
(
$app
,
$file
)
{
if
(
file_exists
(
OC_App
::
getAppPath
(
OC
::
$REQUESTEDAPP
)
.
'/index.php'
))
{
require_once
(
OC_App
::
getAppPath
(
OC
::
$REQUESTEDAPP
)
.
'/index.php'
);
}
else
{
trigger_error
(
'The requested App was not found.'
,
E_USER_ERROR
);
//load default app instead?
}
}
protected
static
function
loadfile
()
{
$app
=
OC
::
$REQUESTEDAPP
;
$file
=
OC
::
$REQUESTEDFILE
;
$app_path
=
OC_App
::
getAppPath
(
$app
);
$app_path
=
OC_App
::
getAppPath
(
$app
);
if
(
file_exists
(
$app_path
.
'/'
.
$file
))
{
$file_ext
=
substr
(
$file
,
-
3
);
if
(
$file_ext
==
'php'
)
{
$file
=
$app_path
.
'/'
.
$file
;
$file
=
$app_path
.
'/'
.
$file
;
unset
(
$app
,
$app_path
,
$app_web_path
,
$file_ext
);
unset
(
$app
,
$app_path
);
if
(
file_exists
(
$file
))
{
require_once
(
$file
);
require_once
(
$file
);
return
true
;
}
}
}
return
false
;
else
{
die
();
header
(
'HTTP/1.0 404 Not Found'
);
exit
;
}
}
}
protected
static
function
loadCSSFile
()
{
protected
static
function
loadCSSFile
()
{
...
...
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