From 990ea0ad5785c886681c4f8aa4e71be5047d5a95 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 13 Nov 2006 22:31:26 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Ajout=20page=20pour=20configurer=20taill?= =?UTF-8?q?e=20max=20des=20fichiers=20upload=E9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/boxes.php | 2 +- htdocs/admin/perms.php | 4 ++ htdocs/admin/security.php | 4 ++ htdocs/admin/security_other.php | 116 ++++++++++++++++++++++++++++++++ htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/other.lang | 2 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/langs/fr_FR/other.lang | 2 + 8 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 htdocs/admin/security_other.php diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index ed9f7847701..7ed180814ac 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -210,7 +210,7 @@ if ($resql) { $var = ! $var; - print '
'; + print ''; $logo=eregi_replace("^object_","",$box->boximg); print ''; print ''.img_object("",$logo).' '.$box->boxlabel.''; diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index f1455efbbda..39472d716af 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -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")); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 60ff95a705e..f72469c9414 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -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")); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php new file mode 100644 index 00000000000..233ed50a865 --- /dev/null +++ b/htdocs/admin/security_other.php @@ -0,0 +1,116 @@ + + * + * 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")."
\n"; +print "
\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 ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("MaxSizeForUploadedFiles").''; +print ' '.$langs->trans("Kb"); +print ''; +print ''; +print '
'; + +//print ''; + +print ''; + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 173b3d04604..9ce22e02e9e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -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 diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 7b917d482fa..e50efeccc25 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -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). diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 75ddb0cf564..1911cc88efe 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -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é diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index aeb913142fe..fa635dc19e9 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -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).