2004-10-20 00:24:10 +02:00
|
|
|
<?php
|
2008-12-15 02:04:32 +01:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2005-06-11 13:35:58 +02:00
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
|
|
|
|
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
2008-03-12 23:17:54 +01:00
|
|
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
2004-02-12 17:44:49 +01:00
|
|
|
*
|
|
|
|
|
* 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
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2004-02-12 17:44:49 +01:00
|
|
|
* (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
|
2011-08-01 01:24:38 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2004-02-12 17:44:49 +01:00
|
|
|
*/
|
2005-03-26 13:55:20 +01:00
|
|
|
|
|
|
|
|
/**
|
2009-11-27 19:26:03 +01:00
|
|
|
* \file htdocs/install/etape4.php
|
|
|
|
|
* \ingroup install
|
|
|
|
|
* \brief Ask login and password of Dolibarr admin user
|
2008-12-15 02:04:32 +01:00
|
|
|
*/
|
2005-03-26 13:55:20 +01:00
|
|
|
|
|
|
|
|
|
2012-08-23 02:46:16 +02:00
|
|
|
include_once 'inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once $dolibarr_main_document_root.'/core/class/conf.class.php';
|
|
|
|
|
require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php';
|
2006-08-06 01:55:10 +02:00
|
|
|
|
2005-02-12 22:25:39 +01:00
|
|
|
|
2012-10-13 13:56:37 +02:00
|
|
|
$setuplang=(GETPOST('selectlang','',3)?GETPOST('selectlang','',3):'auto');
|
2005-10-30 02:07:00 +01:00
|
|
|
$langs->setDefaultLang($setuplang);
|
|
|
|
|
|
2005-02-13 17:47:32 +01:00
|
|
|
$langs->load("admin");
|
2005-02-12 22:25:39 +01:00
|
|
|
$langs->load("install");
|
|
|
|
|
|
2012-04-08 23:18:36 +02:00
|
|
|
// Now we load forced value from install.forced.php file.
|
2011-07-30 16:56:11 +02:00
|
|
|
$useforcedwizard=false;
|
2012-04-08 23:18:36 +02:00
|
|
|
$forcedfile="./install.forced.php";
|
|
|
|
|
if ($conffile == "/etc/dolibarr/conf.php") $forcedfile="/etc/dolibarr/install.forced.php";
|
2012-08-23 02:04:35 +02:00
|
|
|
if (@file_exists($forcedfile)) { $useforcedwizard=true; include_once $forcedfile; }
|
2008-03-12 23:14:24 +01:00
|
|
|
|
2011-06-08 13:23:55 +02:00
|
|
|
dolibarr_install_syslog("--- etape4: Entering etape4.php page");
|
2008-04-21 09:21:13 +02:00
|
|
|
|
2008-12-15 02:04:32 +01:00
|
|
|
$err=0;
|
|
|
|
|
$ok = 0;
|
2008-03-12 23:14:24 +01:00
|
|
|
|
2005-10-30 02:07:00 +01:00
|
|
|
|
2005-02-12 22:25:39 +01:00
|
|
|
|
2008-12-15 02:04:32 +01:00
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
2004-08-25 22:12:02 +02:00
|
|
|
|
2008-12-15 02:04:32 +01:00
|
|
|
pHeader($langs->trans("AdminAccountCreation"),"etape5");
|
2004-08-25 22:12:02 +02:00
|
|
|
|
2010-09-29 10:09:17 +02:00
|
|
|
// Test if we can run a first install process
|
|
|
|
|
if (! is_writable($conffile))
|
|
|
|
|
{
|
2011-07-30 12:23:24 +02:00
|
|
|
print $langs->trans("ConfFileIsNotWritable",$conffiletoshow);
|
2010-09-29 10:09:17 +02:00
|
|
|
pFooter(1,$setuplang,'jscheckparam');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-07 20:07:27 +02:00
|
|
|
|
|
|
|
|
print '<br>'.$langs->trans("LastStepDesc").'<br><br>';
|
|
|
|
|
|
|
|
|
|
|
2005-06-11 13:35:58 +02:00
|
|
|
print '<table cellspacing="0" cellpadding="2" width="100%">';
|
2004-02-12 17:44:49 +01:00
|
|
|
|
2011-09-28 16:26:49 +02:00
|
|
|
$db=getDoliDBInstance($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
2011-09-28 19:41:08 +02:00
|
|
|
|
2004-02-12 17:44:49 +01:00
|
|
|
if ($db->ok == 1)
|
2004-01-27 15:36:40 +01:00
|
|
|
{
|
2011-09-29 22:21:57 +02:00
|
|
|
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
|
2012-04-08 23:18:36 +02:00
|
|
|
print '<input name="login" value="'.(! empty($_GET["login"])?$_GET["login"]:(isset($force_install_dolibarrlogin)?$force_install_dolibarrlogin:'')).'"></td></tr>';
|
2011-09-29 22:21:57 +02:00
|
|
|
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
|
|
|
|
|
print '<input type="password" name="pass"></td></tr>';
|
|
|
|
|
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
|
|
|
|
|
print '<input type="password" name="pass_verif"></td></tr>';
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["error"]) && $_GET["error"] == 1)
|
|
|
|
|
{
|
|
|
|
|
print '<br>';
|
|
|
|
|
print '<div class="error">'.$langs->trans("PasswordsMismatch").'</div>';
|
|
|
|
|
$err=0; // We show button
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["error"]) && $_GET["error"] == 2)
|
|
|
|
|
{
|
|
|
|
|
print '<br>';
|
|
|
|
|
print '<div class="error">';
|
|
|
|
|
print $langs->trans("PleaseTypePassword");
|
|
|
|
|
print '</div>';
|
|
|
|
|
$err=0; // We show button
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["error"]) && $_GET["error"] == 3)
|
|
|
|
|
{
|
|
|
|
|
print '<br>';
|
|
|
|
|
print '<div class="error">'.$langs->trans("PleaseTypeALogin").'</div>';
|
|
|
|
|
$err=0; // We show button
|
|
|
|
|
}
|
2005-04-02 22:56:18 +02:00
|
|
|
|
2004-01-27 15:36:40 +01:00
|
|
|
}
|
|
|
|
|
|
2011-06-08 13:23:55 +02:00
|
|
|
dolibarr_install_syslog("--- install/etape4.php end", LOG_INFO);
|
|
|
|
|
|
2005-10-30 02:07:00 +01:00
|
|
|
pFooter($err,$setuplang);
|
2012-04-08 23:18:36 +02:00
|
|
|
|
|
|
|
|
$db->close();
|
2004-01-27 15:36:40 +01:00
|
|
|
?>
|