Fix: Add test on database name
This commit is contained in:
parent
ab8e9904ef
commit
a5513d165e
@ -22,21 +22,21 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup agenda Module agenda
|
||||
* \brief Module pour gerer l'agenda et actions
|
||||
* \defgroup agenda Module agenda
|
||||
* \brief Module pour gerer l'agenda et actions
|
||||
* \brief $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/includes/modules/modAgenda.class.php
|
||||
* \ingroup agenda
|
||||
* \brief Fichier de description et activation du module agenda
|
||||
* \file htdocs/includes/modules/modAgenda.class.php
|
||||
* \ingroup agenda
|
||||
* \brief Fichier de description et activation du module agenda
|
||||
*/
|
||||
include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php");
|
||||
|
||||
/**
|
||||
* \class modAdherent
|
||||
* \brief Classe de description et activation du module Adherent
|
||||
* \class modAdherent
|
||||
* \brief Classe de description et activation du module Adherent
|
||||
*/
|
||||
class modAgenda extends DolibarrModules
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||
@ -211,7 +211,7 @@ if ($_POST["action"] == "set")
|
||||
$oldcontent = dol_openfile($conffile, 'r', '');
|
||||
if (! dol_openfile($conffile.'.old', 'w', $oldcontent)) $error++;
|
||||
}
|
||||
|
||||
|
||||
$error+=write_conf_file($conffile);
|
||||
}
|
||||
|
||||
@ -351,7 +351,7 @@ if ($_POST["action"] == "set")
|
||||
print $langs->trans("DatabaseCreation").' : ';
|
||||
print $dolibarr_main_db_name;
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Error").' '.$db->errno().'</td></tr>';
|
||||
print '<td>'.$langs->trans("Error").' '.$db->lasterrno().'</td></tr>';
|
||||
|
||||
// Affiche aide diagnostique
|
||||
print '<tr><td colspan="2"><br>';
|
||||
@ -360,6 +360,7 @@ if ($_POST["action"] == "set")
|
||||
print '<br>';
|
||||
print '</td></tr>';
|
||||
|
||||
dolibarr_install_syslog('etape1: Failed to create database '.$dolibarr_main_db_name.' '.$db->lasterrno(), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
$db->close();
|
||||
|
||||
@ -35,6 +35,7 @@ $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["select
|
||||
$langs->setDefaultLang($setuplang);
|
||||
|
||||
$langs->load("install");
|
||||
$langs->load("errors");
|
||||
|
||||
// You can force preselected values of the config step of Dolibarr by adding a file
|
||||
// install.forced.php into directory htdocs/install (This is the case with some installer
|
||||
@ -384,6 +385,12 @@ while (($file = readdir($handle))!==false)
|
||||
</table>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
function checkDatabaseName(databasename) {
|
||||
if (databasename.match(/[-;_\.]/)) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
function jscheckparam()
|
||||
{
|
||||
ok=true;
|
||||
@ -413,24 +420,29 @@ function jscheckparam()
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("ErrorFieldRequired",$langs->transnoentitiesnoconv("DatabaseName"))); ?>');
|
||||
}
|
||||
else if (! checkDatabaseName(document.forminstall.db_name.value))
|
||||
{
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("ErrorSpecialCharNotAllowedForField",$langs->transnoentitiesnoconv("DatabaseName"))); ?>');
|
||||
}
|
||||
// If create database asked
|
||||
else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == '' || document.forminstall.db_pass_root.value == ''))
|
||||
else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == ''))
|
||||
{
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>');
|
||||
}
|
||||
else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == '' || document.forminstall.db_pass_root.value == ''))
|
||||
else if (document.forminstall.db_create_database.checked == true && (document.forminstall.db_user_root.value == ''))
|
||||
{
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseSoRootRequired")); ?>');
|
||||
}
|
||||
// If create user asked
|
||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == '' || document.forminstall.db_pass_root.value == ''))
|
||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == ''))
|
||||
{
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>');
|
||||
}
|
||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == '' || document.forminstall.db_pass_root.value == ''))
|
||||
else if (document.forminstall.db_create_user.checked == true && (document.forminstall.db_user_root.value == ''))
|
||||
{
|
||||
ok=false;
|
||||
alert('<?php echo dol_escape_js($langs->transnoentities("YouAskToCreateDatabaseUserSoRootRequired")); ?>');
|
||||
|
||||
@ -59,4 +59,5 @@ ErrorContactEMail=A technical error occured. Please, contact administrator to fo
|
||||
ErrorWrongValueForField=Wrong value for field number <b>%s</b> (value '<b>%s</b>' does not match regex rule <b>%s</b>)
|
||||
ErrorsOnXLines=Errors on <b>%s</b> source lines
|
||||
WarningsOnXLines=Warnings on <b>%s</b> source lines
|
||||
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)
|
||||
ErrorFileIsInfectedWithAVirus=The antivirus program was not able to validate the file (file might be infected by a virus)
|
||||
ErrorSpecialCharNotAllowedForField=Special characters are not allowed for field "%s"
|
||||
@ -61,3 +61,4 @@ ErrorWrongValueForField=Mauvaise valeur pour le champ numéro <b>%s</b> (la vale
|
||||
ErrorsOnXLines=Erreurs sur <b>%s</b> lignes sources
|
||||
WarningsOnXLines=Alertes sur <b>%s</b> lignes sources
|
||||
ErrorFileIsInfectedWithAVirus=L'antivirus n'a pas pu valider ce fichier (il est probablement infecté par un virus) !
|
||||
ErrorSpecialCharNotAllowedForField=Les caractères spéciaux ne sont pas admins pour le champ "%s"
|
||||
@ -75,13 +75,14 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbort
|
||||
|
||||
print '<tr>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $langs->trans("ActionsToDoBy");
|
||||
print $langs->trans("or").' '.$langs->trans("ActionsToDoBy");
|
||||
print ' </td><td nowrap="nowrap">';
|
||||
print $form->select_users($filtert,'usertodo',1,'',!$canedit);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td nowrap="nowrap">';
|
||||
print $langs->trans("ActionsDoneBy");
|
||||
print $langs->trans("or").' '.$langs->trans("ActionsDoneBy");
|
||||
print ' </td><td nowrap="nowrap">';
|
||||
print $form->select_users($filterd,'userdone',1,'',!$canedit);
|
||||
print '</td></tr>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user