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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
87de5396
Commit
87de5396
authored
15 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Create htaccess file by default into document if not already exists
parent
c681e267
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/install/check.php
+17
-10
17 additions, 10 deletions
htdocs/install/check.php
htdocs/install/etape1.php
+19
-3
19 additions, 3 deletions
htdocs/install/etape1.php
with
36 additions
and
13 deletions
htdocs/install/check.php
+
17
−
10
View file @
87de5396
...
@@ -151,22 +151,29 @@ if ($memmaxorig != '')
...
@@ -151,22 +151,29 @@ if ($memmaxorig != '')
}
}
//
Si fichier present et lisible et renseigne
//
If config file presente and filled
clearstatcache
();
clearstatcache
();
if
(
is_readable
(
$conffile
)
&&
filesize
(
$conffile
)
>
8
)
if
(
is_readable
(
$conffile
)
&&
filesize
(
$conffile
)
>
8
)
{
{
dolibarr_install_syslog
(
"check: conf file '
$conffile
' already
exists
"
);
dolibarr_install_syslog
(
"check: conf file '
$conffile
' already
defined
"
);
$confexists
=
1
;
$confexists
=
1
;
include_once
(
$conffile
);
include_once
(
$conffile
);
// Deja install�, on peut upgrader
$databaseok
=
1
;
// TODO Check if database is ok
// \todo Test if database ok
if
(
$databaseok
)
{
// Already installed for all parts (config and database). We can propose upgrade.
$allowupgrade
=
1
;
$allowupgrade
=
1
;
}
}
else
else
{
{
// Si non on le cr�e
$allowupgrade
=
0
;
dolibarr_install_syslog
(
"check: we try to creat conf file '
$conffile
'"
);
}
}
else
{
// If not, we create it
dolibarr_install_syslog
(
"check: we try to create conf file '
$conffile
'"
);
$confexists
=
0
;
$confexists
=
0
;
# First we try by copying example
# First we try by copying example
...
@@ -196,7 +203,7 @@ else
...
@@ -196,7 +203,7 @@ else
// Si fichier absent et n'a pu etre cr
��
// Si fichier absent et n'a pu etre cr
ee
if
(
!
file_exists
(
$conffile
))
if
(
!
file_exists
(
$conffile
))
{
{
//print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffile);
//print '<img src="../theme/eldy/img/error.png" alt="Error"> '.$langs->trans("ConfFileDoesNotExistsAndCouldNotBeCreated",$conffile);
...
@@ -210,7 +217,7 @@ if (! file_exists($conffile))
...
@@ -210,7 +217,7 @@ if (! file_exists($conffile))
}
}
else
else
{
{
// Si fichier pr
�
sent mais ne peut etre modifi
�
// Si fichier pr
e
sent mais ne peut etre modifi
e
if
(
!
is_writable
(
$conffile
))
if
(
!
is_writable
(
$conffile
))
{
{
if
(
$confexists
)
if
(
$confexists
)
...
@@ -246,7 +253,7 @@ else
...
@@ -246,7 +253,7 @@ else
}
}
print
"<br />
\n
"
;
print
"<br />
\n
"
;
// Si prerequis ok, on affiche le bouton pour passer
�
l'
�
tape suivante
// Si prerequis ok, on affiche le bouton pour passer
a
l'
e
tape suivante
if
(
$checksok
)
if
(
$checksok
)
{
{
$ok
=
0
;
$ok
=
0
;
...
...
This diff is collapsed.
Click to expand it.
htdocs/install/etape1.php
+
19
−
3
View file @
87de5396
...
@@ -64,7 +64,7 @@ if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/")
...
@@ -64,7 +64,7 @@ if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/")
$_POST
[
"main_url"
]
=
substr
(
$_POST
[
"main_url"
],
0
,
strlen
(
$_POST
[
"main_url"
])
-
1
);
$_POST
[
"main_url"
]
=
substr
(
$_POST
[
"main_url"
],
0
,
strlen
(
$_POST
[
"main_url"
])
-
1
);
}
}
//
R�pertoire des documents g�n�r�s (factures
, etc...)
//
Directory for generated documents (invoices, orders, ecm
, etc...)
$main_data_dir
=
isset
(
$_POST
[
"main_data_dir"
])
?
$_POST
[
"main_data_dir"
]
:
''
;
$main_data_dir
=
isset
(
$_POST
[
"main_data_dir"
])
?
$_POST
[
"main_data_dir"
]
:
''
;
if
(
!
$main_data_dir
)
{
$main_data_dir
=
"
$main_dir
/documents"
;
}
if
(
!
$main_data_dir
)
{
$main_data_dir
=
"
$main_dir
/documents"
;
}
...
@@ -120,7 +120,7 @@ if ($_POST["action"] == "set")
...
@@ -120,7 +120,7 @@ if ($_POST["action"] == "set")
// Create subdirectory main_data_dir
// Create subdirectory main_data_dir
if
(
!
$error
)
if
(
!
$error
)
{
{
//
R�pertoire des
documents
//
Create directory for
documents
if
(
!
is_dir
(
$main_data_dir
))
if
(
!
is_dir
(
$main_data_dir
))
{
{
create_exdir
(
$main_data_dir
);
create_exdir
(
$main_data_dir
);
...
@@ -138,7 +138,23 @@ if ($_POST["action"] == "set")
...
@@ -138,7 +138,23 @@ if ($_POST["action"] == "set")
}
}
else
else
{
{
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre t�l�charg�s en passant outre l'authentification
// Create .htaccess file in document directory
$pathhtaccess
=
$main_data_dir
.
'/.htaccess'
;
if
(
!
file_exists
(
$pathhtaccess
))
{
dolibarr_install_syslog
(
"etape1: .htaccess file does not exists, we create it in '"
.
$main_data_dir
.
"'"
);
$handlehtaccess
=@
fopen
(
$pathhtaccess
,
'w'
);
if
(
$handlehtaccess
)
{
fwrite
(
$handlehtaccess
,
'Order allow,deny'
.
"
\n
"
);
fwrite
(
$handlehtaccess
,
'Deny from all'
.
"
\n
"
);
fclose
(
$handlehtaccess
);
dolibarr_install_syslog
(
"etape1: .htaccess file created"
);
}
}
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre telecharges en passant outre l'authentification
$dir
[
0
]
=
"
$main_data_dir
/facture"
;
$dir
[
0
]
=
"
$main_data_dir
/facture"
;
$dir
[
1
]
=
"
$main_data_dir
/users"
;
$dir
[
1
]
=
"
$main_data_dir
/users"
;
$dir
[
2
]
=
"
$main_data_dir
/propale"
;
$dir
[
2
]
=
"
$main_data_dir
/propale"
;
...
...
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