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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
c958d5ba
Commit
c958d5ba
authored
12 years ago
by
Bart Visscher
Browse files
Options
Downloads
Patches
Plain Diff
Fix filesystem setup for shared public link with logged in user
parent
301baf02
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_sharing/public.php
+1
-2
1 addition, 2 deletions
apps/files_sharing/public.php
lib/util.php
+12
-6
12 additions, 6 deletions
lib/util.php
with
13 additions
and
8 deletions
apps/files_sharing/public.php
+
1
−
2
View file @
c958d5ba
...
...
@@ -5,7 +5,6 @@ if (isset($_GET['file'])) {
$pos
=
strpos
(
$_GET
[
'file'
],
'/'
,
1
);
$uidOwner
=
substr
(
$_GET
[
'file'
],
1
,
$pos
-
1
);
if
(
OCP\User
::
userExists
(
$uidOwner
))
{
OC_Util
::
tearDownFS
();
OC_Util
::
setupFS
(
$uidOwner
);
$file
=
substr
(
$_GET
[
'file'
],
$pos
);
$fileSource
=
OC_Filecache
::
getId
(
$_GET
[
'file'
],
''
);
...
...
@@ -73,4 +72,4 @@ if (isset($_GET['file'])) {
}
header
(
'HTTP/1.0 404 Not Found'
);
$tmpl
=
new
OCP\Template
(
''
,
'404'
,
'guest'
);
$tmpl
->
printPage
();
\ No newline at end of file
$tmpl
->
printPage
();
This diff is collapsed.
Click to expand it.
lib/util.php
+
12
−
6
View file @
c958d5ba
...
...
@@ -19,6 +19,18 @@ class OC_Util {
return
false
;
}
// If we are not forced to load a specific user we load the one that is logged in
if
(
$user
==
""
&&
OC_User
::
isLoggedIn
()){
$user
=
OC_User
::
getUser
();
}
// the filesystem will finish when $user is not empty,
// mark fs setup here to avoid doing the setup from loading
// OC_Filesystem
if
(
$user
!=
''
)
{
self
::
$fsSetup
=
true
;
}
$CONFIG_DATADIRECTORY
=
OC_Config
::
getValue
(
"datadirectory"
,
OC
::
$SERVERROOT
.
"/data"
);
//first set up the local "root" storage
if
(
!
self
::
$rootMounted
){
...
...
@@ -26,11 +38,6 @@ class OC_Util {
self
::
$rootMounted
=
true
;
}
// If we are not forced to load a specific user we load the one that is logged in
if
(
$user
==
""
&&
OC_User
::
isLoggedIn
()){
$user
=
OC_User
::
getUser
();
}
if
(
$user
!=
""
){
//if we aren't logged in, there is no use to set up the filesystem
$user_dir
=
'/'
.
$user
.
'/files'
;
$user_root
=
OC_User
::
getHome
(
$user
);
...
...
@@ -43,7 +50,6 @@ class OC_Util {
OC_Filesystem
::
init
(
$user_dir
);
$quotaProxy
=
new
OC_FileProxy_Quota
();
OC_FileProxy
::
register
(
$quotaProxy
);
self
::
$fsSetup
=
true
;
// Load personal mount config
if
(
is_file
(
$user_root
.
'/mount.php'
))
{
$mountConfig
=
include
(
$user_root
.
'/mount.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