Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
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
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
85635cde
Commit
85635cde
authored
14 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Allow to disable CSRF permission
parent
7948b0e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/conf/conf.php.example
+9
-0
9 additions, 0 deletions
htdocs/conf/conf.php.example
htdocs/master.inc.php
+5
-6
5 additions, 6 deletions
htdocs/master.inc.php
with
14 additions
and
6 deletions
htdocs/conf/conf.php.example
+
9
−
0
View file @
85635cde
...
...
@@ -181,6 +181,15 @@ $dolibarr_main_authentication='dolibarr';
#
$dolibarr_main_force_https='0';
# dolibarr_nocsrfcheck
# This parameter can be used to disable CSRF protection.
# This might be required if you access Dolibarr behind a proxy that make
# URL rewriting to avoid false alarms.
# Default value: 0
# Possible values: 0 or 1
# Examples:
# $dolibarr_nocsrfcheck='0';
#
##################
...
...
This diff is collapsed.
Click to expand it.
htdocs/master.inc.php
+
5
−
6
View file @
85635cde
...
...
@@ -76,22 +76,21 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do
if
(
!
defined
(
'NOCSRFCHECK'
)
&&
empty
(
$dolibarr_nocsrfcheck
)
&&
!
empty
(
$_SERVER
[
'REQUEST_METHOD'
])
&&
$_SERVER
[
'REQUEST_METHOD'
]
!=
'GET'
&&
!
empty
(
$_SERVER
[
'HTTP_HOST'
])
&&
!
empty
(
$_SERVER
[
'HTTP_REFERER'
])
&&
!
preg_match
(
'/'
.
preg_quote
(
$_SERVER
[
'HTTP_HOST'
],
'/'
)
.
'/i'
,
$_SERVER
[
'HTTP_REFERER'
]))
{
//print 'HTTP_POST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER'];
print
"Access refused by CSRF protection in main.inc.php
\n
"
;
print
"If you access your server behind a proxy using url rewriting, you might add the line
\$
dolibarr_nocsrfcheck=1 into your conf.php file."
;
exit
;
print
"Access refused by CSRF protection in main.inc.php
.
\n
"
;
print
"If you access your server behind a proxy using url rewriting, you might add the line
\$
dolibarr_nocsrfcheck=1 into your conf.php file.
\n
"
;
die
;
}
if
(
empty
(
$dolibarr_main_db_host
))
{
print
'Dolibarr setup was run but was not completed.<br>'
.
"
\n
"
;
print
'Please, click <a href="install/index.php">here to finish Dolibarr install process</a> ...'
.
"
\n
"
;
exit
;
die
;
}
if
(
empty
(
$dolibarr_main_url_root
))
{
print
'Value for parameter \'dolibarr_main_url_root\' is not defined in your \'htdocs\conf\conf.php\' file.<br>'
.
"
\n
"
;
print
'You must add this parameter with your full Dolibarr root Url (Example: http://myvirtualdomain/ or http://mydomain/mydolibarrurl/)'
.
"
\n
"
;
exit
;
die
;
}
if
(
empty
(
$dolibarr_main_db_type
))
$dolibarr_main_db_type
=
'mysql'
;
// Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
if
(
empty
(
$dolibarr_main_data_root
))
...
...
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