Użytkownik Marcin Król napisał:
> (...)
> Pozatym, jeśli Ci zależy prześlij diffa. Pujdzie do contrib, a jak się
> spodoba to może i do main, chociaż ja osobiście w main takiej
> funkcjonalności nie chciałbym widzieć.
>
Więc przesyłam diffa do wersji 1.4.3 Velis.
Pozdrawiam
--
Michał Rak
Only in lms/img: publicip.gif
diff -ur lms.orig/lib/LMS.class.php lms/lib/LMS.class.php
--- lms.orig/lib/LMS.class.php 2005-01-13 09:48:18.000000000 +0100
+++ lms/lib/LMS.class.php 2005-02-06 22:09:54.000000000 +0100
@@ -800,7 +800,7 @@
function GetUserNodes($id)
{
- if($result = $this->DB->GetAll('SELECT id, name, mac, ipaddr, inet_ntoa(ipaddr) AS ip, access, warning FROM nodes WHERE ownerid=? ORDER BY name ASC', array($id))){
+ if($result = $this->DB->GetAll('SELECT id, name, mac, ipaddr, inet_ntoa(ipaddr) AS ip, publicipaddr, inet_ntoa(publicipaddr) AS publicip, access, warning FROM nodes WHERE ownerid=? ORDER BY name ASC', array($id))){
$result['total'] = sizeof($result);
$result['ownerid'] = $id;
}
@@ -1115,7 +1115,7 @@
function NodeUpdate($nodedata)
{
$this->SetTS('nodes');
- return $this->DB->Execute('UPDATE nodes SET name=UPPER(?), ipaddr=inet_aton(?), mac=UPPER(?), netdev=?, moddate=?NOW?, modid=?, access=?, warning=?, ownerid=? WHERE id=?', array($nodedata['name'], $nodedata['ipaddr'], $nodedata['mac'], $nodedata['netdev'], $this->SESSION->id, $nodedata['access'], $nodedata['warning'], $nodedata['ownerid'], $nodedata['id']));
+ return $this->DB->Execute('UPDATE nodes SET name=UPPER(?), ipaddr=inet_aton(?), mac=UPPER(?), netdev=?, moddate=?NOW?, modid=?, access=?, warning=?, ownerid=?, publicipaddr=inet_aton(?) WHERE id=?', array($nodedata['name'], $nodedata['ipaddr'], $nodedata['mac'], $nodedata['netdev'], $this->SESSION->id, $nodedata['access'], $nodedata['warning'], $nodedata['ownerid'], $nodedata['publicipaddr'], $nodedata['id'] ));
}
function DeleteNode($id)
@@ -1149,6 +1149,11 @@
return $this->DB->GetOne('SELECT inet_ntoa(ipaddr) FROM nodes WHERE id=?', array($id));
}
+ function GetNodePublicIPByID($id)
+ {
+ return $this->DB->GetOne('SELECT inet_ntoa(publicipaddr) FROM nodes WHERE id=?', array($id));
+ }
+
function GetNodeMACByID($id)
{
return $this->DB->GetOne('SELECT mac FROM nodes WHERE id=?', array($id));
@@ -1166,7 +1171,7 @@
function GetNode($id)
{
- if($result = $this->DB->GetRow('SELECT id, name, ownerid, ipaddr, inet_ntoa(ipaddr) AS ip, mac, access, warning, creationdate, moddate, creatorid, modid, netdev, lastonline FROM nodes WHERE id=?', array($id)))
+ if($result = $this->DB->GetRow('SELECT id, name, ownerid, ipaddr, inet_ntoa(ipaddr) AS ip, mac, access, warning, creationdate, moddate, creatorid, modid, netdev, lastonline, publicipaddr, inet_ntoa(publicipaddr) AS publicip FROM nodes WHERE id=?', array($id)))
{
$result['createdby'] = $this->GetAdminName($result['creatorid']);
$result['modifiedby'] = $this->GetAdminName($result['modid']);
@@ -1209,6 +1214,9 @@
break;
case 'ip':
$sqlord = ' ORDER BY ipaddr';
+ break;
+ case 'publicip':
+ $sqlord = ' ORDER BY publicipaddr';
break;
case 'ownerid':
$sqlord = ' ORDER BY ownerid';
@@ -1218,7 +1226,7 @@
break;
}
- if($nodelist = $this->DB->GetAll('SELECT nodes.id AS id, ipaddr, inet_ntoa(ipaddr) AS ip, mac, nodes.name AS name, ownerid, access, warning, netdev, '.$this->DB->Concat('UPPER(lastname)',"' '",'users.name').' AS owner, lastonline FROM nodes, users WHERE ownerid = users.id AND ownerid > 0'.($sqlord != '' ? $sqlord.' '.$direction : '')))
+ if($nodelist = $this->DB->GetAll('SELECT nodes.id AS id, ipaddr, publicipaddr, inet_ntoa(ipaddr) AS ip, inet_ntoa(publicipaddr) AS publicip, mac, nodes.name AS name, ownerid, access, warning, netdev, '.$this->DB->Concat('UPPER(lastname)',"' '",'users.name').' AS owner, lastonline FROM nodes, users WHERE ownerid = users.id AND ownerid > 0'.($sqlord != '' ? $sqlord.' '.$direction : '')))
{
foreach($nodelist as $idx => $row)
{
@@ -1258,6 +1266,9 @@
case 'ip':
$sqlord = ' ORDER BY ipaddr';
break;
+ case 'publicip':
+ $sqlord = ' ORDER BY publicipaddr';
+ break;
case 'ownerid':
$sqlord = ' ORDER BY ownerid';
break;
@@ -1272,6 +1283,9 @@
case 'ipaddr' :
$searchargs[] = "inet_ntoa(ipaddr) ?LIKE? '%".trim($value)."%'";
break;
+ case 'publicipaddr' :
+ $searchargs[] = "inet_ntoa(publicipaddr) ?LIKE? '%".trim($value)."%'";
+ break;
default :
$searchargs[] = $idx." ?LIKE? '%".$value."%'";
}
@@ -1285,7 +1299,7 @@
foreach($username as $idx => $row)
$usernames[$row['id']] = $row['username'];
- if($nodelist = $this->DB->GetAll('SELECT id, ipaddr, inet_ntoa(ipaddr) AS ip, mac, name, ownerid, access, warning FROM nodes '.$searchargs.' '.($sqlord != '' ? $sqlord.' '.$direction : '')))
+ if($nodelist = $this->DB->GetAll('SELECT id, ipaddr, inet_ntoa(ipaddr) AS ip, publicipaddr, inet_ntoa(publicipaddr) AS publicip, mac, name, ownerid, access, warning FROM nodes '.$searchargs.' '.($sqlord != '' ? $sqlord.' '.$direction : '')))
{
foreach($nodelist as $idx => $row)
{
@@ -1377,7 +1391,7 @@
function NodeAdd($nodedata)
{
$this->SetTS('nodes');
- if($this->DB->Execute('INSERT INTO nodes (name, mac, ipaddr, ownerid, creatorid, creationdate, access, warning) VALUES (?, ?, inet_aton(?), ?, ?, ?NOW?, ?, ?)', array(strtoupper($nodedata['name']),strtoupper($nodedata['mac']),$nodedata['ipaddr'],$nodedata['ownerid'],$this->SESSION->id, $nodedata['access'], $nodedata['warning'])))
+ if($this->DB->Execute('INSERT INTO nodes (name, mac, ipaddr, ownerid, creatorid, creationdate, access, warning, publicipaddr) VALUES (?, ?, inet_aton(?), ?, ?, ?NOW?, ?, ?, inet_aton(?))', array(strtoupper($nodedata['name']),strtoupper($nodedata['mac']),$nodedata['ipaddr'],$nodedata['ownerid'],$this->SESSION->id, $nodedata['access'], $nodedata['warning'], $nodedata['publicipaddr'])))
return $this->DB->GetOne('SELECT MAX(id) FROM nodes');
else
return FALSE;
@@ -2071,6 +2085,11 @@
return !($this->DB->GetOne('SELECT * FROM nodes WHERE ipaddr=inet_aton(?)', array($ip)) ? TRUE : FALSE);
}
+ function IsPublicIPFree($ip)
+ {
+ return !($this->DB->GetOne('SELECT * FROM nodes WHERE publicipaddr=inet_aton(?)', array($ip)) ? TRUE : FALSE);
+ }
+
function IsIPGateway($ip)
{
return ($this->DB->GetOne('SELECT gateway FROM networks WHERE gateway = ?', array($ip)) ? TRUE : FALSE);
diff -ur lms.orig/modules/nodeadd.php lms/modules/nodeadd.php
--- lms.orig/modules/nodeadd.php 2005-01-13 09:48:18.000000000 +0100
+++ lms/modules/nodeadd.php 2005-02-06 21:50:32.000000000 +0100
@@ -30,6 +30,7 @@
if(isset($nodedata))
{
$nodedata['ipaddr'] = $_POST['nodedataipaddr'];
+ $nodedata['publicipaddr'] = $_POST['nodedatapublicipaddr'];
$nodedata['mac'] = $_POST['nodedatamac'];
$nodedata['mac'] = str_replace('-',':',$nodedata['mac']);
@@ -66,6 +67,16 @@
elseif($LMS->IsIPGateway($nodedata['ipaddr']))
$error['ipaddr'] = 'Podany adres IP jest adresem bramy!';
+ if($nodedata['publicipaddr']!="")
+ {
+ if(!check_ip($nodedata['publicipaddr']))
+ $error['publicipaddr'] = 'Podany adres IP jest niepoprawny!';
+ elseif(!$LMS->IsPublicIPFree($nodedata['publicipaddr']) && !$nodedata['publicipaddr']=="255.255.255.255")
+ $error['publicipaddr'] = 'Podany adres IP jest zajêty!';
+ }
+ else
+ $nodedata['publicipaddr'] = "255.255.255.255";
+
if(!$nodedata['mac'])
$error['mac'] = 'Proszê podac adres MAC!';
elseif($LMS->CONFIG['phpui']['allow_mac_sharing'] == FALSE)
diff -ur lms.orig/modules/nodeedit.php lms/modules/nodeedit.php
--- lms.orig/modules/nodeedit.php 2005-01-13 09:48:18.000000000 +0100
+++ lms/modules/nodeedit.php 2005-02-06 21:50:56.000000000 +0100
@@ -65,6 +65,7 @@
if(isset($nodeedit))
{
$nodeedit['ipaddr'] = $_POST['nodeeditipaddr'];
+ $nodeedit['publicipaddr'] = $_POST['nodeeditpublicipaddr'];
$nodeedit['mac'] = $_POST['nodeeditmac'];
$nodeedit['mac'] = str_replace('-',':',$nodeedit['mac']);
foreach($nodeedit as $key => $value)
@@ -92,6 +93,20 @@
else
$error['ipaddr'] = 'Podany adres IP jest niepoprawny!';
+ if($nodeedit['publicipaddr']!="")
+ {
+ if(check_ip($nodeedit['publicipaddr']))
+ {
+ $ip = $LMS->GetNodePublicIPByID($nodeedit['id']);
+ if($ip!=$nodeedit['publicipaddr'] && !$LMS->IsPublicIPFree($nodeedit['publicipaddr']))
+ $error['publicipaddr'] = 'Podany adres IP jest zajêty!';
+ }
+ else
+ $error['publicipaddr'] = 'Podany adres IP jest niepoprawny!';
+ }
+ else
+ $nodeedit['publicipaddr']="255.255.255.255";
+
if(check_mac($nodeedit['mac']))
{
if($LMS->CONFIG['phpui']['allow_mac_sharing'] == FALSE)
@@ -126,6 +141,7 @@
$nodeinfo['name'] = $nodeedit['name'];
$nodeinfo['mac'] = $nodeedit['mac'];
$nodeinfo['ip'] = $nodeedit['ipaddr'];
+ $nodeinfo['publicip'] = $nodeedit['publicipaddr'];
$nodeinfo['access'] = $nodeedit['access'];
$nodeinfo['ownerid'] = $nodeedit['ownerid'];
diff -ur lms.orig/templates/nodeaddbox.html lms/templates/nodeaddbox.html
--- lms.orig/templates/nodeaddbox.html 2004-07-17 15:25:16.000000000 +0200
+++ lms/templates/nodeaddbox.html 2005-02-06 22:03:09.000000000 +0100
@@ -24,6 +24,17 @@
</TR>
<TR CLASS="LIGHT">
<TD WIDTH="1%" CLASS="FLEFT">
+ <IMG SRC="img/publicip.gif" BORDER="0" ALT="Publiczny adres IP:">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>Publiczny adres IP:</B>
+ </TD>
+ <TD WIDTH="98%" CLASS="FRIGHT">
+ <INPUT TYPE="TEXT" NAME="nodedatapublicipaddr" VALUE="{$nodedata.publicipaddr}" {tip text="Wpisz publiczny adres IP" trigger="publicipaddr"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%" CLASS="FLEFT">
<IMG SRC="img/mac.gif" BORDER="0" ALT="Adres MAC:">
</TD>
<TD WIDTH="1%" NOWRAP>
diff -ur lms.orig/templates/nodeeditbox.html lms/templates/nodeeditbox.html
--- lms.orig/templates/nodeeditbox.html 2004-09-02 22:36:02.000000000 +0200
+++ lms/templates/nodeeditbox.html 2005-02-06 21:56:16.000000000 +0100
@@ -20,6 +20,14 @@
</TR>
<TR CLASS="LIGHT">
<TD WIDTH="1%" CLASS="FLEFT">
+ <IMG SRC="img/publicip.gif" BORDER="0" ALT="Publiczny adres IP:">
+ </TD>
+ <TD WIDTH="99%" CLASS="FRIGHT" COLSPAN="2">
+ <INPUT TYPE="TEXT" NAME="nodeeditpublicipaddr" VALUE="{if $nodeinfo.publicip ne "255.255.255.255"}{$nodeinfo.publicip}{/if}" {tip text="Wpisz publiczny adres IP" trigger="publicipaddr"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%" CLASS="FLEFT">
<IMG SRC="img/mac.gif" BORDER="0" ALT="Adres MAC:">
</TD>
<TD WIDTH="99%" CLASS="FRIGHT" COLSPAN="2">
diff -ur lms.orig/templates/nodeinfobox.html lms/templates/nodeinfobox.html
--- lms.orig/templates/nodeinfobox.html 2004-08-14 18:14:33.000000000 +0200
+++ lms/templates/nodeinfobox.html 2005-02-06 21:56:30.000000000 +0100
@@ -18,6 +18,14 @@
</TR>
<TR CLASS="LIGHT">
<TD WIDTH="1%" CLASS="FLEFT">
+ <IMG SRC="img/publicip.gif" BORDER="0" ALT="Publiczny adres IP:">
+ </TD>
+ <TD WIDTH="99%" CLASS="FRIGHT" COLSPAN="2">
+ {if $nodeinfo.publicip ne "255.255.255.255"} {$nodeinfo.publicip}{else} <B>brak</B>{/if}
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%" CLASS="FLEFT">
<IMG SRC="img/mac.gif" BORDER="0" ALT="Adres MAC:">
</TD>
<TD WIDTH="99%" CLASS="FRIGHT" COLSPAN="2">
diff -ur lms.orig/templates/nodelist.html lms/templates/nodelist.html
--- lms.orig/templates/nodelist.html 2004-08-25 14:52:18.000000000 +0200
+++ lms/templates/nodelist.html 2005-02-06 21:56:54.000000000 +0100
@@ -4,16 +4,17 @@
<H1>{$layout.pagetitle}</H1>
<table cellpadding="3" width="100%">
<TR class="dark" {tip text="Kliknij na nazwie kolumny aby zmieniæ kryteria sortowania"}>
- <TD class="fleftu" width="97%">
+ <TD class="fleftu" width="97%" valign="top">
<img src="img/node.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodelist&o=name{if $listdata.direction eq "asc" && $listdata.order eq "name"},desc{/if}"><B>Nazwa:</B></A> {if $listdata.order eq "name"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
<img src="img/user.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodelist&o=owner{if $listdata.direction eq "asc" && $listdata.order eq "owner"},desc{/if}">W³a¶ciciel:</A> {if $listdata.order eq "owner"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
<TD Class="fbt" align="right" valign="top" width="1%" nowrap>
- <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodelist&o=id{if $listdata.direction eq "asc" && $listdata.order eq "id"},desc{/if}">ID:</A> {if $listdata.order eq "id"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
+ <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodelist&o=id{if $listdata.direction eq "asc" && $listdata.order eq "id"},desc{/if}">ID:</A>{if $listdata.order eq "id"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
<img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodelist&o=ownerid{if $listdata.direction eq "asc" && $listdata.order eq "ownerid"},desc{/if}">ID w³a¶ciciela:</A> {if $listdata.order eq "ownerid"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
- <TD CLASS="fbt" width="1%">
+ <TD CLASS="fbt" width="1%" nowrap>
<img src="img/ip.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodelist&o=ip{if $listdata.direction eq "asc" && $listdata.order eq "ip"},desc{/if}">Adres IP:</A> {if $listdata.order eq "ip"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
+ <img src="img/publicip.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodelist&o=publicip{if $listdata.direction eq "asc" && $listdata.order eq "publicip"},desc{/if}">Publiczny adres IP:</A> {if $listdata.order eq "publicip"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
<img src="img/mac.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodelist&o=mac{if $listdata.direction eq "asc" && $listdata.order eq "mac"},desc{/if}">Adres MAC:</A> {if $listdata.order eq "mac"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
<TD CLASS="frightu" width="1%" align="right">
@@ -36,7 +37,7 @@
{/if}
{cycle values="#DFD5BD,#EBE4D6" print=false}{section name=nodelist loop=$nodelist start=$start max=$pagelimit}
<TR bgcolor="{cycle}" {cycle print=false} onmouseover="setPointer(this, '#CCFFCC')" onmouseout="setPointer(this, '{cycle}')"{if ! $nodelist[nodelist].access} class="blend"{/if}>
- <TD width="95%" class="fleft" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';">
+ <TD width="95%" class="fleft" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';" valign="top">
<a name="{$nodelist[nodelist].id}">
{if $nodelist[nodelist].lastonline}
{if ($smarty.now-$nodelist[nodelist].lastonline) > $_config.phpui.lastonline_limit}
@@ -56,7 +57,8 @@
</TD>
<TD width="1%" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';">
<img src="img/ip.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].ip}<BR>
- <nobr><img src="img/mac.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].mac}</nobr>
+ {if $nodelist[nodelist].publicip ne "255.255.255.255"}<img src="img/publicip.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].publicip}<BR>
+ {/if}<nobr><img src="img/mac.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].mac}</nobr>
</TD>
<TD class="fright" width="1%">
<nobr>
diff -ur lms.orig/templates/nodesearch.html lms/templates/nodesearch.html
--- lms.orig/templates/nodesearch.html 2003-12-15 01:47:00.000000000 +0100
+++ lms/templates/nodesearch.html 2005-02-06 22:07:14.000000000 +0100
@@ -7,36 +7,56 @@
<INPUT TYPE="hidden" NAME="m" VALUE="nodesearch">
<TABLE WIDTH="100%" CELLPADDING="3">
<TR CLASS="DARK">
- <TD CLASS="FALL" COLSPAN="2">
+ <TD CLASS="FALL" COLSPAN="3">
<B>Wy¶wietl komputery spe³niaj±ce nastêpuj±ce kryteria:</B>
</TD>
</TR>
<TR CLASS="LIGHT">
<TD CLASS="fleft" WIDTH="1%" NOWRAP>
+ <IMG SRC="img/node.gif" BORDER="0" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
<NOBR><B>Nazwa komputera:</B></NOBR>
</TD>
- <TD CLASS="fright" WIDTH="99%">
+ <TD CLASS="fright" WIDTH="98%">
<INPUT TYPE="text" NAME="search[name]" {tip text="Podaj nazwê komputera, albo jej fragment"}>
</TD>
</TR>
<TR CLASS="LIGHT">
<TD CLASS="fleft" WIDTH="1%" NOWRAP>
+ <IMG SRC="img/mac.gif" BORDER="0" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
<NOBR><B>Adres MAC:</B></NOBR>
</TD>
- <TD CLASS="fright" WIDTH="99%">
+ <TD CLASS="fright" WIDTH="98%">
<INPUT TYPE="text" NAME="search[mac]" {tip text="Podaj adres MAC komputera, albo jego fragment"}>
</TD>
</TR>
<TR CLASS="LIGHT">
<TD CLASS="fleft" WIDTH="1%" NOWRAP>
+ <IMG SRC="img/ip.gif" BORDER="0" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
<NOBR><B>Adres IP:</B></NOBR>
</TD>
- <TD CLASS="fright" WIDTH="99%">
+ <TD CLASS="fright" WIDTH="98%">
<INPUT TYPE="text" NAME="search[ipaddr]" {tip text="Podaj adres IP komputera, albo jego fragment"}>
</TD>
</TR>
+ <TR CLASS="LIGHT">
+ <TD CLASS="fleft" WIDTH="1%" NOWRAP>
+ <IMG SRC="img/publicip.gif" BORDER="0" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <NOBR><B>Publiczny adres IP:</B></NOBR>
+ </TD>
+ <TD CLASS="fright" WIDTH="98%">
+ <INPUT TYPE="text" NAME="search[publicipaddr]" {tip text="Podaj publiczny adres IP komputera, albo jego fragment"}>
+ </TD>
+ </TR>
<TR CLASS="light">
- <TD CLASS="fbottomu" WIDTH="100%" COLSPAN="2" ALIGN="right">
+ <TD CLASS="fbottomu" WIDTH="100%" COLSPAN="3" ALIGN="right">
<A href="javascript:document.nodesearch.submit()">Szukaj<IMG SRC="img/search.gif" BORDER="0" ALIGN="absmiddle" ALT=""></A>
</TD>
</TR>
diff -ur lms.orig/templates/nodesearchresults.html lms/templates/nodesearchresults.html
--- lms.orig/templates/nodesearchresults.html 2004-08-30 11:07:33.000000000 +0200
+++ lms/templates/nodesearchresults.html 2005-02-06 21:57:34.000000000 +0100
@@ -4,16 +4,17 @@
<H1>{$layout.pagetitle}</H1>
<table cellpadding="3" width="100%">
<TR class="dark" {tip text="Kliknij na nazwie kolumny aby zmieniæ kryteria sortowania"}>
- <TD class="fleftu" width="97%">
+ <TD class="fleftu" width="97%" valign="top">
<img src="img/node.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodesearch&search&o=name{if $listdata.direction eq "asc" && $listdata.order eq "name"},desc{/if}"><B>Nazwa:</B></A> {if $listdata.order eq "name"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
<img src="img/user.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodesearch&search&o=owner{if $listdata.direction eq "asc" && $listdata.order eq "owner"},desc{/if}">W³a¶ciciel:</A> {if $listdata.order eq "owner"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
<TD Class="fbt" align="right" valign="top" width="1%" nowrap>
- <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodesearch&search&o=id{if $listdata.direction eq "asc" && $listdata.order eq "id"},desc{/if}">ID:</A> {if $listdata.order eq "id"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
- <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodesearch&search&o=ownerid{if $listdata.direction eq "asc" && $listdata.order eq "ownerid"},desc{/if}">ID w³a¶ciciela:</A> {if $listdata.order eq "ownerid"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
+ <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodesearch&search&o=id{if $listdata.direction eq "asc" && $listdata.order eq "id"},desc{/if}">ID:</A>{if $listdata.order eq "id"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
+ <img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><A href="?m=nodesearch&search&o=ownerid{if $listdata.direction eq "asc" && $listdata.order eq "ownerid"},desc{/if}">ID w³a¶ciciela:</A>{if $listdata.order eq "ownerid"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
- <TD CLASS="fbt" width="1%">
+ <TD CLASS="fbt" width="1%" nowrap>
<img src="img/ip.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodesearch&search&o=ip{if $listdata.direction eq "asc" && $listdata.order eq "ip"},desc{/if}">Adres IP:</A> {if $listdata.order eq "ip"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
+ <img src="img/publicip.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodesearch&search&o=publicip{if $listdata.direction eq "asc" && $listdata.order eq "publicip"},desc{/if}">Publiczny adres IP:</A> {if $listdata.order eq "publicip"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}<BR>
<img src="img/mac.gif" border="0" ALT="" align="absmiddle"> <A href="?m=nodesearch&search&o=mac{if $listdata.direction eq "asc" && $listdata.order eq "mac"},desc{/if}">Adres MAC:</A> {if $listdata.order eq "mac"}<IMG SRC="img/{if $listdata.direction eq "desc"}asc{else}desc{/if}_order.gif" align="absmiddle" border="0" ALT="">{/if}
</TD>
<TD CLASS="frightu" width="1%" align="right">
@@ -35,7 +36,7 @@
{/if}
{cycle values="#DFD5BD,#EBE4D6" print=false}{section name=nodelist loop=$nodelist start=$start max=$pagelimit}
<TR bgcolor="{cycle}" {cycle print=false} onmouseover="setPointer(this, '#CCFFCC')" onmouseout="setPointer(this, '{cycle}')"{if ! $nodelist[nodelist].access} class="blend"{/if}>
- <TD width="95%" class="fleft" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';">
+ <TD width="95%" class="fleft" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';" valign="top">
<a name="{$nodelist[nodelist].id}"><img src="img/node.gif" border="0" ALT="" align="absmiddle"> <B>{$nodelist[nodelist].name}</B></A><BR>
<img src="img/user.gif" border="0" ALT="" align="absmiddle"> <A href="?m=userinfo&id={$nodelist[nodelist].ownerid}">{if ! $nodelist[nodelist].access}<font color="#888888">{/if}{$nodelist[nodelist].owner|truncate:60:" ..."|replace:" ":" "}{if ! $nodelist[nodelist].access}</FONT>{/if}</A>
</TD>
@@ -43,8 +44,9 @@
<img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16">({$nodelist[nodelist].id|string_format:"%04d"})<BR>
<img src="img/empty.gif" align="absmiddle" ALT="" border="0" width="1" height="16"><font class="blend">({$nodelist[nodelist].ownerid|string_format:"%04d"})</font>
</TD>
- <TD width="1%" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';">
+ <TD width="1%" onClick="return self.location.href='?m=nodeinfo&id={$nodelist[nodelist].id}';" nowrap>
<img src="img/ip.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].ip}<BR>
+ {if $nodelist[nodelist].publicip ne "255.255.255.255"}<img src="img/publicip.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].publicip}<BR>{/if}
<img src="img/mac.gif" border="0" ALT="" align="absmiddle"> {$nodelist[nodelist].mac}
</TD>
<TD class="fright" width="1%">
diff -ur lms.orig/templates/usernodesbox.html lms/templates/usernodesbox.html
--- lms.orig/templates/usernodesbox.html 2004-03-15 23:21:17.000000000 +0100
+++ lms/templates/usernodesbox.html 2005-02-06 21:58:08.000000000 +0100
@@ -19,7 +19,7 @@
</TD>
<TD WIDTH="97%" onClick="return self.location.href='?m=nodeinfo&id={$usernodes[usernodes].id}';">
<B>{$usernodes[usernodes].name}</B><BR>
- {$usernodes[usernodes].ip} / {$usernodes[usernodes].mac}
+ {$usernodes[usernodes].ip}{if $usernodes[usernodes].publicip ne "255.255.255.255"} ({$usernodes[usernodes].publicip}){/if} / {$usernodes[usernodes].mac}
</TD>
<TD WIDTH="1%" ALIGN="RIGHT" VALIGN="TOP" onClick="return self.location.href='?m=nodeinfo&id={$usernodes[usernodes].id}';">
({$usernodes[usernodes].id|string_format:"%04d"})
ALTER TABLE `nodes` ADD `publicipaddr` INT( 16 ) UNSIGNED DEFAULT '4294967295' NOT NULL ;