New: Add option dolibarr_main_force_https
This commit is contained in:
parent
baa5f74fbd
commit
68c09f00ec
@ -90,6 +90,25 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
|||||||
|
|
||||||
require_once("master.inc.php");
|
require_once("master.inc.php");
|
||||||
|
|
||||||
|
// Check if HTTPS
|
||||||
|
if ($conf->main_force_https)
|
||||||
|
{
|
||||||
|
if (eregi('^http:',$_SERVER["SCRIPT_URI"]) && ! eregi('^https:',$_SERVER["SCRIPT_URI"]))
|
||||||
|
{
|
||||||
|
if ($_SERVER["HTTPS"] != 'on')
|
||||||
|
{
|
||||||
|
dolibarr_syslog("dolibarr_main_force_https is on but https disabled on serveur",LOG_ERR);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dolibarr_syslog("dolibarr_main_force_https is on, we make a redirect",LOG_DEBUG);
|
||||||
|
$newurl=eregi_replace('^http:','https:',$_SERVER["SCRIPT_URI"]);
|
||||||
|
|
||||||
|
header("Location: ".$newurl);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Chargement des includes complementaire de presentation
|
// Chargement des includes complementaire de presentation
|
||||||
if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); // Need 11ko memory
|
if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); // Need 11ko memory
|
||||||
|
|||||||
@ -133,6 +133,8 @@ if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation='latin1_swed
|
|||||||
$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation;
|
$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation;
|
||||||
// Identifiant autres
|
// Identifiant autres
|
||||||
$conf->main_authentication = $dolibarr_main_authentication;
|
$conf->main_authentication = $dolibarr_main_authentication;
|
||||||
|
// Force https
|
||||||
|
$conf->main_force_https = $dolibarr_main_force_https;
|
||||||
// Identifiant propre au client
|
// Identifiant propre au client
|
||||||
if (empty($character_set_client)) $character_set_client='ISO-8859-1';
|
if (empty($character_set_client)) $character_set_client='ISO-8859-1';
|
||||||
$conf->character_set_client=$character_set_client;
|
$conf->character_set_client=$character_set_client;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user