From d9dea81e75bbfc2b1ad1fb1d0e6ce17ceaf3666e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 4 Mar 2011 11:42:06 +0000 Subject: [PATCH] Fix: Enabled if the installation process is "https://" Fix: use complete alternative url --- htdocs/install/etape0.php | 1 + htdocs/install/etape1.php | 8 ++++---- htdocs/install/fileconf.php | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/install/etape0.php b/htdocs/install/etape0.php index a5d43421004..8b059747148 100644 --- a/htdocs/install/etape0.php +++ b/htdocs/install/etape0.php @@ -1,6 +1,7 @@ * Copyright (C) 2007-2010 Laurent Destailleur + * Copyright (C) 2010-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 7753aad853a..9b8578d6568 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,7 +204,7 @@ if ($_POST["action"] == "set") } // Force https - $_POST["main_force_https"] = ((isset($_POST["main_force_https"]) && $_POST["main_force_https"] == "on")?'1':'0'); + $main_force_https = ( (GETPOST("main_force_https") && (GETPOST("main_force_https") == "on" || GETPOST("main_force_https") == 1)) ? '1' : '0'); /** * Write conf file on disk @@ -535,7 +535,7 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_main_document_root=\''.addslashes($main_dir).'\';'); fputs($fp,"\n"); - fputs($fp, '#$dolibarr_main_url_root_alt=\''.addslashes("/custom").'\';'); + fputs($fp, '#$dolibarr_main_url_root_alt=\''.addslashes($_POST["main_url"]."/custom").'\';'); fputs($fp,"\n"); fputs($fp, '#$dolibarr_main_document_root_alt=\''.addslashes($main_dir."/custom").'\';'); @@ -581,7 +581,7 @@ function write_conf_file($conffile) fputs($fp, '$dolibarr_nocsrfcheck=\'0\';'); fputs($fp,"\n"); - fputs($fp, '$dolibarr_main_force_https=\''.$_POST["main_force_https"].'\';'); + fputs($fp, '$dolibarr_main_force_https=\''.$main_force_https.'\';'); fputs($fp,"\n"); fputs($fp, '$dolibarr_main_cookie_cryptkey=\''.$key.'\';'); diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 135eaf359c7..ad5cde2ad35 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -4,7 +4,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien DiCintio - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -211,7 +211,7 @@ if (empty($dolibarr_main_url_root)) trans("ForceHttps"); ?>