From cvs w lms.org.pl Thu Jul 1 15:22:44 2010 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 1 Jul 2010 15:22:44 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20100701132245.00121302C9A7@hydra.altec.pl> Date: Thursday, July 1, 2010 @ 15:22:44 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) - lmsd/ewx-stm-channels: added warnings about channel limits exceeding Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1506&r2=1.1507 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1506 lms/doc/ChangeLog:1.1507 --- lms/doc/ChangeLog:1.1506 Tue Jun 29 13:41:46 2010 +++ lms/doc/ChangeLog Thu Jul 1 15:22:44 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1506 2010/06/29 11:41:46 alec Exp $ +$Id: ChangeLog,v 1.1507 2010/07/01 13:22:44 alec Exp $ version ? (????-??-??) @@ -27,6 +27,9 @@ - fixed array_agg definition for Postgresql 8.1 (alec) - fixed accounting and period description of quarterly payments (alec) - lmsd/ewx-stm-channels: include node's MAC in syslog messages (alec) + - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) + - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) + - lmsd/ewx-stm-channels: added warnings about channel limits exceeding (alec) version 1.11.10 Kri (2010-04-19) From cvs w lms.org.pl Thu Jul 1 15:22:44 2010 From: cvs w lms.org.pl (LMS CVS) Date: Thu, 1 Jul 2010 15:22:44 +0200 (CEST) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-stm-channels (ewx-stm-channels.c) Message-ID: <20100701132244.D5F23302C98B@hydra.altec.pl> Date: Thursday, July 1, 2010 @ 15:22:44 Author: alec Path: /cvsroot/lms/daemon/modules/ewx-stm-channels Modified: ewx-stm-channels.c - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) - lmsd/ewx-stm-channels: added warnings about channel limits exceeding Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c.diff?&r1=1.4&r2=1.5 Index: lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c diff -u lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.4 lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.5 --- lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.4 Tue Jun 29 13:41:46 2010 +++ lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c Thu Jul 1 15:22:44 2010 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-stm-channels.c,v 1.4 2010/06/29 11:41:46 alec Exp $ + * $Id: ewx-stm-channels.c,v 1.5 2010/07/01 13:22:44 alec Exp $ */ #include @@ -43,7 +43,7 @@ char * itoa(int i) { - static char string[15]; + static char string[15]; sprintf(string, "%d", i); return string; } @@ -51,11 +51,11 @@ int find_asterisk(const char *str) { int i, len; - + for(i=0, len = strlen(str); ipath) { - syslog(LOG_ERR, "[%s/ewx-stm-channels] Option 'path' not specified", ewx->base.instance); + syslog(LOG_ERR, "[%s/ewx-stm-channels] Option 'path' not specified", ewx->base.instance); return; } @@ -227,13 +228,13 @@ n = 2; netnames = strdup(ewx->dummy_mac_networks); netname = strdup(netnames); - + // get networks for filter if any specified in 'dummy_mac_networks' // option, use '*' for all networks if(find_asterisk(ewx->dummy_mac_networks)) { for(i=0; i1 ) { - n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); - if(strlen(netname)) + n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); + if(strlen(netname)) { for(i=0; istr_upc(netname))==0) break; - + if(i != anc) { mac_nets = (struct net *) realloc(mac_nets, (sizeof(struct net) * (mnc+1))); @@ -265,13 +266,13 @@ n = 2; netnames = strdup(ewx->dummy_ip_networks); netname = strdup(netnames); - + // get networks for filter if any specified in 'dummy_ip_networks' // option, use '*' for all networks if(find_asterisk(ewx->dummy_ip_networks)) { for(i=0; i1 ) { - n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); - if(strlen(netname)) + n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); + if(strlen(netname)) { for(i=0; istr_upc(netname))==0) - break; + if(strcmp(all_nets[i].name, g->str_upc(netname))==0) + break; if(i != anc) { // same networks can't be included in both dummy_* options for(j=0; jbase.instance); + syslog(LOG_ERR, "[%s/ewx-stm-channels] Network %s already included in 'dummy_mac_networks' option. Skipping.", all_nets[i].name, ewx->base.instance); continue; } @@ -318,13 +319,13 @@ // get networks for filter if any specified in 'excluded_dummy_ip_networks' while( n>1 ) { - n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); - if(strlen(netname)) + n = sscanf(netnames, "%s %[._a-zA-Z0-9- ]", netname, netnames); + if(strlen(netname)) { for(i=0; istr_upc(netname))==0) - break; - + if(strcmp(all_nets[i].name, g->str_upc(netname))==0) + break; + if(i != anc) { eip_nets = (struct net *) realloc(eip_nets, (sizeof(struct net) * (einc+1))); @@ -348,9 +349,9 @@ if(strlen(netname)) { for(i=0; istr_upc(netname))==0) - break; - + if(strcmp(all_nets[i].name, g->str_upc(netname))==0) + break; + if(i != anc) { emac_nets = (struct net *) realloc(emac_nets, (sizeof(struct net) * (emnc+1))); @@ -433,7 +434,7 @@ res = g->db_query(g->conn, query); for(i=0; idb_nrows(res); i++) - { + { int cid = atoi(g->db_get_data(res,i,"id")); int upceil = atoi(g->db_get_data(res,i,"upceil")); int downceil = atoi(g->db_get_data(res,i,"downceil")); @@ -442,10 +443,10 @@ customers[cc].cid = cid; customers[cc].upceil = upceil; customers[cc].downceil = downceil; - customers[cc].no = 0; - customers[cc].downratesum = 0; + customers[cc].no = 0; + customers[cc].downratesum = 0; customers[cc].upratesum = 0; - customers[cc].hosts = NULL; + customers[cc].hosts = NULL; customers[cc].status = UNKNOWN; cc++; } @@ -471,71 +472,72 @@ g->str_replace(&query, "%enets", strlen(enetsql) ? enets : ""); if (night) - { - g->str_replace(&query, "t.downrate", "(CASE WHEN t.downrate_n > 0 THEN t.downrate_n ELSE t.downrate END) AS downrate"); - g->str_replace(&query, "t.downceil", "(CASE WHEN t.downceil_n > 0 THEN t.downceil_n ELSE t.downceil END) AS downceil"); - g->str_replace(&query, "t.uprate", "(CASE WHEN t.uprate_n > 0 THEN t.uprate_n ELSE t.uprate END) AS uprate"); - g->str_replace(&query, "t.upceil", "(CASE WHEN t.upceil_n > 0 THEN t.upceil_n ELSE t.upceil END) AS upceil"); + { + g->str_replace(&query, "t.downrate", "(CASE WHEN t.downrate_n > 0 THEN t.downrate_n ELSE t.downrate END) AS downrate"); + g->str_replace(&query, "t.downceil", "(CASE WHEN t.downceil_n > 0 THEN t.downceil_n ELSE t.downceil END) AS downceil"); + g->str_replace(&query, "t.uprate", "(CASE WHEN t.uprate_n > 0 THEN t.uprate_n ELSE t.uprate END) AS uprate"); + g->str_replace(&query, "t.upceil", "(CASE WHEN t.upceil_n > 0 THEN t.upceil_n ELSE t.upceil END) AS upceil"); } res = g->db_query(g->conn, query); // adding hosts to customers array - for(i=0; idb_nrows(res); i++) - { - int channelid = atoi(g->db_get_data(res,i,"channelid")); - int hostid = atoi(g->db_get_data(res,i,"id")); - char *ip = g->db_get_data(res,i,"ip"); + for (i=0; idb_nrows(res); i++) + { + int channelid = atoi(g->db_get_data(res,i,"channelid")); + int hostid = atoi(g->db_get_data(res,i,"id")); + char *ip = g->db_get_data(res,i,"ip"); unsigned long inet = inet_addr(ip); // looking for a channel - for(j=0; jdefault_upceil && ewx->default_downceil) + if (!channelid && ewx->default_upceil && ewx->default_downceil) { customers = (struct channel *) realloc(customers, (sizeof(struct channel) * (cc+1))); customers[cc].cid = 0; customers[cc].upceil = ewx->default_upceil; customers[cc].downceil = ewx->default_downceil; - customers[cc].no = 0; - customers[cc].downratesum = 0; + customers[cc].no = 0; + customers[cc].downratesum = 0; customers[cc].upratesum = 0; - customers[cc].hosts = NULL; + customers[cc].hosts = NULL; customers[cc].status = UNKNOWN; cc++; } else continue; } - + // Networks test if(nc) { for(n=0; ndb_get_data(res,i,"uprate")); + int uprate = atoi(g->db_get_data(res,i,"uprate")); int downrate = atoi(g->db_get_data(res,i,"downrate")); - int upceil = atoi(g->db_get_data(res,i,"upceil")); + int upceil = atoi(g->db_get_data(res,i,"upceil")); int downceil = atoi(g->db_get_data(res,i,"downceil")); // looking for host - for(k=0; kdb_get_data(res,i,"mac"); // Networks test for dummy_mac if(mnc) @@ -579,6 +581,28 @@ dummy_mac = 1; } + // data checking (MAC duplicates) + if (!dummy_mac && strcmp(mac, "00:00:00:00:00:00")) { + for (n=0; nbase.instance, mac, hostid); + continue; + } + macs = (char **) realloc(macs, (sizeof(char *) * (macs_cnt+1))); + macs[macs_cnt++] = strdup(mac); + } + // data checking ("empty" IP/MAC pairs) + else if (dummy_ip) { + syslog(LOG_ERR, "[%s/ewx-stm-channels] Wrong node data 0.0.0.0/00:00:00:00:00:00 (%05d). Skipped.", + ewx->base.instance, hostid); + continue; + } + + // add to hosts table customers[j].hosts = (struct host *) realloc(customers[j].hosts, (sizeof(struct host) * (k+1))); customers[j].hosts[k].id = hostid; customers[j].hosts[k].uprate = uprate; @@ -594,7 +618,7 @@ customers[j].hosts[k].ip = strdup(DUMMY_IP); if(!dummy_mac) - customers[j].hosts[k].mac = strdup(g->db_get_data(res,i,"mac")); + customers[j].hosts[k].mac = strdup(mac); else customers[j].hosts[k].mac = strdup(DUMMY_MAC); @@ -618,27 +642,39 @@ // Przelecmy po wszystkich kanalach i komputerach, zliczajac sumy rate i ceil // aby nie przekroczyc wartosci ustawionych dla sciezek na urzadzeniu. // Dodatkowo zmniejszymy rate komputerow w kanalach, jesli suma rate przekracza ceil kanalu - for(i=0; i c.upceil) { + syslog(LOG_WARNING, "[%s/ewx-stm-channels] The sum of nodes upload rate is too big for channel (%05d) [sum: %d, ceil: %d]. Reduced nodes rates.", + ewx->base.instance, c.cid, c.upratesum, c.upceil); + } + if (c.downratesum > c.downceil) { + syslog(LOG_WARNING, "[%s/ewx-stm-channels] The sum of nodes download rate is too big for channel (%05d) [sum: %d, ceil: %d]. Reduced nodes rates.", + ewx->base.instance, c.cid, c.downratesum, c.downceil); + } // Summary hosts limits for(k=0; k c.upceil) + if(c.upratesum > c.upceil) { c.hosts[k].uprate = c.hosts[k].uprate / (double) c.upratesum * c.upceil; - if(c.downratesum > c.downceil) + } + if(c.downratesum > c.downceil) { c.hosts[k].downrate = c.hosts[k].downrate / (double) c.downratesum * c.downceil; - // make sure node ceil is not greater tham channel ceil - if(c.upceil < c.hosts[k].upceil) + } + // make sure node ceil is not greater than channel ceil + if (c.upceil < c.hosts[k].upceil) { c.hosts[k].upceil = c.upceil; - if(c.downceil < c.hosts[k].downceil) + } + if (c.downceil < c.hosts[k].downceil) { c.hosts[k].downceil = c.downceil; - + } globaluprate += c.hosts[k].uprate; globaldownrate += c.hosts[k].downrate; } @@ -653,13 +689,13 @@ // path limits checking if(globaluprate>pathuplink || globaldownrate>pathdownlink) { - syslog(LOG_ERR, "[%s/ewx-stm-channels] Path is too small. Need Uplink: %d, Downlink: %d. Exiting.", ewx->base.instance, globaluprate, globaldownrate); + syslog(LOG_ERR, "[%s/ewx-stm-channels] Path is too small. Need Uplink: %d, Downlink: %d. Exiting.", ewx->base.instance, globaluprate, globaldownrate); return; } if(maxupceil>pathuplink || maxdownceil>pathdownlink) { - syslog(LOG_ERR, "[%s/ewx-stm-channels] Path is too small. Need Uplink: %d, Downlink: %d. Exiting.", ewx->base.instance, maxupceil, maxdownceil); + syslog(LOG_ERR, "[%s/ewx-stm-channels] Path is too small. Need Uplink: %d, Downlink: %d. Exiting.", ewx->base.instance, maxupceil, maxdownceil); return; } @@ -699,7 +735,7 @@ ); res = g->db_query(g->conn, query); - + // Creating current config array for(i=0; idb_nrows(res); i++) { @@ -911,64 +947,59 @@ syslog(LOG_INFO, "DEBUG: [%s/ewx-stm-channels] reloaded", ewx->base.instance); #endif - for(i=0; icommunity); From cvs w lms.org.pl Mon Jul 5 09:28:55 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 09:28:55 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20100705072855.A9157302C98B@hydra.altec.pl> Date: Monday, July 5, 2010 @ 09:28:55 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - support big_networks with owner popup selector in nodeadd and nodeedit templates Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1507&r2=1.1508 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1507 lms/doc/ChangeLog:1.1508 --- lms/doc/ChangeLog:1.1507 Thu Jul 1 15:22:44 2010 +++ lms/doc/ChangeLog Mon Jul 5 09:28:55 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1507 2010/07/01 13:22:44 alec Exp $ +$Id: ChangeLog,v 1.1508 2010/07/05 07:28:55 alec Exp $ version ? (????-??-??) @@ -30,6 +30,8 @@ - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) - lmsd/ewx-stm-channels: added warnings about channel limits exceeding (alec) + - support big_networks with owner popup selector in nodeadd and nodeedit + templates (alec/W.Dymkiewicz) version 1.11.10 Kri (2010-04-19) From cvs w lms.org.pl Mon Jul 5 09:28:55 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 09:28:55 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (nodeaddbox.html, nodeeditbox.html) Message-ID: <20100705072856.01FE0301F4F6@hydra.altec.pl> Date: Monday, July 5, 2010 @ 09:28:55 Author: alec Path: /cvsroot/lms/templates Modified: nodeaddbox.html nodeeditbox.html - support big_networks with owner popup selector in nodeadd and nodeedit templates Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.80&r2=1.81 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.83&r2=1.84 Index: lms/templates/nodeaddbox.html diff -u lms/templates/nodeaddbox.html:1.80 lms/templates/nodeaddbox.html:1.81 --- lms/templates/nodeaddbox.html:1.80 Fri May 7 14:22:31 2010 +++ lms/templates/nodeaddbox.html Mon Jul 5 09:28:55 2010 @@ -1,4 +1,4 @@ - +
@@ -114,10 +114,15 @@ {t}Customer:{/t} @@ -182,7 +187,7 @@ var items = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; var length = {/literal}{$_config.phpui.nodepassword_length|default:"16"}{literal}; if(length > 32) length = 32; - + for(var i=0; i {/literal} Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.83 lms/templates/nodeeditbox.html:1.84 --- lms/templates/nodeeditbox.html:1.83 Thu May 6 22:24:58 2010 +++ lms/templates/nodeeditbox.html Mon Jul 5 09:28:55 2010 @@ -1,4 +1,4 @@ - + @@ -107,10 +107,15 @@ {t}Customer:{/t} @@ -167,24 +172,24 @@ {t}Submit{/t} {t}Cancel{/t} - +
- {foreach from=$customers item=c} {/foreach} + {else} + + {t}Search{/t} »»» + {/if}
+ {if $customers} + {t}Search{/t} »»» + {/if}
{literal} {/literal} From cvs w lms.org.pl Mon Jul 5 09:28:55 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 09:28:55 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (nodeadd.php, nodeedit.php) Message-ID: <20100705072855.CE5F5302C9A7@hydra.altec.pl> Date: Monday, July 5, 2010 @ 09:28:55 Author: alec Path: /cvsroot/lms/modules Modified: nodeadd.php nodeedit.php - support big_networks with owner popup selector in nodeadd and nodeedit templates Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeadd.php.diff?&r1=1.93&r2=1.94 http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeedit.php.diff?&r1=1.112&r2=1.113 Index: lms/modules/nodeadd.php diff -u lms/modules/nodeadd.php:1.93 lms/modules/nodeadd.php:1.94 --- lms/modules/nodeadd.php:1.93 Fri May 7 18:48:01 2010 +++ lms/modules/nodeadd.php Mon Jul 5 09:28:55 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeadd.php,v 1.93 2010/05/07 16:48:01 chilek Exp $ + * $Id: nodeadd.php,v 1.94 2010/07/05 07:28:55 alec Exp $ */ $nodedata['access'] = 1; @@ -74,7 +74,7 @@ elseif(strlen($nodedata['name']) > 32) $error['name'] = trans('Node name is too long (max.32 characters)!'); elseif(!preg_match('/^[_a-z0-9-]+$/i', $nodedata['name'])) - $error['name'] = trans('Specified name contains forbidden characters!'); + $error['name'] = trans('Specified name contains forbidden characters!'); elseif($LMS->GetNodeIDByName($nodedata['name'])) $error['name'] = trans('Specified name is in use!'); @@ -123,13 +123,15 @@ if(strlen($nodedata['passwd']) > 32) $error['passwd'] = trans('Password is too long (max.32 characters)!'); + if (!$nodedata['ownerid']) + $error['ownerid'] = trans('Customer not selected!'); if(! $LMS->CustomerExists($nodedata['ownerid'])) - $error['customer'] = trans('You have to select owner!'); + $error['ownerid'] = trans('You have to select owner!'); else { $status = $LMS->GetCustomerStatus($nodedata['ownerid']); if($status == 1) // unknown (interested) - $error['customer'] = trans('Selected customer is not connected!'); + $error['ownerid'] = trans('Selected customer is not connected!'); elseif($status == 2 && $nodedata['access']) // awaiting $error['access'] = trans('Node owner is not connected!'); } @@ -211,8 +213,12 @@ else $SMARTY->assign('allnodegroups', $LMS->GetNodeGroupNames()); +if(!isset($CONFIG['phpui']['big_networks']) || !chkconfig($CONFIG['phpui']['big_networks'])) +{ + $SMARTY->assign('customers', $LMS->GetCustomerNames()); +} + $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); -$SMARTY->assign('customers', $LMS->GetCustomerNames()); $SMARTY->assign('error', $error); $SMARTY->assign('nodedata', $nodedata); $SMARTY->display('nodeadd.html'); Index: lms/modules/nodeedit.php diff -u lms/modules/nodeedit.php:1.112 lms/modules/nodeedit.php:1.113 --- lms/modules/nodeedit.php:1.112 Fri May 7 18:50:18 2010 +++ lms/modules/nodeedit.php Mon Jul 5 09:28:55 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeedit.php,v 1.112 2010/05/07 16:50:18 chilek Exp $ + * $Id: nodeedit.php,v 1.113 2010/07/05 07:28:55 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; @@ -71,13 +71,13 @@ $SESSION->save('backto', $SESSION->get('backto') . '&ownerid='.$customerid); else $SESSION->save('backto', $_SERVER['QUERY_STRING']); - + $layout['pagetitle'] = trans('Node Edit: $0', $nodeinfo['name']); if(isset($_POST['nodeedit']) && !isset($_GET['newmac'])) { $nodeedit = $_POST['nodeedit']; - + $nodeedit['ipaddr'] = $_POST['nodeeditipaddr']; $nodeedit['ipaddr_pub'] = $_POST['nodeeditipaddrpub']; foreach($nodeedit['macs'] as $key => $value) @@ -159,7 +159,7 @@ $error['passwd'] = trans('Password is too long (max.32 characters)!'); if(!isset($nodeedit['access'])) $nodeedit['access'] = 0; - if(!isset($nodeedit['warning'])) $nodeedit['warning'] = 0; + if(!isset($nodeedit['warning'])) $nodeedit['warning'] = 0; if(!isset($nodeedit['chkmac'])) $nodeedit['chkmac'] = 0; if(!isset($nodeedit['halfduplex'])) $nodeedit['halfduplex'] = 0; @@ -194,8 +194,10 @@ } } } - - if($nodeedit['access'] && $LMS->GetCustomerStatus($nodeedit['ownerid']) < 3) + + if (!$nodeedit['ownerid']) + $error['ownerid'] = trans('Customer not selected!'); + else if($nodeedit['access'] && $LMS->GetCustomerStatus($nodeedit['ownerid']) < 3) $error['access'] = trans('Node owner is not connected!'); if(!$error) @@ -233,10 +235,14 @@ include(MODULES_DIR.'/customer.inc.php'); +if(!isset($CONFIG['phpui']['big_networks']) || !chkconfig($CONFIG['phpui']['big_networks'])) +{ + $SMARTY->assign('customers', $LMS->GetCustomerNames()); +} + $SMARTY->assign('netdevices', $LMS->GetNetDevNames()); $SMARTY->assign('nodegroups', $LMS->GetNodeGroupNamesByNode($nodeid)); $SMARTY->assign('othernodegroups', $LMS->GetNodeGroupNamesWithoutNode($nodeid)); -$SMARTY->assign('customers', $LMS->GetCustomerNames()); $SMARTY->assign('error',$error); $SMARTY->assign('nodeinfo',$nodeinfo); $SMARTY->display('nodeedit.html'); From cvs w lms.org.pl Mon Jul 5 10:35:11 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 10:35:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20100705083511.11F75302C98B@hydra.altec.pl> Date: Monday, July 5, 2010 @ 10:35:11 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - support big_networks in documentlist + some fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1508&r2=1.1509 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1508 lms/doc/ChangeLog:1.1509 --- lms/doc/ChangeLog:1.1508 Mon Jul 5 09:28:55 2010 +++ lms/doc/ChangeLog Mon Jul 5 10:35:10 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1508 2010/07/05 07:28:55 alec Exp $ +$Id: ChangeLog,v 1.1509 2010/07/05 08:35:10 alec Exp $ version ? (????-??-??) @@ -30,8 +30,8 @@ - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) - lmsd/ewx-stm-channels: added warnings about channel limits exceeding (alec) - - support big_networks with owner popup selector in nodeadd and nodeedit - templates (alec/W.Dymkiewicz) + - support big_networks with owner popup selector in nodeadd, nodeedit and + documentlist templates (alec/W.Dymkiewicz) version 1.11.10 Kri (2010-04-19) From cvs w lms.org.pl Mon Jul 5 10:35:11 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 10:35:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (menu.php) Message-ID: <20100705083511.2E17E302C9A7@hydra.altec.pl> Date: Monday, July 5, 2010 @ 10:35:11 Author: alec Path: /cvsroot/lms/lib Modified: menu.php - support big_networks in documentlist + some fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/menu.php.diff?&r1=1.59&r2=1.60 Index: lms/lib/menu.php diff -u lms/lib/menu.php:1.59 lms/lib/menu.php:1.60 --- lms/lib/menu.php:1.59 Mon May 24 09:43:17 2010 +++ lms/lib/menu.php Mon Jul 5 10:35:11 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: menu.php,v 1.59 2010/05/24 07:43:17 chilek Exp $ + * $Id: menu.php,v 1.60 2010/07/05 08:35:11 alec Exp $ */ $menu = array( @@ -369,7 +369,7 @@ 'submenu' => array( array( 'name' => trans('List'), - 'link' => '?m=documentlist', + 'link' => '?m=documentlist&init=1', 'tip' => trans('List of documents'), 'prio' => 10, ), From cvs w lms.org.pl Mon Jul 5 10:35:11 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 10:35:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (documentlist.php) Message-ID: <20100705083511.47334301F4F6@hydra.altec.pl> Date: Monday, July 5, 2010 @ 10:35:11 Author: alec Path: /cvsroot/lms/modules Modified: documentlist.php - support big_networks in documentlist + some fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/documentlist.php.diff?&r1=1.24&r2=1.25 Index: lms/modules/documentlist.php diff -u lms/modules/documentlist.php:1.24 lms/modules/documentlist.php:1.25 --- lms/modules/documentlist.php:1.24 Thu Mar 11 14:07:45 2010 +++ lms/modules/documentlist.php Mon Jul 5 10:35:11 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: documentlist.php,v 1.24 2010/03/11 13:07:45 alec Exp $ + * $Id: documentlist.php,v 1.25 2010/07/05 08:35:11 alec Exp $ */ function GetDocumentList($order='cdate,asc', $type=NULL, $customer=NULL, $from=0, $to=0) @@ -75,53 +75,58 @@ return $list; } -if(!isset($_GET['o'])) - $SESSION->restore('doclo', $o); -else - $o = $_GET['o']; -$SESSION->save('doclo', $o); - -if(!isset($_GET['t'])) - $SESSION->restore('doclt', $t); -else - $t = $_GET['t']; -$SESSION->save('doclt', $t); - -if(!isset($_GET['c'])) - $SESSION->restore('doclc', $c); -else - $c = $_GET['c']; -$SESSION->save('doclc', $c); - -if(isset($_GET['from'])) +if (empty($_GET['init'])) { + if(!isset($_GET['o'])) + $SESSION->restore('doclo', $o); + else + $o = $_GET['o']; + $SESSION->save('doclo', $o); + + if(!isset($_GET['t'])) + $SESSION->restore('doclt', $t); + else + $t = $_GET['t']; + $SESSION->save('doclt', $t); + + if(!isset($_GET['c'])) + $SESSION->restore('doclc', $c); + else + $c = $_GET['c']; + $SESSION->save('doclc', $c); + + if(isset($_GET['from'])) + { if($_GET['from'] != '') { - list($year, $month, $day) = explode('/', $_GET['from']); - $from = mktime(0,0,0, $month, $day, $year); - } else - $from = 0; -} -elseif($SESSION->is_set('doclfrom')) - $SESSION->restore('doclfrom', $from); -else + list($year, $month, $day) = explode('/', $_GET['from']); + $from = mktime(0,0,0, $month, $day, $year); + } + else + $from = 0; + } + elseif($SESSION->is_set('doclfrom')) + $SESSION->restore('doclfrom', $from); + else $from = 0; -$SESSION->save('doclfrom', $from); + $SESSION->save('doclfrom', $from); -if(isset($_GET['to'])) -{ + if(isset($_GET['to'])) + { if($_GET['to'] != '') { - list($year, $month, $day) = explode('/', $_GET['to']); - $to = mktime(23,59,59, $month, $day, $year); - } else - $to = 0; -} -elseif($SESSION->is_set('doclto')) - $SESSION->restore('doclto', $to); -else + list($year, $month, $day) = explode('/', $_GET['to']); + $to = mktime(23,59,59, $month, $day, $year); + } + else + $to = 0; + } + elseif($SESSION->is_set('doclto')) + $SESSION->restore('doclto', $to); + else $to = 0; -$SESSION->save('doclto', $to); + $SESSION->save('doclto', $to); +} $documentlist = GetDocumentList($o, $t, $c, $from, $to); @@ -157,7 +162,11 @@ FROM docrights WHERE userid = ? AND rights > 1', 'doctype', array($AUTH->id))); } -$SMARTY->assign('customerlist', $LMS->GetCustomerNames()); +if(!isset($CONFIG['phpui']['big_networks']) || !chkconfig($CONFIG['phpui']['big_networks'])) +{ + $SMARTY->assign('customers', $LMS->GetCustomerNames()); +} + $SMARTY->assign('documentlist', $documentlist); $SMARTY->assign('pagelimit', $pagelimit); $SMARTY->assign('page', $page); From cvs w lms.org.pl Mon Jul 5 10:35:11 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 10:35:11 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (3 files) Message-ID: <20100705083511.808A7301F4F7@hydra.altec.pl> Date: Monday, July 5, 2010 @ 10:35:11 Author: alec Path: /cvsroot/lms/templates Modified: documentlist.html nodeaddbox.html nodeeditbox.html - support big_networks in documentlist + some fixes Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/documentlist.html.diff?&r1=1.25&r2=1.26 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeaddbox.html.diff?&r1=1.81&r2=1.82 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.84&r2=1.85 Index: lms/templates/documentlist.html diff -u lms/templates/documentlist.html:1.25 lms/templates/documentlist.html:1.26 --- lms/templates/documentlist.html:1.25 Tue Jun 1 14:27:43 2010 +++ lms/templates/documentlist.html Mon Jul 5 10:35:11 2010 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{if $docid}{/if} {literal} @@ -65,12 +65,17 @@ {t}Filter:{/t} {t}Customer:{/t} - {foreach from=$customerlist item=customer} {/foreach} -   + + {else} + + {t}Search{/t} »»» + {/if}  {t}Type:{/t} @@ -113,17 +113,17 @@ - @@ -205,8 +205,9 @@ function reset_customer() { - if (document.forms['editnode'].elements['nodeedit[ownerid]'].value) - document.forms['editnode'].elements['nodeedit[customerid]'].value = document.forms['editnode'].elements['nodeedit[ownerid]'].value; + var val; + if (val = document.forms['nodeadd'].elements['nodedata[ownerid]'].value) + document.forms['nodeadd'].elements['nodedata[customerid]'].value = val; } //--> Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.84 lms/templates/nodeeditbox.html:1.85 --- lms/templates/nodeeditbox.html:1.84 Mon Jul 5 09:28:55 2010 +++ lms/templates/nodeeditbox.html Mon Jul 5 10:35:11 2010 @@ -1,4 +1,4 @@ - + @@ -106,17 +106,17 @@ - @@ -207,8 +207,9 @@ function reset_customer() { - if (document.forms['editnode'].elements['nodeedit[ownerid]'].value) - document.forms['editnode'].elements['nodeedit[customerid]'].value = document.forms['editnode'].elements['nodeedit[ownerid]'].value; + var val; + if (val = document.forms['editnode'].elements['nodeedit[ownerid]'].value) + document.forms['editnode'].elements['nodeedit[customerid]'].value = val; } //--> From cvs w lms.org.pl Mon Jul 5 10:48:38 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 10:48:38 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (lms.pgsql) Message-ID: <20100705084838.D5429301F4F6@hydra.altec.pl> Date: Monday, July 5, 2010 @ 10:48:38 Author: alec Path: /cvsroot/lms/doc Modified: lms.pgsql - typo Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/lms.pgsql.diff?&r1=1.166&r2=1.167 Index: lms/doc/lms.pgsql diff -u lms/doc/lms.pgsql:1.166 lms/doc/lms.pgsql:1.167 --- lms/doc/lms.pgsql:1.166 Mon Jun 28 11:28:48 2010 +++ lms/doc/lms.pgsql Mon Jul 5 10:48:38 2010 @@ -1,4 +1,4 @@ -/* $Id: lms.pgsql,v 1.166 2010/06/28 09:28:48 alec Exp $ */ +/* $Id: lms.pgsql,v 1.167 2010/07/05 08:48:38 alec Exp $ */ /* -------------------------------------------------------- Structure of table "users" @@ -44,7 +44,7 @@ settlement smallint DEFAULT 0 NOT NULL, discount numeric(4,2) DEFAULT 0 NOT NULL, paytype smallint DEFAULT NULL, - numberplanid int(11) DEFAULT NULL + numberplanid integer DEFAULT NULL REFERENCES numberplans (id) ON DELETE SET NULL ON UPDATE CASCADE, PRIMARY KEY (id) ); From cvs w lms.org.pl Mon Jul 5 14:54:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 14:54:41 +0200 (CEST) Subject: [lms-commits] CVS update of lms/daemon/modules/ewx-stm-channels (2 files) Message-ID: <20100705125441.3B25F302C98B@hydra.altec.pl> Date: Monday, July 5, 2010 @ 14:54:41 Author: alec Path: /cvsroot/lms/daemon/modules/ewx-stm-channels Modified: ewx-stm-channels.c ewx-stm-channels.h - lmsd/ewx-stm-channels: improved performance of default channel handling + code cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c.diff?&r1=1.5&r2=1.6 http://cvs.lms.org.pl/viewvc/Development/lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h.diff?&r1=1.2&r2=1.3 Index: lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c diff -u lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.5 lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.6 --- lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c:1.5 Thu Jul 1 15:22:44 2010 +++ lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.c Mon Jul 5 14:54:40 2010 @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: ewx-stm-channels.c,v 1.5 2010/07/01 13:22:44 alec Exp $ + * $Id: ewx-stm-channels.c,v 1.6 2010/07/05 12:54:40 alec Exp $ */ #include @@ -738,9 +738,9 @@ // Creating current config array for(i=0; idb_nrows(res); i++) - { - int channelid = atoi(g->db_get_data(res,i,"channelid")); - int hostid = atoi(g->db_get_data(res,i,"nodeid")); + { + int channelid = atoi(g->db_get_data(res,i,"channelid")); + int hostid = atoi(g->db_get_data(res,i,"nodeid")); char *ip = g->db_get_data(res,i,"ip"); unsigned long inet = inet_addr(ip); @@ -748,23 +748,23 @@ if(nc && inet) { for(j=0; jdb_get_data(res,i,"cupceil")); int cdownceil = atoi(g->db_get_data(res,i,"cdownceil")); - + channels = (struct channel *) realloc(channels, (sizeof(struct channel) * (sc+1))); channels[sc].id = channelid; channels[sc].cid = atoi(g->db_get_data(res,i,"cid")); @@ -772,8 +772,8 @@ channels[sc].downceil = cdownceil ? cdownceil : ewx->default_downceil; channels[sc].upratesum = 0; channels[sc].downratesum = 0; - channels[sc].no = 0; - channels[sc].hosts = NULL; + channels[sc].no = 0; + channels[sc].hosts = NULL; channels[sc].status = UNKNOWN; sc++; } @@ -796,21 +796,21 @@ } g->db_free(&res); free(query); - + // Open the session again sh = snmp_open(&session); if(!sh) { - snmp_error(&session, NULL, NULL, &errstr); - syslog(LOG_ERR, "[%s/ewx-stm-channels] SNMP ERROR: %s", ewx->base.instance, errstr); + snmp_error(&session, NULL, NULL, &errstr); + syslog(LOG_ERR, "[%s/ewx-stm-channels] SNMP ERROR: %s", ewx->base.instance, errstr); free(errstr); return; } // Main loop **************************************************************** for(i=0; i channels[x].upceil || new.downceil > c.downceil) + if (new.upceil > channels[x].upceil || new.downceil > c.downceil) { mod_channel(g, ewx, sh, channels[x].id, c.upceil, c.downceil); channels[x].upceil = c.upceil; channels[x].downceil = c.downceil; channels[x].status = STATUS_OK; } - + // moze wystapic (chwilowe) przekroczenie sumy rate if (old.uprate != new.uprate || old.downrate != new.downrate) { channels[x].upratesum += new.uprate - old.uprate; channels[x].downratesum += new.downrate - old.downrate; - + if (channels[x].upceil < channels[x].upratesum || channels[x].downceil < channels[x].downratesum) { mod_channel(g, ewx, sh, channels[x].id, channels[x].upratesum, channels[x].downratesum); channels[x].upceil = channels[x].upratesum; channels[x].downceil = channels[x].downratesum; - channels[x].status = STATUS_OK; + channels[x].status = STATUS_OK; } } - + update_node(g, ewx, sh, &c.hosts[n], channels[j].hosts[k]); savetables = 1; } - + // wszystko sie zgadza, zmieniamy status channels[j].hosts[k].status = STATUS_OK; found++; @@ -900,7 +900,59 @@ } } } - + +//printf("id:%d, x:%d, sc::%d, need:%d, found:%d, no:%d-%d\n", c.cid, x, sc, needupdate, found, c.no, channels[x].no); + // dodajemy nowe hosty/usuwamy z/do kanału domyślnego + // dla lepszej wydajności robimy to tutaj (z pominięciem update_channel) + if (!c.cid && x != sc && !needupdate && (found != c.no || found != channels[x].no)) { + // szukamy komputerów do usunięcia + for (k=0; koffset); + found++; + } + else { + // potrzeba zmienić parametry kanału + needupdate = 1; + break; + } + } + } + } + if(needupdate || found != c.no) { savetables = 1; @@ -913,7 +965,7 @@ } else if (channels[x].upceil != c.upceil || channels[x].downceil != c.downceil) { savetables = 1; - mod_channel(g, ewx, sh, channels[x].id, c.upceil, c.downceil); + mod_channel(g, ewx, sh, channels[x].id, c.upceil, c.downceil); } } // End of main loop ********************************************************** @@ -936,7 +988,7 @@ del_channel(g, ewx, sh, &channels[i]); } } - + // Save device configuration changes if (savetables) save_tables(g, ewx, sh); Index: lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h diff -u lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h:1.2 lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h:1.3 --- lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h:1.2 Tue Jun 15 14:29:02 2010 +++ lms/daemon/modules/ewx-stm-channels/ewx-stm-channels.h Mon Jul 5 14:54:40 2010 @@ -4,7 +4,7 @@ struct ewx_module { MODULE base; - + char *networks; char *excluded_networks; char *dummy_mac_networks; @@ -33,7 +33,7 @@ struct host { - int id; + int id; int status; int uprate; int upceil; @@ -53,7 +53,7 @@ int downceil; int upratesum; int downratesum; - int no; + int no; struct host *hosts; }; @@ -90,7 +90,7 @@ L2tmChannelUplink 4 Unsigned32 L2tmChannelDownlink 5 Unsigned32 L2tmChannelHalfDuplex 6 INTEGER - + */ // nodes OIDs (last element (zero) will be changed to node ID) From cvs w lms.org.pl Mon Jul 5 14:54:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 14:54:41 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib/locale/pl (strings.php) Message-ID: <20100705125441.788D4301F4F6@hydra.altec.pl> Date: Monday, July 5, 2010 @ 14:54:41 Author: alec Path: /cvsroot/lms/lib/locale/pl Modified: strings.php - lmsd/ewx-stm-channels: improved performance of default channel handling + code cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/locale/pl/strings.php.diff?&r1=1.363&r2=1.364 Index: lms/lib/locale/pl/strings.php diff -u lms/lib/locale/pl/strings.php:1.363 lms/lib/locale/pl/strings.php:1.364 --- lms/lib/locale/pl/strings.php:1.363 Wed Jun 23 16:03:53 2010 +++ lms/lib/locale/pl/strings.php Mon Jul 5 14:54:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: strings.php,v 1.363 2010/06/23 14:03:53 alec Exp $ + * $Id: strings.php,v 1.364 2010/07/05 12:54:41 alec Exp $ */ $_LANG['$0 ($1 addresses)'] = '$0 ($1 adresów)'; @@ -929,7 +929,7 @@ $_LANG['Nodes Scanning'] = 'Skanowanie komputerów'; $_LANG['Nodes Search'] = 'Wyszukiwanie komputerów'; $_LANG['Nodes Search Results'] = 'Wyniki wyszukiwania komputerów'; -$_LANG['--- No device ---'] = '--- Brak urządzenia ---'; +$_LANG['no device'] = 'brak urządzenia'; $_LANG['No, I\'ve changed my mind.'] = 'Nie, zmieniłem zdanie.'; $_LANG['no limits'] = 'bez ograniczeń'; $_LANG['No such accounts in database.'] = 'Brak kont w bazie danych.'; From cvs w lms.org.pl Mon Jul 5 14:54:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 14:54:41 +0200 (CEST) Subject: [lms-commits] CVS update of lms/doc (ChangeLog) Message-ID: <20100705125441.59A76302C9A7@hydra.altec.pl> Date: Monday, July 5, 2010 @ 14:54:41 Author: alec Path: /cvsroot/lms/doc Modified: ChangeLog - lmsd/ewx-stm-channels: improved performance of default channel handling + code cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/doc/ChangeLog.diff?&r1=1.1509&r2=1.1510 Index: lms/doc/ChangeLog diff -u lms/doc/ChangeLog:1.1509 lms/doc/ChangeLog:1.1510 --- lms/doc/ChangeLog:1.1509 Mon Jul 5 10:35:10 2010 +++ lms/doc/ChangeLog Mon Jul 5 14:54:41 2010 @@ -1,4 +1,4 @@ -$Id: ChangeLog,v 1.1509 2010/07/05 08:35:10 alec Exp $ +$Id: ChangeLog,v 1.1510 2010/07/05 12:54:41 alec Exp $ version ? (????-??-??) @@ -30,6 +30,7 @@ - lmsd/ewx-stm-channels: added MAC duplicate prevention (alec) - lmsd/ewx-stm-channels: added "empty" IP/MAC pair prevention (alec) - lmsd/ewx-stm-channels: added warnings about channel limits exceeding (alec) + - lmsd/ewx-stm-channels: improved performance of default channel handling (alec) - support big_networks with owner popup selector in nodeadd, nodeedit and documentlist templates (alec/W.Dymkiewicz) From cvs w lms.org.pl Mon Jul 5 14:54:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 14:54:41 +0200 (CEST) Subject: [lms-commits] CVS update of lms/modules (nodeedit.php, noteedit.php) Message-ID: <20100705125441.9A731301F4F7@hydra.altec.pl> Date: Monday, July 5, 2010 @ 14:54:41 Author: alec Path: /cvsroot/lms/modules Modified: nodeedit.php noteedit.php - lmsd/ewx-stm-channels: improved performance of default channel handling + code cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/modules/nodeedit.php.diff?&r1=1.113&r2=1.114 http://cvs.lms.org.pl/viewvc/Development/lms/modules/noteedit.php.diff?&r1=1.3&r2=1.4 Index: lms/modules/nodeedit.php diff -u lms/modules/nodeedit.php:1.113 lms/modules/nodeedit.php:1.114 --- lms/modules/nodeedit.php:1.113 Mon Jul 5 09:28:55 2010 +++ lms/modules/nodeedit.php Mon Jul 5 14:54:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: nodeedit.php,v 1.113 2010/07/05 07:28:55 alec Exp $ + * $Id: nodeedit.php,v 1.114 2010/07/05 12:54:41 alec Exp $ */ $action = isset($_GET['action']) ? $_GET['action'] : ''; @@ -35,9 +35,11 @@ switch($action) { case 'link': - $netdev = $LMS->GetNetDev($_GET['devid']); - - if($netdev['ports'] > $netdev['takenports']) + if (empty($_GET['devid']) || !($netdev = $LMS->GetNetDev($_GET['devid']))) + { + $SESSION->redirect('?m=nodeinfo&id='.$_GET['id']); + } + else if($netdev['ports'] > $netdev['takenports']) { $LMS->NetDevLinkNode($_GET['id'],$_GET['devid'], empty($_GET['linktype']) ? 0 : 1, intval($_GET['port'])); Index: lms/modules/noteedit.php diff -u lms/modules/noteedit.php:1.3 lms/modules/noteedit.php:1.4 --- lms/modules/noteedit.php:1.3 Thu Mar 11 14:07:47 2010 +++ lms/modules/noteedit.php Mon Jul 5 14:54:41 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: noteedit.php,v 1.3 2010/03/11 13:07:47 alec Exp $ + * $Id: noteedit.php,v 1.4 2010/07/05 12:54:41 alec Exp $ */ //$taxeslist = $LMS->GetTaxes(); @@ -174,7 +174,7 @@ $DB->Execute('INSERT INTO debitnotecontents (docid, itemid, value, description) VALUES (?, ?, ?, ?)', array($note['id'], $itemid, $item['value'], $item['description'])); - + $LMS->AddBalance(array( 'time' => $cdate, 'value' => $item['value']*-1, @@ -188,15 +188,15 @@ $DB->UnLockTables(); $DB->CommitTrans(); - + $SESSION->remove('notecontents'); $SESSION->remove('notecustomer'); $SESSION->remove('note'); $SESSION->remove('notenewerror'); - + if(isset($_GET['print'])) $SESSION->save('noteprint', $note['id']); - + $SESSION->redirect('?m=notelist'); } break; @@ -222,7 +222,6 @@ $SMARTY->assign('contents', $contents); $SMARTY->assign('customer', $customer); $SMARTY->assign('note', $note); -//$SMARTY->assign('taxeslist', $taxeslist); $SMARTY->display('noteedit.html'); ?> From cvs w lms.org.pl Mon Jul 5 14:54:41 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 5 Jul 2010 14:54:41 +0200 (CEST) Subject: [lms-commits] CVS update of lms/templates (nodeeditbox.html, nodeinfobox.html) Message-ID: <20100705125441.BB207301F4F8@hydra.altec.pl> Date: Monday, July 5, 2010 @ 14:54:41 Author: alec Path: /cvsroot/lms/templates Modified: nodeeditbox.html nodeinfobox.html - lmsd/ewx-stm-channels: improved performance of default channel handling + code cleanup Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeeditbox.html.diff?&r1=1.85&r2=1.86 http://cvs.lms.org.pl/viewvc/Development/lms/templates/nodeinfobox.html.diff?&r1=1.72&r2=1.73 Index: lms/templates/nodeeditbox.html diff -u lms/templates/nodeeditbox.html:1.85 lms/templates/nodeeditbox.html:1.86 --- lms/templates/nodeeditbox.html:1.85 Mon Jul 5 10:35:11 2010 +++ lms/templates/nodeeditbox.html Mon Jul 5 14:54:41 2010 @@ -1,4 +1,4 @@ - + @@ -71,7 +71,7 @@ {cycle values="light,lucid" print=false} @@ -49,7 +53,7 @@ Index: lms/templates/rtqueueview.html diff -u lms/templates/rtqueueview.html:1.53 lms/templates/rtqueueview.html:1.54 --- lms/templates/rtqueueview.html:1.53 Wed Aug 26 11:22:22 2009 +++ lms/templates/rtqueueview.html Fri Jul 9 10:45:52 2010 @@ -1,5 +1,5 @@ {include file="header.html"} - +

{$layout.pagetitle}

{t}Customer:{/t} + {if $customers} - {foreach from=$customers item=c} {/foreach} - {else} - - {t}Search{/t} »»» - {/if} + {t}or Customer ID:{/t} + {/if} + + {t}Search{/t} »»»
{t}Customer:{/t} + {if $customers} - {foreach from=$customers item=c} {/foreach} - {else} - - {t}Search{/t} »»» - {/if} + {t}or Customer ID:{/t} + {/if} + + {t}Search{/t} »»»
+ + + + + {cycle values="light,lucid" print=false} + {section name=devices loop=$devices} + + + + + {sectionelse} + + + + {/section} +
+ + + {if $layout.module == 'ewxdevlist'} + {t 0=$devices.total|default:"0"}Channel Devices ($0):{/t} + {else} + {t 0=$devices.total|default:"0"}Devices ($0):{/t} + {/if} +
+
+ +
+ {$devices[devices].name}
+ {$devices[devices].producer} {if $devices[devices].model}/ {$devices[devices].model}{/if}{if $devices[devices].location} / {$devices[devices].location}{/if} +
+

 

+

{t}No devices found in database.{/t}

+

 

+
+ + + Index: lms/templates/nodelistshort.html diff -u lms/templates/nodelistshort.html:1.17 lms/templates/nodelistshort.html:1.18 --- lms/templates/nodelistshort.html:1.17 Mon May 24 09:43:18 2010 +++ lms/templates/nodelistshort.html Fri Jul 9 10:45:52 2010 @@ -1,5 +1,5 @@ - + @@ -16,7 +16,11 @@
+ {if $layout.module == 'ewxnodelist'} + {t 0=$customernodes.total|default:"0"}Channel Nodes ($0):{/t} + {else} {t 0=$customernodes.total|default:"0"}Customer Nodes ($0):{/t} + {/if}

 

-

{if $customerinfo.deleted}{t}That customer has been deleted.{/t}{else}{t}That customer hasn't got any node.{/t}{/if}

+

{t}No nodes found in database.{/t}

 

@@ -105,7 +105,7 @@ ({$queue[ticket].address}) {else} - {$queue[ticket].requestor|escape} + {$queue[ticket].requestor|escape} {/if} {if $queue[ticket].requestoremail && !$queue[ticket].customerid} <{$queue[ticket].requestoremail}> From cvs w lms.org.pl Sun Jul 18 10:42:20 2010 From: cvs w lms.org.pl (LMS CVS) Date: Sun, 18 Jul 2010 10:42:20 +0200 (CEST) Subject: [lms-commits] CVS update of lmsweb (lms.org.pl.zone) Message-ID: <20100718084220.93C0F302C98B@hydra.altec.pl> Date: Sunday, July 18, 2010 @ 10:42:20 Author: lukasz Path: /cvsroot/lmsweb Modified: lms.org.pl.zone Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lmsweb/lms.org.pl.zone.diff?&r1=1.11&r2=1.12 Index: lmsweb/lms.org.pl.zone diff -u lmsweb/lms.org.pl.zone:1.11 lmsweb/lms.org.pl.zone:1.12 --- lmsweb/lms.org.pl.zone:1.11 Mon May 24 12:22:31 2010 +++ lmsweb/lms.org.pl.zone Sun Jul 18 10:42:20 2010 @@ -1,4 +1,4 @@ -; $Id: lms.org.pl.zone,v 1.11 2010/05/24 10:22:31 lukasz Exp $ +; $Id: lms.org.pl.zone,v 1.12 2010/07/18 08:42:20 lukasz Exp $ $TTL 86400 $ORIGIN lms.org.pl. @@ -8,8 +8,8 @@ @ IN SOA netserv.baseciq.org. baseciq.baseciq.org. 2010052400 1200 3600 1728000 172800 @ IN NS netserv.baseciq.org. -@ IN NS fns1.sgh.waw.pl. -@ IN NS fns2.sgh.waw.pl. +@ IN NS fns1.42.pl. +@ IN NS fns2.42.pl. ; proszę o zabranie tej domeny i przekierowanie adresu e-mail lukasz w lms.org.pl na lukasz w netx.waw.pl. dziękuję! From cvs w lms.org.pl Mon Jul 26 13:41:28 2010 From: cvs w lms.org.pl (LMS CVS) Date: Mon, 26 Jul 2010 13:41:28 +0200 (CEST) Subject: [lms-commits] CVS update of lms/bin (lms-etherdesc) Message-ID: <20100726114128.AE14A302C98B@hydra.altec.pl> Date: Monday, July 26, 2010 @ 13:41:28 Author: alec Path: /cvsroot/lms/bin Modified: lms-etherdesc - BTS#0000839: fixed multi-mac support Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/bin/lms-etherdesc.diff?&r1=1.25&r2=1.26 Index: lms/bin/lms-etherdesc diff -u lms/bin/lms-etherdesc:1.25 lms/bin/lms-etherdesc:1.26 --- lms/bin/lms-etherdesc:1.25 Fri May 14 09:29:00 2010 +++ lms/bin/lms-etherdesc Mon Jul 26 13:41:28 2010 @@ -20,7 +20,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. # -# $Id: lms-etherdesc,v 1.25 2010/05/14 07:29:00 chilek Exp $ +# $Id: lms-etherdesc,v 1.26 2010/07/26 11:41:28 alec Exp $ use strict; use DBI; @@ -168,7 +168,7 @@ foreach my $key (@networks) { $dbq->execute($key); - + while (my $row = $dbq->fetchrow_hashref()) { my $longip = $row->{'address'}; @@ -177,12 +177,13 @@ { if($maclist{$i}) { - my $mac = lc((split ',', $maclist{$i})[0]); my $name = lc($namelist{$i}); - - $mac =~ s/://g; + my $macs = lc($maclist{$i}); + $macs =~ s/://g; - print ETHERSFILE "$mac:$name\n"; + foreach my $mac (split ',', $macs) { + print ETHERSFILE "$mac:$name\n"; + } } } } From cvs w lms.org.pl Sat Jul 31 23:36:42 2010 From: cvs w lms.org.pl (LMS CVS) Date: Sat, 31 Jul 2010 23:36:42 +0200 (CEST) Subject: [lms-commits] CVS update of lms/lib (Auth.class.php) Message-ID: <20100731213642.535F3302C98B@hydra.altec.pl> Date: Saturday, July 31, 2010 @ 23:36:42 Author: chilek Path: /cvsroot/lms/lib Modified: Auth.class.php - fixed last login for currently logged user Diff URLs: http://cvs.lms.org.pl/viewvc/Development/lms/lib/Auth.class.php.diff?&r1=1.30&r2=1.31 Index: lms/lib/Auth.class.php diff -u lms/lib/Auth.class.php:1.30 lms/lib/Auth.class.php:1.31 --- lms/lib/Auth.class.php:1.30 Thu Mar 11 14:07:34 2010 +++ lms/lib/Auth.class.php Sat Jul 31 23:36:42 2010 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * - * $Id: Auth.class.php,v 1.30 2010/03/11 13:07:34 alec Exp $ + * $Id: Auth.class.php,v 1.31 2010/07/31 21:36:42 chilek Exp $ */ class Auth { @@ -38,7 +38,7 @@ var $lastip; var $error; var $_version = '1.11-cvs'; - var $_revision = '$Revision: 1.30 $'; + var $_revision = '$Revision: 1.31 $'; var $DB = NULL; var $SESSION = NULL; @@ -83,8 +83,11 @@ if($this->islogged || ($this->login && $this->VerifyUser())) { - $this->SESSION->restore('session_last', $this->last); - $this->SESSION->restore('session_lastip', $this->lastip); + if(empty($this->last)) + { + $this->SESSION->restore('session_last', $this->last); + $this->SESSION->restore('session_lastip', $this->lastip); + } $this->logname = $this->logname ? $this->logname : $this->SESSION->get('session_logname'); $this->id = $this->id ? $this->id : $this->SESSION->get('session_id');