dolibarr/htdocs/install/etape4.php

108 lines
3.1 KiB
PHP
Raw Normal View History

<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004-2005 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
* 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.
*
* $Id$
* $Source$
*/
/**
\file htdocs/install/etape4.php
\brief Demande le login et mot de passe de l'administrateur Dolibarr
\version $Revision$
*/
include_once("./inc.php");
$setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto');
2005-10-30 02:07:00 +01:00
$langs->setDefaultLang($setuplang);
$langs->load("admin");
$langs->load("install");
2005-10-30 02:07:00 +01:00
pHeader($langs->trans("AdminAccountCreation"),"etape5");
if (file_exists($conffile))
2004-01-27 15:36:40 +01:00
{
2005-10-30 02:07:00 +01:00
include_once($conffile);
2004-01-27 15:36:40 +01:00
}
if($dolibarr_main_db_type == "mysql")
require_once($dolibarr_main_document_root . "/lib/mysql.lib.php");
else
require_once($dolibarr_main_document_root . "/lib/pgsql.lib.php");
require_once($dolibarr_main_document_root . "/conf/conf.class.php");
2004-01-27 15:36:40 +01:00
print '<table cellspacing="0" cellpadding="2" width="100%">';
2004-02-12 17:44:49 +01:00
$err=0;
2004-02-12 17:44:49 +01:00
$conf = new Conf();
$conf->db->type = $dolibarr_main_db_type;
2004-02-12 17:44:49 +01:00
$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);
2004-02-12 17:44:49 +01:00
$ok = 0;
if ($db->ok == 1)
2004-01-27 15:36:40 +01:00
{
2004-02-12 17:44:49 +01:00
print '<tr><td>'.$langs->trans("DolibarrAdminLogin").' :</td><td>';
2004-02-12 17:44:49 +01:00
print '<input name="login"></td></tr>';
print '<tr><td>'.$langs->trans("Password").' :</td><td>';
2004-02-12 17:44:49 +01:00
print '<input type="password" name="pass"></td></tr>';
print '<tr><td>'.$langs->trans("PasswordAgain").' :</td><td>';
2004-02-12 17:44:49 +01:00
print '<input type="password" name="pass_verif"></td></tr>';
print '</table>';
2004-01-27 15:36:40 +01:00
if (isset($_GET["error"]) && $_GET["error"] == 1)
2004-02-12 17:44:49 +01:00
{
print '<br>';
2005-02-14 22:30:03 +01:00
print '<div class="error">'.$langs->trans("PasswordsMismatch").'</div>';
2004-02-12 17:44:49 +01:00
}
2004-01-27 15:36:40 +01:00
if (isset($_GET["error"]) && $_GET["error"] == 2)
2004-01-27 15:36:40 +01:00
{
print '<br>';
print '<div class="error">';
print $langs->trans("PleaseTypePassword");
print '</div>';
2004-02-12 17:44:49 +01:00
}
2004-01-27 15:36:40 +01:00
if (isset($_GET["error"]) && $_GET["error"] == 3)
2004-02-12 17:44:49 +01:00
{
print '<br>';
2005-02-14 22:30:03 +01:00
print '<div class="error">'.$langs->trans("PleaseTypeALogin").'</div>';
2004-01-27 15:36:40 +01:00
}
2004-01-27 15:36:40 +01:00
}
$db->close();
2005-10-30 02:07:00 +01:00
pFooter($err,$setuplang);
2004-01-27 15:36:40 +01:00
?>