* Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien DiCintio * Copyright (C) 2004-2008 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/install/etape4.php * \ingroup install * \brief Ask login and password of Dolibarr admin user * \version $Id: etape4.php,v 1.38 2011/07/31 23:26:26 eldy Exp $ */ include_once("./inc.php"); require_once($dolibarr_main_document_root."/lib/databases/".$dolibarr_main_db_type.".lib.php"); require_once($dolibarr_main_document_root."/core/class/conf.class.php"); require_once($dolibarr_main_document_root."/lib/admin.lib.php"); $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto'); $langs->setDefaultLang($setuplang); $langs->load("admin"); $langs->load("install"); // Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard. if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin=''; $useforcedwizard=false; if (file_exists("./install.forced.php")) { $useforcedwizard=true; include_once("./install.forced.php"); } else if (file_exists("/etc/dolibarr/install.forced.php")) { $useforcedwizard=include_once("/etc/dolibarr/install.forced.php"); } dolibarr_install_syslog("--- etape4: Entering etape4.php page"); $err=0; $ok = 0; /* * View */ pHeader($langs->trans("AdminAccountCreation"),"etape5"); // Test if we can run a first install process if (! is_writable($conffile)) { print $langs->trans("ConfFileIsNotWritable",$conffiletoshow); pFooter(1,$setuplang,'jscheckparam'); exit; } print '
'.$langs->trans("LastStepDesc").'

'; print ''; $db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port); if ($db->ok == 1) { print ''; print ''; print ''; print '
'.$langs->trans("DolibarrAdminLogin").' :'; print '
'.$langs->trans("Password").' :'; print '
'.$langs->trans("PasswordAgain").' :'; print '
'; if (isset($_GET["error"]) && $_GET["error"] == 1) { print '
'; print '
'.$langs->trans("PasswordsMismatch").'
'; $err=0; // We show button } if (isset($_GET["error"]) && $_GET["error"] == 2) { print '
'; print '
'; print $langs->trans("PleaseTypePassword"); print '
'; $err=0; // We show button } if (isset($_GET["error"]) && $_GET["error"] == 3) { print '
'; print '
'.$langs->trans("PleaseTypeALogin").'
'; $err=0; // We show button } } $db->close(); dolibarr_install_syslog("--- install/etape4.php end", LOG_INFO); pFooter($err,$setuplang); ?>