]> git.pld-linux.org Git - packages/lms.git/blob - lms-misc_mods.patch
- %desc
[packages/lms.git] / lms-misc_mods.patch
1 --- lms/bin/lms-mgc.orig        2005-02-16 21:06:34.000000000 +0100
2 +++ lms/bin/lms-mgc     2005-02-16 22:52:09.737554076 +0100
3 @@ -441,7 +441,7 @@
4                 
5                 # BUILD NODELIST
6                 
7 -               $dbq = $dbase->prepare("SELECT ipaddr, mac, access, nodes.id as id, ownerid, nodes.name as name, warning, nodes.info AS info, pin FROM nodes, users WHERE users.id=nodes.ownerid");
8 +               $dbq = $dbase->prepare("SELECT ipaddr, mac, access, nodes.id as id, ownerid, nodes.name as name, warning, nodes.info AS info, pin FROM nodes LEFT JOIN users ON users.id=nodes.ownerid");
9                 $dbq->execute();
10  
11                 my %maclist;
12 --- lms/bin/lms-cutoff.orig     2005-02-16 21:06:34.000000000 +0100
13 +++ lms/bin/lms-cutoff  2005-02-16 23:30:45.107977542 +0100
14 @@ -151,9 +151,9 @@
15         
16  }
17  
18 -$dbq = $dbase->prepare("DELETE FROM timestamps WHERE tablename = 'nodes' OR tablename = '_global'");
19 +$dbq = $dbase->prepare("DELETE FROM timestamps WHERE tablename = '_force' OR tablename = '_global'");
20  $dbq->execute();
21 -$dbq = $dbase->prepare("INSERT INTO timestamps (tablename,time) VALUES ('nodes',$utsfmt)");
22 +$dbq = $dbase->prepare("INSERT INTO timestamps (tablename,time) VALUES ('_force',$utsfmt)");
23  $dbq->execute();
24  $dbq = $dbase->prepare("INSERT INTO timestamps (tablename,time) VALUES ('_global',$utsfmt)");
25  $dbq->execute();
26 --- lms/bin/lms-notify.orig     2005-02-16 21:06:34.000000000 +0100
27 +++ lms/bin/lms-notify  2005-01-12 14:48:40.000000000 +0100
28 @@ -226,6 +227,11 @@
29                                 }
30  
31                                 {
32 +                                       my $uid = $row->{'id'};
33 +                               $line =~ s/\%id/$uid/;
34 +                               }
35 +
36 +                               {
37                                         my $phone = $row->{'phone1'};
38                                 $line =~ s/\%phone1/$phone/;
39                                 }
40 --- lms/lib/LMS.class.php.orig  2005-02-16 22:16:02.728958199 +0100
41 +++ lms/lib/LMS.class.php       2005-02-16 22:16:30.059785467 +0100
42 @@ -1557,7 +1557,7 @@
43  
44         function GetUserAssignments($id)
45         {
46 -               if($assignments = $this->DB->GetAll('SELECT assignments.id AS id, tariffid, userid, period, at, suspended, value, uprate, upceil, downceil, downrate, name, invoice, datefrom, dateto FROM assignments LEFT JOIN tariffs ON (tariffid=tariffs.id) WHERE userid=? ORDER BY datefrom ASC', array($id)))
47 +               if($assignments = $this->DB->GetAll('SELECT assignments.id AS id, tariffid, userid, period, at, suspended, value, uprate, upceil, downceil, downrate, name, description, invoice, datefrom, dateto FROM assignments LEFT JOIN tariffs ON (tariffid=tariffs.id) WHERE userid=? ORDER BY datefrom ASC', array($id)))
48                 {
49                         foreach($assignments as $idx => $row)
50                         {
51 @@ -3153,6 +3153,15 @@
52             return $this->DB->GetRow('SELECT sum(upload) as upload, sum(download) as download FROM stats WHERE dt >='.$from.' AND dt <'.$to.' AND nodeid='.$host);
53         }
54  
55 +       function TrafficUser($from, $to, $user)
56 +       {
57 +           $traffic = $this->DB->GetRow('SELECT sum(upload) as upload, sum(download) as download FROM stats, nodes WHERE id=nodeid AND ownerid = '.$user.' AND dt >='.$from.' AND dt <'.$to);
58 +           list($t['download']['data'], $t['download']['unit']) = setunits($traffic['download']);
59 +           list($t['upload']['data'], $t['upload']['unit']) = setunits($traffic['upload']);
60 +           list($t['sum']['data'], $t['sum']['unit']) = setunits($traffic['upload']+$traffic['download']);
61 +           return $t;
62 +       }
63 +
64         function TrafficFirstRecord($host)
65         {
66             return $this->DB->GetOne('SELECT MIN(dt) FROM stats WHERE nodeid='.$host);
67 --- lms/templates/balancenew.html.orig  2005-02-17 00:00:59.356697601 +0100
68 +++ lms/templates/balancenew.html       2005-02-17 00:01:51.632773685 +0100
69 @@ -66,6 +66,9 @@
70                                                         {section name=users loop=$users}
71                                                         <OPTION value="{$users[users].id}">{$users[users].username|truncate:25:" ..."} ({$users[users].id|string_format:"%04d"})</OPTION>
72                                                         {/section}
73 +                                                       {section name=users loop=$users}
74 +                                                       <OPTION value="{$users[users].id}">{$users[users].id|string_format:"%04d"} {$users[users].username|truncate:25:" ..."}</OPTION>
75 +                                                       {/section}
76                                                 </SELECT>
77                                                 {t}Selected:{/t} <INPUT TYPE="edit" NAME="selectededit" VALUE="0" SIZE="5" STYLE="border:0; background-color: #DFD5BD;" readonly></INPUT>
78                                         </TD>
This page took 0.051379 seconds and 3 git commands to generate.