11 Mar
2009
11 Mar
'09
14:42
W załączeniu patch, który otrzymałem od Roberta (CyberM) odnośnie Radiusa w LMSie. Patch wymaga kilku zmian dla postgresa, a ponieważ w tym tygodniu mogę nie mieć czasu go dopracować, więc przesyłam tutaj. Może ktoś będzie miał ochotę przeglądnąć/poprawić/skomentować.
--
Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252
LAN Management System Developer http://lms.org.pl
Roundcube Webmail Project Developer http://roundcube.net
!DSPAM:49b7bf7d147101327519691!
diff -Naur ./lms-cvs/doc/ChangeLog ./lms/doc/ChangeLog
--- ./lms-cvs/doc/ChangeLog 2009-02-27 20:07:00.000000000 +0100
+++ ./lms/doc/ChangeLog 2009-03-02 02:30:45.000000000 +0100
@@ -7,6 +7,7 @@
- changed length of ewx_pt_config.name column type to 32 characters (alec)
- lmsd: added 'skip_disabled' option in ewx-pt and ewx-stm modules (alec)
- BTS:0000787: fixed parse error in transferforms2.php (alec)
+ - added radius support (Robert "CyberM" Konopa)
version 1.11.7 Bastet (2009-02-13):
diff -Naur ./lms-cvs/doc/radius/README ./lms/doc/radius/README
--- ./lms-cvs/doc/radius/README 1970-01-01 01:00:00.000000000 +0100
+++ ./lms/doc/radius/README 2009-03-11 09:25:28.000000000 +0100
@@ -0,0 +1,13 @@
+Aby uruchomic wsparcie dla Freeradius'a nalezy w konfiguracji interfrejsu
+uzytkownika w sekcji "phpui" dodac opcje "radius" z parametrem "1".
+W opcjach urzadzen i ich adresow IP pojawia sie dodatkowe pola sluzace do
+konfiguracji NAS. Do niniejszej dokumentacji zalaczony jest przykladowy plik
+sql.conf ktory nalezy dolaczyc do konfiguracji freeradius'a.Zalecam wczesniejsze
+zrobienie kopii zapasowej orginalnego pliku konfiguracyjnego. Przykladowa
+konfiguracja zapewnia autoryzacje klientow z wykorzystaniem PPPoEi hasel
+MSCHAPv2 (przetestowano z wezlem PPPoE uruchomionym na Mikrotiku). Sekcje
+"sql_mac" mozna wykorzystac do dodatkowej autoryzacji urzadzen z uwzglednieniem
+sprzetowego adresu MAC.
+
+p.s.
+sugestie oraz spostrzezenia prosze kierowac na adres cyberm@tlen.pl
\ Brak znaku nowej linii na koñcu pliku
diff -Naur ./lms-cvs/doc/radius/sql.conf ./lms/doc/radius/sql.conf
--- ./lms-cvs/doc/radius/sql.conf 1970-01-01 01:00:00.000000000 +0100
+++ ./lms/doc/radius/sql.conf 2009-03-11 09:17:53.000000000 +0100
@@ -0,0 +1,168 @@
+#
+# Configuration for the SQL module, when using MySQL.
+#
+# The database schema is available at:
+#
+# src/radiusd/src/modules/rlm_sql/drivers/rlm_sql_mysql/db_mysql.sql
+#
+# If you are using PostgreSQL, please use 'postgresql.conf', instead.
+# If you are using Oracle, please use 'oracle.conf', instead.
+# If you are using MS-SQL, please use 'mssql.conf', instead.
+#
+# $Id: sql.conf,v 1.41.2.2 2005/08/24 17:02:04 nbk Exp $
+#
+
+sql {
+ driver = "rlm_sql_mysql"
+ server = "localhost"
+ login = "lms"
+ password = "twojehaslo"
+ radius_db = "lms"
+ acct_table1 = "radacct"
+ acct_table2 = "radacct"
+ nas_table = "nas"
+ deletestalesessions = yes
+ sqltrace = no
+ sqltracefile = ${logdir}/sqltrace.sql
+ num_sql_socks = 15
+ connect_failure_retry_delay = 60
+ #safe-characters = "@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
+ sql_user_name = "%{User-Name}"
+
+ accounting_onoff_query = "UPDATE ${acct_table1} SET AcctStopTime='%S', AcctSessionTime=unix_timestamp('%S') - unix_timestamp(AcctStartTime), AcctTerminateCause='%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}' WHERE AcctSessionTime=0 AND AcctStopTime=0 AND NASIPAddress= '%{NAS-IP-Address}' AND AcctStartTime <= '%S'"
+ accounting_update_query = "UPDATE ${acct_table1} \
+ SET FramedIPAddress = '%{Framed-IP-Address}', \
+ AcctSessionTime = '%{Acct-Session-Time}', \
+ AcctInputOctets = '%{Acct-Input-Octets}', \
+ AcctOutputOctets = '%{Acct-Output-Octets}' \
+ WHERE AcctSessionId = '%{Acct-Session-Id}' \
+ AND UserName = '%{SQL-User-Name}' \
+ AND NASIPAddress= '%{NAS-IP-Address}'"
+ accounting_update_query_alt = "INSERT into ${acct_table1} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S',INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0')"
+ accounting_start_query = "INSERT into ${acct_table1} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', '0', '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '%{Acct-Delay-Time}', '0')"
+ accounting_start_query_alt = "UPDATE ${acct_table1} SET AcctStartTime = '%S', AcctStartDelay = '%{Acct-Delay-Time}', ConnectInfo_start = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
+ accounting_stop_query = "UPDATE ${acct_table2} SET AcctStopTime = '%S', AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Octets}', AcctOutputOctets = '%{Acct-Output-Octets}', AcctTerminateCause = '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}', ConnectInfo_stop = '%{Connect-Info}' WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{SQL-User-Name}' AND NASIPAddress = '%{NAS-IP-Address}'"
+ accounting_stop_query_alt = "INSERT into ${acct_table2} (AcctSessionId, AcctUniqueId, UserName, Realm, NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, AcctStartDelay, AcctStopDelay) values('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', DATE_SUB('%S', INTERVAL (%{Acct-Session-Time:-0} + %{Acct-Delay-Time:-0}) SECOND), '%S', '%{Acct-Session-Time}', '%{Acct-Authentic}', '', '%{Connect-Info}', '%{Acct-Input-Octets}', '%{Acct-Output-Octets}', '%{Called-Station-Id}', '%{Calling-Station-Id}', '%{Acct-Terminate-Cause}', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}', '0', '%{Acct-Delay-Time}')"
+
+ # Uncomment simul_count_query to enable simultaneous use checking
+ # simul_count_query = "SELECT COUNT(*) FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime = 0"
+ simul_verify_query = "SELECT RadAcctId, AcctSessionId, UserName, NASIPAddress, NASPortId, FramedIPAddress, CallingStationId, FramedProtocol FROM ${acct_table1} WHERE UserName='%{SQL-User-Name}' AND AcctStopTime = 0"
+
+ # Set to 'yes' to read radius clients from the database ('nas' table)
+ #readclients = yes
+}
+
+sql sql_pppoe {
+ driver = "rlm_sql_mysql"
+ server = "localhost"
+ login = "lms"
+ password = "twojehaslo"
+ radius_db = "lms"
+ deletestalesessions = yes
+ sqltrace = no
+ sqltracefile = ${logdir}/sqltrace.sql
+ num_sql_socks = 15
+ connect_failure_retry_delay = 60
+ sql_user_name = "%{User-Name}"
+ sql_set_password = ""
+ authreply_table = "radreply"
+ nas_table = "nas"
+ readclients = no
+ authorize_check_query = "SELECT id, lower(name) as UserName , 'User-Password' as Attribute , passwd as Value, '==' as op FROM nodes WHERE name = '%{User-Name}'\
+ UNION\
+ SELECT id, lower(name) as UserName , 'Simultaneous-Use' as Attribute, '1' as Value, ':=' as op FROM nodes WHERE name = '%{User-Name}'\
+ UNION\
+ SELECT 0 AS id, '%{User-Name}' AS UserName, 'Max-Octets' AS Attribute,\
+ CONCAT(ROUND(COALESCE(x.dlimit, y.dlimit))) AS Value, ':=' AS op\
+ FROM (SELECT n.id, MIN(n.name) AS name, SUM(t.dlimit/o.cnt) AS dlimit\
+ FROM nodeassignments na\
+ JOIN assignments a ON (na.assignmentid = a.id)\
+ JOIN tariffs t ON (a.tariffid = t.id)\
+ JOIN nodes n ON (na.nodeid = n.id)\
+ JOIN (SELECT assignmentid, COUNT(*) AS cnt\
+ FROM nodeassignments GROUP BY assignmentid) o ON (o.assignmentid = na.assignmentid)\
+ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND n.name = '%{User-Name}'\
+ GROUP BY n.id\
+ ) x\
+ RIGHT JOIN (SELECT\
+ SUM(t.dlimit)/o.cnt AS dlimit\
+ FROM assignments a\
+ JOIN tariffs t ON (a.tariffid = t.id)\
+ JOIN nodes n ON (a.customerid = n.ownerid)\
+ JOIN (SELECT COUNT(*) AS cnt, ownerid FROM nodes\
+ WHERE NOT EXISTS(SELECT 1 FROM nodeassignments, assignments a WHERE assignmentid = a.id AND nodeid = nodes.id AND a.suspended = 0 AND (a.dateto > unix_timestamp() OR a.dateto = 0))\
+ GROUP BY ownerid) o ON (o.ownerid = n.ownerid)\
+ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND t.dlimit != '0'\
+ AND NOT EXISTS (SELECT 1 FROM nodeassignments WHERE assignmentid = a.id) AND n.name = '%{User-Name}'\
+ GROUP BY n.id\
+ ) y ON (1=1);"
+
+ authorize_reply_query = "SELECT id, lower(name) as UserName , 'Framed-IP-Address' as Attribute, inet_ntoa(ipaddr) as Value, '==' as op FROM nodes WHERE name = '%{User-Name}'\
+ UNION\
+ SELECT 0 AS id, '%{User-Name}' AS UserName, 'Mikrotik-Rate-Limit' AS Attribute,\
+ CONCAT(ROUND(COALESCE(x.upceil, y.upceil, z.upceil)),'k','/', ROUND(COALESCE(x.downceil, y.downceil, z.downceil)),'k') AS Value, '==' AS op\
+ FROM (SELECT n.id, MIN(n.name) AS name, SUM(t.downceil/o.cnt) AS downceil, SUM(t.upceil/o.cnt) AS upceil\
+ FROM nodeassignments na\
+ JOIN assignments a ON (na.assignmentid = a.id)\
+ JOIN tariffs t ON (a.tariffid = t.id)\
+ JOIN nodes n ON (na.nodeid = n.id)\
+ JOIN (SELECT assignmentid, COUNT(*) AS cnt\
+ FROM nodeassignments GROUP BY assignmentid) o ON (o.assignmentid = na.assignmentid)\
+ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0 AND n.name = '%{User-Name}'\
+ GROUP BY n.id\
+ ) x\
+ RIGHT JOIN (SELECT\
+ SUM(t.downceil)/o.cnt AS downceil,\
+ SUM(t.upceil)/o.cnt AS upceil\
+ FROM assignments a\
+ JOIN tariffs t ON (a.tariffid = t.id)\
+ JOIN nodes n ON (a.customerid = n.ownerid)\
+ JOIN (SELECT COUNT(*) AS cnt, ownerid FROM nodes \
+ WHERE NOT EXISTS(SELECT 1 FROM nodeassignments, assignments a WHERE assignmentid = a.id AND nodeid = nodes.id AND a.suspended = 0 AND (a.dateto > unix_timestamp() OR a.dateto = 0))\
+ GROUP BY ownerid) o ON (o.ownerid = n.ownerid)\
+ WHERE (a.datefrom <= unix_timestamp() OR a.datefrom = 0) AND (a.dateto > unix_timestamp() OR a.dateto = 0) AND a.suspended = 0\
+ AND NOT EXISTS (SELECT 1 FROM nodeassignments WHERE assignmentid = a.id) AND n.name = '%{User-Name}'\
+ GROUP BY n.id\
+ ) y ON (1=1)\
+ RIGHT JOIN (SELECT n.id, n.name, 64 AS downceil, 64 AS upceil\
+ FROM nodes n WHERE n.name = '%{User-Name}'\
+ ) z ON (1=1)\
+ UNION\
+ SELECT id, UserName, Attribute, Value, op \
+ FROM ${authreply_table} \
+ WHERE Username = '%{SQL-User-Name}' \
+ ORDER BY id;"
+}
+
+sql sql_mac {
+ driver = "rlm_sql_mysql"
+ server = "localhost"
+ login = "lms"
+ password = "twojehaslo"
+ radius_db = "lms"
+ deletestalesessions = yes
+ sqltrace = no
+ sqltracefile = ${logdir}/sqltrace.sql
+ num_sql_socks = 10
+ connect_failure_retry_delay = 60
+ sql_user_name = "%{User-Name}"
+ sql_set_password = ""
+ authorize_check_query = "SELECT id, upper(mac) as UserName , 'User-Password' as Attribute, '' as Value, '==' as op FROM nodes WHERE upper(mac) = '%{SQL-User-Name}' and access=1 ORDER by id"
+}
+
+sql sql_last_online {
+ driver = "rlm_sql_mysql"
+ server = "localhost"
+ login = "lms"
+ password = "twojehaslo"
+ radius_db = "lms"
+ postauth_table = "nodes"
+ deletestalesessions = yes
+ sqltrace = no
+ sqltracefile = ${logdir}/sqltrace.sql
+ num_sql_socks = 15
+ connect_failure_retry_delay = 60
+ sql_user_name = "%{User-Name}"
+ sql_set_password = ""
+ postauth_query = "UPDATE nodes SET lastonline = unix_timestamp() WHERE name='%{User-Name}'"
+}
diff -Naur ./lms-cvs/lib/LMS.class.php ./lms/lib/LMS.class.php
--- ./lms-cvs/lib/LMS.class.php 2009-02-19 20:49:55.000000000 +0100
+++ ./lms/lib/LMS.class.php 2009-03-05 21:16:26.000000000 +0100
@@ -1154,12 +1160,13 @@
return $this->DB->GetOne('SELECT ownerid FROM nodes WHERE id=?', array($id));
}
+# -- moje radius --
function NodeUpdate($nodedata, $deleteassignments=FALSE)
{
$this->DB->Execute('UPDATE nodes SET name=UPPER(?), ipaddr_pub=inet_aton(?),
ipaddr=inet_aton(?), mac=UPPER(?), passwd=?, netdev=?, moddate=?NOW?,
modid=?, access=?, warning=?, ownerid=?, info=?,
- location=?, chkmac=?, halfduplex=?, linktype=?, port=?
+ location=?, chkmac=?, halfduplex=?, linktype=?, port=?, nas=?
WHERE id=?',
array($nodedata['name'],
$nodedata['ipaddr_pub'],
@@ -1177,6 +1184,7 @@
$nodedata['halfduplex'],
isset($nodedata['linktype']) ? 1 : 0,
isset($nodedata['port']) && $nodedata['netdev'] ? intval($nodedata['port']) : 0,
+ $nodedata['nas'],
$nodedata['id']
));
@@ -1244,7 +1252,7 @@
if($result = $this->DB->GetRow('SELECT id, name, ownerid, ipaddr, inet_ntoa(ipaddr) AS ip,
ipaddr_pub, inet_ntoa(ipaddr_pub) AS ip_pub, mac, passwd, access,
warning, creationdate, moddate, creatorid, modid, netdev, lastonline,
- info, location, chkmac, halfduplex, linktype, port
+ info, location, chkmac, halfduplex, linktype, port, nas
FROM nodes WHERE id = ?', array($id)))
{
$result['createdby'] = $this->GetUserName($result['creatorid']);
@@ -2895,7 +2903,7 @@
}
$netdevlist = $this->DB->GetAll('SELECT d.id, d.name, d.location,
- d.description, d.producer, d.model, d.serialnumber, d.ports,
+ d.description, d.producer, d.model, d.serialnumber, d.ports,
(SELECT COUNT(*) FROM nodes WHERE netdev=d.id AND ownerid > 0)
+ (SELECT COUNT(*) FROM netlinks WHERE src = d.id OR dst = d.id)
AS takenports
@@ -2958,13 +2966,13 @@
$this->DB->Execute('DELETE FROM netdevices WHERE id=?', array($id));
$this->DB->CommitTrans();
}
-
+# -- moje radius --
function NetDevAdd($netdevdata)
{
if($this->DB->Execute('INSERT INTO netdevices (name, location,
description, producer, model, serialnumber,
- ports, purchasetime, guaranteeperiod)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)',
+ ports, purchasetime, guaranteeperiod, shortname, nastype, clients, secret, community)
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
array($netdevdata['name'],
$netdevdata['location'],
$netdevdata['description'],
@@ -2973,17 +2981,23 @@
$netdevdata['serialnumber'],
$netdevdata['ports'],
$netdevdata['purchasetime'],
- $netdevdata['guaranteeperiod']
+ $netdevdata['guaranteeperiod'],
+ $netdevdata['shortname'],
+ $netdevdata['nastype'],
+ $netdevadta['clients'],
+ $netdevdata['secret'],
+ $netdevdata['community']
)))
return $this->DB->GetLastInsertID('netdevices');
else
return FALSE;
}
+# -- moje radius --
function NetDevUpdate($netdevdata)
{
$this->DB->Execute('UPDATE netdevices SET name=?, location=?, description=?, producer=?,
- model=?, serialnumber=?, ports=?, purchasetime=?, guaranteeperiod=?
+ model=?, serialnumber=?, ports=?, purchasetime=?, guaranteeperiod=?, shortname=?, nastype=?, clients=?, secret=?, community=?
WHERE id=?',
array( $netdevdata['name'],
$netdevdata['location'],
@@ -2994,6 +3008,11 @@
$netdevdata['ports'],
$netdevdata['purchasetime'],
$netdevdata['guaranteeperiod'],
+ $netdevdata['shortname'],
+ $netdevdata['nastype'],
+ $netdevdata['clients'],
+ $netdevdata['secret'],
+ $netdevdata['community'],
$netdevdata['id']
));
}
@@ -3903,6 +3922,12 @@
return $this->DB->GetOne('SELECT name FROM countries WHERE id = ?', array($id));
}
+# -- moje radius --
+ function GetNAStype()
+ {
+ return $this->DB->GetAllByKey('SELECT id, name FROM nastype ORDER BY name', 'id');
+ }
+
//VoIP functions
function GetVoipAccountList($order='login,asc', $search=NULL, $sqlskey='AND')
{
diff -Naur ./lms-cvs/lib/locale/pl/strings.php ./lms/lib/locale/pl/strings.php
--- ./lms-cvs/lib/locale/pl/strings.php 2009-01-30 14:10:47.000000000 +0100
+++ ./lms/lib/locale/pl/strings.php 2009-03-02 13:53:52.000000000 +0100
@@ -2127,4 +2127,14 @@
$_LANG['with document'] = 'z dokumentem';
$_LANG['without document'] = 'bez dokumentu';
+$_LANG['Shortname:'] = 'Nazwa skrócona:';
+$_LANG['Max clients:'] = 'IloÅÄ klientów:';
+$_LANG['Secret:'] = 'HasÅo:';
+$_LANG['Community:'] = 'Community:';
+$_LANG['Enter shortname (optional)'] = 'Podaj nazwÄ skróconÄ
(opcjonalnie)';
+$_LANG['Select type (optional)'] = 'Wybierz typ (opcjonalnie)';
+$_LANG['Enter max clients (optional)'] = 'Podaj maksymalnÄ
liczbÄ klientów (opcjonalnie)';
+$_LANG['Enter secret (optional)'] = 'Podaj hasÅo (opcjonalnie)';
+$_LANG['Enter community (optional)'] = 'Podaj community (opcjonalnie)';
+
?>
diff -Naur ./lms-cvs/lib/upgradedb/mysql.2009030501.php ./lms/lib/upgradedb/mysql.2009030501.php
--- ./lms-cvs/lib/upgradedb/mysql.2009030501.php 1970-01-01 01:00:00.000000000 +0100
+++ ./lms/lib/upgradedb/mysql.2009030501.php 2009-03-11 09:09:06.000000000 +0100
@@ -0,0 +1,116 @@
+<?php
+
+/*
+ * LMS Mysql autoupgrade version 1.11-cvs
+ *
+ * (C) Copyright 2001-2009 LMS Developers
+ *
+ * Please, see the doc/AUTHORS for more information about authors!
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * $Id: mysql.2009030200.php,v 1.0 2009/03/02 01:49:40 Robert "CyberM" Konopa Exp $
+ */
+
+$DB->Execute("
+CREATE TABLE nastype (
+ id int(11) NOT NULL auto_increment,
+ name varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (id),
+ UNIQUE KEY name (name)
+) TYPE=MyISAM");
+
+$DB->Execute("
+CREATE TABLE radacct (
+ RadAcctId bigint(21) NOT NULL auto_increment,
+ AcctSessionId varchar(32) NOT NULL default '',
+ AcctUniqueId varchar(32) NOT NULL default '',
+ UserName varchar(64) NOT NULL default '',
+ Realm varchar(64) default '',
+ NASIPAddress varchar(15) NOT NULL default '',
+ NASPortId varchar(15) default NULL,
+ NASPortType varchar(32) default NULL,
+ AcctStartTime datetime NOT NULL default '0000-00-00 00:00:00',
+ AcctStopTime datetime NOT NULL default '0000-00-00 00:00:00',
+ AcctSessionTime int(12) default NULL,
+ AcctAuthentic varchar(32) default NULL,
+ ConnectInfo_start varchar(50) default NULL,
+ ConnectInfo_stop varchar(50) default NULL,
+ AcctInputOctets bigint(12) default NULL,
+ AcctOutputOctets bigint(12) default NULL,
+ CalledStationId varchar(50) NOT NULL default '',
+ CallingStationId varchar(50) NOT NULL default '',
+ AcctTerminateCause varchar(32) NOT NULL default '',
+ ServiceType varchar(32) default NULL,
+ FramedProtocol varchar(32) default NULL,
+ FramedIPAddress varchar(15) NOT NULL default '',
+ AcctStartDelay int(12) default NULL,
+ AcctStopDelay int(12) default NULL,
+ PRIMARY KEY (RadAcctId),
+ KEY UserName (UserName),
+ KEY FramedIPAddress (FramedIPAddress),
+ KEY AcctSessionId (AcctSessionId),
+ KEY AcctUniqueId (AcctUniqueId),
+ KEY AcctStartTime (AcctStartTime),
+ KEY AcctStopTime (AcctStopTime),
+ KEY NASIPAddress (NASIPAddress)
+");
+
+$DB->Execute("
+CREATE TABLE radreply (
+ id int(11) unsigned NOT NULL auto_increment,
+ UserName varchar(64) NOT NULL default '',
+ Attribute varchar(32) NOT NULL default '',
+ op char(2) NOT NULL DEFAULT '=',
+ Value varchar(253) NOT NULL default '',
+ PRIMARY KEY (id),
+ KEY UserName (UserName(32))
+");
+
+$DB->Execute("ALTER TABLE nodes ADD nas int(1) NOT NULL DEFAULT '0'");
+$DB->Execute("ALTER TABLE netdevices ADD shortname varchar(32) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD nastype int(11) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD clients int(11) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD secret varchar(60) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD community varchar(50) NULL DEFAULT ''");
+
+
+$DB->Execute("CREATE VIEW nas AS
+ SELECT no.id, inet_ntoa(no.ipaddr), nd.shortname, nd.nastype type, nd.clients ports, nd.secret, nd.community, nd.description
+ FROM nodes no
+ JOIN netdevices nd ON (no.netdev = nd.id)
+ WHERE no.nas='1'");
+
+$DB->Execute("INSERT INTO nastype (name) VALUES ('mikrotik_snmp')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('cisco')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('computone')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('livingston')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('max40xx')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('multitech')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('netserver')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('pathras')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('patton')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('portslave')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('tc')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('usrhiper')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('other')");
+$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES ('phpui', 'radius', '0')");
+$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES ('phpui', 'pubip', '1')");
+
+$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2009030501', 'dbversion'));
+
diff -Naur ./lms-cvs/lib/upgradedb/postgres.2009030501.php ./lms/lib/upgradedb/postgres.2009030501.php
--- ./lms-cvs/lib/upgradedb/postgres.2009030501.php 1970-01-01 01:00:00.000000000 +0100
+++ ./lms/lib/upgradedb/postgres.2009030501.php 2009-03-11 09:09:06.000000000 +0100
@@ -0,0 +1,116 @@
+<?php
+
+/*
+ * LMS Mysql autoupgrade version 1.11-cvs
+ *
+ * (C) Copyright 2001-2009 LMS Developers
+ *
+ * Please, see the doc/AUTHORS for more information about authors!
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License Version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ * USA.
+ *
+ * $Id: mysql.2009030200.php,v 1.0 2009/03/02 01:49:40 Robert "CyberM" Konopa Exp $
+ */
+
+$DB->Execute("
+CREATE TABLE nastype (
+ id int(11) NOT NULL auto_increment,
+ name varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (id),
+ UNIQUE KEY name (name)
+) TYPE=MyISAM");
+
+$DB->Execute("
+CREATE TABLE radacct (
+ RadAcctId bigint(21) NOT NULL auto_increment,
+ AcctSessionId varchar(32) NOT NULL default '',
+ AcctUniqueId varchar(32) NOT NULL default '',
+ UserName varchar(64) NOT NULL default '',
+ Realm varchar(64) default '',
+ NASIPAddress varchar(15) NOT NULL default '',
+ NASPortId varchar(15) default NULL,
+ NASPortType varchar(32) default NULL,
+ AcctStartTime datetime NOT NULL default '0000-00-00 00:00:00',
+ AcctStopTime datetime NOT NULL default '0000-00-00 00:00:00',
+ AcctSessionTime int(12) default NULL,
+ AcctAuthentic varchar(32) default NULL,
+ ConnectInfo_start varchar(50) default NULL,
+ ConnectInfo_stop varchar(50) default NULL,
+ AcctInputOctets bigint(12) default NULL,
+ AcctOutputOctets bigint(12) default NULL,
+ CalledStationId varchar(50) NOT NULL default '',
+ CallingStationId varchar(50) NOT NULL default '',
+ AcctTerminateCause varchar(32) NOT NULL default '',
+ ServiceType varchar(32) default NULL,
+ FramedProtocol varchar(32) default NULL,
+ FramedIPAddress varchar(15) NOT NULL default '',
+ AcctStartDelay int(12) default NULL,
+ AcctStopDelay int(12) default NULL,
+ PRIMARY KEY (RadAcctId),
+ KEY UserName (UserName),
+ KEY FramedIPAddress (FramedIPAddress),
+ KEY AcctSessionId (AcctSessionId),
+ KEY AcctUniqueId (AcctUniqueId),
+ KEY AcctStartTime (AcctStartTime),
+ KEY AcctStopTime (AcctStopTime),
+ KEY NASIPAddress (NASIPAddress)
+");
+
+$DB->Execute("
+CREATE TABLE radreply (
+ id int(11) unsigned NOT NULL auto_increment,
+ UserName varchar(64) NOT NULL default '',
+ Attribute varchar(32) NOT NULL default '',
+ op char(2) NOT NULL DEFAULT '=',
+ Value varchar(253) NOT NULL default '',
+ PRIMARY KEY (id),
+ KEY UserName (UserName(32))
+");
+
+$DB->Execute("ALTER TABLE nodes ADD nas int(1) NOT NULL DEFAULT '0'");
+$DB->Execute("ALTER TABLE netdevices ADD shortname varchar(32) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD nastype int(11) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD clients int(11) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD secret varchar(60) NULL DEFAULT ''");
+$DB->Execute("ALTER TABLE netdevices ADD community varchar(50) NULL DEFAULT ''");
+
+
+$DB->Execute("CREATE VIEW nas AS
+ SELECT no.id, inet_ntoa(no.ipaddr), nd.shortname, nd.nastype type, nd.clients ports, nd.secret, nd.community, nd.description
+ FROM nodes no
+ JOIN netdevices nd ON (no.netdev = nd.id)
+ WHERE no.nas='1'");
+
+$DB->Execute("INSERT INTO nastype (name) VALUES ('mikrotik_snmp')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('cisco')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('computone')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('livingston')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('max40xx')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('multitech')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('netserver')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('pathras')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('patton')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('portslave')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('tc')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('usrhiper')");
+$DB->Execute("INSERT INTO nastype (name) VALUES ('other')");
+$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES ('phpui', 'radius', '0')");
+$DB->Execute("INSERT INTO uiconfig (section, var, value) VALUES ('phpui', 'pubip', '1')");
+
+$DB->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2009030501', 'dbversion'));
+
diff -Naur ./lms-cvs/lib/upgradedb.php ./lms/lib/upgradedb.php
--- ./lms-cvs/lib/upgradedb.php 2009-02-16 13:56:25.000000000 +0100
+++ ./lms/lib/upgradedb.php 2009-03-11 09:10:16.000000000 +0100
@@ -24,7 +24,7 @@
* $Id: upgradedb.php,v 1.149 2009/02/16 12:56:25 alec Exp $
*/
-define('DBVERSION', '2009021600'); // here should be always the newest version of database!
+define('DBVERSION', '2009030501'); // here should be always the newest version of database!
// it placed here to avoid read disk every time when we call this file.
/*
diff -Naur ./lms-cvs/modules/configlist.php ./lms/modules/configlist.php
--- ./lms-cvs/modules/configlist.php 2009-01-13 08:45:48.000000000 +0100
+++ ./lms/modules/configlist.php 2009-03-02 12:43:06.000000000 +0100
@@ -279,6 +279,15 @@
$config[$idx]['description'] = trans('Default period value for assignment. Default: 0');
break;
+ // -- moje radius --
+ case 'radius':
+ $config[$idx]['description'] = trans('Enable or disable RADIUS support. Default: 0');
+ break;
+
+ case 'pubip':
+ $config[$idx]['description'] = trans('Enable or disable public IP address from nodes. Default: 1');
+ break;
+
default:
$config[$idx]['description'] = trans('Unknown option. No description.');
break;
diff -Naur ./lms-cvs/modules/netdevadd.php ./lms/modules/netdevadd.php
--- ./lms-cvs/modules/netdevadd.php 2009-01-13 08:45:51.000000000 +0100
+++ ./lms/modules/netdevadd.php 2009-03-02 14:57:40.000000000 +0100
@@ -28,6 +28,10 @@
{
$netdevdata = $_POST['netdev'];
+# -- moje --
+ if(!ereg('^[0-9]{1,11}$', $netdevdata['clients']))
+ $error['clients'] = trans('Invalid clients format or too long (max.11 characters) !');
+
if($netdevdata['ports'] == '')
$netdevdata['ports'] = 0;
else
@@ -80,6 +84,9 @@
$SMARTY->assign('netdev', $netdevdata);
}
+// -- moje radius --
+$SMARTY->assign('nastype', $LMS->GetNAStype());
+
$layout['pagetitle'] = trans('New Device');
$SMARTY->display('netdevadd.html');
diff -Naur ./lms-cvs/modules/netdevedit.php ./lms/modules/netdevedit.php
--- ./lms-cvs/modules/netdevedit.php 2009-01-13 08:45:51.000000000 +0100
+++ ./lms/modules/netdevedit.php 2009-03-02 22:56:46.000000000 +0100
@@ -157,6 +157,10 @@
$DB->Execute('UPDATE nodes SET halfduplex=? WHERE id=?', array($_GET['duplex'], $_GET['ip']));
$SESSION->redirect('?m=netdevinfo&id='.$_GET['id'].'&ip='.$_GET['ip']);
+
+case 'nas':
+ $DB->Execute('UPDATE nodes SET nas=? WHERE id=?', array($_GET['nas'], $_GET['ip']));
+ $SESSION->redirect('?m=netdevinfo&id='.$_GET['id'].'&ip='.$_GET['ip']);
case 'connect':
@@ -344,6 +348,7 @@
if(!isset($nodeipdata['chkmac'])) $nodeipdata['chkmac'] = 0;
if(!isset($nodeipdata['halfduplex'])) $nodeipdata['halfduplex'] = 0;
+ if(!isset($nodeipdata['nas'])) $nodeipdata['nas'] = 0;
if(!$error)
{
@@ -431,6 +436,7 @@
if(!isset($nodeipdata['chkmac'])) $nodeipdata['chkmac'] = 0;
if(!isset($nodeipdata['halfduplex'])) $nodeipdata['halfduplex'] = 0;
+ if(!isset($nodeipdata['nas'])) $nodeipdata['nas'] = 0;
if(!$error)
{
@@ -547,6 +553,8 @@
$SMARTY->assign('replacelisttotal',$replacelisttotal);
$SMARTY->assign('devlinktype',$SESSION->get('devlinktype'));
$SMARTY->assign('nodelinktype',$SESSION->get('nodelinktype'));
+// -- moje radius --
+$SMARTY->assign('nastype', $LMS->GetNAStype());
switch($edit)
{
diff -Naur ./lms-cvs/templates/netdevadd.html ./lms/templates/netdevadd.html
--- ./lms-cvs/templates/netdevadd.html 2008-03-06 09:05:16.000000000 +0100
+++ ./lms/templates/netdevadd.html 2009-03-02 14:29:41.000000000 +0100
@@ -76,6 +76,69 @@
<INPUT TYPE="TEXT" NAME="netdev[location]" VALUE="{$netdev.location}" {tip text="Enter device location (optional)"}>
</TD>
</TR>
+<!-- moje radius -->
+{if $_config.phpui.radius|chkconfig}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%"><BR>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Shortname:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[shortname]" VALUE="{$netdev.shortname}" MAXLENGTH="32" {tip trigger="shortname" text="Enter shortname (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Type:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <SELECT NAME="netdev[nastype]" {tip text="Select type (optional)"}>
+ <OPTION VALUE="0"</OPTION>
+ {foreach from=$nastype item=item key=key}
+ <OPTION VALUE="{$item.name}" {if $item.name==$netdevices.nastype} SELECTED{/if}>{$item.name}</OPTION>
+ {/foreach}
+ </SELECT>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Max clients:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[clients]" VALUE="{$netdev.clients}" {tip trigger="clients" text="Enter max clients (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Secret:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[secret]" VALUE="{$netdev.secret}" MAXLENGTH="60" {tip text="Enter secret (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Community:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[community]" VALUE="{$netdev.community}" MAXLENGTH="50" {tip text="Enter community (optional)"}>
+ </TD>
+ </TR>
+{/if}
+<!-- moje off -->
</TABLE>
</TD>
<TD WIDTH="50%" style="vertical-align:top;">
diff -Naur ./lms-cvs/templates/netdeveditbox.html ./lms/templates/netdeveditbox.html
--- ./lms-cvs/templates/netdeveditbox.html 2008-03-06 09:05:16.000000000 +0100
+++ ./lms/templates/netdeveditbox.html 2009-03-02 13:51:55.000000000 +0100
@@ -75,6 +75,74 @@
<INPUT TYPE="TEXT" NAME="netdev[location]" VALUE="{$netdevinfo.location}" {tip text="Enter device location (optional)"}>
</TD>
</TR>
+<!-- moje radius -->
+{if $_config.phpui.radius|chkconfig}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%"><BR>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Shortname:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[shortname]" VALUE="{$netdevinfo.shortname}" {tip text="Enter shortname (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Type:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <SELECT NAME="netdev[nastype]" {tip text="Select type (optional)" trigger="type"}>
+ <OPTION VALUE="0"</OPTION>
+ {foreach from=$nastype item=item key=key}
+ <OPTION VALUE="{$item.name}" {if $item.name==$netdevinfo.nastype} SELECTED{/if}>{$item.name}</OPTION>
+ {/foreach}
+ </SELECT>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Max clients:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[clients]" VALUE="{$netdevinfo.clients}" {tip text="Enter max clients (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Secret:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[secret]" VALUE="{$netdevinfo.secret}" {tip text="Enter secret (optional)"}>
+ </TD>
+ </TR>
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Community:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ <INPUT TYPE="TEXT" NAME="netdev[community]" VALUE="{$netdevinfo.community}" {tip text="Enter community (optional)"}>
+ </TD>
+ </TR>
+{/if}
+<!-- moje off -->
</TABLE>
</TD>
<TD WIDTH="50%" style="vertical-align:top;">
diff -Naur ./lms-cvs/templates/netdevinfobox.html ./lms/templates/netdevinfobox.html
--- ./lms-cvs/templates/netdevinfobox.html 2008-01-22 08:43:46.000000000 +0100
+++ ./lms/templates/netdevinfobox.html 2009-03-02 13:41:19.000000000 +0100
@@ -88,6 +88,79 @@
</TD>
</TR>
{/if}
+<!-- moje radius-->
+{if $_config.phpui.radius|chkconfig}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%"><BR>
+ </TD>
+ </TR>
+ {if $netdevinfo.shortname}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Shortname:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ {$netdevinfo.shortname}
+ </TD>
+ </TR>
+ {/if}
+ {if $netdevinfo.nastype}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Type:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ {$netdevinfo.nastype}
+ </TD>
+ </TR>
+ {/if}
+ {if $netdevinfo.clients}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Max clients:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ {$netdevinfo.clients}
+ </TD>
+ </TR>
+ {/if}
+ {if $netdevinfo.secret}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Secret:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ {$netdevinfo.secret}
+ </TD>
+ </TR>
+ {/if}
+ {if $netdevinfo.community}
+ <TR CLASS="LIGHT">
+ <TD WIDTH="1%">
+ <IMG SRC="img/division.gif" ALT="">
+ </TD>
+ <TD WIDTH="1%" NOWRAP>
+ <B>{t}Community:{/t}</B>
+ </TD>
+ <TD WIDTH="98%">
+ {$netdevinfo.community}
+ </TD>
+ </TR>
+ {/if}
+{/if}
+<!-- moje off -->
</TABLE>
</TD>
<TD WIDTH="50%" style="vertical-align:top;">
diff -Naur ./lms-cvs/templates/netdevipaddbox.html ./lms/templates/netdevipaddbox.html
--- ./lms-cvs/templates/netdevipaddbox.html 2008-12-28 20:03:27.000000000 +0100
+++ ./lms/templates/netdevipaddbox.html 2009-03-02 22:31:20.000000000 +0100
@@ -31,6 +31,7 @@
<INPUT TYPE="TEXT" NAME="ipadd[ipaddr]" VALUE="{$nodeipdata.ipaddr}" {tip text="Enter IP address" trigger="ipaddr"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.editipaddr['ipadd[ipaddr]'],0,{$netdevinfo.id});" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {if $_config.phpui.pubip|chkconfig}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/ip_pub.gif" ALT="{t}Pub. IP address:{/t}">
@@ -42,6 +43,7 @@
<INPUT TYPE="TEXT" NAME="ipadd[ipaddr_pub]" VALUE="{$nodeipdata.ipaddr_pub}" {tip text="Enter IP address (optional)" trigger="ipaddr_pub"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.editipaddr['ipadd[ipaddr_pub]'],0,{$netdevinfo.id});" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {/if}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/mac.gif" ALT="">
@@ -74,6 +76,9 @@
<TD WIDTH="98%" NOWRAP>
{t}MAC checking{/t}: <INPUT TYPE="checkbox" NAME="ipadd[chkmac]" VALUE="1" {tip text="Enable/disable MAC address checking" trigger="chkmac"}{if !isset($nodeipdata.chkmac) || $nodeipdata.chkmac} checked{/if}>
{t}Half duplex{/t}: <INPUT TYPE="checkbox" NAME="ipadd[halfduplex]" VALUE="1" {tip text="Select transmission mode" trigger="halfduplex"}{if $nodeipdata.halfduplex} checked{/if}>
+ {if $_config.phpui.radius|chkconfig}
+ {t}NAS{/t}: <INPUT TYPE="checkbox" NAME="ipadd[nas]" VALUE="1" {tip text="Select NAS on or off" trigger="nas"}{if $nodeipdata.nas} checked{/if}>
+ {/if}
</TD>
</TR>
<TR CLASS="LIGHT">
diff -Naur ./lms-cvs/templates/netdevipeditbox.html ./lms/templates/netdevipeditbox.html
--- ./lms-cvs/templates/netdevipeditbox.html 2008-12-28 20:03:27.000000000 +0100
+++ ./lms/templates/netdevipeditbox.html 2009-03-02 22:51:19.000000000 +0100
@@ -37,6 +37,7 @@
<INPUT TYPE="TEXT" NAME="ipadd[ipaddr]" VALUE="{$nodeipdata.ipaddr}" {tip text="Enter IP address" trigger="ipaddr"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.editipaddr['ipadd[ipaddr]'],{$nodeipdata.netid},{$netdevinfo.id});" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {if $_config.phpui.pubip|chkconfig}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/ip_pub.gif" ALT="">
@@ -48,6 +49,7 @@
<INPUT TYPE="TEXT" NAME="ipadd[ipaddr_pub]" VALUE="{if $nodeipdata.ip_pub!="0.0.0.0"}{$nodeipdata.ip_pub}{/if}" {tip text="Enter IP address" trigger="ipaddr_pub"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.editipaddr['ipadd[ipaddr_pub]'],{$nodeipdata.netid},{$netdevinfo.id});" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {/if}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/mac.gif" ALT="">
@@ -80,6 +82,10 @@
<TD WIDTH="99%" NOWRAP>
{t}MAC checking{/t}: <INPUT TYPE="checkbox" NAME="ipadd[chkmac]" VALUE="1" {tip text="Enable/disable MAC address checking" trigger="chkmac"}{if $nodeipdata.chkmac} checked{/if}>
{t}Half duplex{/t}: <INPUT TYPE="checkbox" NAME="ipadd[halfduplex]" VALUE="1" {tip text="Select transmission mode" trigger="halfduplex"}{if $nodeipdata.halfduplex} checked{/if}>
+ {if $_config.phpui.radius|chkconfig}
+
+ {t}NAS{/t}: <INPUT TYPE="checkbox" NAME="ipadd[nas]" VALUE="1" {tip text="Select NAS on or off" trigger="nas"}{if $nodeipdata.nas} checked{/if}>
+ {/if}
</TD>
</TR>
<TR CLASS="LIGHT">
diff -Naur ./lms-cvs/templates/netdevipinfobox.html ./lms/templates/netdevipinfobox.html
--- ./lms-cvs/templates/netdevipinfobox.html 2008-12-28 20:03:27.000000000 +0100
+++ ./lms/templates/netdevipinfobox.html 2009-03-02 23:26:45.000000000 +0100
@@ -7,6 +7,7 @@
else
location.href = '?m=netdevedit&id={$netdevinfo.id}&ip={$nodeipdata.id}&action=chkmac&chkmac=0';
{literal}}{/literal}
+
function duplex_change()
{literal}{{/literal}
if(document.getElementById('duplex').checked)
@@ -14,6 +15,14 @@
else
location.href = '?m=netdevedit&id={$netdevinfo.id}&ip={$nodeipdata.id}&action=duplex&duplex=0';
{literal}}{/literal}
+
+ function nas_change()
+{literal}{{/literal}
+ if(document.getElementById('nas').checked)
+ location.href = '?m=netdevedit&id={$netdevinfo.id}&ip={$nodeipdata.id}&action=nas&nas=1';
+ else
+ location.href = '?m=netdevedit&id={$netdevinfo.id}&ip={$nodeipdata.id}&action=nas&nas=0';
+{literal}}{/literal}
</SCRIPT>
<TABLE WIDTH="100%" CELLPADDING="3">
<TR CLASS="DARK">
@@ -71,6 +80,10 @@
<TD WIDTH="99%" COLSPAN="2">
{t}MAC checking{/t}: <INPUT TYPE="checkbox" NAME="chkmac" ID="chkmac" VALUE="1" {if $nodeipdata.chkmac} checked{/if} onclick="chkmac_change();">
{t}Half duplex{/t}: <INPUT TYPE="checkbox" NAME="duplex" ID="duplex" VALUE="1" {if $nodeipdata.halfduplex} checked{/if} onclick="duplex_change();">
+ {if $_config.phpui.radius|chkconfig}
+
+ {t}NAS{/t}: <INPUT TYPE="checkbox" NAME="nas" ID="nas" VALUE="1" {if $nodeipdata.nas} checked{/if} onclick="nas_change();">
+ {/if}
</TD>
</TR>
<TR CLASS="LIGHT">
diff -Naur ./lms-cvs/templates/nodeaddbox.html ./lms/templates/nodeaddbox.html
--- ./lms-cvs/templates/nodeaddbox.html 2008-12-28 20:03:28.000000000 +0100
+++ ./lms/templates/nodeaddbox.html 2009-03-02 12:47:47.000000000 +0100
@@ -24,6 +24,7 @@
<INPUT TYPE="TEXT" NAME="nodedataipaddr" VALUE="{$nodedata.ipaddr}" {tip text="Enter IP address" trigger="ipaddr"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.nodeadd.nodedataipaddr);" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {if $_config.phpui.pubip|chkconfig}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/ip_pub.gif" ALT="{t}Pub. IP address:{/t}">
@@ -32,6 +33,7 @@
<INPUT TYPE="TEXT" NAME="nodedataipaddr_pub" VALUE="{$nodedata.ipaddr_pub}" {tip text="Enter IP address (optional)" trigger="ipaddr_pub"}> <a href="javascript: void(0);" onClick="return ipchoosewin(document.nodeadd.nodedataipaddr_pub);" {tip text="Click to select IP from the list"}>»»»</A>
</TD>
</TR>
+ {/if}
<TR CLASS="LIGHT">
<TD WIDTH="1%">
<IMG SRC="img/mac.gif" ALT="{t}MAC address:{/t}">
!DSPAM:49b7bf7d147101327519691!