Просмотр исходного кода

add translation for snmp forms

rajven 3 лет назад
Родитель
Сommit
a082325459

+ 2 - 3
html/admin/devices/mactable.php

@@ -37,6 +37,5 @@ foreach ($ports as $port) {
     }
 }
 print "</table>\n";
-?>
-</body>
-</html>
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
+?>

+ 23 - 20
html/admin/devices/portmactable.php

@@ -2,21 +2,26 @@
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
-?>
-<html>
-<head>
-<title>Панель администратора</title>
-<link rel="stylesheet" type="text/css"	href="/<?php echo HTML_STYLE.".css"; ?>">
-<meta http-equiv="content-type" content="application/xhtml+xml">
-<meta charset="UTF-8">
-</head>
-<body>
-<div id="cont">
-<?php
+
 $port_id = $id;
-$sSQL = "SELECT DP.port, DP.snmp_index, D.device_name, D.ip, D.snmp_version, D.community, D.fdb_snmp_index, D.vendor_id FROM `device_ports` AS DP, devices AS D WHERE D.id = DP.device_id AND DP.id=$port_id";
+$sSQL = "SELECT DP.device_id, DP.port, DP.snmp_index, D.device_name, D.ip, D.snmp_version, D.community, D.fdb_snmp_index, D.vendor_id FROM `device_ports` AS DP, devices AS D WHERE D.id = DP.device_id AND DP.id=$port_id";
 $port_info = get_record_sql($db_link, $sSQL);
 
+$device_id = $port_info["device_id"];
+
+$device=get_record($db_link,'devices',"id=".$device_id);
+$user_info = get_record_sql($db_link,"SELECT * FROM User_list WHERE id=".$device['user_id']);
+
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
+
+print_device_submenu($page_url);
+print_editdevice_submenu($page_url,$id,$device['device_type'],$user_info['login']);
+
+?>
+
+<div id="contsubmenu">
+<?php
+
 $display_name = " ".$port_info['port']." свича ".$port_info['device_name'];
 print "<b>".$port_info['device_name']." [".$port_info['port']."] </b><br>\n";
 
