]> git.pld-linux.org Git - packages/lms.git/blame - lms-tariff_per_node.patch
- new
[packages/lms.git] / lms-tariff_per_node.patch
Content-type: text/html ]> git.pld-linux.org Git - packages/lms.git/blame - lms-tariff_per_node.patch


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 6) line 1, <$fd> line 200.
This page took 0.700557 seconds and 4 git commands to generate.
CommitLineData
70fc914c
TO
1diff -ur lms-cvs.orig/lib/LMS.class.php lms-cvs/lib/LMS.class.php
2--- lms-cvs.orig/lib/LMS.class.php 2005-02-02 21:09:04.226695078 +0100
3+++ lms-cvs/lib/LMS.class.php 2005-02-02 21:08:30.677015322 +0100
4@@ -1221,6 +1221,12 @@
5 return $this->DB->GetOne('SELECT ownerid FROM nodes WHERE id=?', array($id));
6 }
7
8+ function NodeAssignmentUpdate($nodedata)
9+ {
10+ $this->SetTS('nodesassignments');
11+ return $this->DB->Execute('UPDATE nodesassignments SET assignmentid=? WHERE nodeid=?',array($nodedata['assignment'],$nodedata['id']));
12+ }
13+
14 function NodeUpdate($nodedata)
15 {
16 $this->SetTS('nodes');
17@@ -1272,7 +1278,17 @@
18 {
19 return $this->DB->GetOne('SELECT name FROM nodes WHERE ipaddr=inet_aton(?)', array($ipaddr));
20 }
21+
22+ function GetNodeAssignment($id)
23+ {
24+ return $this->DB->GetOne('SELECT assignmentid FROM nodesassignments WHERE nodeid=?',array($id));
25+ }
26
27+ function GetNodeTariff($id)
28+ {
29+ return $this->DB->GetOne('SELECT name FROM tariffs LEFT JOIN assignments ON (tariffs.id=assignments.tariffid) WHERE assignments.id=?',array($id));
30+ }
31+
32 function GetNode($id)
33 {
34 if($result = $this->DB->GetRow('SELECT id, name, ownerid, ipaddr, inet_ntoa(ipaddr) AS ip, mac, access, warning, creationdate, moddate, creatorid, modid, netdev, lastonline, info FROM nodes WHERE id=?', array($id)))
35@@ -1296,6 +1312,8 @@
36 $result['netname'] = $this->GetNetworkName($result['netid']);
37 $result['producer'] = get_producer($result['mac']);
38 $result['devicename'] = $this->GetNetDevName($result['netdevid']);
39+ $result['assignment'] = $this->GetNodeAssignment($id);
40+ $result['tariff'] = $this->GetNodeTariff($result['assignment']);
41 return $result;
42 }else
43 return FALSE;
44@@ -1488,6 +1506,12 @@
45 return $this->DB->Execute('UPDATE nodes SET access=0 WHERE netdev=? AND ownerid=0', array($netdev));
46 }
47
48+ function NodeAssignmentAdd($nodedata)
49+ {
50+ $this->SetTS('nodesassignments');
51+ return $this->DB->Execute('INSERT INTO nodesassignments (nodeid,assignmentid) VALUES (?,?)',array($nodedata['id'], $nodedata['assignment']));
52+ }
53+
54 function NodeAdd($nodedata)
55 {
56 $this->SetTS('nodes');
57diff -ur lms-cvs.orig/modules/nodeadd.php lms-cvs/modules/nodeadd.php
58--- lms-cvs.orig/modules/nodeadd.php 2005-02-02 21:11:40.954932764 +0100
59+++ lms-cvs/modules/nodeadd.php 2005-02-01 20:51:45.000000000 +0100
60@@ -81,7 +81,8 @@
61
62 if(!$error)
63 {
64- $nodeid = $LMS->NodeAdd($nodedata);
65+ $nodeid=$LMS->NodeAdd($nodedata);
66+ $LMS->NodeAssignmentAdd($nodedata);
67 if($nodedata['reuse']=='')
68 {
69 header('Location: ?m=nodeinfo&id='.$nodeid);
70diff -ur lms-cvs.orig/modules/nodeedit.php lms-cvs/modules/nodeedit.php
71--- lms-cvs.orig/modules/nodeedit.php 2005-02-02 21:11:41.036919912 +0100
72+++ lms-cvs/modules/nodeedit.php 2005-02-01 20:51:45.000000000 +0100
73@@ -130,6 +130,8 @@
74
75 if(!$error)
76 {
77+ if ($nodeinfo['assignment']) $LMS->NodeAssignmentUpdate($nodeedit);
78+ else $LMS->NodeAssignmentAdd($nodeedit);
79 $LMS->NodeUpdate($nodeedit);
80 header('Location: ?m=nodeinfo&id='.$nodeedit['id']);
81 }
82diff -ur lms-cvs.orig/templates/nodeaddbox.html lms-cvs/templates/nodeaddbox.html
83--- lms-cvs.orig/templates/nodeaddbox.html 2005-01-31 22:09:20.000000000 +0100
84+++ lms-cvs/templates/nodeaddbox.html 2005-02-01 20:52:10.000000000 +0100
85@@ -35,6 +35,22 @@
86 </TR>
87 <TR CLASS="LIGHT">
88 <TD WIDTH="1%" CLASS="FLEFT">
89+ <IMG SRC="img/money.gif" BORDER="0" ALT=""></A>
90+ </TD>
91+ <TD WIDTH="1%" NOWRAP>
92+ <B>Taryfa:</B>
93+ </TD>
94+ <TD WIDTH="99%" CLASS="FRIGHT" COLSPAN="2">
95