Conditionnement de l'accs au droit user->admin.

Remplacement des border=0/1 par class="noborder/border"
This commit is contained in:
Laurent Destailleur 2004-02-15 00:05:21 +00:00
parent 3e2d08bbb2
commit ecf819ea2c
11 changed files with 131 additions and 33 deletions

View File

@ -20,6 +20,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print_titre("Boites affichées"); print_titre("Boites affichées");
@ -58,10 +62,12 @@ $boxes = array();
$pos[0] = "Homepage"; $pos[0] = "Homepage";
print '<table class="border" cellpadding="3" cellspacing="0">'; print '<table class="noborder" cellpadding="3" cellspacing="0">';
$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"; $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); $result = $db->query($sql);
$var=True;
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows();
@ -69,10 +75,11 @@ if ($result)
while ($i < $num) while ($i < $num)
{ {
$var = ! $var;
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
print '<tr class="pair"><td>'.$obj->name.'</td><td>' . $pos[$obj->position] . '</td><td>'; print '<tr '.$bc[$var].'><td width="200">'.$obj->name.'</td><td width="200">' . $pos[$obj->position] . '</td><td width="50" align="center">';
print '<a href="'.$PHP_SELF.'?rowid='.$obj->rowid.'&amp;action=delete">Supprimer</a>'; print '<a href="'.$PHP_SELF.'?rowid='.$obj->rowid.'&amp;action=delete">'.img_delete().'</a>';
array_push($boxes, $obj->box_id); array_push($boxes, $obj->box_id);
print '</td></tr>'; print '</td></tr>';
$i++; $i++;
@ -87,10 +94,12 @@ print '</table>';
*/ */
print "<p>"; print "<p>";
print_titre("Boites disponibles"); print_titre("Boites disponibles");
print '<table class="border" cellpadding="3" cellspacing="0">'; print '<table class="noborder" cellpadding="3" cellspacing="0">';
$sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def"; $sql = "SELECT rowid, name, file FROM ".MAIN_DB_PREFIX."boxes_def";
$result = $db->query($sql); $result = $db->query($sql);
$var=True;
if ($result) if ($result)
{ {
$num = $db->num_rows(); $num = $db->num_rows();
@ -98,9 +107,10 @@ if ($result)
while ($i < $num) while ($i < $num)
{ {
$var = ! $var;
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
print '<tr class="pair"><td>'.$obj->name.'</td><td>' . $obj->file . '</td><td align="center">'; print '<tr '.$bc[$var].'><td width="200">'.$obj->name.'</td><td width="200">' . $obj->file . '</td><td width="50" align="center">';
/* /*

View File

@ -21,6 +21,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print_titre("Configuration autre (Dolibarr version ".DOL_VERSION.")"); 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_r(get_defined_constants());
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<TR class="liste_titre">'; print '<TR class="liste_titre">';
print '<TD>Nom</TD>'; print '<TD>Nom</TD>';
print '<TD>Valeur</TD>'; print '<TD>Valeur</TD>';
@ -103,7 +107,7 @@ if ($result)
} }
elseif ($obj->type == 'texte') elseif ($obj->type == 'texte')
{ {
print '<textarea name="constvalue" cols="35" rows="5"wrap="soft">'; print '<textarea name="constvalue" cols="35" rows="5" wrap="soft">';
print $obj->value; print $obj->value;
print "</textarea>\n"; print "</textarea>\n";
print '</td><td>'; print '</td><td>';

View File

@ -21,6 +21,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
if ($HTTP_POST_VARS["action"] == 'update') if ($HTTP_POST_VARS["action"] == 'update')
{ {
dolibarr_set_const($db, "MAIN_THEME",$HTTP_POST_VARS["main_theme"]); dolibarr_set_const($db, "MAIN_THEME",$HTTP_POST_VARS["main_theme"]);
@ -41,7 +45,7 @@ if ($_GET["action"] == 'edit')
print '<form method="post" action="'.$PHP_SELF.'">'; print '<form method="post" action="'.$PHP_SELF.'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre"><td>Nom</td><td>Valeur</td></tr>'; print '<tr class="liste_titre"><td>Nom</td><td>Valeur</td></tr>';
print '<tr class="impair"><td>Thème</td>'; print '<tr class="impair"><td>Thème</td>';
@ -76,7 +80,7 @@ if ($_GET["action"] == 'edit')
else else
{ {
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre"><td>Nom</td><td>Valeur</td></tr>'; print '<tr class="liste_titre"><td>Nom</td><td>Valeur</td></tr>';
print '<tr class="impair"><td width="50%">Thème</td><td>' . MAIN_THEME . '</td></tr>'; print '<tr class="impair"><td width="50%">Thème</td><td>' . MAIN_THEME . '</td></tr>';
print '<tr class="pair"><td>Longueur maximum des listes</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>'; print '<tr class="pair"><td>Longueur maximum des listes</td><td>' . SIZE_LISTE_LIMIT . '</td></tr>';

View File

@ -21,6 +21,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
if ($HTTP_POST_VARS["action"] == 'update') if ($HTTP_POST_VARS["action"] == 'update')
{ {
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$HTTP_POST_VARS["nom"]); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$HTTP_POST_VARS["nom"]);
@ -41,7 +45,7 @@ if ($_GET["action"] == 'edit')
print '<form method="post" action="'.$PHP_SELF.'">'; print '<form method="post" action="'.$PHP_SELF.'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Informations sur la société ou association</td></tr>'; print '<tr class="liste_titre"><td colspan="2">Informations sur la société ou association</td></tr>';
print '<tr class="impair"><td>Nom de la société/association</td><td>'; print '<tr class="impair"><td>Nom de la société/association</td><td>';
@ -57,8 +61,8 @@ if ($_GET["action"] == 'edit')
else else
{ {
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print '<tr class="liste_titre"><td colspan="2">Informations sur la société ou association</td></tr>'; print '<tr class="liste_titre"><td>Informations sur la société/association</td><td>Valeur</td></tr>';
print '<tr class="impair"><td width="50%">Nom de la société/association</td><td>' . MAIN_INFO_SOCIETE_NOM . '</td></tr>'; print '<tr class="impair"><td width="50%">Nom de la société/association</td><td>' . MAIN_INFO_SOCIETE_NOM . '</td></tr>';
print '<tr class="pair"><td>Numéro de tva intracommunautaire</td><td>' . MAIN_INFO_TVAINTRA . '</td></tr>'; print '<tr class="pair"><td>Numéro de tva intracommunautaire</td><td>' . MAIN_INFO_TVAINTRA . '</td></tr>';
print '</table><br>'; print '</table><br>';

View File

@ -21,6 +21,9 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
// //
// TODO mettre cette section dans la base de données // TODO mettre cette section dans la base de données
// //
@ -80,8 +83,9 @@ if (!$user->admin)
print_titre("Modules"); print_titre("Modules");
print '<table class="border" cellpadding="3" cellspacing="0">'; print '<br>';
print '<TR class="liste_titre">'; print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<tr class="liste_titre">';
print '<td>Nom</td>'; print '<td>Nom</td>';
print '<td>Info</td>'; print '<td>Info</td>';
print '<td align="center">Activé</td>'; print '<td align="center">Activé</td>';
@ -124,9 +128,12 @@ while (($file = readdir($handle))!==false)
} }
sort($orders); sort($orders);
$var=True;
foreach ($orders as $key => $value) foreach ($orders as $key => $value)
{ {
$var=!$var;
$modName = $modules[$orders[$key]]; $modName = $modules[$orders[$key]];
if ($modName) if ($modName)
@ -137,7 +144,7 @@ foreach ($orders as $key => $value)
$const_name = $objMod->const_name; $const_name = $objMod->const_name;
$const_value = $objMod->const_config; $const_value = $objMod->const_config;
print '<tr class="pair"><td>'; print "<tr $bc[$var]><td>";
echo $objMod->name; echo $objMod->name;
print "</td><td>\n"; print "</td><td>\n";
print $objMod->description; print $objMod->description;

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,15 +21,20 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print_titre("Liste de tous les paramètres de configuration Dolibarr"); print_titre("Liste de tous les paramètres de configuration Dolibarr");
print '<table border="1" cellpadding="3" cellspacing="0">'; print '<br>';
print '<TR class="liste_titre">'; print '<table class="noborder" cellpadding="3" cellspacing="0">';
print '<TD>Nom</TD>'; print '<tr class="liste_titre">';
print '<TD>Valeur</TD>'; print '<td>Paramètre</td>';
print "</TR>\n"; print '<td>Valeur</td>';
print "</tr>\n";
$sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC"; $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const ORDER BY name ASC";
$result = $db->query($sql); $result = $db->query($sql);
@ -43,7 +49,7 @@ if ($result)
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
$var=!$var; $var=!$var;
print "<tr $bc[$var] class=value><td>$obj->name</td>\n"; print "<tr $bc[$var]><td>$obj->name</td>\n";
print '<td>'; print '<td>';
print $obj->value; print $obj->value;

View File

@ -34,27 +34,37 @@
//include_once("../../allpre.inc.php"); //include_once("../../allpre.inc.php");
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print_titre("Résumé des informations systèmes Dolibarr"); print_titre("Résumé des informations systèmes Dolibarr");
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibar</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">Dolibar</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>" . DOL_VERSION . "</td></tr>\n"; print "<tr $bc[1]><td width=\"140\">Version</td><td>" . DOL_VERSION . "</td></tr>\n";
print '</table>'; print '</table>';
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">OS</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">OS</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".get_cfg_var("System")."</td></tr>\n"; // Récupère la version de l'OS
ob_start();
phpinfo();
$chaine = ob_get_contents();
ob_end_clean();
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
print "<tr $bc[1]><td width=\"140\">Version</td><td>".$reg[1]."</td></tr>\n";
print '</table>'; print '</table>';
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Serveur Web</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">Serveur Web</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n"; print "<tr $bc[1]><td width=\"140\">Version</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
print "<tr $bc[0]><td>document root</td><td>" . DOL_DOCUMENT_ROOT . "</td></tr>\n"; print "<tr $bc[0]><td>document root</td><td>" . DOL_DOCUMENT_ROOT . "</td></tr>\n";
@ -62,7 +72,7 @@ print '</table>';
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">PHP</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">PHP</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".phpversion()."</td></tr>\n"; print "<tr $bc[1]><td width=\"140\">Version</td><td>".phpversion()."</td></tr>\n";
print "<tr $bc[0]><td>Liaison Web-PHP</td><td>".php_sapi_name()."</td></tr>\n"; print "<tr $bc[0]><td>Liaison Web-PHP</td><td>".php_sapi_name()."</td></tr>\n";
@ -70,13 +80,23 @@ print '</table>';
print "<br>\n"; print "<br>\n";
print '<table border="1" cellpadding="3" cellspacing="0" width="100%">'; print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Base de données</td></tr>\n"; print "<tr class=\"liste_titre\"><td colspan=\"2\">Base de données</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">type</td><td>" . $conf->db->type . "</td></tr>\n"; $sql = "SHOW VARIABLES LIKE 'version'";
print "<tr $bc[0]><td>host</td><td>" . $conf->db->host . "</td></tr>\n"; $result = $db->query($sql);
print "<tr $bc[1]><td>user</td><td>" . $conf->db->user . "&nbsp;</td></tr>\n"; if ($result)
print "<tr $bc[0]><td>pass</td><td>" . $conf->db->pass . "&nbsp;</td></tr>\n"; {
$row = $db->fetch_row();
}
print "<tr $bc[0]><td>Version</td><td>" . $row[1] . "</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Type</td><td>" . $conf->db->type . "</td></tr>\n";
print "<tr $bc[0]><td>Host</td><td>" . $conf->db->host . "</td></tr>\n";
print "<tr $bc[1]><td>User</td><td>" . $conf->db->user . "&nbsp;</td></tr>\n";
print "<tr $bc[0]><td>Pass</td><td>" . $conf->db->pass . "&nbsp;</td></tr>\n";
print "<tr $bc[1]><td>Database name</td><td>" . $conf->db->name . "</td></tr>\n"; print "<tr $bc[1]><td>Database name</td><td>" . $conf->db->name . "</td></tr>\n";
print '</table>'; print '</table>';

View File

@ -20,9 +20,27 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print "TODO"; print_titre("OS");
print "<br>\n";
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td>Paramètre</td><td>Valeur</td></tr>\n";
// Récupère la version de l'OS
ob_start();
phpinfo();
$chaine = ob_get_contents();
ob_end_clean();
eregi('System </td><td class="v">([^\/]*)</td>',$chaine,$reg);
print "<tr $bc[1]><td width=\"140\"><b>Version</b></td><td>".$reg[1]."</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
?> ?>

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,6 +21,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print "TODO"; print "TODO";

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -20,6 +21,10 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
//require_once "PEAR/Info.php"; //require_once "PEAR/Info.php";
llxHeader(); llxHeader();

View File

@ -20,9 +20,24 @@
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
if (!$user->admin)
accessforbidden();
llxHeader(); llxHeader();
print "TODO"; print_titre("Serveur Web");
print "<br>\n";
print '<table class="noborder" cellpadding="3" cellspacing="0" width="100%">';
print "<tr class=\"liste_titre\"><td colspan=\"2\">Serveur Web</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Version</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
print "<tr $bc[0]><td>Nom du serveur virtuel</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">IP</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
print "<tr $bc[0]><td>Port</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
print "<tr $bc[1]><td width=\"140\">Racine du serveur</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
print '</table>';
llxFooter(); llxFooter();
?> ?>