Administration : add information about system

This commit is contained in:
Dany De Bontridder 2015-10-19 14:35:09 +02:00
parent db9835387b
commit a8f22675a3
3 changed files with 60 additions and 6 deletions

View file

@ -91,11 +91,63 @@ if ( $action== 'restore')
}
if ($action== 'audit_log')
{
/* List the connexion successuf and failed */
/* List the connexion successfull and failed */
require_once NOALYSS_INCLUDE."/audit_log.php";
}
if ( $action == "logout") {
require_once 'logout.php';
if ( $action == "info") {
echo "<h2>"._("Paramètre base de données")."</h2>";
$a_option = array ("client_encoding","lc_collate","listen_addresses",
"server_encoding","work_mem","shared_buffers","server_version",
"hba_file","config_file","data_directory");
echo '<ul style="list-style:square">';
echo "<li>";
echo _('Hôte')." = ".noalyss_psql_host;
echo "</li>";
echo "<li>";
echo _('Port')." = ".noalyss_psql_port;
echo "</li>";
echo "<li>";
echo _('Utilisateur')." = ".noalyss_user;
echo "</li>";
for ( $i = 0 ; $i < count($a_option); $i++) {
$name=$a_option[$i];
$sql="select setting from pg_settings where name=$1";
$value=$rep->get_value($sql,array($name));
echo "<li> ".$name." = ".$value."</li>";
}
echo "</ul>";
echo "<h2>"._('Paramètre PHP')."</h2>";
ob_start();
echo phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_ENVIRONMENT | INFO_VARIABLES);
$r=ob_get_clean();
$html=new DOMDocument();
$html->loadHTML($r);
$nodelist=$html->getElementsByTagName("style");
$nodelist->item(0)->nodeValue='
.p {text-align: left;}
.e {background-color: #ccccff; font-weight: bold; color: #000000;}
.h {background-color: #9999cc; font-weight: bold; color: #000000;word-wrap:break-word;word-break: break-all;}
.v {background-color: #cccccc; color: #000000;;word-wrap:break-word;word-break: break-all}
.vr {background-color: #cccccc; text-align: right; color: #000000;word-wrap:break-word;word-break: break-all}
img {float: right; border: 0px;}
hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}
';
$a_table=$html->getElementsByTagName("table");
for ( $i = 0 ; $i < $a_table->length;$i++) {
$a_table->item($i)->attributes->getNamedItem("width")->nodeValue="100%";
}
$a_title = $html->getElementsByTagName("title");
for ( $i = 0;$i<$a_title->length;$i++) {
$a_title->item($i)->nodeValue="";
}
echo $html->saveHTML();
}
?>
</DIV>

View file

@ -298,8 +298,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
{
echo '<!doctype html>';
printf("\n");
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
printf("\n");
}
else {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN" >';
@ -316,6 +315,7 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
<TITLE>$title</TITLE>
<link rel=\"icon\" type=\"image/ico\" href=\"favicon.ico\" />
<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
<LINK REL=\"stylesheet\" type=\"text/css\" href=\"".$style."?version=".SVNINFO."\" media=\"screen\"/>
<link rel=\"stylesheet\" type=\"text/css\" href=\"./style-print.css?version=".SVNINFO."\" media=\"print\"/>" .
$p_script2 . "

View file

@ -112,7 +112,9 @@ function MenuAdmin()
array("admin-noalyss.php?action=modele_mgt",_("Modèles"),_('Gestion des modèles'),2),
array("admin-noalyss.php?action=restore",_("Restaure"),_("Restaure une base de données"),3),
array("admin-noalyss.php?action=audit_log",_("Audit"),_("Utilisateurs qui se sont connectés"),4),
array("login.php",_("Accueil"))
array("admin-noalyss.php?action=info",_("Information système")),
array("login.php",_("Accueil")),
array("logout.php",_("Sortie"))
);
}
else