New: Ajout page pour configurer taille max des fichiers upload

This commit is contained in:
Laurent Destailleur 2006-11-13 22:31:26 +00:00
parent 5e209d9f38
commit 990ea0ad57
8 changed files with 131 additions and 1 deletions

View File

@ -210,7 +210,7 @@ if ($resql)
{
$var = ! $var;
print '<form action="boxes.php" method="POST">';
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$logo=eregi_replace("^object_","",$box->boximg);
print '<tr '.$bc[$var].'>';
print '<td>'.img_object("",$logo).' '.$box->boxlabel.'</td>';

View File

@ -68,6 +68,10 @@ $head[$h][0] = DOL_URL_ROOT."/admin/security.php";
$head[$h][1] = $langs->trans("Passwords");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security_other.php";
$head[$h][1] = $langs->trans("Miscellanous");
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Security"));

View File

@ -86,6 +86,10 @@ $head[$h][1] = $langs->trans("Passwords");
$hselected=$h;
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security_other.php";
$head[$h][1] = $langs->trans("Miscellanous");
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Security"));

View File

@ -0,0 +1,116 @@
<?php
/* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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/admin/security_other.php
\ingroup setup
\brief Page de configuration du module sécurité autre
\version $Revision$
*/
require("./pre.inc.php");
$langs->load("users");
$langs->load("admin");
if (!$user->admin) accessforbidden();
/*
* Actions
*/
if ($_GET["action"] == 'set_main_upload_doc')
{
if (! dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',$_POST["MAIN_UPLOAD_DOC"]))
{
dolibarr_print_error($db);
}
else
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
}
/*
* Affichage onglet
*/
llxHeader();
print_fiche_titre($langs->trans("SecuritySetup"),'','setup');
print $langs->trans("MiscellanousDesc")."<br>\n";
print "<br>\n";
$h = 0;
$head[$h][0] = DOL_URL_ROOT."/admin/perms.php";
$head[$h][1] = $langs->trans("DefaultRights");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security.php";
$head[$h][1] = $langs->trans("Passwords");
$h++;
$head[$h][0] = DOL_URL_ROOT."/admin/security_other.php";
$head[$h][1] = $langs->trans("Miscellanous");
$hselected=$h;
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("Security"));
$var=false;
$form = new Form($db);
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?action=set_main_upload_doc" method="POST">';
print '<tr '.$bc[$var].'>';
print '<td>'.$langs->trans("MaxSizeForUploadedFiles").'</td>';
print '<td>';
print '<input class="flat" name="MAIN_UPLOAD_DOC" type="text" size="6" value="'.$conf->global->MAIN_UPLOAD_DOC.'"> '.$langs->trans("Kb");
print '</td>';
print '<td align="center">';
print '<input type="submit" class="button" name="button" value="'.$langs->trans("Modify").'">';
print '</td>';
print '</tr></form>';
print '</table>';
//print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
print '</div>';
$db->close();
llxFooter('$Date$ - $Revision$');
?>

View File

@ -408,6 +408,7 @@ GeneratedPasswordDesc=Define here which rule you want to use to generate new pas
DictionnaryDesc=Define here all reference datas. You can complete predefined value with yours
ConstDesc=All other parameters not available in previous pages
OnceSetupFinishedCreateUsers=Warning, you are a Dolibarr administrator user. Administrator users are used to setup Dolibarr. For a usual usage of Dolibarr, it is recommanded to use a non administrator user created from Users & Groups menu.
MiscellanousDesc=Define here all other parameters related to security.
##### Users setup #####
UserGroupSetup=Users and groups module setup
GeneratePassword=Suggest a generated password

View File

@ -20,8 +20,10 @@ Notify_NOTIFY_VAL_FAC=Validate bill
NbOfAttachedFiles=Number of attached files/documents
TotalSizeOfAttachedFiles=Total size of attached files/documents
MaxSize=Maximum size
MaxSizeForUploadedFiles=Maximum size for uplaoded files (0 to disallow any upload)
AttachANewFile=Attach a new file/document
LinkedObject=Linked object
Miscellanous=Miscellanous
NbOfActiveNotifications=Number of notifications
WarningInstallDirExists=Warning, install directory (%s) still exists. This is a serious security hole. You should removed it as soon as possible.
WarningUntilDirRemoved=This warning will keep active while directory is present (Shown only for admin users).

View File

@ -408,6 +408,7 @@ GeneratedPasswordDesc=Definissez ici quelle r
DictionnaryDesc=Definissez ici les données de référence. Vous pouvez compléter/modifier les données prédéfinies avec les votres
ConstDesc=Tout autre parametre non editable dans les pages précédentes
OnceSetupFinishedCreateUsers=Attention, vous êtes sous un compte administrateur de Dolibarr. Les administrateurs sont utilisés pour configurer Dolibarr. Pour une utilisation courante de Dolibarr, il est recommandé d'utiliser un compte non administrateur créé depuis le menu "Utilisateurs & Groupes".
MiscellanousDesc=Définissez ici les autres paramètres en rapport avec la sécurité.
##### Users setup #####
UserGroupSetup=Configuration module utilisateurs et groupes
GeneratePassword=Proposer un mot de passe généré

View File

@ -20,8 +20,10 @@ Notify_NOTIFY_VAL_FAC=Validation facture
NbOfAttachedFiles=Nombre de fichiers/documents liés
TotalSizeOfAttachedFiles=Taille total des fichiers/documents liés
MaxSize=Taille maximum
MaxSizeForUploadedFiles=Taille maximum des documents uploadés (0 pour interdire l'upload)
AttachANewFile=Ajouter un nouveau fichier/document
LinkedObject=Objet lié
Miscellanous=Divers
NbOfActiveNotifications=Nombre de notifications
WarningInstallDirExists=Attention, le répertoire install (%s) existe toujours. Une fois l'install terminée, sa présence n'est plus nécessaire et représente une faille sérieuse de sécurité. Vous devriez l'effacer dès que possible.
WarningUntilDirRemoved=Cette alerte restera active tant que le répertoire existera (alerte visible pour les utilisateurs admin uniquement).