Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
8f669880
Commit
8f669880
authored
Nov 09, 2012
by
Stefan Seidel
Browse files
Fix WebDAV (and Android Client) not being able to authorize on Debian Squeeze + mod_fcgid installs.
parent
c0538636
Changes
3
Hide whitespace changes
Inline
Side-by-side
.htaccess
View file @
8f669880
<
IfModule
mod_fcgid.c
>
<
IfModule
mod_setenvif.c
>
<
IfModule
mod_headers.c
>
SetEnvIfNoCase
^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader
set
XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</
IfModule
>
</
IfModule
>
</
IfModule
>
ErrorDocument
403 /core/templates/403.php
ErrorDocument
404 /core/templates/404.php
<
IfModule
mod_php5.c
>
...
...
lib/base.php
View file @
8f669880
...
...
@@ -356,6 +356,10 @@ class OC{
//try to set the session lifetime to 60min
@
ini_set
(
'gc_maxlifetime'
,
'3600'
);
//copy http auth headers for apache+php-fcgid work around
if
(
isset
(
$_SERVER
[
'HTTP_XAUTHORIZATION'
])
&&
!
isset
(
$_SERVER
[
'HTTP_AUTHORIZATION'
]))
{
$_SERVER
[
'HTTP_AUTHORIZATION'
]
=
$_SERVER
[
'HTTP_XAUTHORIZATION'
];
}
//set http auth headers for apache+php-cgi work around
if
(
isset
(
$_SERVER
[
'HTTP_AUTHORIZATION'
])
&&
preg_match
(
'/Basic\s+(.*)$/i'
,
$_SERVER
[
'HTTP_AUTHORIZATION'
],
$matches
))
{
...
...
lib/setup.php
View file @
8f669880
...
...
@@ -573,7 +573,15 @@ class OC_Setup {
* create .htaccess files for apache hosts
*/
private
static
function
createHtaccess
()
{
$content
=
"ErrorDocument 403 "
.
OC
::
$WEBROOT
.
"/core/templates/403.php
\n
"
;
//custom 403 error page
$content
=
"<IfModule mod_fcgid.c>
\n
"
;
$content
.
=
"<IfModule mod_setenvif.c>
\n
"
;
$content
.
=
"<IfModule mod_headers.c>
\n
"
;
$content
.
=
"SetEnvIfNoCase ^Authorization$
\"
(.+)
\"
XAUTHORIZATION=$1
\n
"
;
$content
.
=
"RequestHeader set XAuthorization %
{
XAUTHORIZATION
}
e env=XAUTHORIZATION
\n
"
;
$content
.
=
"</IfModule>
\n
"
;
$content
.
=
"</IfModule>
\n
"
;
$content
.
=
"</IfModule>
\n
"
;
$content
.
=
"ErrorDocument 403 "
.
OC
::
$WEBROOT
.
"/core/templates/403.php
\n
"
;
//custom 403 error page
$content
.
=
"ErrorDocument 404 "
.
OC
::
$WEBROOT
.
"/core/templates/404.php
\n
"
;
//custom 404 error page
$content
.
=
"<IfModule mod_php5.c>
\n
"
;
$content
.
=
"php_value upload_max_filesize 512M
\n
"
;
//upload limit
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment