From ecf819ea2c08ef86151b919cbc46f247a0fe353b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Feb 2004 00:05:21 +0000 Subject: [PATCH] =?UTF-8?q?Conditionnement=20de=20l'acc=E8s=20au=20droit?= =?UTF-8?q?=20user->admin.=20Remplacement=20des=20border=3D0/1=20par=20cla?= =?UTF-8?q?ss=3D"noborder/border"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/boxes.php | 20 ++++++++++---- htdocs/admin/const.php | 8 ++++-- htdocs/admin/ihm.php | 8 ++++-- htdocs/admin/index.php | 10 +++++-- htdocs/admin/modules.php | 13 +++++++-- htdocs/admin/system/constall.php | 18 ++++++++---- htdocs/admin/system/index.php | 40 ++++++++++++++++++++------- htdocs/admin/system/os.php | 20 +++++++++++++- htdocs/admin/system/pear.php | 5 ++++ htdocs/admin/system/pear_packages.php | 5 ++++ htdocs/admin/system/web.php | 17 +++++++++++- 11 files changed, 131 insertions(+), 33 deletions(-) diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index b4708a87511..d746fae1b78 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -20,6 +20,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); print_titre("Boites affichées"); @@ -58,10 +62,12 @@ $boxes = array(); $pos[0] = "Homepage"; -print ''; +print '
'; $sql = "SELECT b.rowid, b.box_id, b.position, d.name FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as d where b.box_id = d.rowid"; $result = $db->query($sql); +$var=True; + if ($result) { $num = $db->num_rows(); @@ -69,10 +75,11 @@ if ($result) while ($i < $num) { + $var = ! $var; $obj = $db->fetch_object( $i); - print ''; $i++; @@ -87,10 +94,12 @@ print '
'.$obj->name.'' . $pos[$obj->position] . ''; - print 'Supprimer'; + print '
'.$obj->name.'' . $pos[$obj->position] . ''; + print ''.img_delete().''; array_push($boxes, $obj->box_id); print '
'; */ print "

"; print_titre("Boites disponibles"); -print ''; +print '
'; $sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def"; $result = $db->query($sql); +$var=True; + if ($result) { $num = $db->num_rows(); @@ -98,9 +107,10 @@ if ($result) while ($i < $num) { + $var = ! $var; $obj = $db->fetch_object( $i); - print '
'.$obj->name.'' . $obj->file . ''; + print '
'.$obj->name.'' . $obj->file . ''; /* diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index d2a21308e95..b28ca57160d 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -21,6 +21,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); print_titre("Configuration autre (Dolibarr version ".DOL_VERSION.")"); @@ -28,7 +32,7 @@ print_titre("Configuration autre (Dolibarr version ".DOL_VERSION.")"); //print_r(get_defined_constants()); print "
\n"; -print ''; +print '
'; print ''; print ''; print ''; @@ -103,7 +107,7 @@ if ($result) } elseif ($obj->type == 'texte') { - print '\n"; print '
NomValeur'; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index b28e78be452..096da4c0a57 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -21,6 +21,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + if ($HTTP_POST_VARS["action"] == 'update') { dolibarr_set_const($db, "MAIN_THEME",$HTTP_POST_VARS["main_theme"]); @@ -41,7 +45,7 @@ if ($_GET["action"] == 'edit') print '
'; print ''; - print ''; + print '
'; print ''; print ''; @@ -76,7 +80,7 @@ if ($_GET["action"] == 'edit') else { - print '
NomValeur
Thème
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 736cce80791..98b7e7e23b7 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -21,6 +21,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + if ($HTTP_POST_VARS["action"] == 'update') { dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$HTTP_POST_VARS["nom"]); @@ -41,7 +45,7 @@ if ($_GET["action"] == 'edit') print ''; print ''; - print '
NomValeur
Thème' . MAIN_THEME . '
Longueur maximum des listes' . SIZE_LISTE_LIMIT . '
'; + print '
'; print ''; print '
Informations sur la société ou association
Nom de la société/association'; @@ -57,8 +61,8 @@ if ($_GET["action"] == 'edit') else { - print ''; - print ''; + print '
Informations sur la société ou association
'; + print ''; print ''; print ''; print '
Informations sur la société/associationValeur
Nom de la société/association' . MAIN_INFO_SOCIETE_NOM . '
Numéro de tva intracommunautaire' . MAIN_INFO_TVAINTRA . '

'; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index d884b0fa53f..55cea5f4993 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -21,6 +21,9 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + // // TODO mettre cette section dans la base de données // @@ -80,8 +83,9 @@ if (!$user->admin) print_titre("Modules"); -print ''; -print ''; +print '
'; +print '
'; +print ''; print ''; print ''; print ''; @@ -124,9 +128,12 @@ while (($file = readdir($handle))!==false) } sort($orders); +$var=True; foreach ($orders as $key => $value) { + $var=!$var; + $modName = $modules[$orders[$key]]; if ($modName) @@ -137,7 +144,7 @@ foreach ($orders as $key => $value) $const_name = $objMod->const_name; $const_value = $objMod->const_config; - print '
NomInfoActivé
'; + print "
"; echo $objMod->name; print "\n"; print $objMod->description; diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index f860aaea36c..0061f3872f0 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -20,15 +21,20 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); print_titre("Liste de tous les paramètres de configuration Dolibarr"); -print ''; -print ''; -print ''; -print ''; -print "\n"; +print '
'; +print '
NomValeur
'; +print ''; +print ''; +print ''; +print "\n"; $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC"; $result = $db->query($sql); @@ -43,7 +49,7 @@ if ($result) $obj = $db->fetch_object( $i); $var=!$var; - print "\n"; + print "\n"; print '
ParamètreValeur
$obj->name
$obj->name'; print $obj->value; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index 93b870a521e..6ef3c79da13 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -34,27 +34,37 @@ //include_once("../../allpre.inc.php"); require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); print_titre("Résumé des informations systèmes Dolibarr"); print "
\n"; -print ''; +print '
'; print "\n"; print "\n"; print '
Dolibar
Version" . DOL_VERSION . "
'; print "
\n"; -print ''; +print '
'; print "\n"; -print "\n"; +// Récupère la version de l'OS +ob_start(); +phpinfo(); +$chaine = ob_get_contents(); +ob_end_clean(); +eregi('System ',$chaine,$reg); +print "\n"; print '
OS
Version".get_cfg_var("System")."
([^\/]*)
Version".$reg[1]."
'; print "
\n"; -print ''; +print '
'; print "\n"; print "\n"; print "\n"; @@ -62,7 +72,7 @@ print '
Serveur Web
Version".$_SERVER["SERVER_SOFTWARE"]."
document root" . DOL_DOCUMENT_ROOT . "
'; print "
\n"; -print ''; +print '
'; print "\n"; print "\n"; print "\n"; @@ -70,13 +80,23 @@ print '
PHP
Version".phpversion()."
Liaison Web-PHP".php_sapi_name()."
'; print "
\n"; -print ''; +print '
'; print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; +$sql = "SHOW VARIABLES LIKE 'version'"; +$result = $db->query($sql); +if ($result) +{ + $row = $db->fetch_row(); +} +print "\n"; +print "\n"; +print "\n"; +print "\n"; +print "\n"; print "\n"; + + + print '
Base de données
type" . $conf->db->type . "
host" . $conf->db->host . "
user" . $conf->db->user . " 
pass" . $conf->db->pass . " 
Version" . $row[1] . "
Type" . $conf->db->type . "
Host" . $conf->db->host . "
User" . $conf->db->user . " 
Pass" . $conf->db->pass . " 
Database name" . $conf->db->name . "
'; diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 792f30e4448..484de7cc28b 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -20,9 +20,27 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); -print "TODO"; +print_titre("OS"); + +print "
\n"; + +print ''; +print "\n"; +// Récupère la version de l'OS +ob_start(); +phpinfo(); +$chaine = ob_get_contents(); +ob_end_clean(); +eregi('System ',$chaine,$reg); +print "\n"; +print '
ParamètreValeur
([^\/]*)
Version".$reg[1]."
'; + llxFooter(); ?> diff --git a/htdocs/admin/system/pear.php b/htdocs/admin/system/pear.php index cea94757852..85d8764193a 100644 --- a/htdocs/admin/system/pear.php +++ b/htdocs/admin/system/pear.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -20,6 +21,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); print "TODO"; diff --git a/htdocs/admin/system/pear_packages.php b/htdocs/admin/system/pear_packages.php index 9baf1c7d960..acdcf2cb7d5 100644 --- a/htdocs/admin/system/pear_packages.php +++ b/htdocs/admin/system/pear_packages.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * 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 @@ -20,6 +21,10 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + //require_once "PEAR/Info.php"; llxHeader(); diff --git a/htdocs/admin/system/web.php b/htdocs/admin/system/web.php index 792f30e4448..d9d17bbadd2 100644 --- a/htdocs/admin/system/web.php +++ b/htdocs/admin/system/web.php @@ -20,9 +20,24 @@ */ require("./pre.inc.php"); +if (!$user->admin) + accessforbidden(); + + llxHeader(); -print "TODO"; +print_titre("Serveur Web"); + +print "
\n"; + +print ''; +print "\n"; +print "\n"; +print "\n"; +print "\n"; +print "\n"; +print "\n"; +print '
Serveur Web
Version".$_SERVER["SERVER_SOFTWARE"]."
Nom du serveur virtuel" . $_SERVER["SERVER_NAME"] . "
IP".$_SERVER["SERVER_ADDR"]."
Port" . $_SERVER["SERVER_PORT"] . "
Racine du serveur".$_SERVER["DOCUMENT_ROOT"]."
'; llxFooter(); ?>