diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 5998c00eaf0..6c779950ee6 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -70,15 +70,12 @@ div.main-inside { margin-top: 10px; } - div.error { - font-size: 1.3em; - padding: 10px; - margin-top: 10px; - border: 1px solid red; - } - - + color: #550000; font-weight: bold; + padding: 0.2em 0.2em 0.2em 0.2em; + margin: 0.5em 0em 0.5em 0em; + border: 1px solid #6C7C8B; +} div.barrebottom { text-align: right; diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 0a96b20a38c..1e9423d4345 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -1,7 +1,8 @@ - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2004 Sebastien DiCintio +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2004 Sebastien DiCintio + * Copyright (C) 2004-2005 Laurent Destailleur * * 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 @@ -24,7 +25,7 @@ /** \file htdocs/install/etape4.php - \brief Demande le login et mode de passe de l'administrateur Dolibarr + \brief Demande le login et mot de passe de l'administrateur Dolibarr \version $Revision$ */ @@ -52,7 +53,7 @@ else require ($dolibarr_main_document_root . "/conf/conf.class.php"); -print ''; +print '
'; $err=0; @@ -78,11 +79,13 @@ if ($db->ok == 1) if (isset($_GET["error"]) && $_GET["error"] == 1) { + print '
'; print '
'.$langs->trans("PasswordsMismatch").'
'; } if (isset($_GET["error"]) && $_GET["error"] == 2) { + print '
'; print '
'; print $langs->trans("PleaseTypePassword"); print '
'; @@ -90,6 +93,7 @@ if ($db->ok == 1) if (isset($_GET["error"]) && $_GET["error"] == 3) { + print '
'; print '
'.$langs->trans("PleaseTypeALogin").'
'; } diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index c6658da0d8b..c7a0c216f35 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2005 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien DiCintio @@ -20,10 +20,10 @@ * * $Id$ * $Source$ - * */ -/** \file htdocs/install/etape5.php +/** + \file htdocs/install/etape5.php \brief Page de fin d'installation \version $Revision$ */ @@ -39,76 +39,89 @@ $success=0; if (file_exists($conffile)) { - include($conffile); + include($conffile); } if($dolibarr_main_db_type == "mysql") - require ($dolibarr_main_document_root . "/lib/mysql.lib.php"); + require ($dolibarr_main_document_root . "/lib/mysql.lib.php"); else - require ($dolibarr_main_document_root . "/lib/pgsql.lib.php"); - + require ($dolibarr_main_document_root . "/lib/pgsql.lib.php"); + require ($dolibarr_main_document_root . "/conf/conf.class.php"); + if ($_POST["action"] == "set") { - if ($_POST["pass"] <> $_POST["pass_verif"]) + if ($_POST["pass"] <> $_POST["pass_verif"]) { - Header("Location: etape4.php?error=1&selectlang=$setuplang"); + Header("Location: etape4.php?error=1&selectlang=$setuplang"); } - if (strlen(trim($_POST["pass"])) == 0) + if (strlen(trim($_POST["pass"])) == 0) { - Header("Location: etape4.php?error=2&selectlang=$setuplang"); + Header("Location: etape4.php?error=2&selectlang=$setuplang"); } - if (strlen(trim($_POST["login"])) == 0) + if (strlen(trim($_POST["login"])) == 0) { - Header("Location: etape4.php?error=3&selectlang=$setuplang"); + Header("Location: etape4.php?error=3&selectlang=$setuplang"); } - pHeader($langs->trans("SetupEnd"),"etape5"); + pHeader($langs->trans("SetupEnd"),"etape5"); - print '
'; - $error=0; + print '
'; + $error=0; - $conf = new Conf(); - $conf->db->type = $dolibarr_main_db_type; - $conf->db->host = $dolibarr_main_db_host; - $conf->db->name = $dolibarr_main_db_name; - $conf->db->user = $dolibarr_main_db_user; - $conf->db->pass = $dolibarr_main_db_pass; + $conf = new Conf(); + $conf->db->type = $dolibarr_main_db_type; + $conf->db->host = $dolibarr_main_db_host; + $conf->db->name = $dolibarr_main_db_name; + $conf->db->user = $dolibarr_main_db_user; + $conf->db->pass = $dolibarr_main_db_pass; - $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); - $ok = 0; - if ($db->connected == 1) + $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name); + $ok = 0; + if ($db->connected == 1) { - $sql = "INSERT INTO llx_user(datec,login,pass,admin,name,code) VALUES (now()"; - $sql .= ",'".$_POST["login"]."'"; - $sql .= ",'".$_POST["pass"]."'"; - $sql .= ",1,'Administrateur','ADM')"; + $sql = "INSERT INTO llx_user(datec,login,pass,admin,name,code) VALUES (now()"; + $sql .= ",'".$_POST["login"]."'"; + $sql .= ",'".$_POST["pass"]."'"; + $sql .= ",1,'Administrateur','ADM')"; } - - if ($db->query($sql) || $db->errno() == 1062) - { - $db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'"); - print $langs->trans("AdminLoginCreatedSuccessfuly")."
"; - $success = 1; - } - else - { - print "Echec de la création du compte administrateur
"; - } - print '
'; - $db->close(); + $resql=$db->query($sql); + + if ($resql) + { + $db->query("DELETE FROM llx_const WHERE name='MAIN_NOT_INSTALLED'"); + print $langs->trans("AdminLoginCreatedSuccessfuly")."
"; + $success = 1; + } + else + { + if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') + { + print $langs->trans("AdminLoginAlreadyExists",$_POST["login"])."
"; + } + else { + print $langs->trans("FailedToCreateAdminLogin")."
"; + } + } + + // Si install non Français, on configure pour fonctionner en mode internationnal + if ($langs->defaultlang != "fr_FR") { + $db->query("INSERT INTO llx_const(name,value,type,visible) values ('COMPANY_CREATE_TWO_STEPS','1','yesno',0)"); + } + + print ''; + + $db->close(); } -?> -
+print "
"; -trans("SystemIsInstalled")."
"; print $langs->trans("YouNeedToPersonalizeSetup")."
";