2004-10-19 22:24:10 +00:00
|
|
|
<?php
|
2008-12-15 01:04:32 +00:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2005-06-11 11:35:58 +00:00
|
|
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
|
|
|
|
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
|
2008-03-12 22:17:54 +00:00
|
|
|
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
2004-02-12 16:44:49 +00: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
|
|
|
|
|
* 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, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*/
|
2005-03-26 12:55:20 +00:00
|
|
|
|
|
|
|
|
/**
|
2009-11-27 18:26:03 +00:00
|
|
|
* \file htdocs/install/etape4.php
|
|
|
|
|
* \ingroup install
|
|
|
|
|
* \brief Ask login and password of Dolibarr admin user
|
|
|
|
|
* \version $Id$
|
2008-12-15 01:04:32 +00:00
|
|
|
*/
|
2005-03-26 12:55:20 +00:00
|
|
|
|
|
|
|
|
|
2005-02-12 21:25:39 +00:00
|
|
|
include_once("./inc.php");
|
2008-12-15 01:04:32 +00:00
|
|
|
require_once($dolibarr_main_document_root."/lib/databases/".$dolibarr_main_db_type.".lib.php");
|
2010-04-28 10:02:54 +00:00
|
|
|
require_once($dolibarr_main_document_root."/core/class/conf.class.php");
|
2008-12-15 01:04:32 +00:00
|
|
|
require_once($dolibarr_main_document_root."/lib/admin.lib.php");
|
2006-08-05 23:55:10 +00:00
|
|
|
|
2005-02-12 21:25:39 +00:00
|
|
|
|
2006-01-04 16:22:38 +00:00
|
|
|
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
|
2005-10-30 01:07:00 +00:00
|
|
|
$langs->setDefaultLang($setuplang);
|
|
|
|
|
|
2005-02-13 16:47:32 +00:00
|
|
|
$langs->load("admin");
|
2005-02-12 21:25:39 +00:00
|
|
|
$langs->load("install");
|
|
|
|
|
|
2008-03-12 22:14:24 +00:00
|
|
|
// Init "forced values" to nothing. "forced values" are used after an doliwamp install wizard.
|
|
|
|
|
if (! isset($force_install_dolibarrlogin)) $force_install_dolibarrlogin='';
|
2008-03-12 22:17:54 +00:00
|
|
|
if (file_exists("./install.forced.php")) include_once("./install.forced.php");
|
2008-03-12 22:14:24 +00:00
|
|
|
|
2008-04-21 07:21:13 +00:00
|
|
|
dolibarr_install_syslog("etape4: Entering etape4.php page");
|
|
|
|
|
|
2008-12-15 01:04:32 +00:00
|
|
|
$err=0;
|
|
|
|
|
$ok = 0;
|
2008-03-12 22:14:24 +00:00
|
|
|
|
2005-10-30 01:07:00 +00:00
|
|
|
|
2005-02-12 21:25:39 +00:00
|
|
|
|
2008-12-15 01:04:32 +00:00
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
2004-08-25 20:12:02 +00:00
|
|
|
|
2008-12-15 01:04:32 +00:00
|
|
|
pHeader($langs->trans("AdminAccountCreation"),"etape5");
|
2004-08-25 20:12:02 +00:00
|
|
|
|
2010-09-29 08:09:17 +00:00
|
|
|
// Test if we can run a first install process
|
|
|
|
|
if (! is_writable($conffile))
|
|
|
|
|
{
|
|
|
|
|
print $langs->trans("ConfFileIsNotWritable",'htdocs/conf/conf.php');
|
|
|
|
|
pFooter(1,$setuplang,'jscheckparam');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2005-06-11 11:35:58 +00:00
|
|
|
print '<table cellspacing="0" cellpadding="2" width="100%">';
|
2004-02-12 16:44:49 +00:00
|
|
|
|
2008-03-10 22:38:43 +00:00
|
|
|
$db = new DoliDb($conf->db->type,$conf->db->host,$conf->db->user,$conf->db->pass,$conf->db->name,$conf->db->port);
|
2004-02-12 16:44:49 +00:00
|
|
|
if ($db->ok == 1)
|
2004-01-27 14:36:40 +00:00
|
|
|
{
|
2008-12-15 01:04:32 +00:00
|
|
|
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
|
|
|
|
|
print '<input name="login" value="'.(! empty($_GET["login"])?$_GET["login"]:$force_install_dolibarrlogin).'"></td></tr>';
|
|
|
|
|
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>';
|
2009-01-25 17:56:42 +00:00
|
|
|
$err=0; // We show button
|
2008-12-15 01:04:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["error"]) && $_GET["error"] == 2)
|
|
|
|
|
{
|
|
|
|
|
print '<br>';
|
|
|
|
|
print '<div class="error">';
|
|
|
|
|
print $langs->trans("PleaseTypePassword");
|
|
|
|
|
print '</div>';
|
2009-01-25 17:56:42 +00:00
|
|
|
$err=0; // We show button
|
2008-12-15 01:04:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_GET["error"]) && $_GET["error"] == 3)
|
|
|
|
|
{
|
|
|
|
|
print '<br>';
|
|
|
|
|
print '<div class="error">'.$langs->trans("PleaseTypeALogin").'</div>';
|
2009-01-25 17:56:42 +00:00
|
|
|
$err=0; // We show button
|
2008-12-15 01:04:32 +00:00
|
|
|
}
|
2005-04-02 20:56:18 +00:00
|
|
|
|
2004-01-27 14:36:40 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-02 20:56:18 +00:00
|
|
|
$db->close();
|
|
|
|
|
|
2005-10-30 01:07:00 +00:00
|
|
|
pFooter($err,$setuplang);
|
2004-01-27 14:36:40 +00:00
|
|
|
?>
|