forked from poppyred/1.6.x
/
system.nic.infos.php
executable file
·103 lines (69 loc) · 2.42 KB
/
system.nic.infos.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.system.network.inc');
//info=proc
$usersmenus=new usersMenus();
if($usersmenus->AsSystemAdministrator==false){exit;}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["proc"])){popup_proc();exit;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$tile=$tpl->_ENGINE_parse_body('{network_hardware_infos}');
$start="NicinfosStart()";
if($_GET["info"]=='proc'){$start="ProcinfosStart()";}
$html="
function NicinfosStart(){
YahooWin2('600','$page?popup=yes','$tile');
}
function ProcinfosStart(){
YahooWin2('600','$page?proc=yes','$tile');
}
$start;
";
echo $html;
}
function popup(){
$infos=infos();
$html="<span style='font-size:16px;font-weight:bold'>{network_hardware_infos_text}</span>
<br>
<div style='width:100%;height:400px;overflow:auto'>$infos</div>
";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
function popup_proc(){
$infos=infos_proc();
$html="<H1>{proc_hardware_infos_text}</H1>
<br>
<div style='width:100%;height:400px;overflow:auto'>$infos</div>
";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
function infos(){
if(!is_file("ressources/logs/LSHW.NET.HTML")){
$error=@file_get_contents("ressources/logs/LSHW.ERROR.TXT");
return "<H2 style='color:red'>{could_not_open_infos} ($error)</H2>";}
$datas=file_get_contents("ressources/logs/LSHW.NET.HTML");
return transform_datas($datas);
}
function infos_proc(){
if(!is_file("ressources/logs/LSHW.PROC.HTML")){return "<H2 style='color:red'>{could_not_open_infos}</H2>";}
$datas=file_get_contents("ressources/logs/LSHW.PROC.HTML");
return transform_datas($datas);
}
function transform_datas($datas){
if(preg_match("#<body>(.+?)</body>#is",$datas,$re)){$datas=$re[1];}
$datas=str_replace("class=\"first\"","class=legend valign='top'",$datas);
$datas=str_replace("class=\"second\"","style='font-size:12px;font-weight:bold'",$datas);
$datas=str_replace("class=\"node\"","class=table_form style='margin:5px'",$datas);
$datas=str_replace("class=\"node-disabled\"","class=table_form style='margin:5px'",$datas);
$datas=str_replace("class=\"sub-first\"","class=legend",$datas);
$datas=str_replace(">width: <","nowrap>32/64 capabilities:<",$datas);
return $datas;
}
?>