@@ -30,7 +35,7 @@ if ($port_info['vendor_id'] == 9) {
 
 if ($port_info['snmp_index'] > 0) {
     print "<table class=\"data\" cellspacing=\"1\" cellpadding=\"4\">\n";
-    print "<tr><td><b>Список маков активных на порту</b></td></tr>\n";
+    print "<tr><td><b>".WEB_device_port_mac_table_show."</b></td></tr>\n";
     if (! $port_info['fdb_snmp_index']) { $port_info['snmp_index'] = $port_info['port']; }
     $fdb = get_fdb_port_table($port_info['ip'], $port_info['snmp_index'], $port_info['community'], $port_info['snmp_version']);
     foreach ($fdb as $a_mac => $a_port) {
@@ -46,12 +51,12 @@ if ($port_info['snmp_index'] > 0) {
 ?>
 <table class="data">
 <tr>
-<td>Mac</td>
-<td>User</td>
-<td>Last found</td>
+<td><?php echo WEB_cell_mac; ?></td>
+<td><?php echo WEB_cell_login; ?></td>
+<td><?php echo WEB_cell_last_found; ?></td>
 </tr>
 <?php
-print "<b>Список маков когда-либо обнаруженных на порту</b><br>\n";
+print "<b>".WEB_device_port_mac_table_history."</b><br>\n";
 $d_sql = "select A.ip,A.ip_int,A.mac,A.id,A.dns_name,A.last_found from User_auth as A, connections as C where C.port_id=$port_id and A.id=C.auth_id order by A.ip_int";
 $t_device = mysqli_query($db_link, $d_sql);
 while (list ($f_ip, $f_int, $f_mac, $f_auth_id, $f_dns, $f_last) = mysqli_fetch_array($t_device)) {
@@ -74,7 +79,5 @@ while (list ($fmac, $f_last) = mysqli_fetch_array($maclist)) {
     print "<td class=\"data\">$f_last</td>\n";
     print "</tr>";
 }
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
 ?>
-</table>
-</body>
-</html>

+ 8 - 8
html/admin/devices/portsbyvlan.php

@@ -10,9 +10,9 @@ print_device_submenu($page_url);
 <div id="cont">
 <br>
 <form name="def" action="portsbyvlan.php" method="post">
-<b>Список портов в влане &nbsp</b> <?php print_vlan_select($db_link,'id',$id); ?>
-<input type="submit" name="show_vlan" value="Показать">
-Отображать:<?php print_row_at_pages('rows',$displayed); ?>
+<b><?php echo WEB_device_ports_by_vlan; ?> &nbsp</b> <?php print_vlan_select($db_link,'id',$id); ?>
+<input type="submit" name="show_vlan" value="<?php echo WEB_btn_show; ?>">
+<?php print WEB_rows_at_page; print_row_at_pages('rows',$displayed); ?>
 </form>
 
 <?php
@@ -28,8 +28,8 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 
 <table class="data">
 <tr>
-<td>Device</td>
-<td>Port</td>
+<td><?php echo WEB_cell_name; ?></td>
+<td><?php echo WEB_device_port_name; ?></td>
 </tr>
 <?php
 $sSQL = "SELECT DP.id, DP.port, D.id, D.device_name FROM `device_ports` AS DP, devices AS D WHERE D.id = DP.device_id AND DP.vlan=$id";
@@ -42,6 +42,6 @@ while (list ($f_port_id,$f_port,$f_switch_id,$f_switch) = mysqli_fetch_array($po
 }
 ?>
 </table>
-<?php print_navigation($page_url,$page,$displayed,$count_records[0],$total); ?>
-</body>
-</html>
+<?php print_navigation($page_url,$page,$displayed,$count_records[0],$total); 
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
+?>

+ 14 - 16
html/admin/devices/snmpwalk.php

@@ -2,20 +2,20 @@
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
+
+$device=get_record($db_link,'devices',"id=".$id);
+$user_info = get_record_sql($db_link,"SELECT * FROM User_list WHERE id=".$device['user_id']);
+
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
+print_device_submenu($page_url);
+print_editdevice_submenu($page_url,$id,$device['device_type'],$user_info['login']);
+
 ?>
-<html>
-<head>
-<title>Панель администратора</title>
-<link rel="stylesheet" type="text/css" href="/<?php echo HTML_STYLE.".css"; ?>">
-<meta http-equiv="content-type" content="application/xhtml+xml">
-<meta charset="UTF-8">
-</head>
-<body>
-<div id="cont">
+
+<div id="contsubmenu">
 <?php
-$dev_info = get_record($db_link,'devices','id='.$id);
-$interfaces = get_snmp_interfaces($dev_info['ip'], $dev_info['community'], $dev_info['snmp_version']);
-$dev_info = walk_snmp($dev_info['ip'], $dev_info['community'], $dev_info['snmp_version'],SYSINFO_MIB);
+$interfaces = get_snmp_interfaces($device['ip'], $device['community'], $device['snmp_version']);
+$dev_info = walk_snmp($device['ip'], $device['community'], $device['snmp_version'],SYSINFO_MIB);
 foreach ($dev_info as $key => $value) {
 list ($v_type,$v_data)=explode(':',$value);
 $v_clean = preg_replace('/\s/', '', $v_data);
@@ -29,7 +29,5 @@ list ($v_type,$v_data)=explode(':',$int);
 print "<tr><td class=\"data\">$key</td><td class=\"data\"> $v_data</td></tr>"; 
 }
 print "</table>\n";
-?>
-</div>
-</body>
-</html>
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
+?>

+ 5 - 0
html/inc/languages/russian.php

@@ -309,5 +309,10 @@ define("WEB_device_show_location","Расположение оборудован
 
 /* mac table */
 define("WEB_device_mac_table_show","Список маков активных на оборудовании");
+define("WEB_device_port_mac_table_show","Список маков активных на порту оборудования");
+define("WEB_device_port_mac_table_history","Список маков когда-либо обнаруженных на порту");
+
+/* portsbyvlan */
+define("WEB_device_ports_by_vlan","Список портов в влане");
 
 ?>