Merge lp:~alexharrington/xibo/upgrade-db-backup-switch into lp:~xibo-maintainers/xibo/encke
- upgrade-db-backup-switch
- Merge into encke
Proposed by
Alex Harrington
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~alexharrington/xibo/upgrade-db-backup-switch |
Merge into: | lp:~xibo-maintainers/xibo/encke |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~alexharrington/xibo/upgrade-db-backup-switch |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dan Garner | Needs Information | ||
Review via email: mp+12199@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'client/dotNET/FileCollector.cs' | |||
2 | --- client/dotNET/FileCollector.cs 2009-03-13 09:21:56 +0000 | |||
3 | +++ client/dotNET/FileCollector.cs 2009-07-26 11:40:59 +0000 | |||
4 | @@ -236,6 +236,9 @@ | |||
5 | 236 | } | 236 | } |
6 | 237 | else | 237 | else |
7 | 238 | { | 238 | { |
8 | 239 | // Set the flag to indicate we have a connection to XMDS | ||
9 | 240 | Properties.Settings.Default.XmdsLastConnection = DateTime.Now; | ||
10 | 241 | |||
11 | 239 | // What file type were we getting | 242 | // What file type were we getting |
12 | 240 | if (currentFileList.type == "layout") | 243 | if (currentFileList.type == "layout") |
13 | 241 | { | 244 | { |
14 | 242 | 245 | ||
15 | === modified file 'client/dotNET/HardwareKey.cs' | |||
16 | --- client/dotNET/HardwareKey.cs 2009-03-02 23:21:22 +0000 | |||
17 | +++ client/dotNET/HardwareKey.cs 2009-07-26 11:40:59 +0000 | |||
18 | @@ -31,7 +31,18 @@ | |||
19 | 31 | { | 31 | { |
20 | 32 | System.Diagnostics.Debug.WriteLine("[IN]", "HardwareKey"); | 32 | System.Diagnostics.Debug.WriteLine("[IN]", "HardwareKey"); |
21 | 33 | 33 | ||
23 | 34 | hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C")); | 34 | // Get the key from the Settings |
24 | 35 | hardwareKey = Properties.Settings.Default.hardwareKey; | ||
25 | 36 | |||
26 | 37 | // Is the key empty? | ||
27 | 38 | if (hardwareKey == "") | ||
28 | 39 | { | ||
29 | 40 | // Calculate the Hardware key from the CPUID and Volume Serial | ||
30 | 41 | hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C")); | ||
31 | 42 | |||
32 | 43 | // Store the key | ||
33 | 44 | Properties.Settings.Default.hardwareKey = hardwareKey; | ||
34 | 45 | } | ||
35 | 35 | 46 | ||
36 | 36 | System.Diagnostics.Debug.WriteLine("[OUT]", "HardwareKey"); | 47 | System.Diagnostics.Debug.WriteLine("[OUT]", "HardwareKey"); |
37 | 37 | } | 48 | } |
38 | @@ -48,6 +59,19 @@ | |||
39 | 48 | } | 59 | } |
40 | 49 | 60 | ||
41 | 50 | /// <summary> | 61 | /// <summary> |
42 | 62 | /// Regenerates the hardware key | ||
43 | 63 | /// </summary> | ||
44 | 64 | public void Regenerate() | ||
45 | 65 | { | ||
46 | 66 | // Calculate the Hardware key from the CPUID and Volume Serial | ||
47 | 67 | hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C")); | ||
48 | 68 | |||
49 | 69 | // Store the key | ||
50 | 70 | Properties.Settings.Default.hardwareKey = hardwareKey; | ||
51 | 71 | Properties.Settings.Default.Save(); | ||
52 | 72 | } | ||
53 | 73 | |||
54 | 74 | /// <summary> | ||
55 | 51 | /// return Volume Serial Number from hard drive | 75 | /// return Volume Serial Number from hard drive |
56 | 52 | /// </summary> | 76 | /// </summary> |
57 | 53 | /// <param name="strDriveLetter">[optional] Drive letter</param> | 77 | /// <param name="strDriveLetter">[optional] Drive letter</param> |
58 | 54 | 78 | ||
59 | === modified file 'client/dotNET/Image.cs' | |||
60 | --- client/dotNET/Image.cs 2009-02-25 22:57:05 +0000 | |||
61 | +++ client/dotNET/Image.cs 2009-08-03 14:09:45 +0000 | |||
62 | @@ -27,30 +27,37 @@ | |||
63 | 27 | { | 27 | { |
64 | 28 | class ImagePosition : Media | 28 | class ImagePosition : Media |
65 | 29 | { | 29 | { |
66 | 30 | private string _filePath; | ||
67 | 31 | PictureBox _pictureBox; | ||
68 | 32 | |||
69 | 30 | public ImagePosition(RegionOptions options) | 33 | public ImagePosition(RegionOptions options) |
70 | 31 | : base(options.width, options.height, options.top, options.left) | 34 | : base(options.width, options.height, options.top, options.left) |
71 | 32 | { | 35 | { |
73 | 33 | this.filePath = options.uri; | 36 | _filePath = options.uri; |
74 | 34 | 37 | ||
76 | 35 | if (!System.IO.File.Exists(this.filePath)) | 38 | if (!System.IO.File.Exists(_filePath)) |
77 | 36 | { | 39 | { |
78 | 37 | // Exit | 40 | // Exit |
80 | 38 | this.loaded = false; | 41 | System.Diagnostics.Trace.WriteLine(new LogMessage("Image - Dispose", "Cannot Create image object. Invalid Filepath."), LogType.Error.ToString()); |
81 | 39 | return; | 42 | return; |
82 | 40 | } | 43 | } |
83 | 41 | 44 | ||
96 | 42 | Bitmap img = new Bitmap(this.filePath); | 45 | try |
97 | 43 | 46 | { | |
98 | 44 | this.pictureBox = new PictureBox(); | 47 | _pictureBox = new PictureBox(); |
99 | 45 | this.pictureBox.SizeMode = PictureBoxSizeMode.Zoom; | 48 | _pictureBox.SizeMode = PictureBoxSizeMode.Zoom; |
100 | 46 | this.pictureBox.Image = img; | 49 | _pictureBox.Image = new Bitmap(_filePath); |
101 | 47 | this.pictureBox.Size = new Size(width, height); | 50 | _pictureBox.Size = new Size(width, height); |
102 | 48 | this.pictureBox.Location = new Point(0, 0); | 51 | _pictureBox.Location = new Point(0, 0); |
103 | 49 | this.pictureBox.BorderStyle = BorderStyle.None; | 52 | _pictureBox.BorderStyle = BorderStyle.None; |
104 | 50 | this.pictureBox.BackColor = Color.Transparent; | 53 | _pictureBox.BackColor = Color.Transparent; |
105 | 51 | this.loaded = true; | 54 | |
106 | 52 | 55 | this.Controls.Add(this._pictureBox); | |
107 | 53 | this.Controls.Add(this.pictureBox); | 56 | } |
108 | 57 | catch (Exception ex) | ||
109 | 58 | { | ||
110 | 59 | System.Diagnostics.Trace.WriteLine(new LogMessage("ImagePosition", String.Format("Cannot create Image Object with exception: {0}", ex.Message)), LogType.Error.ToString()); | ||
111 | 60 | } | ||
112 | 54 | } | 61 | } |
113 | 55 | 62 | ||
114 | 56 | public override void RenderMedia() | 63 | public override void RenderMedia() |
115 | @@ -60,16 +67,22 @@ | |||
116 | 60 | 67 | ||
117 | 61 | protected override void Dispose(bool disposing) | 68 | protected override void Dispose(bool disposing) |
118 | 62 | { | 69 | { |
120 | 63 | if (disposing && loaded) | 70 | if (disposing) |
121 | 64 | { | 71 | { |
123 | 65 | this.pictureBox.Dispose(); | 72 | try |
124 | 73 | { | ||
125 | 74 | Controls.Remove(_pictureBox); | ||
126 | 75 | |||
127 | 76 | _pictureBox.Image.Dispose(); | ||
128 | 77 | _pictureBox.Dispose(); | ||
129 | 78 | } | ||
130 | 79 | catch (Exception ex) | ||
131 | 80 | { | ||
132 | 81 | System.Diagnostics.Trace.WriteLine(new LogMessage("Image - Dispose", String.Format("Cannot dispose Image Object with exception: {0}", ex.Message)), LogType.Error.ToString()); | ||
133 | 82 | } | ||
134 | 66 | } | 83 | } |
135 | 67 | 84 | ||
136 | 68 | base.Dispose(disposing); | 85 | base.Dispose(disposing); |
137 | 69 | } | 86 | } |
138 | 70 | |||
139 | 71 | private string filePath; | ||
140 | 72 | private bool loaded; | ||
141 | 73 | PictureBox pictureBox; | ||
142 | 74 | } | 87 | } |
143 | 75 | } | 88 | } |
144 | 76 | 89 | ||
145 | === added file 'client/dotNET/LogMessage.cs' | |||
146 | --- client/dotNET/LogMessage.cs 1970-01-01 00:00:00 +0000 | |||
147 | +++ client/dotNET/LogMessage.cs 2009-07-26 11:40:59 +0000 | |||
148 | @@ -0,0 +1,75 @@ | |||
149 | 1 | /* | ||
150 | 2 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
151 | 3 | * Copyright (C) 2009 Daniel Garner | ||
152 | 4 | * | ||
153 | 5 | * This file is part of Xibo. | ||
154 | 6 | * | ||
155 | 7 | * Xibo is free software: you can redistribute it and/or modify | ||
156 | 8 | * it under the terms of the GNU Affero General Public License as published by | ||
157 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
158 | 10 | * any later version. | ||
159 | 11 | * | ||
160 | 12 | * Xibo is distributed in the hope that it will be useful, | ||
161 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
162 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
163 | 15 | * GNU Affero General Public License for more details. | ||
164 | 16 | * | ||
165 | 17 | * You should have received a copy of the GNU Affero General Public License | ||
166 | 18 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
167 | 19 | */ | ||
168 | 20 | using System; | ||
169 | 21 | using System.Collections.Generic; | ||
170 | 22 | using System.Text; | ||
171 | 23 | |||
172 | 24 | namespace XiboClient | ||
173 | 25 | { | ||
174 | 26 | class LogMessage | ||
175 | 27 | { | ||
176 | 28 | String _method; | ||
177 | 29 | String _message; | ||
178 | 30 | int _scheduleId; | ||
179 | 31 | int _layoutId; | ||
180 | 32 | int _mediaId; | ||
181 | 33 | |||
182 | 34 | public LogMessage(String method, String message) | ||
183 | 35 | { | ||
184 | 36 | _method = method; | ||
185 | 37 | _message = message; | ||
186 | 38 | } | ||
187 | 39 | |||
188 | 40 | public LogMessage(String method, String message, int scheduleId, int layoutId) | ||
189 | 41 | { | ||
190 | 42 | _method = method; | ||
191 | 43 | _message = message; | ||
192 | 44 | _scheduleId = scheduleId; | ||
193 | 45 | _layoutId = layoutId; | ||
194 | 46 | } | ||
195 | 47 | |||
196 | 48 | public LogMessage(String method, String message, int scheduleId, int layoutId, int mediaId) | ||
197 | 49 | { | ||
198 | 50 | _method = method; | ||
199 | 51 | _message = message; | ||
200 | 52 | _scheduleId = scheduleId; | ||
201 | 53 | _layoutId = layoutId; | ||
202 | 54 | _mediaId = mediaId; | ||
203 | 55 | } | ||
204 | 56 | |||
205 | 57 | public override string ToString() | ||
206 | 58 | { | ||
207 | 59 | // Format the message into the expected XML sub nodes. | ||
208 | 60 | // Just do this with a string builder rather than an XML builder. | ||
209 | 61 | String theMessage; | ||
210 | 62 | |||
211 | 63 | theMessage = String.Format("<message>{0}</message>", _message); | ||
212 | 64 | theMessage += String.Format("<method>{0}</method>", _method); | ||
213 | 65 | |||
214 | 66 | if (_scheduleId != 0) theMessage += String.Format("<scheduleid>{0}</scheduleid>", _scheduleId.ToString()); | ||
215 | 67 | if (_layoutId != 0) theMessage += String.Format("<layoutid>{0}</layoutid>", _scheduleId.ToString()); | ||
216 | 68 | if (_mediaId != 0) theMessage += String.Format("<mediaid>{0}</mediaid>", _scheduleId.ToString()); | ||
217 | 69 | |||
218 | 70 | return theMessage; | ||
219 | 71 | } | ||
220 | 72 | } | ||
221 | 73 | |||
222 | 74 | public enum LogType { Info, Audit, Error } | ||
223 | 75 | } | ||
224 | 0 | 76 | ||
225 | === modified file 'client/dotNET/MainForm.cs' | |||
226 | --- client/dotNET/MainForm.cs 2009-03-08 11:40:17 +0000 | |||
227 | +++ client/dotNET/MainForm.cs 2009-07-30 23:01:31 +0000 | |||
228 | @@ -34,9 +34,24 @@ | |||
229 | 34 | { | 34 | { |
230 | 35 | public partial class MainForm : Form | 35 | public partial class MainForm : Form |
231 | 36 | { | 36 | { |
232 | 37 | private Schedule schedule; | ||
233 | 38 | private Collection<Region> regions; | ||
234 | 39 | private bool isExpired = false; | ||
235 | 40 | private int scheduleId; | ||
236 | 41 | private int layoutId; | ||
237 | 42 | |||
238 | 43 | double layoutWidth; | ||
239 | 44 | double layoutHeight; | ||
240 | 45 | double scaleFactor; | ||
241 | 46 | |||
242 | 47 | private StatLog _statLog; | ||
243 | 48 | private Stat _stat; | ||
244 | 49 | |||
245 | 37 | public MainForm() | 50 | public MainForm() |
246 | 38 | { | 51 | { |
247 | 39 | InitializeComponent(); | 52 | InitializeComponent(); |
248 | 53 | |||
249 | 54 | _statLog = new StatLog(); | ||
250 | 40 | } | 55 | } |
251 | 41 | 56 | ||
252 | 42 | private void MainForm_Load(object sender, EventArgs e) | 57 | private void MainForm_Load(object sender, EventArgs e) |
253 | @@ -50,7 +65,7 @@ | |||
254 | 50 | Directory.CreateDirectory(Properties.Settings.Default.LibraryPath + @"\backgrounds"); | 65 | Directory.CreateDirectory(Properties.Settings.Default.LibraryPath + @"\backgrounds"); |
255 | 51 | } | 66 | } |
256 | 52 | catch (Exception ex) | 67 | catch (Exception ex) |
258 | 53 | { System.Diagnostics.Debug.WriteLine(ex.Message); } | 68 | { System.Diagnostics.Trace.WriteLine(ex.Message); } |
259 | 54 | } | 69 | } |
260 | 55 | 70 | ||
261 | 56 | // Hide the cursor | 71 | // Hide the cursor |
262 | @@ -71,7 +86,7 @@ | |||
263 | 71 | } | 86 | } |
264 | 72 | catch (Exception ex) | 87 | catch (Exception ex) |
265 | 73 | { | 88 | { |
267 | 74 | System.Diagnostics.Debug.WriteLine(ex.Message); | 89 | System.Diagnostics.Debug.WriteLine(ex.Message, LogType.Error.ToString()); |
268 | 75 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); | 90 | MessageBox.Show("Fatal Error initialising the application", "Fatal Error"); |
269 | 76 | this.Close(); | 91 | this.Close(); |
270 | 77 | this.Dispose(); | 92 | this.Dispose(); |
271 | @@ -89,6 +104,15 @@ | |||
272 | 89 | this.scheduleId = scheduleId; | 104 | this.scheduleId = scheduleId; |
273 | 90 | this.layoutId = layoutId; | 105 | this.layoutId = layoutId; |
274 | 91 | 106 | ||
275 | 107 | if (_stat != null) | ||
276 | 108 | { | ||
277 | 109 | // Log the end of the currently running layout. | ||
278 | 110 | _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | ||
279 | 111 | |||
280 | 112 | // Record this stat event in the statLog object | ||
281 | 113 | _statLog.RecordStat(_stat); | ||
282 | 114 | } | ||
283 | 115 | |||
284 | 92 | try | 116 | try |
285 | 93 | { | 117 | { |
286 | 94 | this.DestroyLayout(); | 118 | this.DestroyLayout(); |
287 | @@ -102,9 +126,6 @@ | |||
288 | 102 | System.Diagnostics.Debug.WriteLine(ex.Message); | 126 | System.Diagnostics.Debug.WriteLine(ex.Message); |
289 | 103 | isExpired = true; | 127 | isExpired = true; |
290 | 104 | } | 128 | } |
291 | 105 | |||
292 | 106 | // Flush the TraceListener | ||
293 | 107 | System.Diagnostics.Trace.Flush(); | ||
294 | 108 | } | 129 | } |
295 | 109 | 130 | ||
296 | 110 | 131 | ||
297 | @@ -113,7 +134,12 @@ | |||
298 | 113 | /// </summary> | 134 | /// </summary> |
299 | 114 | private void PrepareLayout(string layoutPath) | 135 | private void PrepareLayout(string layoutPath) |
300 | 115 | { | 136 | { |
302 | 116 | XmlLog.AppendStat("Layout Started", StatType.LayoutStart, scheduleId, layoutId, "0"); | 137 | // Create a start record for this layout |
303 | 138 | _stat = new Stat(); | ||
304 | 139 | _stat.type = StatType.Layout; | ||
305 | 140 | _stat.scheduleID = scheduleId; | ||
306 | 141 | _stat.layoutID = layoutId; | ||
307 | 142 | _stat.fromDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | ||
308 | 117 | 143 | ||
309 | 118 | // Get this layouts XML | 144 | // Get this layouts XML |
310 | 119 | XmlDocument layoutXml = new XmlDocument(); | 145 | XmlDocument layoutXml = new XmlDocument(); |
311 | @@ -213,20 +239,6 @@ | |||
312 | 213 | leftOverY = 0; | 239 | leftOverY = 0; |
313 | 214 | } | 240 | } |
314 | 215 | 241 | ||
315 | 216 | // Are we licensed? | ||
316 | 217 | if (Properties.Settings.Default.licensed == 0) | ||
317 | 218 | { | ||
318 | 219 | // Show a label indicating this fact | ||
319 | 220 | notLic = new Label(); | ||
320 | 221 | notLic.Location = new Point(0, 0); | ||
321 | 222 | notLic.Size = new System.Drawing.Size(500, 200); | ||
322 | 223 | notLic.Text = "This Display is not Licensed."; | ||
323 | 224 | notLic.BackColor = Color.WhiteSmoke; | ||
324 | 225 | this.Controls.Add(notLic); | ||
325 | 226 | notLic.BringToFront(); | ||
326 | 227 | notLic.Show(); | ||
327 | 228 | } | ||
328 | 229 | |||
329 | 230 | // New region and region options objects | 242 | // New region and region options objects |
330 | 231 | regions = new Collection<Region>(); | 243 | regions = new Collection<Region>(); |
331 | 232 | RegionOptions options = new RegionOptions(); | 244 | RegionOptions options = new RegionOptions(); |
332 | @@ -305,7 +317,7 @@ | |||
333 | 305 | // All the media nodes for this region / layout combination | 317 | // All the media nodes for this region / layout combination |
334 | 306 | options.mediaNodes = region.ChildNodes; | 318 | options.mediaNodes = region.ChildNodes; |
335 | 307 | 319 | ||
337 | 308 | Region temp = new Region(); | 320 | Region temp = new Region(ref _statLog); |
338 | 309 | temp.DurationElapsedEvent += new Region.DurationElapsedDelegate(temp_DurationElapsedEvent); | 321 | temp.DurationElapsedEvent += new Region.DurationElapsedDelegate(temp_DurationElapsedEvent); |
339 | 310 | 322 | ||
340 | 311 | System.Diagnostics.Debug.WriteLine("Created new region", "MainForm - Prepare Layout"); | 323 | System.Diagnostics.Debug.WriteLine("Created new region", "MainForm - Prepare Layout"); |
341 | @@ -368,6 +380,8 @@ | |||
342 | 368 | 380 | ||
343 | 369 | foreach (Region region in regions) | 381 | foreach (Region region in regions) |
344 | 370 | { | 382 | { |
345 | 383 | region.Clear(); | ||
346 | 384 | |||
347 | 371 | this.Controls.Remove(region); | 385 | this.Controls.Remove(region); |
348 | 372 | 386 | ||
349 | 373 | try | 387 | try |
350 | @@ -384,27 +398,21 @@ | |||
351 | 384 | 398 | ||
352 | 385 | regions.Clear(); | 399 | regions.Clear(); |
353 | 386 | regions = null; | 400 | regions = null; |
376 | 387 | 401 | } | |
377 | 388 | this.Controls.Remove(notLic); | 402 | |
378 | 389 | 403 | /// <summary> | |
379 | 390 | // Want a check for powerpoint instances left open by this user | 404 | /// Force a flush of the stats log |
380 | 391 | /*foreach (System.Diagnostics.Process proc in System.Diagnostics.Process.GetProcessesByName("POWERPNT")) | 405 | /// </summary> |
381 | 392 | { | 406 | public void FlushStats() |
382 | 393 | System.Diagnostics.Debug.WriteLine("Killing leftover Powerpoint process.", "MainForm - DestoryLayout"); | 407 | { |
383 | 394 | // Close them (End Process) | 408 | try |
384 | 395 | proc.Kill(); | 409 | { |
385 | 396 | }*/ | 410 | _statLog.Flush(); |
386 | 397 | } | 411 | } |
387 | 398 | 412 | catch | |
388 | 399 | private Schedule schedule; | 413 | { |
389 | 400 | private Collection<Region> regions; | 414 | System.Diagnostics.Trace.WriteLine(new LogMessage("MainForm - FlushStats", "Unable to Flush Stats"), LogType.Error.ToString()); |
390 | 401 | private bool isExpired = false; | 415 | } |
391 | 402 | private Label notLic; | 416 | } |
370 | 403 | private int scheduleId; | ||
371 | 404 | private int layoutId; | ||
372 | 405 | |||
373 | 406 | double layoutWidth; | ||
374 | 407 | double layoutHeight; | ||
375 | 408 | double scaleFactor; | ||
392 | 409 | } | 417 | } |
393 | 410 | } | 418 | } |
394 | 411 | \ No newline at end of file | 419 | \ No newline at end of file |
395 | 412 | 420 | ||
396 | === modified file 'client/dotNET/Media.cs' | |||
397 | --- client/dotNET/Media.cs 2008-12-19 23:34:13 +0000 | |||
398 | +++ client/dotNET/Media.cs 2009-08-03 21:56:06 +0000 | |||
399 | @@ -28,6 +28,8 @@ | |||
400 | 28 | { | 28 | { |
401 | 29 | public Media(int width, int height, int top, int left) | 29 | public Media(int width, int height, int top, int left) |
402 | 30 | { | 30 | { |
403 | 31 | Hide(); | ||
404 | 32 | |||
405 | 31 | this.width = width; | 33 | this.width = width; |
406 | 32 | this.height = height; | 34 | this.height = height; |
407 | 33 | this.top = top; | 35 | this.top = top; |
408 | @@ -45,9 +47,12 @@ | |||
409 | 45 | this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); | 47 | this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); |
410 | 46 | this.BackColor = System.Drawing.Color.Transparent; | 48 | this.BackColor = System.Drawing.Color.Transparent; |
411 | 47 | this.TransparencyKey = System.Drawing.Color.White; | 49 | this.TransparencyKey = System.Drawing.Color.White; |
412 | 50 | |||
413 | 51 | SetStyle(ControlStyles.OptimizedDoubleBuffer, true); | ||
414 | 52 | SetStyle(ControlStyles.AllPaintingInWmPaint, true); | ||
415 | 48 | } | 53 | } |
416 | 49 | 54 | ||
418 | 50 | public virtual void RenderMedia() | 55 | protected void StartTimer() |
419 | 51 | { | 56 | { |
420 | 52 | //start the timer | 57 | //start the timer |
421 | 53 | if (!timerStarted && duration != 0) | 58 | if (!timerStarted && duration != 0) |
422 | @@ -60,9 +65,15 @@ | |||
423 | 60 | 65 | ||
424 | 61 | timerStarted = true; | 66 | timerStarted = true; |
425 | 62 | } | 67 | } |
426 | 68 | } | ||
427 | 69 | |||
428 | 70 | public virtual void RenderMedia() | ||
429 | 71 | { | ||
430 | 72 | // Start the timer for this media | ||
431 | 73 | StartTimer(); | ||
432 | 63 | 74 | ||
433 | 64 | // Show the form | 75 | // Show the form |
435 | 65 | this.Show(); | 76 | Show(); |
436 | 66 | } | 77 | } |
437 | 67 | 78 | ||
438 | 68 | protected virtual void timer_Tick(object sender, EventArgs e) | 79 | protected virtual void timer_Tick(object sender, EventArgs e) |
439 | 69 | 80 | ||
440 | === modified file 'client/dotNET/OptionForm.cs' | |||
441 | --- client/dotNET/OptionForm.cs 2009-03-08 11:40:17 +0000 | |||
442 | +++ client/dotNET/OptionForm.cs 2009-07-26 11:40:59 +0000 | |||
443 | @@ -58,6 +58,9 @@ | |||
444 | 58 | System.Diagnostics.Debug.WriteLine("Getting the Hardware Key", "OptionForm"); | 58 | System.Diagnostics.Debug.WriteLine("Getting the Hardware Key", "OptionForm"); |
445 | 59 | hardwareKey = new HardwareKey(); | 59 | hardwareKey = new HardwareKey(); |
446 | 60 | 60 | ||
447 | 61 | // Regenerate the key | ||
448 | 62 | hardwareKey.Regenerate(); | ||
449 | 63 | |||
450 | 61 | System.Diagnostics.Debug.WriteLine("Getting the Library Path", "OptionForm"); | 64 | System.Diagnostics.Debug.WriteLine("Getting the Library Path", "OptionForm"); |
451 | 62 | if (Properties.Settings.Default.LibraryPath == "DEFAULT") | 65 | if (Properties.Settings.Default.LibraryPath == "DEFAULT") |
452 | 63 | { | 66 | { |
453 | @@ -114,6 +117,8 @@ | |||
454 | 114 | { | 117 | { |
455 | 115 | textBoxResults.Text = "Sending Request"; | 118 | textBoxResults.Text = "Sending Request"; |
456 | 116 | 119 | ||
457 | 120 | this.xmds1.Url = Properties.Settings.Default.XiboClient_xmds_xmds; | ||
458 | 121 | |||
459 | 117 | Properties.Settings.Default.displayName = textBoxDisplayName.Text; | 122 | Properties.Settings.Default.displayName = textBoxDisplayName.Text; |
460 | 118 | Properties.Settings.Default.Save(); | 123 | Properties.Settings.Default.Save(); |
461 | 119 | 124 | ||
462 | 120 | 125 | ||
463 | === modified file 'client/dotNET/Program.cs' | |||
464 | --- client/dotNET/Program.cs 2009-03-08 12:51:18 +0000 | |||
465 | +++ client/dotNET/Program.cs 2009-07-26 11:40:59 +0000 | |||
466 | @@ -35,25 +35,25 @@ | |||
467 | 35 | Application.SetCompatibleTextRenderingDefault(false); | 35 | Application.SetCompatibleTextRenderingDefault(false); |
468 | 36 | 36 | ||
469 | 37 | System.Diagnostics.Trace.Listeners.Add(new XiboTraceListener()); | 37 | System.Diagnostics.Trace.Listeners.Add(new XiboTraceListener()); |
471 | 38 | System.Diagnostics.Trace.AutoFlush = true; | 38 | System.Diagnostics.Trace.AutoFlush = false; |
472 | 39 | 39 | ||
473 | 40 | Form formMain; | 40 | Form formMain; |
474 | 41 | 41 | ||
475 | 42 | if (arg.GetLength(0) > 0) | 42 | if (arg.GetLength(0) > 0) |
476 | 43 | { | 43 | { |
478 | 44 | System.Diagnostics.Trace.WriteLine("Options Started", "Main"); | 44 | System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Options Started"), LogType.Info.ToString()); |
479 | 45 | formMain = new OptionForm(); | 45 | formMain = new OptionForm(); |
480 | 46 | } | 46 | } |
481 | 47 | else | 47 | else |
482 | 48 | { | 48 | { |
484 | 49 | System.Diagnostics.Trace.WriteLine("Client Started", "Main"); | 49 | System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Client Started"), LogType.Info.ToString()); |
485 | 50 | formMain = new MainForm(); | 50 | formMain = new MainForm(); |
486 | 51 | } | 51 | } |
487 | 52 | 52 | ||
488 | 53 | Application.Run(formMain); | 53 | Application.Run(formMain); |
489 | 54 | 54 | ||
490 | 55 | // Always flush at the end | 55 | // Always flush at the end |
492 | 56 | System.Diagnostics.Trace.WriteLine("Application Finished", "Main"); | 56 | System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Application Finished"), LogType.Info.ToString()); |
493 | 57 | System.Diagnostics.Trace.Flush(); | 57 | System.Diagnostics.Trace.Flush(); |
494 | 58 | } | 58 | } |
495 | 59 | } | 59 | } |
496 | 60 | 60 | ||
497 | === modified file 'client/dotNET/Properties/Settings.Designer.cs' | |||
498 | --- client/dotNET/Properties/Settings.Designer.cs 2009-03-08 11:40:17 +0000 | |||
499 | +++ client/dotNET/Properties/Settings.Designer.cs 2009-07-30 23:01:31 +0000 | |||
500 | @@ -47,7 +47,7 @@ | |||
501 | 47 | [global::System.Configuration.UserScopedSettingAttribute()] | 47 | [global::System.Configuration.UserScopedSettingAttribute()] |
502 | 48 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | 48 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
503 | 49 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] | 49 | [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)] |
505 | 50 | [global::System.Configuration.DefaultSettingValueAttribute("http://localhost/Xibo/server/xmds.php")] | 50 | [global::System.Configuration.DefaultSettingValueAttribute("http://localhost/1.0.0/server/xmds.php")] |
506 | 51 | public string XiboClient_xmds_xmds { | 51 | public string XiboClient_xmds_xmds { |
507 | 52 | get { | 52 | get { |
508 | 53 | return ((string)(this["XiboClient_xmds_xmds"])); | 53 | return ((string)(this["XiboClient_xmds_xmds"])); |
509 | @@ -93,18 +93,6 @@ | |||
510 | 93 | } | 93 | } |
511 | 94 | } | 94 | } |
512 | 95 | 95 | ||
513 | 96 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
514 | 97 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
515 | 98 | [global::System.Configuration.DefaultSettingValueAttribute("900")] | ||
516 | 99 | public decimal collectInterval { | ||
517 | 100 | get { | ||
518 | 101 | return ((decimal)(this["collectInterval"])); | ||
519 | 102 | } | ||
520 | 103 | set { | ||
521 | 104 | this["collectInterval"] = value; | ||
522 | 105 | } | ||
523 | 106 | } | ||
524 | 107 | |||
525 | 108 | [global::System.Configuration.ApplicationScopedSettingAttribute()] | 96 | [global::System.Configuration.ApplicationScopedSettingAttribute()] |
526 | 109 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | 97 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
527 | 110 | [global::System.Configuration.DefaultSettingValueAttribute("log.xml")] | 98 | [global::System.Configuration.DefaultSettingValueAttribute("log.xml")] |
528 | @@ -215,5 +203,61 @@ | |||
529 | 215 | return ((string)(this["Version"])); | 203 | return ((string)(this["Version"])); |
530 | 216 | } | 204 | } |
531 | 217 | } | 205 | } |
532 | 206 | |||
533 | 207 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
534 | 208 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
535 | 209 | [global::System.Configuration.DefaultSettingValueAttribute("")] | ||
536 | 210 | public string hardwareKey { | ||
537 | 211 | get { | ||
538 | 212 | return ((string)(this["hardwareKey"])); | ||
539 | 213 | } | ||
540 | 214 | set { | ||
541 | 215 | this["hardwareKey"] = value; | ||
542 | 216 | } | ||
543 | 217 | } | ||
544 | 218 | |||
545 | 219 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
546 | 220 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
547 | 221 | [global::System.Configuration.DefaultSettingValueAttribute("50")] | ||
548 | 222 | public int StatsFlushCount { | ||
549 | 223 | get { | ||
550 | 224 | return ((int)(this["StatsFlushCount"])); | ||
551 | 225 | } | ||
552 | 226 | set { | ||
553 | 227 | this["StatsFlushCount"] = value; | ||
554 | 228 | } | ||
555 | 229 | } | ||
556 | 230 | |||
557 | 231 | [global::System.Configuration.ApplicationScopedSettingAttribute()] | ||
558 | 232 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
559 | 233 | [global::System.Configuration.DefaultSettingValueAttribute("stats.xml")] | ||
560 | 234 | public string StatsLogFile { | ||
561 | 235 | get { | ||
562 | 236 | return ((string)(this["StatsLogFile"])); | ||
563 | 237 | } | ||
564 | 238 | } | ||
565 | 239 | |||
566 | 240 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
567 | 241 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
568 | 242 | public global::System.DateTime XmdsLastConnection { | ||
569 | 243 | get { | ||
570 | 244 | return ((global::System.DateTime)(this["XmdsLastConnection"])); | ||
571 | 245 | } | ||
572 | 246 | set { | ||
573 | 247 | this["XmdsLastConnection"] = value; | ||
574 | 248 | } | ||
575 | 249 | } | ||
576 | 250 | |||
577 | 251 | [global::System.Configuration.UserScopedSettingAttribute()] | ||
578 | 252 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] | ||
579 | 253 | [global::System.Configuration.DefaultSettingValueAttribute("900")] | ||
580 | 254 | public decimal collectInterval { | ||
581 | 255 | get { | ||
582 | 256 | return ((decimal)(this["collectInterval"])); | ||
583 | 257 | } | ||
584 | 258 | set { | ||
585 | 259 | this["collectInterval"] = value; | ||
586 | 260 | } | ||
587 | 261 | } | ||
588 | 218 | } | 262 | } |
589 | 219 | } | 263 | } |
590 | 220 | 264 | ||
591 | === modified file 'client/dotNET/Properties/Settings.settings' | |||
592 | --- client/dotNET/Properties/Settings.settings 2009-03-08 11:40:17 +0000 | |||
593 | +++ client/dotNET/Properties/Settings.settings 2009-07-30 23:01:31 +0000 | |||
594 | @@ -9,7 +9,7 @@ | |||
595 | 9 | <Value Profile="(Default)">schedule.xml</Value> | 9 | <Value Profile="(Default)">schedule.xml</Value> |
596 | 10 | </Setting> | 10 | </Setting> |
597 | 11 | <Setting Name="XiboClient_xmds_xmds" Type="(Web Service URL)" Scope="User"> | 11 | <Setting Name="XiboClient_xmds_xmds" Type="(Web Service URL)" Scope="User"> |
599 | 12 | <Value Profile="(Default)">http://localhost/Xibo/server/xmds.php</Value> | 12 | <Value Profile="(Default)">http://localhost/1.0.0/server/xmds.php</Value> |
600 | 13 | </Setting> | 13 | </Setting> |
601 | 14 | <Setting Name="ServerKey" Type="System.String" Scope="User"> | 14 | <Setting Name="ServerKey" Type="System.String" Scope="User"> |
602 | 15 | <Value Profile="(Default)">changetocustomerkey</Value> | 15 | <Value Profile="(Default)">changetocustomerkey</Value> |
603 | @@ -20,9 +20,6 @@ | |||
604 | 20 | <Setting Name="licensed" Type="System.Int32" Scope="User"> | 20 | <Setting Name="licensed" Type="System.Int32" Scope="User"> |
605 | 21 | <Value Profile="(Default)">0</Value> | 21 | <Value Profile="(Default)">0</Value> |
606 | 22 | </Setting> | 22 | </Setting> |
607 | 23 | <Setting Name="collectInterval" Type="System.Decimal" Scope="User"> | ||
608 | 24 | <Value Profile="(Default)">900</Value> | ||
609 | 25 | </Setting> | ||
610 | 26 | <Setting Name="logLocation" Type="System.String" Scope="Application"> | 23 | <Setting Name="logLocation" Type="System.String" Scope="Application"> |
611 | 27 | <Value Profile="(Default)">log.xml</Value> | 24 | <Value Profile="(Default)">log.xml</Value> |
612 | 28 | </Setting> | 25 | </Setting> |
613 | @@ -53,5 +50,20 @@ | |||
614 | 53 | <Setting Name="Version" Type="System.String" Scope="Application"> | 50 | <Setting Name="Version" Type="System.String" Scope="Application"> |
615 | 54 | <Value Profile="(Default)">1</Value> | 51 | <Value Profile="(Default)">1</Value> |
616 | 55 | </Setting> | 52 | </Setting> |
617 | 53 | <Setting Name="hardwareKey" Type="System.String" Scope="User"> | ||
618 | 54 | <Value Profile="(Default)" /> | ||
619 | 55 | </Setting> | ||
620 | 56 | <Setting Name="StatsFlushCount" Type="System.Int32" Scope="User"> | ||
621 | 57 | <Value Profile="(Default)">50</Value> | ||
622 | 58 | </Setting> | ||
623 | 59 | <Setting Name="StatsLogFile" Type="System.String" Scope="Application"> | ||
624 | 60 | <Value Profile="(Default)">stats.xml</Value> | ||
625 | 61 | </Setting> | ||
626 | 62 | <Setting Name="XmdsLastConnection" Type="System.DateTime" Scope="User"> | ||
627 | 63 | <Value Profile="(Default)" /> | ||
628 | 64 | </Setting> | ||
629 | 65 | <Setting Name="collectInterval" Type="System.Decimal" Scope="User"> | ||
630 | 66 | <Value Profile="(Default)">900</Value> | ||
631 | 67 | </Setting> | ||
632 | 56 | </Settings> | 68 | </Settings> |
633 | 57 | </SettingsFile> | 69 | </SettingsFile> |
634 | 58 | \ No newline at end of file | 70 | \ No newline at end of file |
635 | 59 | 71 | ||
636 | === modified file 'client/dotNET/Region.cs' | |||
637 | --- client/dotNET/Region.cs 2009-06-20 10:05:53 +0000 | |||
638 | +++ client/dotNET/Region.cs 2009-08-03 21:56:06 +0000 | |||
639 | @@ -31,9 +31,24 @@ | |||
640 | 31 | class Region : Panel | 31 | class Region : Panel |
641 | 32 | { | 32 | { |
642 | 33 | private BlackList blackList; | 33 | private BlackList blackList; |
645 | 34 | 34 | public delegate void DurationElapsedDelegate(); | |
646 | 35 | public Region() | 35 | public event DurationElapsedDelegate DurationElapsedEvent; |
647 | 36 | |||
648 | 37 | private Media media; | ||
649 | 38 | private RegionOptions options; | ||
650 | 39 | public bool hasExpired = false; | ||
651 | 40 | public bool layoutExpired = false; | ||
652 | 41 | private int currentSequence = -1; | ||
653 | 42 | |||
654 | 43 | // Stat objects | ||
655 | 44 | private StatLog _statLog; | ||
656 | 45 | private Stat _stat; | ||
657 | 46 | |||
658 | 47 | public Region(ref StatLog statLog) | ||
659 | 36 | { | 48 | { |
660 | 49 | // Store the statLog | ||
661 | 50 | _statLog = statLog; | ||
662 | 51 | |||
663 | 37 | //default options | 52 | //default options |
664 | 38 | options.width = 1024; | 53 | options.width = 1024; |
665 | 39 | options.height = 768; | 54 | options.height = 768; |
666 | @@ -45,6 +60,9 @@ | |||
667 | 45 | this.Size = new System.Drawing.Size(options.width, options.height); | 60 | this.Size = new System.Drawing.Size(options.width, options.height); |
668 | 46 | this.BackColor = System.Drawing.Color.Transparent; | 61 | this.BackColor = System.Drawing.Color.Transparent; |
669 | 47 | 62 | ||
670 | 63 | SetStyle(ControlStyles.OptimizedDoubleBuffer, true); | ||
671 | 64 | SetStyle(ControlStyles.AllPaintingInWmPaint, true); | ||
672 | 65 | |||
673 | 48 | // Create a new BlackList for us to use | 66 | // Create a new BlackList for us to use |
674 | 49 | blackList = new BlackList(); | 67 | blackList = new BlackList(); |
675 | 50 | } | 68 | } |
676 | @@ -139,19 +157,21 @@ | |||
677 | 139 | 157 | ||
678 | 140 | //add event handler | 158 | //add event handler |
679 | 141 | media.DurationElapsedEvent += new Media.DurationElapsedDelegate(media_DurationElapsedEvent); | 159 | media.DurationElapsedEvent += new Media.DurationElapsedDelegate(media_DurationElapsedEvent); |
681 | 142 | 160 | ||
682 | 143 | //any additional media specific render options (and starts the timer) | 161 | //any additional media specific render options (and starts the timer) |
683 | 144 | media.RenderMedia(); | 162 | media.RenderMedia(); |
684 | 145 | 163 | ||
685 | 164 | Controls.Add(media); | ||
686 | 165 | |||
687 | 146 | // This media has started and is being replaced | 166 | // This media has started and is being replaced |
693 | 147 | XmlLog.AppendStat("Media Start", StatType.MediaStart, options.scheduleId, options.layoutId, options.mediaid); | 167 | _stat = new Stat(); |
694 | 148 | 168 | _stat.type = StatType.Media; | |
695 | 149 | //media.Opacity = 0F; // Completely Opaque | 169 | _stat.fromDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
696 | 150 | 170 | _stat.scheduleID = options.scheduleId; | |
697 | 151 | this.Controls.Add(media); | 171 | _stat.layoutID = options.layoutId; |
698 | 172 | _stat.mediaID = options.mediaid; | ||
699 | 152 | 173 | ||
700 | 153 | System.Diagnostics.Debug.WriteLine("Showing new media", "Region - Eval Options"); | 174 | System.Diagnostics.Debug.WriteLine("Showing new media", "Region - Eval Options"); |
701 | 154 | |||
702 | 155 | } | 175 | } |
703 | 156 | 176 | ||
704 | 157 | /// <summary> | 177 | /// <summary> |
705 | @@ -180,7 +200,7 @@ | |||
706 | 180 | return; | 200 | return; |
707 | 181 | } | 201 | } |
708 | 182 | 202 | ||
710 | 183 | 203 | // Move the sequence on | |
711 | 184 | currentSequence++; | 204 | currentSequence++; |
712 | 185 | 205 | ||
713 | 186 | if (currentSequence >= options.mediaNodes.Count) | 206 | if (currentSequence >= options.mediaNodes.Count) |
714 | @@ -201,10 +221,11 @@ | |||
715 | 201 | options.text = ""; | 221 | options.text = ""; |
716 | 202 | options.documentTemplate = ""; | 222 | options.documentTemplate = ""; |
717 | 203 | options.copyrightNotice = ""; | 223 | options.copyrightNotice = ""; |
719 | 204 | options.scrollSpeed = 1; | 224 | options.scrollSpeed = 30; |
720 | 205 | options.updateInterval = 6; | 225 | options.updateInterval = 6; |
721 | 206 | options.uri = ""; | 226 | options.uri = ""; |
722 | 207 | options.direction = "none"; | 227 | options.direction = "none"; |
723 | 228 | options.javaScript = ""; | ||
724 | 208 | 229 | ||
725 | 209 | // Get a media node | 230 | // Get a media node |
726 | 210 | bool validNode = false; | 231 | bool validNode = false; |
727 | @@ -284,7 +305,7 @@ | |||
728 | 284 | System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode"); | 305 | System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode"); |
729 | 285 | } | 306 | } |
730 | 286 | } | 307 | } |
732 | 287 | else if (option.Name == "updateInverval") | 308 | else if (option.Name == "updateInterval") |
733 | 288 | { | 309 | { |
734 | 289 | try | 310 | try |
735 | 290 | { | 311 | { |
736 | @@ -314,6 +335,10 @@ | |||
737 | 314 | { | 335 | { |
738 | 315 | options.text = raw.InnerText; | 336 | options.text = raw.InnerText; |
739 | 316 | } | 337 | } |
740 | 338 | else if (raw.Name == "embedScript") | ||
741 | 339 | { | ||
742 | 340 | options.javaScript = raw.InnerText; | ||
743 | 341 | } | ||
744 | 317 | } | 342 | } |
745 | 318 | 343 | ||
746 | 319 | // That should cover all the new options | 344 | // That should cover all the new options |
747 | @@ -350,8 +375,18 @@ | |||
748 | 350 | System.Diagnostics.Debug.WriteLine(ex.Message); | 375 | System.Diagnostics.Debug.WriteLine(ex.Message); |
749 | 351 | } | 376 | } |
750 | 352 | 377 | ||
753 | 353 | // This media has expired and is being replaced | 378 | try |
754 | 354 | XmlLog.AppendStat("Media Expired", StatType.MediaEnd, options.scheduleId, options.layoutId, options.mediaid); | 379 | { |
755 | 380 | // Here we say that this media is expired | ||
756 | 381 | _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | ||
757 | 382 | |||
758 | 383 | // Record this stat event in the statLog object | ||
759 | 384 | _statLog.RecordStat(_stat); | ||
760 | 385 | } | ||
761 | 386 | catch | ||
762 | 387 | { | ||
763 | 388 | System.Diagnostics.Trace.WriteLine("No Stat record when one was expected", LogType.Error.ToString()); | ||
764 | 389 | } | ||
765 | 355 | } | 390 | } |
766 | 356 | } | 391 | } |
767 | 357 | 392 | ||
768 | @@ -367,6 +402,29 @@ | |||
769 | 367 | } | 402 | } |
770 | 368 | 403 | ||
771 | 369 | /// <summary> | 404 | /// <summary> |
772 | 405 | /// Clears the Region of anything that it shouldnt still have... | ||
773 | 406 | /// </summary> | ||
774 | 407 | public void Clear() | ||
775 | 408 | { | ||
776 | 409 | try | ||
777 | 410 | { | ||
778 | 411 | // What happens if we are disposing this region but we have not yet completed the stat event? | ||
779 | 412 | if (String.IsNullOrEmpty(_stat.toDate)) | ||
780 | 413 | { | ||
781 | 414 | // Say that this media has ended | ||
782 | 415 | _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | ||
783 | 416 | |||
784 | 417 | // Record this stat event in the statLog object | ||
785 | 418 | _statLog.RecordStat(_stat); | ||
786 | 419 | } | ||
787 | 420 | } | ||
788 | 421 | catch | ||
789 | 422 | { | ||
790 | 423 | System.Diagnostics.Trace.WriteLine(new LogMessage("Region - Clear", "Error closing off stat record"), LogType.Error.ToString()); | ||
791 | 424 | } | ||
792 | 425 | } | ||
793 | 426 | |||
794 | 427 | /// <summary> | ||
795 | 370 | /// Performs the disposal. | 428 | /// Performs the disposal. |
796 | 371 | /// </summary> | 429 | /// </summary> |
797 | 372 | protected override void Dispose(bool disposing) | 430 | protected override void Dispose(bool disposing) |
798 | @@ -393,16 +451,6 @@ | |||
799 | 393 | 451 | ||
800 | 394 | base.Dispose(disposing); | 452 | base.Dispose(disposing); |
801 | 395 | } | 453 | } |
802 | 396 | |||
803 | 397 | public delegate void DurationElapsedDelegate(); | ||
804 | 398 | public event DurationElapsedDelegate DurationElapsedEvent; | ||
805 | 399 | |||
806 | 400 | private Media media; | ||
807 | 401 | private RegionOptions options; | ||
808 | 402 | public bool hasExpired = false; | ||
809 | 403 | public bool layoutExpired = false; | ||
810 | 404 | private int currentSequence = -1; | ||
811 | 405 | |||
812 | 406 | } | 454 | } |
813 | 407 | 455 | ||
814 | 408 | /// <summary> | 456 | /// <summary> |
815 | @@ -431,6 +479,7 @@ | |||
816 | 431 | public string text; | 479 | public string text; |
817 | 432 | public string documentTemplate; | 480 | public string documentTemplate; |
818 | 433 | public string copyrightNotice; | 481 | public string copyrightNotice; |
819 | 482 | public string javaScript; | ||
820 | 434 | public int updateInterval; | 483 | public int updateInterval; |
821 | 435 | public int scrollSpeed; | 484 | public int scrollSpeed; |
822 | 436 | 485 | ||
823 | 437 | 486 | ||
824 | === removed file 'client/dotNET/Resources/Thumbs.db' | |||
825 | 438 | Binary files client/dotNET/Resources/Thumbs.db 2008-12-19 23:34:13 +0000 and client/dotNET/Resources/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 487 | Binary files client/dotNET/Resources/Thumbs.db 2008-12-19 23:34:13 +0000 and client/dotNET/Resources/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
826 | === modified file 'client/dotNET/Rss.cs' | |||
827 | --- client/dotNET/Rss.cs 2009-06-20 10:39:40 +0000 | |||
828 | +++ client/dotNET/Rss.cs 2009-08-03 21:56:06 +0000 | |||
829 | @@ -81,9 +81,25 @@ | |||
830 | 81 | this.documentText = options.text; | 81 | this.documentText = options.text; |
831 | 82 | this.documentTemplate = options.documentTemplate; | 82 | this.documentTemplate = options.documentTemplate; |
832 | 83 | 83 | ||
833 | 84 | // What do we want the background to look like | ||
834 | 85 | String bodyStyle; | ||
835 | 86 | String document; | ||
836 | 87 | |||
837 | 88 | if (backgroundImage == null || backgroundImage == "") | ||
838 | 89 | { | ||
839 | 90 | bodyStyle = "background-color:" + backgroundColor + " ;"; | ||
840 | 91 | } | ||
841 | 92 | else | ||
842 | 93 | { | ||
843 | 94 | bodyStyle = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";"; | ||
844 | 95 | } | ||
845 | 96 | |||
846 | 97 | // Build the document string | ||
847 | 98 | document = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script><style type='text/css'>body {{{2}}}, p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString(), bodyStyle); | ||
848 | 99 | |||
849 | 84 | try | 100 | try |
850 | 85 | { | 101 | { |
852 | 86 | webBrowser.DocumentText = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); | 102 | webBrowser.DocumentText = document; |
853 | 87 | } | 103 | } |
854 | 88 | catch (Exception e) | 104 | catch (Exception e) |
855 | 89 | { | 105 | { |
856 | @@ -102,9 +118,10 @@ | |||
857 | 102 | try | 118 | try |
858 | 103 | { | 119 | { |
859 | 104 | wc = new System.Net.WebClient(); | 120 | wc = new System.Net.WebClient(); |
861 | 105 | wc.Encoding = System.Text.Encoding.UTF8; | 121 | |
862 | 122 | //wc.Encoding = System.Text.Encoding.UTF8; | ||
863 | 106 | 123 | ||
865 | 107 | System.Diagnostics.Debug.WriteLine("Created at WebClient and set the Encoding to UTF8", "RSS - Refresh local RSS"); | 124 | System.Diagnostics.Debug.WriteLine("Created at WebClient", "RSS - Refresh local RSS"); |
866 | 108 | 125 | ||
867 | 109 | wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted); | 126 | wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted); |
868 | 110 | 127 | ||
869 | @@ -119,6 +136,7 @@ | |||
870 | 119 | void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e) | 136 | void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e) |
871 | 120 | { | 137 | { |
872 | 121 | String rssContents; | 138 | String rssContents; |
873 | 139 | System.Net.WebClient wc = (System.Net.WebClient) sender; | ||
874 | 122 | 140 | ||
875 | 123 | if (e.Error != null) | 141 | if (e.Error != null) |
876 | 124 | { | 142 | { |
877 | @@ -133,10 +151,10 @@ | |||
878 | 133 | 151 | ||
879 | 134 | try | 152 | try |
880 | 135 | { | 153 | { |
882 | 136 | System.IO.StreamReader sr = new System.IO.StreamReader(data, Encoding.UTF8); | 154 | System.IO.StreamReader sr = new System.IO.StreamReader(data, wc.Encoding); |
883 | 137 | rssContents = sr.ReadToEnd(); | 155 | rssContents = sr.ReadToEnd(); |
884 | 138 | 156 | ||
886 | 139 | StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read)); | 157 | StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read), wc.Encoding); |
887 | 140 | 158 | ||
888 | 141 | System.Diagnostics.Debug.WriteLine("Retrieved RSS - about to write it", "RSS - wc_OpenReadCompleted"); | 159 | System.Diagnostics.Debug.WriteLine("Retrieved RSS - about to write it", "RSS - wc_OpenReadCompleted"); |
889 | 142 | 160 | ||
890 | @@ -218,21 +236,14 @@ | |||
891 | 218 | 236 | ||
892 | 219 | //Add the control | 237 | //Add the control |
893 | 220 | this.Controls.Add(webBrowser); | 238 | this.Controls.Add(webBrowser); |
894 | 239 | |||
895 | 240 | Show(); | ||
896 | 221 | } | 241 | } |
897 | 222 | 242 | ||
898 | 223 | private void loadLoading() | 243 | private void loadLoading() |
899 | 224 | { | 244 | { |
900 | 225 | HtmlDocument htmlDoc = webBrowser.Document; | 245 | HtmlDocument htmlDoc = webBrowser.Document; |
901 | 226 | 246 | ||
902 | 227 | if (backgroundImage == null || backgroundImage == "") | ||
903 | 228 | { | ||
904 | 229 | htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;"; | ||
905 | 230 | } | ||
906 | 231 | else | ||
907 | 232 | { | ||
908 | 233 | htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";"; | ||
909 | 234 | } | ||
910 | 235 | |||
911 | 236 | htmlDoc.Body.InnerHtml = "<h1>Loading...</h1>"; | 247 | htmlDoc.Body.InnerHtml = "<h1>Loading...</h1>"; |
912 | 237 | } | 248 | } |
913 | 238 | 249 | ||
914 | @@ -243,15 +254,6 @@ | |||
915 | 243 | 254 | ||
916 | 244 | htmlDoc.Body.InnerHtml = ""; | 255 | htmlDoc.Body.InnerHtml = ""; |
917 | 245 | 256 | ||
918 | 246 | if (backgroundImage == null || backgroundImage == "") | ||
919 | 247 | { | ||
920 | 248 | htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;"; | ||
921 | 249 | } | ||
922 | 250 | else | ||
923 | 251 | { | ||
924 | 252 | htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";"; | ||
925 | 253 | } | ||
926 | 254 | |||
927 | 255 | //Get the RSS | 257 | //Get the RSS |
928 | 256 | rssReader = new RssReader(); | 258 | rssReader = new RssReader(); |
929 | 257 | rssReader.Url = rssFilePath; | 259 | rssReader.Url = rssFilePath; |
930 | @@ -343,7 +345,7 @@ | |||
931 | 343 | textWrap = String.Format("width: {0}px;", this.width - 50); | 345 | textWrap = String.Format("width: {0}px;", this.width - 50); |
932 | 344 | } | 346 | } |
933 | 345 | 347 | ||
935 | 346 | textRender += string.Format("<div id='text' style='position:relative;overflow:hidden;width:{0}px; height:{1}px;'>", this.width, this.height); | 348 | textRender += string.Format("<div id='text' style='position:relative;overflow:hidden;width:{0}px; height:{1}px;'>", this.width - 10, this.height); |
936 | 347 | textRender += string.Format("<div id='innerText' style='position:absolute; left: 0px; top: 0px; {0}'>{1}</div></div>", textWrap, documentText); | 349 | textRender += string.Format("<div id='innerText' style='position:absolute; left: 0px; top: 0px; {0}'>{1}</div></div>", textWrap, documentText); |
937 | 348 | 350 | ||
938 | 349 | htmlDoc.Body.InnerHtml = textRender; | 351 | htmlDoc.Body.InnerHtml = textRender; |
939 | @@ -423,7 +425,7 @@ | |||
940 | 423 | /// </summary> | 425 | /// </summary> |
941 | 424 | public override void RenderMedia() | 426 | public override void RenderMedia() |
942 | 425 | { | 427 | { |
944 | 426 | base.RenderMedia(); | 428 | base.StartTimer(); |
945 | 427 | } | 429 | } |
946 | 428 | 430 | ||
947 | 429 | protected override void Dispose(bool disposing) | 431 | protected override void Dispose(bool disposing) |
948 | 430 | 432 | ||
949 | === modified file 'client/dotNET/RssReader.cs' | |||
950 | --- client/dotNET/RssReader.cs 2008-12-19 23:34:13 +0000 | |||
951 | +++ client/dotNET/RssReader.cs 2009-07-07 06:05:50 +0000 | |||
952 | @@ -85,11 +85,8 @@ | |||
953 | 85 | throw new ArgumentException("You must provide a feed URL"); | 85 | throw new ArgumentException("You must provide a feed URL"); |
954 | 86 | } | 86 | } |
955 | 87 | 87 | ||
956 | 88 | //start the parsing process | ||
957 | 89 | XmlReader reader = XmlReader.Create(Url); | ||
958 | 90 | |||
959 | 91 | XmlDocument xmlDoc = new XmlDocument(); | 88 | XmlDocument xmlDoc = new XmlDocument(); |
961 | 92 | xmlDoc.Load(reader); | 89 | xmlDoc.Load(Url); |
962 | 93 | 90 | ||
963 | 94 | //parse the items of the feed | 91 | //parse the items of the feed |
964 | 95 | ParseDocElements(xmlDoc.SelectSingleNode("//channel"), "title", ref feedTitle); | 92 | ParseDocElements(xmlDoc.SelectSingleNode("//channel"), "title", ref feedTitle); |
965 | @@ -97,8 +94,6 @@ | |||
966 | 97 | 94 | ||
967 | 98 | ParseRssItems(xmlDoc); | 95 | ParseRssItems(xmlDoc); |
968 | 99 | 96 | ||
969 | 100 | reader.Close(); | ||
970 | 101 | |||
971 | 102 | //return the feed items | 97 | //return the feed items |
972 | 103 | return feedItems; | 98 | return feedItems; |
973 | 104 | } | 99 | } |
974 | 105 | 100 | ||
975 | === modified file 'client/dotNET/Schedule.cs' | |||
976 | --- client/dotNET/Schedule.cs 2009-06-18 18:36:21 +0000 | |||
977 | +++ client/dotNET/Schedule.cs 2009-08-03 21:56:06 +0000 | |||
978 | @@ -95,24 +95,25 @@ | |||
979 | 95 | if (e.Error != null) | 95 | if (e.Error != null) |
980 | 96 | { | 96 | { |
981 | 97 | //There was an error - what do we do? | 97 | //There was an error - what do we do? |
983 | 98 | System.Diagnostics.Debug.WriteLine(e.Error.Message); | 98 | System.Diagnostics.Trace.WriteLine(e.Error.Message); |
984 | 99 | 99 | ||
985 | 100 | // Is it a "not licensed" error | 100 | // Is it a "not licensed" error |
986 | 101 | if (e.Error.Message == "This display client is not licensed") | 101 | if (e.Error.Message == "This display client is not licensed") |
987 | 102 | { | 102 | { |
988 | 103 | Properties.Settings.Default.licensed = 0; | 103 | Properties.Settings.Default.licensed = 0; |
989 | 104 | Properties.Settings.Default.Save(); | ||
990 | 105 | } | 104 | } |
991 | 106 | 105 | ||
992 | 107 | xmdsProcessing = false; | 106 | xmdsProcessing = false; |
993 | 108 | } | 107 | } |
994 | 109 | else | 108 | else |
995 | 110 | { | 109 | { |
996 | 110 | // Set the flag to indicate we have a connection to XMDS | ||
997 | 111 | Properties.Settings.Default.XmdsLastConnection = DateTime.Now; | ||
998 | 112 | |||
999 | 111 | // Firstly we know we are licensed if we get this far | 113 | // Firstly we know we are licensed if we get this far |
1000 | 112 | if (Properties.Settings.Default.licensed == 0) | 114 | if (Properties.Settings.Default.licensed == 0) |
1001 | 113 | { | 115 | { |
1002 | 114 | Properties.Settings.Default.licensed = 1; | 116 | Properties.Settings.Default.licensed = 1; |
1003 | 115 | Properties.Settings.Default.Save(); | ||
1004 | 116 | } | 117 | } |
1005 | 117 | 118 | ||
1006 | 118 | try | 119 | try |
1007 | @@ -156,11 +157,6 @@ | |||
1008 | 156 | { | 157 | { |
1009 | 157 | System.Diagnostics.Debug.WriteLine("Schedule Retrival Complete."); | 158 | System.Diagnostics.Debug.WriteLine("Schedule Retrival Complete."); |
1010 | 158 | 159 | ||
1011 | 159 | // Send the XML log here if necessary | ||
1012 | 160 | XmlLog log = new XmlLog(); | ||
1013 | 161 | |||
1014 | 162 | log.PrepareAndSend(); | ||
1015 | 163 | |||
1016 | 164 | // Set XMDS to no longer be processing | 160 | // Set XMDS to no longer be processing |
1017 | 165 | xmdsProcessing = false; | 161 | xmdsProcessing = false; |
1018 | 166 | 162 | ||
1019 | @@ -168,13 +164,16 @@ | |||
1020 | 168 | if (e.Error != null) | 164 | if (e.Error != null) |
1021 | 169 | { | 165 | { |
1022 | 170 | //There was an error - what do we do? | 166 | //There was an error - what do we do? |
1024 | 171 | System.Diagnostics.Debug.WriteLine(e.Error.Message); | 167 | System.Diagnostics.Trace.WriteLine(e.Error.Message); |
1025 | 172 | } | 168 | } |
1026 | 173 | else | 169 | else |
1027 | 174 | { | 170 | { |
1028 | 175 | // Only update the schedule if its changed. | 171 | // Only update the schedule if its changed. |
1029 | 176 | String md5CurrentSchedule = ""; | 172 | String md5CurrentSchedule = ""; |
1030 | 177 | 173 | ||
1031 | 174 | // Set the flag to indicate we have a connection to XMDS | ||
1032 | 175 | Properties.Settings.Default.XmdsLastConnection = DateTime.Now; | ||
1033 | 176 | |||
1034 | 178 | try | 177 | try |
1035 | 179 | { | 178 | { |
1036 | 180 | StreamReader sr = new StreamReader(File.Open(this.scheduleLocation, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)); | 179 | StreamReader sr = new StreamReader(File.Open(this.scheduleLocation, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite)); |
1037 | @@ -217,10 +216,17 @@ | |||
1038 | 217 | System.Diagnostics.Debug.WriteLine("Layout file changed"); | 216 | System.Diagnostics.Debug.WriteLine("Layout file changed"); |
1039 | 218 | 217 | ||
1040 | 219 | // If the layout that got changed is the current layout, move on | 218 | // If the layout that got changed is the current layout, move on |
1045 | 220 | if (layoutSchedule[currentLayout].layoutFile == Properties.Settings.Default.LibraryPath + @"\" + layoutPath) | 219 | try |
1046 | 221 | { | 220 | { |
1047 | 222 | forceChange = true; | 221 | if (layoutSchedule[currentLayout].layoutFile == Properties.Settings.Default.LibraryPath + @"\" + layoutPath) |
1048 | 223 | NextLayout(); | 222 | { |
1049 | 223 | forceChange = true; | ||
1050 | 224 | NextLayout(); | ||
1051 | 225 | } | ||
1052 | 226 | } | ||
1053 | 227 | catch (Exception ex) | ||
1054 | 228 | { | ||
1055 | 229 | System.Diagnostics.Trace.WriteLine(new LogMessage("fileCollector_LayoutFileChanged", String.Format("Unable to determine current layout with exception {0}", ex.Message)), LogType.Error.ToString()); | ||
1056 | 224 | } | 230 | } |
1057 | 225 | } | 231 | } |
1058 | 226 | 232 | ||
1059 | @@ -235,7 +241,7 @@ | |||
1060 | 235 | } | 241 | } |
1061 | 236 | else | 242 | else |
1062 | 237 | { | 243 | { |
1064 | 238 | Application.DoEvents(); // Make sure everything that is cued to render does | 244 | Application.DoEvents(); // Make sure everything that is queued to render does |
1065 | 239 | 245 | ||
1066 | 240 | xmdsProcessing = true; | 246 | xmdsProcessing = true; |
1067 | 241 | 247 | ||
1068 | @@ -244,6 +250,9 @@ | |||
1069 | 244 | // Fire off a get required files event - async | 250 | // Fire off a get required files event - async |
1070 | 245 | xmds2.RequiredFilesAsync(Properties.Settings.Default.ServerKey, hardwareKey.Key, Properties.Settings.Default.Version); | 251 | xmds2.RequiredFilesAsync(Properties.Settings.Default.ServerKey, hardwareKey.Key, Properties.Settings.Default.Version); |
1071 | 246 | } | 252 | } |
1072 | 253 | |||
1073 | 254 | // Flush the log | ||
1074 | 255 | System.Diagnostics.Trace.Flush(); | ||
1075 | 247 | } | 256 | } |
1076 | 248 | 257 | ||
1077 | 249 | /// <summary> | 258 | /// <summary> |
1078 | @@ -270,8 +279,6 @@ | |||
1079 | 270 | 279 | ||
1080 | 271 | System.Diagnostics.Debug.WriteLine(String.Format("Next layout: {0}", layoutSchedule[currentLayout].layoutFile), "Schedule - Next Layout"); | 280 | System.Diagnostics.Debug.WriteLine(String.Format("Next layout: {0}", layoutSchedule[currentLayout].layoutFile), "Schedule - Next Layout"); |
1081 | 272 | 281 | ||
1082 | 273 | XmlLog.AppendStat("Layout Finished", StatType.LayoutEnd, layoutSchedule[previousLayout].scheduleid, layoutSchedule[previousLayout].id, "0"); | ||
1083 | 274 | |||
1084 | 275 | forceChange = false; | 282 | forceChange = false; |
1085 | 276 | 283 | ||
1086 | 277 | //Raise the event | 284 | //Raise the event |
1087 | 278 | 285 | ||
1088 | === added file 'client/dotNET/StatLog.cs' | |||
1089 | --- client/dotNET/StatLog.cs 1970-01-01 00:00:00 +0000 | |||
1090 | +++ client/dotNET/StatLog.cs 2009-08-02 15:54:18 +0000 | |||
1091 | @@ -0,0 +1,330 @@ | |||
1092 | 1 | /* | ||
1093 | 2 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
1094 | 3 | * Copyright (C) 2009 Daniel Garner | ||
1095 | 4 | * | ||
1096 | 5 | * This file is part of Xibo. | ||
1097 | 6 | * | ||
1098 | 7 | * Xibo is free software: you can redistribute it and/or modify | ||
1099 | 8 | * it under the terms of the GNU Affero General Public License as published by | ||
1100 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
1101 | 10 | * any later version. | ||
1102 | 11 | * | ||
1103 | 12 | * Xibo is distributed in the hope that it will be useful, | ||
1104 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1105 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1106 | 15 | * GNU Affero General Public License for more details. | ||
1107 | 16 | * | ||
1108 | 17 | * You should have received a copy of the GNU Affero General Public License | ||
1109 | 18 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
1110 | 19 | */ | ||
1111 | 20 | using System; | ||
1112 | 21 | using System.Collections.Generic; | ||
1113 | 22 | using System.Collections.ObjectModel; | ||
1114 | 23 | using System.Text; | ||
1115 | 24 | using System.IO; | ||
1116 | 25 | using System.Windows.Forms; | ||
1117 | 26 | using System.Xml; | ||
1118 | 27 | |||
1119 | 28 | namespace XiboClient | ||
1120 | 29 | { | ||
1121 | 30 | class StatLog | ||
1122 | 31 | { | ||
1123 | 32 | private Collection<Stat> _stats; | ||
1124 | 33 | private xmds.xmds _xmds; | ||
1125 | 34 | private String _lastSubmit; | ||
1126 | 35 | private HardwareKey _hardwareKey; | ||
1127 | 36 | private Boolean _xmdsProcessing; | ||
1128 | 37 | |||
1129 | 38 | public StatLog() | ||
1130 | 39 | { | ||
1131 | 40 | _stats = new Collection<Stat>(); | ||
1132 | 41 | _xmds = new xmds.xmds(); | ||
1133 | 42 | |||
1134 | 43 | // Register a listener for the XMDS stats | ||
1135 | 44 | _xmds.SubmitStatsCompleted += new XiboClient.xmds.SubmitStatsCompletedEventHandler(_xmds_SubmitStatsCompleted); | ||
1136 | 45 | |||
1137 | 46 | // Get the key for this display | ||
1138 | 47 | _hardwareKey = new HardwareKey(); | ||
1139 | 48 | |||
1140 | 49 | _xmdsProcessing = false; | ||
1141 | 50 | } | ||
1142 | 51 | |||
1143 | 52 | /// <summary> | ||
1144 | 53 | /// Record a complete Layout Event | ||
1145 | 54 | /// </summary> | ||
1146 | 55 | /// <param name="fromDT"></param> | ||
1147 | 56 | /// <param name="toDT"></param> | ||
1148 | 57 | /// <param name="scheduleID"></param> | ||
1149 | 58 | /// <param name="layoutID"></param> | ||
1150 | 59 | public void RecordLayout(String fromDT, String toDT, int scheduleID, int layoutID) | ||
1151 | 60 | { | ||
1152 | 61 | if (!Properties.Settings.Default.statsEnabled) return; | ||
1153 | 62 | |||
1154 | 63 | Stat stat = new Stat(); | ||
1155 | 64 | |||
1156 | 65 | stat.type = StatType.Layout; | ||
1157 | 66 | stat.fromDate = fromDT; | ||
1158 | 67 | stat.toDate = toDT; | ||
1159 | 68 | stat.scheduleID = scheduleID; | ||
1160 | 69 | stat.layoutID = layoutID; | ||
1161 | 70 | |||
1162 | 71 | _stats.Add(stat); | ||
1163 | 72 | |||
1164 | 73 | return; | ||
1165 | 74 | } | ||
1166 | 75 | |||
1167 | 76 | /// <summary> | ||
1168 | 77 | /// Record a complete Media Event | ||
1169 | 78 | /// </summary> | ||
1170 | 79 | /// <param name="fromDT"></param> | ||
1171 | 80 | /// <param name="toDT"></param> | ||
1172 | 81 | /// <param name="layoutID"></param> | ||
1173 | 82 | /// <param name="mediaID"></param> | ||
1174 | 83 | public void RecordMedia(String fromDT, String toDT, int layoutID, String mediaID) | ||
1175 | 84 | { | ||
1176 | 85 | if (!Properties.Settings.Default.statsEnabled) return; | ||
1177 | 86 | |||
1178 | 87 | Stat stat = new Stat(); | ||
1179 | 88 | |||
1180 | 89 | stat.type = StatType.Media; | ||
1181 | 90 | stat.fromDate = fromDT; | ||
1182 | 91 | stat.toDate = toDT; | ||
1183 | 92 | stat.layoutID = layoutID; | ||
1184 | 93 | stat.mediaID = mediaID; | ||
1185 | 94 | |||
1186 | 95 | _stats.Add(stat); | ||
1187 | 96 | |||
1188 | 97 | return; | ||
1189 | 98 | } | ||
1190 | 99 | |||
1191 | 100 | /// <summary> | ||
1192 | 101 | /// Record a complete Event | ||
1193 | 102 | /// </summary> | ||
1194 | 103 | /// <param name="fromDT"></param> | ||
1195 | 104 | /// <param name="toDT"></param> | ||
1196 | 105 | /// <param name="tag"></param> | ||
1197 | 106 | public void RecordEvent(String fromDT, String toDT, String tag) | ||
1198 | 107 | { | ||
1199 | 108 | if (!Properties.Settings.Default.statsEnabled) return; | ||
1200 | 109 | |||
1201 | 110 | Stat stat = new Stat(); | ||
1202 | 111 | |||
1203 | 112 | stat.type = StatType.Event; | ||
1204 | 113 | stat.fromDate = fromDT; | ||
1205 | 114 | stat.toDate = toDT; | ||
1206 | 115 | stat.tag = tag; | ||
1207 | 116 | |||
1208 | 117 | _stats.Add(stat); | ||
1209 | 118 | |||
1210 | 119 | return; | ||
1211 | 120 | } | ||
1212 | 121 | |||
1213 | 122 | /// <summary> | ||
1214 | 123 | /// RecordStat | ||
1215 | 124 | /// </summary> | ||
1216 | 125 | /// <param name="stat"></param> | ||
1217 | 126 | public void RecordStat(Stat stat) | ||
1218 | 127 | { | ||
1219 | 128 | System.Diagnostics.Debug.WriteLine(String.Format("Recording a Stat Record. Current Count = {0}", _stats.Count.ToString()), LogType.Audit.ToString()); | ||
1220 | 129 | |||
1221 | 130 | _stats.Add(stat); | ||
1222 | 131 | |||
1223 | 132 | // At some point we will need to flush the stats | ||
1224 | 133 | if (_stats.Count >= Properties.Settings.Default.StatsFlushCount) | ||
1225 | 134 | { | ||
1226 | 135 | Flush(); | ||
1227 | 136 | } | ||
1228 | 137 | |||
1229 | 138 | return; | ||
1230 | 139 | } | ||
1231 | 140 | |||
1232 | 141 | /// <summary> | ||
1233 | 142 | /// Flush the stats | ||
1234 | 143 | /// </summary> | ||
1235 | 144 | public void Flush() | ||
1236 | 145 | { | ||
1237 | 146 | System.Diagnostics.Debug.WriteLine(new LogMessage("Flush", String.Format("IN")), LogType.Audit.ToString()); | ||
1238 | 147 | |||
1239 | 148 | // Determine if there is anything to flush | ||
1240 | 149 | if (_stats.Count < 1 || _xmdsProcessing) return; | ||
1241 | 150 | |||
1242 | 151 | int threshold = ((int)Properties.Settings.Default.collectInterval * 5); | ||
1243 | 152 | |||
1244 | 153 | // Determine where we want to log. | ||
1245 | 154 | if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now) | ||
1246 | 155 | { | ||
1247 | 156 | FlushToFile(); | ||
1248 | 157 | } | ||
1249 | 158 | else | ||
1250 | 159 | { | ||
1251 | 160 | FlushToXmds(); | ||
1252 | 161 | } | ||
1253 | 162 | |||
1254 | 163 | System.Diagnostics.Debug.WriteLine(new LogMessage("Flush", String.Format("OUT")), LogType.Audit.ToString()); | ||
1255 | 164 | } | ||
1256 | 165 | |||
1257 | 166 | /// <summary> | ||
1258 | 167 | /// Send the Stat to a File | ||
1259 | 168 | /// </summary> | ||
1260 | 169 | private void FlushToFile() | ||
1261 | 170 | { | ||
1262 | 171 | System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToFile", String.Format("IN")), LogType.Audit.ToString()); | ||
1263 | 172 | |||
1264 | 173 | // There is something to flush - we want to parse the collection adding to the TextWriter each time. | ||
1265 | 174 | try | ||
1266 | 175 | { | ||
1267 | 176 | // Open the Text Writer | ||
1268 | 177 | StreamWriter tw = new StreamWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.StatsLogFile, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | ||
1269 | 178 | |||
1270 | 179 | try | ||
1271 | 180 | { | ||
1272 | 181 | foreach (Stat stat in _stats) | ||
1273 | 182 | { | ||
1274 | 183 | tw.WriteLine(stat.ToString()); | ||
1275 | 184 | } | ||
1276 | 185 | } | ||
1277 | 186 | catch (Exception ex) | ||
1278 | 187 | { | ||
1279 | 188 | System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToFile", String.Format("Error writing stats line to file with exception {0}", ex.Message)), LogType.Error.ToString()); | ||
1280 | 189 | } | ||
1281 | 190 | finally | ||
1282 | 191 | { | ||
1283 | 192 | // Close the tw. | ||
1284 | 193 | tw.Close(); | ||
1285 | 194 | tw.Dispose(); | ||
1286 | 195 | } | ||
1287 | 196 | } | ||
1288 | 197 | catch (Exception ex) | ||
1289 | 198 | { | ||
1290 | 199 | // Log this exception | ||
1291 | 200 | System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToFile", String.Format("Error writing stats to file with exception {0}", ex.Message)), LogType.Error.ToString()); | ||
1292 | 201 | } | ||
1293 | 202 | finally | ||
1294 | 203 | { | ||
1295 | 204 | // Always clear the stats. If the file open failed for some reason then we dont want to try again | ||
1296 | 205 | _stats.Clear(); | ||
1297 | 206 | } | ||
1298 | 207 | |||
1299 | 208 | System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToFile", String.Format("OUT")), LogType.Audit.ToString()); | ||
1300 | 209 | } | ||
1301 | 210 | |||
1302 | 211 | /// <summary> | ||
1303 | 212 | /// Send the Stats to XMDS | ||
1304 | 213 | /// </summary> | ||
1305 | 214 | private void FlushToXmds() | ||
1306 | 215 | { | ||
1307 | 216 | System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToXmds", String.Format("IN")), LogType.Audit.ToString()); | ||
1308 | 217 | |||
1309 | 218 | String stats; | ||
1310 | 219 | |||
1311 | 220 | stats = "<log>"; | ||
1312 | 221 | |||
1313 | 222 | // Load the Stats collection into a string | ||
1314 | 223 | try | ||
1315 | 224 | { | ||
1316 | 225 | foreach (Stat stat in _stats) | ||
1317 | 226 | { | ||
1318 | 227 | stats += stat.ToString(); | ||
1319 | 228 | } | ||
1320 | 229 | } | ||
1321 | 230 | catch (Exception ex) | ||
1322 | 231 | { | ||
1323 | 232 | System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToXmds", String.Format("Error converting stat to a string {0}", ex.Message)), LogType.Error.ToString()); | ||
1324 | 233 | } | ||
1325 | 234 | |||
1326 | 235 | stats += "</log>"; | ||
1327 | 236 | |||
1328 | 237 | // Store the stats as the last sent (so we have a record if it fails) | ||
1329 | 238 | _lastSubmit = stats; | ||
1330 | 239 | |||
1331 | 240 | // Clear the stats collection | ||
1332 | 241 | _stats.Clear(); | ||
1333 | 242 | |||
1334 | 243 | // Submit the string to XMDS | ||
1335 | 244 | _xmdsProcessing = true; | ||
1336 | 245 | |||
1337 | 246 | _xmds.SubmitStatsAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, _hardwareKey.Key, stats); | ||
1338 | 247 | |||
1339 | 248 | // Log out | ||
1340 | 249 | System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToXmds", String.Format("OUT")), LogType.Audit.ToString()); | ||
1341 | 250 | } | ||
1342 | 251 | |||
1343 | 252 | /// <summary> | ||
1344 | 253 | /// Capture the XMDS call and see if it went well | ||
1345 | 254 | /// </summary> | ||
1346 | 255 | /// <param name="sender"></param> | ||
1347 | 256 | /// <param name="e"></param> | ||
1348 | 257 | void _xmds_SubmitStatsCompleted(object sender, XiboClient.xmds.SubmitStatsCompletedEventArgs e) | ||
1349 | 258 | { | ||
1350 | 259 | System.Diagnostics.Debug.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("IN")), LogType.Audit.ToString()); | ||
1351 | 260 | |||
1352 | 261 | _xmdsProcessing = false; | ||
1353 | 262 | |||
1354 | 263 | // Test if we succeeded or not | ||
1355 | 264 | if (e.Error != null) | ||
1356 | 265 | { | ||
1357 | 266 | // We had an error, log it. | ||
1358 | 267 | System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Error during Submit to XMDS {0}", e.Error.Message)), LogType.Error.ToString()); | ||
1359 | 268 | |||
1360 | 269 | // Dump the stats to a file instead | ||
1361 | 270 | if (_lastSubmit != "") | ||
1362 | 271 | { | ||
1363 | 272 | try | ||
1364 | 273 | { | ||
1365 | 274 | // Open the Text Writer | ||
1366 | 275 | StreamWriter tw = new StreamWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.StatsLogFile, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | ||
1367 | 276 | |||
1368 | 277 | try | ||
1369 | 278 | { | ||
1370 | 279 | tw.Write(_lastSubmit); | ||
1371 | 280 | } | ||
1372 | 281 | catch (Exception ex) | ||
1373 | 282 | { | ||
1374 | 283 | // Log this exception | ||
1375 | 284 | System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Error writing stats to file with exception {0}", ex.Message)), LogType.Error.ToString()); | ||
1376 | 285 | } | ||
1377 | 286 | finally | ||
1378 | 287 | { | ||
1379 | 288 | tw.Close(); | ||
1380 | 289 | tw.Dispose(); | ||
1381 | 290 | } | ||
1382 | 291 | } | ||
1383 | 292 | catch (Exception ex) | ||
1384 | 293 | { | ||
1385 | 294 | // Log this exception | ||
1386 | 295 | System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Could not open the file with exception {0}", ex.Message)), LogType.Error.ToString()); | ||
1387 | 296 | } | ||
1388 | 297 | } | ||
1389 | 298 | } | ||
1390 | 299 | |||
1391 | 300 | // Clear the last sumbit | ||
1392 | 301 | _lastSubmit = ""; | ||
1393 | 302 | |||
1394 | 303 | System.Diagnostics.Debug.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("OUT")), LogType.Audit.ToString()); | ||
1395 | 304 | } | ||
1396 | 305 | } | ||
1397 | 306 | |||
1398 | 307 | class Stat | ||
1399 | 308 | { | ||
1400 | 309 | public StatType type; | ||
1401 | 310 | public String fromDate; | ||
1402 | 311 | public String toDate; | ||
1403 | 312 | public int layoutID; | ||
1404 | 313 | public int scheduleID; | ||
1405 | 314 | public String mediaID; | ||
1406 | 315 | public String tag; | ||
1407 | 316 | |||
1408 | 317 | public override string ToString() | ||
1409 | 318 | { | ||
1410 | 319 | // Format the message into the expected XML sub nodes. | ||
1411 | 320 | // Just do this with a string builder rather than an XML builder. | ||
1412 | 321 | String theMessage; | ||
1413 | 322 | |||
1414 | 323 | theMessage = String.Format("<stat type=\"{0}\" fromdt=\"{1}\" todt=\"{2}\" layoutid=\"{3}\" scheduleid=\"{4}\" mediaid=\"{5}\"></stat>", type, fromDate, toDate, layoutID.ToString(), scheduleID.ToString(), mediaID); | ||
1415 | 324 | |||
1416 | 325 | return theMessage; | ||
1417 | 326 | } | ||
1418 | 327 | } | ||
1419 | 328 | |||
1420 | 329 | public enum StatType { Layout, Media, Event }; | ||
1421 | 330 | } | ||
1422 | 0 | 331 | ||
1423 | === modified file 'client/dotNET/Text.cs' | |||
1424 | --- client/dotNET/Text.cs 2009-06-20 10:39:40 +0000 | |||
1425 | +++ client/dotNET/Text.cs 2009-08-03 21:56:06 +0000 | |||
1426 | @@ -27,7 +27,17 @@ | |||
1427 | 27 | { | 27 | { |
1428 | 28 | class Text : Media | 28 | class Text : Media |
1429 | 29 | { | 29 | { |
1431 | 30 | private double scaleFactor; | 30 | private string filePath; |
1432 | 31 | private string direction; | ||
1433 | 32 | private string backgroundImage; | ||
1434 | 33 | private string backgroundColor; | ||
1435 | 34 | private WebBrowser webBrowser; | ||
1436 | 35 | private string _documentText; | ||
1437 | 36 | |||
1438 | 37 | private string backgroundTop; | ||
1439 | 38 | private string backgroundLeft; | ||
1440 | 39 | private double _scaleFactor; | ||
1441 | 40 | private int _scrollSpeed; | ||
1442 | 31 | 41 | ||
1443 | 32 | //<summary> | 42 | //<summary> |
1444 | 33 | //Creates a Text display control | 43 | //Creates a Text display control |
1445 | @@ -41,7 +51,7 @@ | |||
1446 | 41 | this.backgroundImage = options.backgroundImage; | 51 | this.backgroundImage = options.backgroundImage; |
1447 | 42 | this.backgroundColor = options.backgroundColor; | 52 | this.backgroundColor = options.backgroundColor; |
1448 | 43 | 53 | ||
1450 | 44 | scaleFactor = options.scaleFactor; | 54 | _scaleFactor = options.scaleFactor; |
1451 | 45 | 55 | ||
1452 | 46 | backgroundTop = options.backgroundTop + "px"; | 56 | backgroundTop = options.backgroundTop + "px"; |
1453 | 47 | backgroundLeft = options.backgroundLeft + "px"; | 57 | backgroundLeft = options.backgroundLeft + "px"; |
1454 | @@ -50,12 +60,28 @@ | |||
1455 | 50 | webBrowser.Size = this.Size; | 60 | webBrowser.Size = this.Size; |
1456 | 51 | webBrowser.ScrollBarsEnabled = false; | 61 | webBrowser.ScrollBarsEnabled = false; |
1457 | 52 | 62 | ||
1460 | 53 | //set the text | 63 | // set the text |
1461 | 54 | documentText = options.text; | 64 | _documentText = options.text; |
1462 | 65 | _scrollSpeed = options.scrollSpeed; | ||
1463 | 66 | |||
1464 | 67 | // What do we want the background to look like | ||
1465 | 68 | String bodyStyle; | ||
1466 | 69 | String document; | ||
1467 | 70 | |||
1468 | 71 | if (backgroundImage == null || backgroundImage == "") | ||
1469 | 72 | { | ||
1470 | 73 | bodyStyle = "background-color:" + backgroundColor + " ;"; | ||
1471 | 74 | } | ||
1472 | 75 | else | ||
1473 | 76 | { | ||
1474 | 77 | bodyStyle = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";"; | ||
1475 | 78 | } | ||
1476 | 79 | |||
1477 | 80 | document = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script>{2}<style type='text/css'>body {{{3}}}, p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString(), options.javaScript, bodyStyle); | ||
1478 | 55 | 81 | ||
1479 | 56 | try | 82 | try |
1480 | 57 | { | 83 | { |
1482 | 58 | webBrowser.DocumentText = String.Format("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /><script type='text/javascript'>{0}</script><style type='text/css'>p, h1, h2, h3, h4, h5 {{ margin:2px; font-size:{1}em; }}</style></head><body></body></html>", Properties.Resources.textRender, options.scaleFactor.ToString()); | 84 | webBrowser.DocumentText = document; |
1483 | 59 | } | 85 | } |
1484 | 60 | catch (Exception e) | 86 | catch (Exception e) |
1485 | 61 | { | 87 | { |
1486 | @@ -68,24 +94,14 @@ | |||
1487 | 68 | 94 | ||
1488 | 69 | void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) | 95 | void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) |
1489 | 70 | { | 96 | { |
1490 | 71 | |||
1491 | 72 | HtmlDocument htmlDoc = webBrowser.Document; | 97 | HtmlDocument htmlDoc = webBrowser.Document; |
1492 | 73 | |||
1493 | 74 | if (backgroundImage == null || backgroundImage == "") | ||
1494 | 75 | { | ||
1495 | 76 | htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;"; | ||
1496 | 77 | } | ||
1497 | 78 | else | ||
1498 | 79 | { | ||
1499 | 80 | htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";"; | ||
1500 | 81 | } | ||
1501 | 82 | 98 | ||
1502 | 83 | //decide whether we need a marquee or not | 99 | //decide whether we need a marquee or not |
1503 | 84 | if (direction == "none") | 100 | if (direction == "none") |
1504 | 85 | { | 101 | { |
1505 | 86 | //we dont | 102 | //we dont |
1508 | 87 | //set the body of the webBrowser to the document text (altered by the RSS feed) | 103 | //set the body of the webBrowser to the document text |
1509 | 88 | htmlDoc.Body.InnerHtml = documentText; | 104 | htmlDoc.Body.InnerHtml = _documentText; |
1510 | 89 | } | 105 | } |
1511 | 90 | else | 106 | else |
1512 | 91 | { | 107 | { |
1513 | @@ -93,24 +109,36 @@ | |||
1514 | 93 | String textWrap = ""; | 109 | String textWrap = ""; |
1515 | 94 | if (direction == "left" || direction == "right") textWrap = "white-space: nowrap"; | 110 | if (direction == "left" || direction == "right") textWrap = "white-space: nowrap"; |
1516 | 95 | 111 | ||
1519 | 96 | textRender += string.Format("<div id='text' style='position:relative;overflow:hidden;width:{0}; height:{1};'>", this.width, this.height); | 112 | textRender += string.Format("<div id='text' style='position:relative;overflow:hidden;width:{0}; height:{1};'>", this.width - 10, this.height); |
1520 | 97 | textRender += string.Format("<div id='innerText' style='position:absolute; left: 0px; top: 0px; {0}'>{1}</div></div>", textWrap, documentText); | 113 | textRender += string.Format("<div id='innerText' style='position:absolute; left: 0px; top: 0px; {0}'>{1}</div></div>", textWrap, _documentText); |
1521 | 98 | 114 | ||
1522 | 99 | htmlDoc.Body.InnerHtml = textRender; | 115 | htmlDoc.Body.InnerHtml = textRender; |
1523 | 100 | 116 | ||
1524 | 101 | Object[] objArray = new Object[2]; | 117 | Object[] objArray = new Object[2]; |
1525 | 102 | objArray[0] = direction; | 118 | objArray[0] = direction; |
1527 | 103 | objArray[1] = 30; | 119 | objArray[1] = _scrollSpeed; |
1528 | 104 | 120 | ||
1529 | 105 | htmlDoc.InvokeScript("init", objArray); | 121 | htmlDoc.InvokeScript("init", objArray); |
1530 | 106 | } | 122 | } |
1531 | 107 | 123 | ||
1532 | 124 | System.Diagnostics.Debug.WriteLine(htmlDoc.Body.InnerHtml, LogType.Audit.ToString()); | ||
1533 | 125 | |||
1534 | 126 | // Try to call the EmbedInit Function | ||
1535 | 127 | try | ||
1536 | 128 | { | ||
1537 | 129 | htmlDoc.InvokeScript("EmbedInit"); | ||
1538 | 130 | } | ||
1539 | 131 | catch { } | ||
1540 | 132 | |||
1541 | 133 | // Add the control | ||
1542 | 108 | this.Controls.Add(webBrowser); | 134 | this.Controls.Add(webBrowser); |
1543 | 135 | |||
1544 | 136 | Show(); | ||
1545 | 109 | } | 137 | } |
1546 | 110 | 138 | ||
1547 | 111 | public override void RenderMedia() | 139 | public override void RenderMedia() |
1548 | 112 | { | 140 | { |
1550 | 113 | base.RenderMedia(); | 141 | base.StartTimer(); |
1551 | 114 | } | 142 | } |
1552 | 115 | 143 | ||
1553 | 116 | protected override void Dispose(bool disposing) | 144 | protected override void Dispose(bool disposing) |
1554 | @@ -123,15 +151,5 @@ | |||
1555 | 123 | 151 | ||
1556 | 124 | base.Dispose(disposing); | 152 | base.Dispose(disposing); |
1557 | 125 | } | 153 | } |
1558 | 126 | |||
1559 | 127 | private string filePath; | ||
1560 | 128 | private string direction; | ||
1561 | 129 | private string backgroundImage; | ||
1562 | 130 | private string backgroundColor; | ||
1563 | 131 | private WebBrowser webBrowser; | ||
1564 | 132 | private string documentText; | ||
1565 | 133 | |||
1566 | 134 | private string backgroundTop; | ||
1567 | 135 | private string backgroundLeft; | ||
1568 | 136 | } | 154 | } |
1569 | 137 | } | 155 | } |
1570 | 138 | 156 | ||
1571 | === modified file 'client/dotNET/Web References/xmds/Reference.cs' | |||
1572 | --- client/dotNET/Web References/xmds/Reference.cs 2008-12-19 23:34:13 +0000 | |||
1573 | +++ client/dotNET/Web References/xmds/Reference.cs 2009-07-26 11:40:59 +0000 | |||
1574 | @@ -41,6 +41,10 @@ | |||
1575 | 41 | 41 | ||
1576 | 42 | private System.Threading.SendOrPostCallback BlackListOperationCompleted; | 42 | private System.Threading.SendOrPostCallback BlackListOperationCompleted; |
1577 | 43 | 43 | ||
1578 | 44 | private System.Threading.SendOrPostCallback SubmitLogOperationCompleted; | ||
1579 | 45 | |||
1580 | 46 | private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted; | ||
1581 | 47 | |||
1582 | 44 | private bool useDefaultCredentialsSetExplicitly; | 48 | private bool useDefaultCredentialsSetExplicitly; |
1583 | 45 | 49 | ||
1584 | 46 | /// <remarks/> | 50 | /// <remarks/> |
1585 | @@ -98,6 +102,12 @@ | |||
1586 | 98 | public event BlackListCompletedEventHandler BlackListCompleted; | 102 | public event BlackListCompletedEventHandler BlackListCompleted; |
1587 | 99 | 103 | ||
1588 | 100 | /// <remarks/> | 104 | /// <remarks/> |
1589 | 105 | public event SubmitLogCompletedEventHandler SubmitLogCompleted; | ||
1590 | 106 | |||
1591 | 107 | /// <remarks/> | ||
1592 | 108 | public event SubmitStatsCompletedEventHandler SubmitStatsCompleted; | ||
1593 | 109 | |||
1594 | 110 | /// <remarks/> | ||
1595 | 101 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#RegisterDisplay", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | 111 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#RegisterDisplay", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] |
1596 | 102 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] | 112 | [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")] |
1597 | 103 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { | 113 | public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) { |
1598 | @@ -320,6 +330,78 @@ | |||
1599 | 320 | } | 330 | } |
1600 | 321 | 331 | ||
1601 | 322 | /// <remarks/> | 332 | /// <remarks/> |
1602 | 333 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#SubmitLog", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | ||
1603 | 334 | [return: System.Xml.Serialization.SoapElementAttribute("success")] | ||
1604 | 335 | public bool SubmitLog(string version, string serverKey, string hardwareKey, string logXml) { | ||
1605 | 336 | object[] results = this.Invoke("SubmitLog", new object[] { | ||
1606 | 337 | version, | ||
1607 | 338 | serverKey, | ||
1608 | 339 | hardwareKey, | ||
1609 | 340 | logXml}); | ||
1610 | 341 | return ((bool)(results[0])); | ||
1611 | 342 | } | ||
1612 | 343 | |||
1613 | 344 | /// <remarks/> | ||
1614 | 345 | public void SubmitLogAsync(string version, string serverKey, string hardwareKey, string logXml) { | ||
1615 | 346 | this.SubmitLogAsync(version, serverKey, hardwareKey, logXml, null); | ||
1616 | 347 | } | ||
1617 | 348 | |||
1618 | 349 | /// <remarks/> | ||
1619 | 350 | public void SubmitLogAsync(string version, string serverKey, string hardwareKey, string logXml, object userState) { | ||
1620 | 351 | if ((this.SubmitLogOperationCompleted == null)) { | ||
1621 | 352 | this.SubmitLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitLogOperationCompleted); | ||
1622 | 353 | } | ||
1623 | 354 | this.InvokeAsync("SubmitLog", new object[] { | ||
1624 | 355 | version, | ||
1625 | 356 | serverKey, | ||
1626 | 357 | hardwareKey, | ||
1627 | 358 | logXml}, this.SubmitLogOperationCompleted, userState); | ||
1628 | 359 | } | ||
1629 | 360 | |||
1630 | 361 | private void OnSubmitLogOperationCompleted(object arg) { | ||
1631 | 362 | if ((this.SubmitLogCompleted != null)) { | ||
1632 | 363 | System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); | ||
1633 | 364 | this.SubmitLogCompleted(this, new SubmitLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); | ||
1634 | 365 | } | ||
1635 | 366 | } | ||
1636 | 367 | |||
1637 | 368 | /// <remarks/> | ||
1638 | 369 | [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#SubmitLog", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")] | ||
1639 | 370 | [return: System.Xml.Serialization.SoapElementAttribute("success")] | ||
1640 | 371 | public bool SubmitStats(string version, string serverKey, string hardwareKey, string statXml) { | ||
1641 | 372 | object[] results = this.Invoke("SubmitStats", new object[] { | ||
1642 | 373 | version, | ||
1643 | 374 | serverKey, | ||
1644 | 375 | hardwareKey, | ||
1645 | 376 | statXml}); | ||
1646 | 377 | return ((bool)(results[0])); | ||
1647 | 378 | } | ||
1648 | 379 | |||
1649 | 380 | /// <remarks/> | ||
1650 | 381 | public void SubmitStatsAsync(string version, string serverKey, string hardwareKey, string statXml) { | ||
1651 | 382 | this.SubmitStatsAsync(version, serverKey, hardwareKey, statXml, null); | ||
1652 | 383 | } | ||
1653 | 384 | |||
1654 | 385 | /// <remarks/> | ||
1655 | 386 | public void SubmitStatsAsync(string version, string serverKey, string hardwareKey, string statXml, object userState) { | ||
1656 | 387 | if ((this.SubmitStatsOperationCompleted == null)) { | ||
1657 | 388 | this.SubmitStatsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitStatsOperationCompleted); | ||
1658 | 389 | } | ||
1659 | 390 | this.InvokeAsync("SubmitStats", new object[] { | ||
1660 | 391 | version, | ||
1661 | 392 | serverKey, | ||
1662 | 393 | hardwareKey, | ||
1663 | 394 | statXml}, this.SubmitStatsOperationCompleted, userState); | ||
1664 | 395 | } | ||
1665 | 396 | |||
1666 | 397 | private void OnSubmitStatsOperationCompleted(object arg) { | ||
1667 | 398 | if ((this.SubmitStatsCompleted != null)) { | ||
1668 | 399 | System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); | ||
1669 | 400 | this.SubmitStatsCompleted(this, new SubmitStatsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); | ||
1670 | 401 | } | ||
1671 | 402 | } | ||
1672 | 403 | |||
1673 | 404 | /// <remarks/> | ||
1674 | 323 | public new void CancelAsync(object userState) { | 405 | public new void CancelAsync(object userState) { |
1675 | 324 | base.CancelAsync(userState); | 406 | base.CancelAsync(userState); |
1676 | 325 | } | 407 | } |
1677 | @@ -493,6 +575,58 @@ | |||
1678 | 493 | } | 575 | } |
1679 | 494 | } | 576 | } |
1680 | 495 | } | 577 | } |
1681 | 578 | |||
1682 | 579 | /// <remarks/> | ||
1683 | 580 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")] | ||
1684 | 581 | public delegate void SubmitLogCompletedEventHandler(object sender, SubmitLogCompletedEventArgs e); | ||
1685 | 582 | |||
1686 | 583 | /// <remarks/> | ||
1687 | 584 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")] | ||
1688 | 585 | [System.Diagnostics.DebuggerStepThroughAttribute()] | ||
1689 | 586 | [System.ComponentModel.DesignerCategoryAttribute("code")] | ||
1690 | 587 | public partial class SubmitLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { | ||
1691 | 588 | |||
1692 | 589 | private object[] results; | ||
1693 | 590 | |||
1694 | 591 | internal SubmitLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | ||
1695 | 592 | base(exception, cancelled, userState) { | ||
1696 | 593 | this.results = results; | ||
1697 | 594 | } | ||
1698 | 595 | |||
1699 | 596 | /// <remarks/> | ||
1700 | 597 | public bool Result { | ||
1701 | 598 | get { | ||
1702 | 599 | this.RaiseExceptionIfNecessary(); | ||
1703 | 600 | return ((bool)(this.results[0])); | ||
1704 | 601 | } | ||
1705 | 602 | } | ||
1706 | 603 | } | ||
1707 | 604 | |||
1708 | 605 | /// <remarks/> | ||
1709 | 606 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")] | ||
1710 | 607 | public delegate void SubmitStatsCompletedEventHandler(object sender, SubmitStatsCompletedEventArgs e); | ||
1711 | 608 | |||
1712 | 609 | /// <remarks/> | ||
1713 | 610 | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")] | ||
1714 | 611 | [System.Diagnostics.DebuggerStepThroughAttribute()] | ||
1715 | 612 | [System.ComponentModel.DesignerCategoryAttribute("code")] | ||
1716 | 613 | public partial class SubmitStatsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { | ||
1717 | 614 | |||
1718 | 615 | private object[] results; | ||
1719 | 616 | |||
1720 | 617 | internal SubmitStatsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : | ||
1721 | 618 | base(exception, cancelled, userState) { | ||
1722 | 619 | this.results = results; | ||
1723 | 620 | } | ||
1724 | 621 | |||
1725 | 622 | /// <remarks/> | ||
1726 | 623 | public bool Result { | ||
1727 | 624 | get { | ||
1728 | 625 | this.RaiseExceptionIfNecessary(); | ||
1729 | 626 | return ((bool)(this.results[0])); | ||
1730 | 627 | } | ||
1731 | 628 | } | ||
1732 | 629 | } | ||
1733 | 496 | } | 630 | } |
1734 | 497 | 631 | ||
1735 | 498 | #pragma warning restore 1591 | 632 | #pragma warning restore 1591 |
1736 | 499 | \ No newline at end of file | 633 | \ No newline at end of file |
1737 | 500 | 634 | ||
1738 | === modified file 'client/dotNET/Web References/xmds/Reference.map' | |||
1739 | --- client/dotNET/Web References/xmds/Reference.map 2009-01-23 20:51:50 +0000 | |||
1740 | +++ client/dotNET/Web References/xmds/Reference.map 2009-07-26 11:40:59 +0000 | |||
1741 | @@ -1,6 +1,6 @@ | |||
1742 | 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
1743 | 2 | <DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | 2 | <DiscoveryClientResultsFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
1744 | 3 | <Results> | 3 | <Results> |
1746 | 4 | <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://localhost/Xibo/server/xmds.php?wsdl" filename="xmds.wsdl" /> | 4 | <DiscoveryClientResult referenceType="System.Web.Services.Discovery.ContractReference" url="http://localhost/1.0.0/server/xmds.php?wsdl" filename="xmds.wsdl" /> |
1747 | 5 | </Results> | 5 | </Results> |
1748 | 6 | </DiscoveryClientResultsFile> | 6 | </DiscoveryClientResultsFile> |
1749 | 7 | \ No newline at end of file | 7 | \ No newline at end of file |
1750 | 8 | 8 | ||
1751 | === modified file 'client/dotNET/Web References/xmds/xmds.wsdl' | |||
1752 | --- client/dotNET/Web References/xmds/xmds.wsdl 2009-01-23 20:51:50 +0000 | |||
1753 | +++ client/dotNET/Web References/xmds/xmds.wsdl 2009-07-26 11:40:59 +0000 | |||
1754 | @@ -63,6 +63,24 @@ | |||
1755 | 63 | <wsdl:message name="BlackListResponse"> | 63 | <wsdl:message name="BlackListResponse"> |
1756 | 64 | <wsdl:part name="success" type="xsd:boolean" /> | 64 | <wsdl:part name="success" type="xsd:boolean" /> |
1757 | 65 | </wsdl:message> | 65 | </wsdl:message> |
1758 | 66 | <wsdl:message name="SubmitLogRequest"> | ||
1759 | 67 | <wsdl:part name="version" type="xsd:string" /> | ||
1760 | 68 | <wsdl:part name="serverKey" type="xsd:string" /> | ||
1761 | 69 | <wsdl:part name="hardwareKey" type="xsd:string" /> | ||
1762 | 70 | <wsdl:part name="logXml" type="xsd:string" /> | ||
1763 | 71 | </wsdl:message> | ||
1764 | 72 | <wsdl:message name="SubmitLogResponse"> | ||
1765 | 73 | <wsdl:part name="success" type="xsd:boolean" /> | ||
1766 | 74 | </wsdl:message> | ||
1767 | 75 | <wsdl:message name="SubmitStatsRequest"> | ||
1768 | 76 | <wsdl:part name="version" type="xsd:string" /> | ||
1769 | 77 | <wsdl:part name="serverKey" type="xsd:string" /> | ||
1770 | 78 | <wsdl:part name="hardwareKey" type="xsd:string" /> | ||
1771 | 79 | <wsdl:part name="statXml" type="xsd:string" /> | ||
1772 | 80 | </wsdl:message> | ||
1773 | 81 | <wsdl:message name="SubmitStatsResponse"> | ||
1774 | 82 | <wsdl:part name="success" type="xsd:boolean" /> | ||
1775 | 83 | </wsdl:message> | ||
1776 | 66 | <wsdl:portType name="xmdsPortType"> | 84 | <wsdl:portType name="xmdsPortType"> |
1777 | 67 | <wsdl:operation name="RegisterDisplay"> | 85 | <wsdl:operation name="RegisterDisplay"> |
1778 | 68 | <documentation>Registered the Display on the Xibo Network</documentation> | 86 | <documentation>Registered the Display on the Xibo Network</documentation> |
1779 | @@ -94,6 +112,16 @@ | |||
1780 | 94 | <wsdl:input message="tns:BlackListRequest" /> | 112 | <wsdl:input message="tns:BlackListRequest" /> |
1781 | 95 | <wsdl:output message="tns:BlackListResponse" /> | 113 | <wsdl:output message="tns:BlackListResponse" /> |
1782 | 96 | </wsdl:operation> | 114 | </wsdl:operation> |
1783 | 115 | <wsdl:operation name="SubmitLog"> | ||
1784 | 116 | <documentation>Submit Logging from the Client</documentation> | ||
1785 | 117 | <wsdl:input message="tns:SubmitLogRequest" /> | ||
1786 | 118 | <wsdl:output message="tns:SubmitLogResponse" /> | ||
1787 | 119 | </wsdl:operation> | ||
1788 | 120 | <wsdl:operation name="SubmitStats"> | ||
1789 | 121 | <documentation>Submit Display statistics from the Client</documentation> | ||
1790 | 122 | <wsdl:input message="tns:SubmitStatsRequest" /> | ||
1791 | 123 | <wsdl:output message="tns:SubmitStatsResponse" /> | ||
1792 | 124 | </wsdl:operation> | ||
1793 | 97 | </wsdl:portType> | 125 | </wsdl:portType> |
1794 | 98 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> | 126 | <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType"> |
1795 | 99 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> | 127 | <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> |
1796 | @@ -151,10 +179,28 @@ | |||
1797 | 151 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | 179 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> |
1798 | 152 | </wsdl:output> | 180 | </wsdl:output> |
1799 | 153 | </wsdl:operation> | 181 | </wsdl:operation> |
1800 | 182 | <wsdl:operation name="SubmitLog"> | ||
1801 | 183 | <soap:operation soapAction="urn:xmds#SubmitLog" style="rpc" /> | ||
1802 | 184 | <wsdl:input> | ||
1803 | 185 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
1804 | 186 | </wsdl:input> | ||
1805 | 187 | <wsdl:output> | ||
1806 | 188 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
1807 | 189 | </wsdl:output> | ||
1808 | 190 | </wsdl:operation> | ||
1809 | 191 | <wsdl:operation name="SubmitStats"> | ||
1810 | 192 | <soap:operation soapAction="urn:xmds#SubmitLog" style="rpc" /> | ||
1811 | 193 | <wsdl:input> | ||
1812 | 194 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
1813 | 195 | </wsdl:input> | ||
1814 | 196 | <wsdl:output> | ||
1815 | 197 | <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> | ||
1816 | 198 | </wsdl:output> | ||
1817 | 199 | </wsdl:operation> | ||
1818 | 154 | </wsdl:binding> | 200 | </wsdl:binding> |
1819 | 155 | <wsdl:service name="xmds"> | 201 | <wsdl:service name="xmds"> |
1820 | 156 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> | 202 | <wsdl:port name="xmdsPort" binding="tns:xmdsBinding"> |
1822 | 157 | <soap:address location="http://localhost/Xibo/server/xmds.php" /> | 203 | <soap:address location="http://localhost/1.0.0/server/xmds.php" /> |
1823 | 158 | </wsdl:port> | 204 | </wsdl:port> |
1824 | 159 | </wsdl:service> | 205 | </wsdl:service> |
1825 | 160 | </wsdl:definitions> | 206 | </wsdl:definitions> |
1826 | 161 | \ No newline at end of file | 207 | \ No newline at end of file |
1827 | 162 | 208 | ||
1828 | === modified file 'client/dotNET/XiboClient.csproj' | |||
1829 | --- client/dotNET/XiboClient.csproj 2009-03-28 19:13:50 +0000 | |||
1830 | +++ client/dotNET/XiboClient.csproj 2009-07-26 11:40:59 +0000 | |||
1831 | @@ -141,9 +141,11 @@ | |||
1832 | 141 | <Compile Include="RssReader.cs" /> | 141 | <Compile Include="RssReader.cs" /> |
1833 | 142 | <Compile Include="Schedule.cs" /> | 142 | <Compile Include="Schedule.cs" /> |
1834 | 143 | <Compile Include="Settings.cs" /> | 143 | <Compile Include="Settings.cs" /> |
1835 | 144 | <Compile Include="StatLog.cs" /> | ||
1836 | 144 | <Compile Include="Text.cs"> | 145 | <Compile Include="Text.cs"> |
1837 | 145 | <SubType>Form</SubType> | 146 | <SubType>Form</SubType> |
1838 | 146 | </Compile> | 147 | </Compile> |
1839 | 148 | <Compile Include="LogMessage.cs" /> | ||
1840 | 147 | <Compile Include="Video.cs"> | 149 | <Compile Include="Video.cs"> |
1841 | 148 | <SubType>Form</SubType> | 150 | <SubType>Form</SubType> |
1842 | 149 | </Compile> | 151 | </Compile> |
1843 | @@ -163,7 +165,6 @@ | |||
1844 | 163 | </Compile> | 165 | </Compile> |
1845 | 164 | <Compile Include="WindowAnimator.cs" /> | 166 | <Compile Include="WindowAnimator.cs" /> |
1846 | 165 | <Compile Include="XiboTraceListener.cs" /> | 167 | <Compile Include="XiboTraceListener.cs" /> |
1847 | 166 | <Compile Include="XmlLog.cs" /> | ||
1848 | 167 | </ItemGroup> | 168 | </ItemGroup> |
1849 | 168 | <ItemGroup> | 169 | <ItemGroup> |
1850 | 169 | <COMReference Include="AxShockwaveFlashObjects"> | 170 | <COMReference Include="AxShockwaveFlashObjects"> |
1851 | @@ -226,10 +227,10 @@ | |||
1852 | 226 | <WebReferences Include="Web References\" /> | 227 | <WebReferences Include="Web References\" /> |
1853 | 227 | </ItemGroup> | 228 | </ItemGroup> |
1854 | 228 | <ItemGroup> | 229 | <ItemGroup> |
1856 | 229 | <WebReferenceUrl Include="http://localhost/Xibo/server/xmds.php%3fwsdl"> | 230 | <WebReferenceUrl Include="http://localhost/1.0.0/server/xmds.php%3fwsdl"> |
1857 | 230 | <UrlBehavior>Dynamic</UrlBehavior> | 231 | <UrlBehavior>Dynamic</UrlBehavior> |
1858 | 231 | <RelPath>Web References\xmds\</RelPath> | 232 | <RelPath>Web References\xmds\</RelPath> |
1860 | 232 | <UpdateFromURL>http://localhost/Xibo/server/xmds.php%3fwsdl</UpdateFromURL> | 233 | <UpdateFromURL>http://localhost/1.0.0/server/xmds.php%3fwsdl</UpdateFromURL> |
1861 | 233 | <ServiceLocationURL> | 234 | <ServiceLocationURL> |
1862 | 234 | </ServiceLocationURL> | 235 | </ServiceLocationURL> |
1863 | 235 | <CachedDynamicPropName> | 236 | <CachedDynamicPropName> |
1864 | 236 | 237 | ||
1865 | === modified file 'client/dotNET/XiboTraceListener.cs' | |||
1866 | --- client/dotNET/XiboTraceListener.cs 2009-03-08 12:41:17 +0000 | |||
1867 | +++ client/dotNET/XiboTraceListener.cs 2009-08-02 15:54:18 +0000 | |||
1868 | @@ -30,6 +30,13 @@ | |||
1869 | 30 | { | 30 | { |
1870 | 31 | class XiboTraceListener : TraceListener | 31 | class XiboTraceListener : TraceListener |
1871 | 32 | { | 32 | { |
1872 | 33 | private Collection<TraceMessage> _traceMessages; | ||
1873 | 34 | private String _logPath; | ||
1874 | 35 | private Boolean _xmdsProcessing; | ||
1875 | 36 | private xmds.xmds _xmds; | ||
1876 | 37 | private String _lastSubmit; | ||
1877 | 38 | private HardwareKey _hardwareKey; | ||
1878 | 39 | |||
1879 | 33 | public XiboTraceListener() | 40 | public XiboTraceListener() |
1880 | 34 | { | 41 | { |
1881 | 35 | InitializeListener(); | 42 | InitializeListener(); |
1882 | @@ -44,8 +51,17 @@ | |||
1883 | 44 | private void InitializeListener() | 51 | private void InitializeListener() |
1884 | 45 | { | 52 | { |
1885 | 46 | // Make a new collection of TraceMessages | 53 | // Make a new collection of TraceMessages |
1888 | 47 | traceMessages = new Collection<TraceMessage>(); | 54 | _traceMessages = new Collection<TraceMessage>(); |
1889 | 48 | logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation; | 55 | _logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation; |
1890 | 56 | |||
1891 | 57 | _xmdsProcessing = false; | ||
1892 | 58 | _xmds = new xmds.xmds(); | ||
1893 | 59 | |||
1894 | 60 | // Register a listener for the XMDS stats | ||
1895 | 61 | _xmds.SubmitLogCompleted += new XiboClient.xmds.SubmitLogCompletedEventHandler(_xmds_SubmitLogCompleted); | ||
1896 | 62 | |||
1897 | 63 | // Get the key for this display | ||
1898 | 64 | _hardwareKey = new HardwareKey(); | ||
1899 | 49 | } | 65 | } |
1900 | 50 | 66 | ||
1901 | 51 | private void AddToCollection(string message, string category) | 67 | private void AddToCollection(string message, string category) |
1902 | @@ -56,62 +72,133 @@ | |||
1903 | 56 | traceMessage.dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); | 72 | traceMessage.dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); |
1904 | 57 | traceMessage.message = message; | 73 | traceMessage.message = message; |
1905 | 58 | 74 | ||
1907 | 59 | traceMessages.Add(traceMessage); | 75 | _traceMessages.Add(traceMessage); |
1908 | 60 | } | 76 | } |
1909 | 61 | 77 | ||
1910 | 62 | private void FlushToFile() | 78 | private void FlushToFile() |
1911 | 63 | { | 79 | { |
1912 | 80 | if (_traceMessages.Count < 1) return; | ||
1913 | 81 | |||
1914 | 64 | try | 82 | try |
1915 | 65 | { | 83 | { |
1919 | 66 | XmlTextWriter xw = new XmlTextWriter(File.Open(logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | 84 | // Open the Text Writer |
1920 | 67 | 85 | StreamWriter tw = new StreamWriter(File.Open(_logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | |
1921 | 68 | foreach (TraceMessage message in traceMessages) | 86 | |
1922 | 87 | String theMessage; | ||
1923 | 88 | |||
1924 | 89 | foreach (TraceMessage message in _traceMessages) | ||
1925 | 69 | { | 90 | { |
1931 | 70 | xw.WriteStartElement("trace"); | 91 | String traceMsg = message.message.ToString(); |
1932 | 71 | xw.WriteElementString("category", message.category); | 92 | |
1933 | 72 | xw.WriteElementString("date", message.dateTime); | 93 | theMessage = String.Format("<trace date=\"{0}\" category=\"{1}\">{2}</trace>", message.dateTime, message.category, traceMsg); |
1934 | 73 | xw.WriteElementString("message", message.message); | 94 | tw.WriteLine(theMessage); |
1930 | 74 | xw.WriteEndElement(); | ||
1935 | 75 | } | 95 | } |
1936 | 76 | 96 | ||
1938 | 77 | xw.Close(); | 97 | // Close the tw. |
1939 | 98 | tw.Close(); | ||
1940 | 99 | tw.Dispose(); | ||
1941 | 78 | 100 | ||
1942 | 79 | // Remove the messages we have just added | 101 | // Remove the messages we have just added |
1944 | 80 | traceMessages.Clear(); | 102 | _traceMessages.Clear(); |
1945 | 81 | } | 103 | } |
1947 | 82 | catch (Exception e) | 104 | catch |
1948 | 83 | { | 105 | { |
1949 | 84 | // What can we do? | 106 | // What can we do? |
1950 | 85 | } | 107 | } |
1970 | 86 | 108 | finally | |
1971 | 87 | // Test the size of the XML file | 109 | { |
1972 | 88 | FileInfo fileInfo = new FileInfo(logPath); | 110 | _traceMessages.Clear(); |
1973 | 89 | 111 | } | |
1974 | 90 | // If its greater than a certain size - send it to the WebService | 112 | } |
1975 | 91 | if (fileInfo.Length > 6000) | 113 | |
1976 | 92 | { | 114 | /// <summary> |
1977 | 93 | // Move the current log file to a ready file | 115 | /// Flush the log to XMDS |
1978 | 94 | try | 116 | /// </summary> |
1979 | 95 | { | 117 | private void FlushToXmds() |
1980 | 96 | String logPathTemp = Application.UserAppDataPath + @"/" + String.Format("{0}.ready", DateTime.Now.ToFileTime().ToString()); | 118 | { |
1981 | 97 | 119 | String log; | |
1982 | 98 | File.Move(logPath, logPathTemp); | 120 | |
1983 | 99 | } | 121 | log = "<log>"; |
1984 | 100 | catch (Exception ex) | 122 | |
1985 | 101 | { | 123 | // Load the Stats collection into a string |
1986 | 102 | 124 | try | |
1987 | 103 | } | 125 | { |
1988 | 104 | } | 126 | foreach (TraceMessage traceMessage in _traceMessages) |
1989 | 127 | { | ||
1990 | 128 | String traceMsg = traceMessage.message.ToString(); | ||
1991 | 129 | |||
1992 | 130 | log += String.Format("<trace date=\"{0}\" category=\"{1}\">{2}</trace>", traceMessage.dateTime, traceMessage.category, traceMsg); | ||
1993 | 131 | } | ||
1994 | 132 | } | ||
1995 | 133 | catch (Exception ex) | ||
1996 | 134 | { | ||
1997 | 135 | System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToXmds", String.Format("Error converting stat to a string {0}", ex.Message)), LogType.Error.ToString()); | ||
1998 | 136 | } | ||
1999 | 137 | |||
2000 | 138 | log += "</log>"; | ||
2001 | 139 | |||
2002 | 140 | // Store the stats as the last sent (so we have a record if it fails) | ||
2003 | 141 | _lastSubmit = log; | ||
2004 | 142 | |||
2005 | 143 | // Clear the stats collection | ||
2006 | 144 | _traceMessages.Clear(); | ||
2007 | 145 | |||
2008 | 146 | // Submit the string to XMDS | ||
2009 | 147 | _xmdsProcessing = true; | ||
2010 | 148 | |||
2011 | 149 | _xmds.SubmitLogAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, _hardwareKey.Key, log); | ||
2012 | 150 | } | ||
2013 | 151 | |||
2014 | 152 | /// <summary> | ||
2015 | 153 | /// Capture the XMDS call and see if it went well | ||
2016 | 154 | /// </summary> | ||
2017 | 155 | /// <param name="sender"></param> | ||
2018 | 156 | /// <param name="e"></param> | ||
2019 | 157 | void _xmds_SubmitLogCompleted(object sender, XiboClient.xmds.SubmitLogCompletedEventArgs e) | ||
2020 | 158 | { | ||
2021 | 159 | _xmdsProcessing = false; | ||
2022 | 160 | |||
2023 | 161 | // Test if we succeeded or not | ||
2024 | 162 | if (e.Error != null) | ||
2025 | 163 | { | ||
2026 | 164 | // We had an error, log it. | ||
2027 | 165 | System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitLogCompleted", String.Format("Error during Submit to XMDS {0}", e.Error.Message)), LogType.Error.ToString()); | ||
2028 | 166 | |||
2029 | 167 | // Dump the stats to a file instead | ||
2030 | 168 | if (_lastSubmit != "") | ||
2031 | 169 | { | ||
2032 | 170 | try | ||
2033 | 171 | { | ||
2034 | 172 | // Open the Text Writer | ||
2035 | 173 | StreamWriter tw = new StreamWriter(File.Open(_logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | ||
2036 | 174 | |||
2037 | 175 | try | ||
2038 | 176 | { | ||
2039 | 177 | tw.Write(_lastSubmit); | ||
2040 | 178 | } | ||
2041 | 179 | catch {} | ||
2042 | 180 | finally | ||
2043 | 181 | { | ||
2044 | 182 | tw.Close(); | ||
2045 | 183 | tw.Dispose(); | ||
2046 | 184 | } | ||
2047 | 185 | } | ||
2048 | 186 | catch {} | ||
2049 | 187 | } | ||
2050 | 188 | } | ||
2051 | 189 | |||
2052 | 190 | // Clear the last sumbit | ||
2053 | 191 | _lastSubmit = ""; | ||
2054 | 105 | } | 192 | } |
2055 | 106 | 193 | ||
2056 | 107 | public override void Write(string message) | 194 | public override void Write(string message) |
2057 | 108 | { | 195 | { |
2059 | 109 | AddToCollection(message, ""); | 196 | AddToCollection(message, "Audit"); |
2060 | 110 | } | 197 | } |
2061 | 111 | 198 | ||
2062 | 112 | public override void Write(object o) | 199 | public override void Write(object o) |
2063 | 113 | { | 200 | { |
2065 | 114 | AddToCollection(o.ToString(), ""); | 201 | AddToCollection(o.ToString(), "Audit"); |
2066 | 115 | } | 202 | } |
2067 | 116 | 203 | ||
2068 | 117 | public override void Write(string message, string category) | 204 | public override void Write(string message, string category) |
2069 | @@ -162,16 +249,47 @@ | |||
2070 | 162 | 249 | ||
2071 | 163 | public override void Close() | 250 | public override void Close() |
2072 | 164 | { | 251 | { |
2074 | 165 | FlushToFile(); | 252 | // Determine if there is anything to flush |
2075 | 253 | if (_traceMessages.Count < 1) return; | ||
2076 | 254 | |||
2077 | 255 | // As we are closing if XMDS is already busy just log to file. | ||
2078 | 256 | if (_xmdsProcessing) | ||
2079 | 257 | { | ||
2080 | 258 | FlushToFile(); | ||
2081 | 259 | } | ||
2082 | 260 | else | ||
2083 | 261 | { | ||
2084 | 262 | int threshold = ((int)Properties.Settings.Default.collectInterval * 5); | ||
2085 | 263 | |||
2086 | 264 | // Determine where we want to log. | ||
2087 | 265 | if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now) | ||
2088 | 266 | { | ||
2089 | 267 | FlushToFile(); | ||
2090 | 268 | } | ||
2091 | 269 | else | ||
2092 | 270 | { | ||
2093 | 271 | FlushToXmds(); | ||
2094 | 272 | } | ||
2095 | 273 | } | ||
2096 | 166 | } | 274 | } |
2097 | 167 | 275 | ||
2098 | 168 | public override void Flush() | 276 | public override void Flush() |
2099 | 169 | { | 277 | { |
2101 | 170 | FlushToFile(); | 278 | // Determine if there is anything to flush |
2102 | 279 | if (_traceMessages.Count < 1 || _xmdsProcessing) return; | ||
2103 | 280 | |||
2104 | 281 | int threshold = ((int)Properties.Settings.Default.collectInterval * 5); | ||
2105 | 282 | |||
2106 | 283 | // Determine where we want to log. | ||
2107 | 284 | if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now) | ||
2108 | 285 | { | ||
2109 | 286 | FlushToFile(); | ||
2110 | 287 | } | ||
2111 | 288 | else | ||
2112 | 289 | { | ||
2113 | 290 | FlushToXmds(); | ||
2114 | 291 | } | ||
2115 | 171 | } | 292 | } |
2116 | 172 | |||
2117 | 173 | private Collection<TraceMessage> traceMessages; | ||
2118 | 174 | private String logPath; | ||
2119 | 175 | } | 293 | } |
2120 | 176 | 294 | ||
2121 | 177 | [Serializable] | 295 | [Serializable] |
2122 | 178 | 296 | ||
2123 | === removed file 'client/dotNET/XmlLog.cs' | |||
2124 | --- client/dotNET/XmlLog.cs 2009-03-08 12:51:18 +0000 | |||
2125 | +++ client/dotNET/XmlLog.cs 1970-01-01 00:00:00 +0000 | |||
2126 | @@ -1,172 +0,0 @@ | |||
2127 | 1 | /* | ||
2128 | 2 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
2129 | 3 | * Copyright (C) 2006,2007,2008 Daniel Garner and James Packer | ||
2130 | 4 | * | ||
2131 | 5 | * This file is part of Xibo. | ||
2132 | 6 | * | ||
2133 | 7 | * Xibo is free software: you can redistribute it and/or modify | ||
2134 | 8 | * it under the terms of the GNU Affero General Public License as published by | ||
2135 | 9 | * the Free Software Foundation, either version 3 of the License, or | ||
2136 | 10 | * any later version. | ||
2137 | 11 | * | ||
2138 | 12 | * Xibo is distributed in the hope that it will be useful, | ||
2139 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2140 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2141 | 15 | * GNU Affero General Public License for more details. | ||
2142 | 16 | * | ||
2143 | 17 | * You should have received a copy of the GNU Affero General Public License | ||
2144 | 18 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
2145 | 19 | */ | ||
2146 | 20 | using System; | ||
2147 | 21 | using System.Collections.Generic; | ||
2148 | 22 | using System.IO; | ||
2149 | 23 | using System.Text; | ||
2150 | 24 | using System.Windows.Forms; | ||
2151 | 25 | using System.Xml; | ||
2152 | 26 | |||
2153 | 27 | namespace XiboClient | ||
2154 | 28 | { | ||
2155 | 29 | class XmlLog | ||
2156 | 30 | { | ||
2157 | 31 | /// <summary> | ||
2158 | 32 | /// Creates a new XmlLog Class used for sending the log | ||
2159 | 33 | /// </summary> | ||
2160 | 34 | /// <param name="logPath"></param> | ||
2161 | 35 | public XmlLog() | ||
2162 | 36 | { | ||
2163 | 37 | logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation; | ||
2164 | 38 | |||
2165 | 39 | // Get the key for this display | ||
2166 | 40 | hardwareKey = new HardwareKey(); | ||
2167 | 41 | |||
2168 | 42 | // Setup the WebService call | ||
2169 | 43 | xmds1 = new XiboClient.xmds.xmds(); | ||
2170 | 44 | xmds1.RecieveXmlLogCompleted += new XiboClient.xmds.RecieveXmlLogCompletedEventHandler(xmds1_RecieveXmlLogCompleted); | ||
2171 | 45 | |||
2172 | 46 | return; | ||
2173 | 47 | } | ||
2174 | 48 | |||
2175 | 49 | /// <summary> | ||
2176 | 50 | /// Prepares the log for sending | ||
2177 | 51 | /// </summary> | ||
2178 | 52 | public void PrepareAndSend() | ||
2179 | 53 | { | ||
2180 | 54 | currentFile = 0; | ||
2181 | 55 | |||
2182 | 56 | // Get a list of all the log files avaiable to process | ||
2183 | 57 | DirectoryInfo di = new DirectoryInfo(Application.UserAppDataPath); | ||
2184 | 58 | |||
2185 | 59 | files = di.GetFiles("*.ready"); | ||
2186 | 60 | |||
2187 | 61 | // There thought never be no files | ||
2188 | 62 | if (files.Length == 0) return; | ||
2189 | 63 | |||
2190 | 64 | // Send them (one by one) | ||
2191 | 65 | SendLog(files[currentFile].FullName); | ||
2192 | 66 | |||
2193 | 67 | return; | ||
2194 | 68 | } | ||
2195 | 69 | |||
2196 | 70 | /// <summary> | ||
2197 | 71 | /// Sends and XmlLog files that are ready to send | ||
2198 | 72 | /// Binds a xmds1.RecieveXmlLogCompleted event | ||
2199 | 73 | /// </summary> | ||
2200 | 74 | public void SendLog(string filePath) | ||
2201 | 75 | { | ||
2202 | 76 | // Read the Xml | ||
2203 | 77 | try | ||
2204 | 78 | { | ||
2205 | 79 | StreamReader tr = new StreamReader(File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)); | ||
2206 | 80 | xmds1.RecieveXmlLogAsync(Properties.Settings.Default.ServerKey, hardwareKey.Key, tr.ReadToEnd(), Properties.Settings.Default.Version); | ||
2207 | 81 | tr.Close(); | ||
2208 | 82 | } | ||
2209 | 83 | catch (Exception ex) | ||
2210 | 84 | { | ||
2211 | 85 | System.Diagnostics.Debug.WriteLine(ex.Message); | ||
2212 | 86 | } | ||
2213 | 87 | } | ||
2214 | 88 | |||
2215 | 89 | /// <summary> | ||
2216 | 90 | /// Completed sending the XML Log | ||
2217 | 91 | /// </summary> | ||
2218 | 92 | /// <param name="sender"></param> | ||
2219 | 93 | /// <param name="e"></param> | ||
2220 | 94 | void xmds1_RecieveXmlLogCompleted(object sender, XiboClient.xmds.RecieveXmlLogCompletedEventArgs e) | ||
2221 | 95 | { | ||
2222 | 96 | // Delete the Log File if success | ||
2223 | 97 | if (e.Error != null) | ||
2224 | 98 | { | ||
2225 | 99 | System.Diagnostics.Debug.WriteLine(e.Error.Message); | ||
2226 | 100 | } | ||
2227 | 101 | else | ||
2228 | 102 | { | ||
2229 | 103 | if (e.Result) | ||
2230 | 104 | { | ||
2231 | 105 | try | ||
2232 | 106 | { | ||
2233 | 107 | // Do the delete | ||
2234 | 108 | File.Delete(files[currentFile].FullName); | ||
2235 | 109 | } | ||
2236 | 110 | catch (Exception ex) | ||
2237 | 111 | { | ||
2238 | 112 | System.Diagnostics.Debug.WriteLine(ex.Message); | ||
2239 | 113 | } | ||
2240 | 114 | } | ||
2241 | 115 | } | ||
2242 | 116 | |||
2243 | 117 | // Process the next file in the que | ||
2244 | 118 | currentFile++; | ||
2245 | 119 | |||
2246 | 120 | if (currentFile < files.Length) | ||
2247 | 121 | { | ||
2248 | 122 | SendLog(files[currentFile].FullName); | ||
2249 | 123 | } | ||
2250 | 124 | |||
2251 | 125 | return; | ||
2252 | 126 | } | ||
2253 | 127 | |||
2254 | 128 | /// <summary> | ||
2255 | 129 | /// Appends a Stats XML message to the current Log | ||
2256 | 130 | /// </summary> | ||
2257 | 131 | /// <param name="message"></param> | ||
2258 | 132 | /// <param name="cat"></param> | ||
2259 | 133 | /// <param name="type"></param> | ||
2260 | 134 | /// <param name="scheduleID"></param> | ||
2261 | 135 | /// <param name="layoutID"></param> | ||
2262 | 136 | /// <param name="mediaID"></param> | ||
2263 | 137 | public static void AppendStat(String message, StatType type, int scheduleID, int layoutID, string mediaID) | ||
2264 | 138 | { | ||
2265 | 139 | if (!Properties.Settings.Default.statsEnabled) return; | ||
2266 | 140 | |||
2267 | 141 | try | ||
2268 | 142 | { | ||
2269 | 143 | XmlTextWriter xw = new XmlTextWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.logLocation, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8); | ||
2270 | 144 | |||
2271 | 145 | xw.WriteStartElement("stat"); | ||
2272 | 146 | |||
2273 | 147 | xw.WriteElementString("date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); | ||
2274 | 148 | xw.WriteElementString("message", message); | ||
2275 | 149 | xw.WriteElementString("type", type.ToString()); | ||
2276 | 150 | xw.WriteElementString("scheduleID", scheduleID.ToString()); | ||
2277 | 151 | xw.WriteElementString("layoutID", layoutID.ToString()); | ||
2278 | 152 | if (mediaID != "0") xw.WriteElementString("mediaID", mediaID.ToString()); | ||
2279 | 153 | |||
2280 | 154 | xw.WriteEndElement(); | ||
2281 | 155 | |||
2282 | 156 | xw.Close(); | ||
2283 | 157 | } | ||
2284 | 158 | catch (Exception ex) | ||
2285 | 159 | { | ||
2286 | 160 | } | ||
2287 | 161 | } | ||
2288 | 162 | |||
2289 | 163 | private XiboClient.xmds.xmds xmds1; | ||
2290 | 164 | private HardwareKey hardwareKey; | ||
2291 | 165 | string logPath; | ||
2292 | 166 | |||
2293 | 167 | FileInfo[] files; | ||
2294 | 168 | int currentFile; | ||
2295 | 169 | } | ||
2296 | 170 | |||
2297 | 171 | public enum StatType { LayoutStart, LayoutEnd, MediaStart, MediaEnd }; | ||
2298 | 172 | } | ||
2299 | 173 | 0 | ||
2300 | === modified file 'client/dotNET/app.config' | |||
2301 | --- client/dotNET/app.config 2009-03-08 11:40:17 +0000 | |||
2302 | +++ client/dotNET/app.config 2009-07-30 23:01:31 +0000 | |||
2303 | @@ -14,7 +14,7 @@ | |||
2304 | 14 | <value>DEFAULT</value> | 14 | <value>DEFAULT</value> |
2305 | 15 | </setting> | 15 | </setting> |
2306 | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> |
2308 | 17 | <value>http://localhost/Xibo/server/xmds.php</value> | 17 | <value>http://localhost/1.0.0/server/xmds.php</value> |
2309 | 18 | </setting> | 18 | </setting> |
2310 | 19 | <setting name="ServerKey" serializeAs="String"> | 19 | <setting name="ServerKey" serializeAs="String"> |
2311 | 20 | <value>changetocustomerkey</value> | 20 | <value>changetocustomerkey</value> |
2312 | @@ -25,9 +25,6 @@ | |||
2313 | 25 | <setting name="licensed" serializeAs="String"> | 25 | <setting name="licensed" serializeAs="String"> |
2314 | 26 | <value>0</value> | 26 | <value>0</value> |
2315 | 27 | </setting> | 27 | </setting> |
2316 | 28 | <setting name="collectInterval" serializeAs="String"> | ||
2317 | 29 | <value>900</value> | ||
2318 | 30 | </setting> | ||
2319 | 31 | <setting name="powerpointEnabled" serializeAs="String"> | 28 | <setting name="powerpointEnabled" serializeAs="String"> |
2320 | 32 | <value>False</value> | 29 | <value>False</value> |
2321 | 33 | </setting> | 30 | </setting> |
2322 | @@ -49,6 +46,18 @@ | |||
2323 | 49 | <setting name="ProxyPort" serializeAs="String"> | 46 | <setting name="ProxyPort" serializeAs="String"> |
2324 | 50 | <value /> | 47 | <value /> |
2325 | 51 | </setting> | 48 | </setting> |
2326 | 49 | <setting name="hardwareKey" serializeAs="String"> | ||
2327 | 50 | <value /> | ||
2328 | 51 | </setting> | ||
2329 | 52 | <setting name="StatsFlushCount" serializeAs="String"> | ||
2330 | 53 | <value>50</value> | ||
2331 | 54 | </setting> | ||
2332 | 55 | <setting name="XmdsLastConnection" serializeAs="String"> | ||
2333 | 56 | <value /> | ||
2334 | 57 | </setting> | ||
2335 | 58 | <setting name="collectInterval" serializeAs="String"> | ||
2336 | 59 | <value>900</value> | ||
2337 | 60 | </setting> | ||
2338 | 52 | </XiboClient.Properties.Settings> | 61 | </XiboClient.Properties.Settings> |
2339 | 53 | </userSettings> | 62 | </userSettings> |
2340 | 54 | <applicationSettings> | 63 | <applicationSettings> |
2341 | @@ -65,6 +74,9 @@ | |||
2342 | 65 | <setting name="Version" serializeAs="String"> | 74 | <setting name="Version" serializeAs="String"> |
2343 | 66 | <value>1</value> | 75 | <value>1</value> |
2344 | 67 | </setting> | 76 | </setting> |
2345 | 77 | <setting name="StatsLogFile" serializeAs="String"> | ||
2346 | 78 | <value>stats.xml</value> | ||
2347 | 79 | </setting> | ||
2348 | 68 | </XiboClient.Properties.Settings> | 80 | </XiboClient.Properties.Settings> |
2349 | 69 | </applicationSettings> | 81 | </applicationSettings> |
2350 | 70 | </configuration> | 82 | </configuration> |
2351 | 71 | \ No newline at end of file | 83 | \ No newline at end of file |
2352 | 72 | 84 | ||
2353 | === removed file 'client/dotNET/bin/Release/XiboClient.XmlSerializers.dll' | |||
2354 | 73 | Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 1970-01-01 00:00:00 +0000 differ | 85 | Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 1970-01-01 00:00:00 +0000 differ |
2355 | === removed file 'client/dotNET/bin/Release/XiboClient.exe' | |||
2356 | 74 | Binary files client/dotNET/bin/Release/XiboClient.exe 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.exe 1970-01-01 00:00:00 +0000 differ | 86 | Binary files client/dotNET/bin/Release/XiboClient.exe 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.exe 1970-01-01 00:00:00 +0000 differ |
2357 | === modified file 'client/dotNET/bin/Release/XiboClient.exe.config' | |||
2358 | --- client/dotNET/bin/Release/XiboClient.exe.config 2009-03-08 12:41:17 +0000 | |||
2359 | +++ client/dotNET/bin/Release/XiboClient.exe.config 2009-07-30 23:01:31 +0000 | |||
2360 | @@ -14,7 +14,7 @@ | |||
2361 | 14 | <value>DEFAULT</value> | 14 | <value>DEFAULT</value> |
2362 | 15 | </setting> | 15 | </setting> |
2363 | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> |
2365 | 17 | <value>http://localhost/Xibo/server/xmds.php</value> | 17 | <value>http://localhost/1.0.0/server/xmds.php</value> |
2366 | 18 | </setting> | 18 | </setting> |
2367 | 19 | <setting name="ServerKey" serializeAs="String"> | 19 | <setting name="ServerKey" serializeAs="String"> |
2368 | 20 | <value>changetocustomerkey</value> | 20 | <value>changetocustomerkey</value> |
2369 | @@ -25,9 +25,6 @@ | |||
2370 | 25 | <setting name="licensed" serializeAs="String"> | 25 | <setting name="licensed" serializeAs="String"> |
2371 | 26 | <value>0</value> | 26 | <value>0</value> |
2372 | 27 | </setting> | 27 | </setting> |
2373 | 28 | <setting name="collectInterval" serializeAs="String"> | ||
2374 | 29 | <value>900</value> | ||
2375 | 30 | </setting> | ||
2376 | 31 | <setting name="powerpointEnabled" serializeAs="String"> | 28 | <setting name="powerpointEnabled" serializeAs="String"> |
2377 | 32 | <value>False</value> | 29 | <value>False</value> |
2378 | 33 | </setting> | 30 | </setting> |
2379 | @@ -49,6 +46,18 @@ | |||
2380 | 49 | <setting name="ProxyPort" serializeAs="String"> | 46 | <setting name="ProxyPort" serializeAs="String"> |
2381 | 50 | <value /> | 47 | <value /> |
2382 | 51 | </setting> | 48 | </setting> |
2383 | 49 | <setting name="hardwareKey" serializeAs="String"> | ||
2384 | 50 | <value /> | ||
2385 | 51 | </setting> | ||
2386 | 52 | <setting name="StatsFlushCount" serializeAs="String"> | ||
2387 | 53 | <value>50</value> | ||
2388 | 54 | </setting> | ||
2389 | 55 | <setting name="XmdsLastConnection" serializeAs="String"> | ||
2390 | 56 | <value /> | ||
2391 | 57 | </setting> | ||
2392 | 58 | <setting name="collectInterval" serializeAs="String"> | ||
2393 | 59 | <value>900</value> | ||
2394 | 60 | </setting> | ||
2395 | 52 | </XiboClient.Properties.Settings> | 61 | </XiboClient.Properties.Settings> |
2396 | 53 | </userSettings> | 62 | </userSettings> |
2397 | 54 | <applicationSettings> | 63 | <applicationSettings> |
2398 | @@ -65,6 +74,9 @@ | |||
2399 | 65 | <setting name="Version" serializeAs="String"> | 74 | <setting name="Version" serializeAs="String"> |
2400 | 66 | <value>1</value> | 75 | <value>1</value> |
2401 | 67 | </setting> | 76 | </setting> |
2402 | 77 | <setting name="StatsLogFile" serializeAs="String"> | ||
2403 | 78 | <value>stats.xml</value> | ||
2404 | 79 | </setting> | ||
2405 | 68 | </XiboClient.Properties.Settings> | 80 | </XiboClient.Properties.Settings> |
2406 | 69 | </applicationSettings> | 81 | </applicationSettings> |
2407 | 70 | </configuration> | 82 | </configuration> |
2408 | 71 | \ No newline at end of file | 83 | \ No newline at end of file |
2409 | 72 | 84 | ||
2410 | === removed file 'client/dotNET/bin/Release/XiboClient.pdb' | |||
2411 | 73 | Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.pdb 1970-01-01 00:00:00 +0000 differ | 85 | Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-06-20 10:39:40 +0000 and client/dotNET/bin/Release/XiboClient.pdb 1970-01-01 00:00:00 +0000 differ |
2412 | === modified file 'client/dotNET/bin/Release/XiboClient.vshost.exe.config' | |||
2413 | --- client/dotNET/bin/Release/XiboClient.vshost.exe.config 2009-03-08 12:41:17 +0000 | |||
2414 | +++ client/dotNET/bin/Release/XiboClient.vshost.exe.config 2009-07-30 23:01:31 +0000 | |||
2415 | @@ -14,7 +14,7 @@ | |||
2416 | 14 | <value>DEFAULT</value> | 14 | <value>DEFAULT</value> |
2417 | 15 | </setting> | 15 | </setting> |
2418 | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> | 16 | <setting name="XiboClient_xmds_xmds" serializeAs="String"> |
2420 | 17 | <value>http://localhost/Xibo/server/xmds.php</value> | 17 | <value>http://localhost/1.0.0/server/xmds.php</value> |
2421 | 18 | </setting> | 18 | </setting> |
2422 | 19 | <setting name="ServerKey" serializeAs="String"> | 19 | <setting name="ServerKey" serializeAs="String"> |
2423 | 20 | <value>changetocustomerkey</value> | 20 | <value>changetocustomerkey</value> |
2424 | @@ -25,9 +25,6 @@ | |||
2425 | 25 | <setting name="licensed" serializeAs="String"> | 25 | <setting name="licensed" serializeAs="String"> |
2426 | 26 | <value>0</value> | 26 | <value>0</value> |
2427 | 27 | </setting> | 27 | </setting> |
2428 | 28 | <setting name="collectInterval" serializeAs="String"> | ||
2429 | 29 | <value>900</value> | ||
2430 | 30 | </setting> | ||
2431 | 31 | <setting name="powerpointEnabled" serializeAs="String"> | 28 | <setting name="powerpointEnabled" serializeAs="String"> |
2432 | 32 | <value>False</value> | 29 | <value>False</value> |
2433 | 33 | </setting> | 30 | </setting> |
2434 | @@ -49,6 +46,18 @@ | |||
2435 | 49 | <setting name="ProxyPort" serializeAs="String"> | 46 | <setting name="ProxyPort" serializeAs="String"> |
2436 | 50 | <value /> | 47 | <value /> |
2437 | 51 | </setting> | 48 | </setting> |
2438 | 49 | <setting name="hardwareKey" serializeAs="String"> | ||
2439 | 50 | <value /> | ||
2440 | 51 | </setting> | ||
2441 | 52 | <setting name="StatsFlushCount" serializeAs="String"> | ||
2442 | 53 | <value>50</value> | ||
2443 | 54 | </setting> | ||
2444 | 55 | <setting name="XmdsLastConnection" serializeAs="String"> | ||
2445 | 56 | <value /> | ||
2446 | 57 | </setting> | ||
2447 | 58 | <setting name="collectInterval" serializeAs="String"> | ||
2448 | 59 | <value>900</value> | ||
2449 | 60 | </setting> | ||
2450 | 52 | </XiboClient.Properties.Settings> | 61 | </XiboClient.Properties.Settings> |
2451 | 53 | </userSettings> | 62 | </userSettings> |
2452 | 54 | <applicationSettings> | 63 | <applicationSettings> |
2453 | @@ -65,6 +74,9 @@ | |||
2454 | 65 | <setting name="Version" serializeAs="String"> | 74 | <setting name="Version" serializeAs="String"> |
2455 | 66 | <value>1</value> | 75 | <value>1</value> |
2456 | 67 | </setting> | 76 | </setting> |
2457 | 77 | <setting name="StatsLogFile" serializeAs="String"> | ||
2458 | 78 | <value>stats.xml</value> | ||
2459 | 79 | </setting> | ||
2460 | 68 | </XiboClient.Properties.Settings> | 80 | </XiboClient.Properties.Settings> |
2461 | 69 | </applicationSettings> | 81 | </applicationSettings> |
2462 | 70 | </configuration> | 82 | </configuration> |
2463 | 71 | \ No newline at end of file | 83 | \ No newline at end of file |
2464 | 72 | 84 | ||
2465 | === modified file 'server/3rdparty/fckeditor/editor/css/fck_editorarea.css' | |||
2466 | --- server/3rdparty/fckeditor/editor/css/fck_editorarea.css 2008-12-14 14:41:09 +0000 | |||
2467 | +++ server/3rdparty/fckeditor/editor/css/fck_editorarea.css 2009-08-03 12:54:45 +0000 | |||
2468 | @@ -40,7 +40,7 @@ | |||
2469 | 40 | 40 | ||
2470 | 41 | body, td | 41 | body, td |
2471 | 42 | { | 42 | { |
2473 | 43 | font-family: Arial, Verdana, sans-serif; | 43 | font-family: "Times New Roman", Times, serif; |
2474 | 44 | font-size: 12px; | 44 | font-size: 12px; |
2475 | 45 | } | 45 | } |
2476 | 46 | 46 | ||
2477 | 47 | 47 | ||
2478 | === modified file 'server/3rdparty/jQuery/jquery.tablesorter.pack.js' | |||
2479 | --- server/3rdparty/jQuery/jquery.tablesorter.pack.js 2008-12-14 14:42:52 +0000 | |||
2480 | +++ server/3rdparty/jQuery/jquery.tablesorter.pack.js 2009-06-27 10:56:12 +0000 | |||
2481 | @@ -1,8 +1,7 @@ | |||
2482 | 1 | /* | 1 | /* |
2483 | 2 | * | 2 | * |
2484 | 3 | * TableSorter 2.0 - Client-side table sorting with ease! | 3 | * TableSorter 2.0 - Client-side table sorting with ease! |
2487 | 4 | * Version 2.0 | 4 | * Version 2.0.3 |
2486 | 5 | * @requires jQuery v1.1.3 | ||
2488 | 6 | * | 5 | * |
2489 | 7 | * Copyright (c) 2007 Christian Bach | 6 | * Copyright (c) 2007 Christian Bach |
2490 | 8 | * Examples and docs at: http://tablesorter.com | 7 | * Examples and docs at: http://tablesorter.com |
2491 | @@ -11,4 +10,4 @@ | |||
2492 | 11 | * http://www.gnu.org/licenses/gpl.html | 10 | * http://www.gnu.org/licenses/gpl.html |
2493 | 12 | * | 11 | * |
2494 | 13 | */ | 12 | */ |
2495 | 14 | eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){$.1z({w:y 6(){7 k=[],12=[];u.2r={2g:"3c",2s:"2V",1P:"3L",2G:"3E",2x:"3w",1y:14,1l:"3b",1q:{},12:[],19:{16:["1X","1U"]},K:{},1Q:F,2I:W,H:[],1t:[],1g:"2u",L:F};6 1f(a,b){18(a+","+(y T().15()-b.15())+"3h")}6 18(s){q(1o 1O!="26"&&1o 1O.L!="26"){1O.18(s)}M{30(s)}}6 23(a,b){q(a.8.L){7 c=""}7 d=[],V=a.13[0].N[0].V,l=V.x;B(7 i=0;i<l;i++){7 p=F;q($.1w&&($(b[i]).Y()&&$(b[i]).Y().17)){p=1L($(b[i]).Y().17)}M q((a.8.K[i]&&a.8.K[i].17)){p=1L(a.8.K[i].17)}q(!p){p=2E(a.8,V[i])}q(a.8.L){c+="1u:"+i+" 3C:"+p.C+"\\n"}d.O(p)}q(a.8.L){18(c)}m d};6 2E(a,b){7 l=k.x;B(7 i=1;i<l;i++){q(k[i].I($.1G(1F(a,b)))){m k[i]}}m k[0]}6 1L(a){7 l=k.x;B(7 i=0;i<l;i++){q(k[i].C.Z()==a.Z()){m k[i]}}m F}6 1K(a){q(a.8.L){7 b=y T()}7 d=(a.13[0]&&a.13[0].N.x)||0,2m=a.13[0].N[0].V.x,k=a.8.1q,R={1x:[],1k:[]};B(7 i=0;i<d;++i){7 c=a.13[0].N[i],1d=[];R.1x.O($(c));B(7 j=0;j<2m;++j){1d.O(k[j].D(1F(a.8,c.V[j]),a,c.V[j]))}1d.O(i);R.1k.O(1d);1d=14};q(a.8.L){1f("3i R B "+d+" N:",b)}m R};6 1F(a,b){q(!b)m"";7 t="";q(1o(a.1l)=="6"){t=a.1l(b)}M q(a.1l=="3e"){t=$(b).1b()}M{q(b.1A[0]&&b.1A[0].3a()){t=b.1A[0].2a}M{t=b.2a}}m t}6 1n(a,b){q(a.8.L){7 d=y T()}7 c=b,r=c.1x,n=c.1k,29=n.x,1B=(n[0].x-1),2d=$("1p:1c",a).32();N=[];B(7 i=0;i<29;i++){N.O(r[n[i][1B]]);q(a.8.1D==14){2d.2k(r[n[i][1B]])}}q(a.8.1D!=14){a.8.1D(a,N)}N=14;1E(a);q(a.8.L){1f("2X 1h:",d)}};6 20(b){q(b.8.L){7 c=y T()}7 d=($.1w)?W:F,1H=[];B(7 i=0;i<b.1e.N.x;i++){1H[i]=0};$1s=$(1J(b,1H,0,b.1e.N[0].V.x));$1s.1r(6(a){u.11=0;u.1u=a;u.1j=1T(b.8.2G);q(1S(u)||1R(b,a))u.1i=W;q(!u.1i){$(u).1m(b.8.2g)}b.8.1t[a]=u});q(b.8.L){1f("2O K:",c);18($1s)}m $1s};6 1J(a,b,d){7 e=[],r=a.1e.N,c=r[d].V;B(7 i=b[d];i<c.x;i++){7 f=c[i];q(f.2N>1){e=e.3K(1J(a,b,d+f.2K))}M{q(a.1e.x==1||(f.2K>1||!r[d+1])){e.O(f)}b[d]=(i+d)}}m e};6 1S(a){q(($.1w)&&($(a).Y().17===F)){m W};m F}6 1R(a,i){q((a.8.K[i])&&(a.8.K[i].17===F)){m W};m F}6 1E(a){7 c=a.8.12;7 l=c.x;B(7 i=0;i<l;i++){2J(c[i]).D(a)}}6 2J(a){7 l=12.x;B(7 i=0;i<l;i++){q(12[i].C.Z()==a.Z()){m 12[i]}}};6 1T(v){q(1o(v)!="3J"){i=(v.Z()=="3I")?1:0}M{i=(v==(0||1))?v:0}m i}6 2H(v,a){7 l=a.x;B(7 i=0;i<l;i++){q(a[i][0]==v){m W}}m F}6 1N(b,c,d,e){c.1v(e[0]).1v(e[1]);7 h=[];c.1r(6(a){q(!u.1i){h[u.1u]=$(u)}});7 l=d.x;B(7 i=0;i<l;i++){h[d[i][0]].1m(e[d[i][1]])}}6 2F(a,b){7 c=a.8;q(c.1Q){7 d=$(\'<3H>\');$("1p:1c 1M:1c 3G",a).1r(6(){d.2k($(\'<3F>\').16(\'2D\',$(u).2D()))});$(a).3D(d)}}6 2B(a,b){7 c=a.8,l=b.x;B(7 i=0;i<l;i++){7 s=b[i],o=c.1t[s[0]];o.11=s[1];o.11++}}6 1I(a,b,d){q(a.8.L){7 f=y T()}7 g="7 2A = 6(a,b) {",l=b.x;B(7 i=0;i<l;i++){7 c=b[i][0];7 h=b[i][1];7 s=(2z(a.8.1q,c)=="1b")?((h==0)?"2y":"2w"):((h==0)?"2v":"2t");7 e="e"+i;g+="7 "+e+" = "+s+"(a["+c+"],b["+c+"]); ";g+="q("+e+") { m "+e+"; } ";g+="M { "}B(7 i=0;i<l;i++){g+="}; "}g+="m 0; ";g+="}; ";3B(g);d.1k.3A(2A);q(a.8.L){1f("3z 3y "+b.3x()+" 3v 3u "+h+" 2q:",f)}m d};6 2y(a,b){m((a<b)?-1:((a>b)?1:0))};6 2w(a,b){m((b<a)?-1:((b>a)?1:0))};6 2v(a,b){m a-b};6 2t(a,b){m b-a};6 2z(a,i){m a[i].J};u.2o=6(f){m u.1r(6(){7 c,$3t,$K,R,8,3s=0,3r;u.8={};8=$.1z(u.8,$.w.2r,f);q(!u.1e||!u.13)m W;c=$(u);$K=20(u);u.8.1q=23(u,$K);R=1K(u);7 d=[8.1P,8.2s];2F(u);$K.3p(6(e){q(!u.1i){7 b=$(u);7 i=u.1u;u.1j=u.11++%2;q(!e[8.2x]){8.H=[];q(8.1y!=14){7 a=8.1y;B(7 j=0;j<a.x;j++){8.H.O(a[j])}}8.H.O([i,u.1j])}M{q(2H(i,8.H)){B(7 j=0;j<8.H.x;j++){7 s=8.H[j],o=8.1t[s[0]];q(s[0]==i){o.11=s[1];o.11++;s[1]=o.11%2}}}M{8.H.O([i,u.1j])}};1N(c[0],$K,8.H,d);1n(c[0],1I(c[0],8.H,R));m F}}).3o(6(){q(8.2I){u.3n=6(){m F};m F}});c.1C("3m",6(){R=1K(u)}).1C("2j",6(e,a){7 b=8.H=a;2B(u,b);1N(u,$K,b,d);1n(u,1I(u,b,R))}).1C("3l",6(){1n(u,R)});q($.1w&&($(u).Y()&&$(u).Y().2i)){8.H=$(u).Y().2i}q(8.H.x>0){c.3k("2j",[8.H])}1E(u)})};u.G=6(b){7 l=k.x,a=W;B(7 i=0;i<l;i++){q(k[i].C.Z()==b.C.Z()){a=F}}q(a){k.O(b)}};u.2h=6(a){12.O(a)};u.S=6(s){7 i=3j(s);m(2f(i))?0:i};u.24=6(s){7 i=3g(s);m(2f(i))?0:i}}});$.3f.1z({w:$.w.2o});$.w.G({C:"1b",I:6(s){m W},D:6(s){m $.1G(s.Z())},J:"1b"});$.w.G({C:"2c",I:6(s){m s.25(y Q(/^\\d+$/))},D:6(s){m $.w.24(s)},J:"P"});$.w.G({C:"3d",I:6(s){m/^[£$€?.]/.U(s)},D:6(s){m $.w.S(s.X(y Q(/[^0-9.]/g),""))},J:"P"});$.w.G({C:"2c",I:6(s){m/^\\d+$/.U(s)},D:6(s){m $.w.S(s)},J:"P"});$.w.G({C:"39",I:6(s){m s.25(y Q(/^(\\+|-)?[0-9]+\\.[0-9]+((E|e)(\\+|-)?[0-9]+)?$/))},D:6(s){m $.w.S(s.X(y Q(/,/),""))},J:"P"});$.w.G({C:"38",I:6(s){m/^\\d{2,3}[\\.]\\d{2,3}[\\.]\\d{2,3}[\\.]\\d{2,3}$/.U(s)},D:6(s){7 a=s.37(".");7 r="";B(7 i=0,1a;1a=a[i];i++){q(1a.x==2){r+="0"+1a}M{r+=1a}}m $.w.S(s)},J:"P"});$.w.G({C:"36",I:6(s){m/^(28?|27|2e):\\/\\/$/.U(s)},D:6(s){m 2b.1G(s.X(y Q(/(28?|27|2e):\\/\\//),\'\'))},J:"1b"});$.w.G({C:"35",I:6(s){m/^\\d{4}[\\/-]\\d{1,2}[\\/-]\\d{1,2}$/.U(s)},D:6(s){m $.w.S((s!="")?y T(s.X(y Q(/-/g),"/")).15():"0")},J:"P"});$.w.G({C:"34",I:6(s){m/^\\d{1,3}%$/.U(s)},D:6(s){m $.w.S(s.X(y Q(/%/g),""))},J:"P"});$.w.G({C:"33",I:6(s){m/^[A-31-z]{3,10}\\.?[0-9]{1,2},([0-9]{4}|\\\'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\\s(2Z|3q)))$/.U(s);\n },\n D: 6(s) {\n m $.w.S(y T(s).15());\n },\n J: "P"\n });\n \n $.w.G({\n C: "2Y",\n I: 6(s) {\n m /\\d{1,2}[\\/-]\\d{1,2}[\\/-]\\d{2,4}/.U(s);\n },\n D: 6(s,1h) {\n 7 c = 1h.8;\n s = s.X(y Q(/-/g),"/");\n q(c.1g == "2u") {\n /** 2l 22 2p 21 2n D */\n s = s.X(y Q(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{4})/), "$3/$1/$2");\n } M q(c.1g == "2W") {\n /** 2l 22 2p 21 2n D */\n s = s.X(y Q(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{4})/), "$3/$2/$1");\n } M q(c.1g == "2C/1Z/1Y" || c.1g == "2C-1Z-1Y") {\n s = s.X(y Q(/(\\d{1,2})[\\/-](\\d{1,2})[\\/-](\\d{2})/), "$1/$2/$3"); \n }\n m $.w.S(y T(s).15());\n },\n J: "P"\n });\n \n $.w.G({\n C: "2q",\n I: 6(s) {\n m /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\\s(2U|2T)))$/.U(s);\n },\n D: 6(s) {\n m $.w.S(y T("2S/1W/1W " + s).15());\n },\n J: "P"\n });\n \n \n $.w.G({\n C: "2R",\n I: 6(s) {\n m F;\n },\n D: 6(s,1h,2M) {\n 7 c = 1h.8, p = (!c.1V) ? \'2Q\':c.1V;m $(2M).Y()[p]},J:"P"});$.w.2h({C:"2P",D:6(a){$("> 1p:1c/1M:2L:1X",a).1v(a.8.19.16[1]).1m(a.8.19.16[0]);$("> 1p:1c/1M:2L:1U",a).1v(a.8.19.16[0]).1m(a.8.19.16[1])}})})(2b);',62,234,'||||||function|var|config||||||||||||||return||||if||||this||tablesorter|length|new|||for|id|format||false|addParser|sortList|is|type|headers|debug|else|rows|push|numeric|RegExp|cache|formatFloat|Date|test|cells|true|replace|data|toLowerCase||count|widgets|tBodies|null|getTime|css|sorter|log|widgetZebra|item|text|first|cols|tHead|benchmark|dateFormat|table|sortDisabled|order|normalized|textExtraction|addClass|appendToTable|typeof|tbody|parsers|each|tableHeaders|headerList|column|removeClass|meta|row|sortForce|extend|childNodes|checkCell|bind|appender|applyWidget|getElementText|trim|tableHeadersRows|multisort|checkCellColSpan|buildCache|getParserById|tr|setHeadersCss|console|cssDesc|widthFixed|checkHeaderOptions|checkHeaderMetadata|formatSortingOrder|odd|parserMetadataName|01|even|yy|mm|buildHeaders|in|the|buildParserCache|formatInt|match|undefined|ftp|https|totalRows|innerHTML|jQuery|integer|tableBody|file|isNaN|cssHeader|addWidget|sortlist|sorton|append|reformat|totalCells|ISO|construct|string|time|defaults|cssAsc|sortNumericDesc|us|sortNumeric|sortTextDesc|sortMultiSortKey|sortText|getCachedSortType|sortWrapper|updateHeaderSortCount|dd|width|detectParserForColumn|fixColumnWidth|sortInitialOrder|isValueInArray|cancelSelection|getWidgetById|rowSpan|visible|cell|colSpan|Built|zebra|sortValue|metadata|2000|pm|am|headerSortUp|uk|Rebuilt|shortDate|AM|alert|Za|empty|usLongDate|percent|isoDate|url|split|ipAddress|floating|hasChildNodes|simple|header|currency|complex|fn|parseInt|ms|Building|parseFloat|trigger|appendCache|update|onselectstart|mousedown|click|PM|sortOrder|shiftDown|document|dir|and|shiftKey|toString|on|Sorting|sort|eval|parser|prepend|asc|col|td|colgroup|desc|Number|concat|headerSortDown'.split('|'),0,{})) | ||
2496 | 15 | \ No newline at end of file | 13 | \ No newline at end of file |
2497 | 14 | (function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,cells[i]);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i];}}return parsers[0];}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));}cols.push(i);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){if(!node)return"";var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML;}else{t=node.innerHTML;}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node);}else{t=$(node).text();}}return t;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0;};$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).addClass(table.config.cssHeader);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0;}else{i=(v==(0||1))?v:0;}return i;}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function sortText(a,b){return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}$("tr:visible",table.tBodies[0]).filter(':even').removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(':odd').removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery); | ||
2498 | 16 | \ No newline at end of file | 15 | \ No newline at end of file |
2499 | 17 | 16 | ||
2500 | === removed file 'server/img/Thumbs.db' | |||
2501 | 18 | Binary files server/img/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 17 | Binary files server/img/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2502 | === removed file 'server/img/bodys/Thumbs.db' | |||
2503 | 19 | Binary files server/img/bodys/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/bodys/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 18 | Binary files server/img/bodys/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/bodys/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2504 | === removed file 'server/img/dashboard/Thumbs.db' | |||
2505 | 20 | Binary files server/img/dashboard/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/dashboard/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 19 | Binary files server/img/dashboard/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/dashboard/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2506 | === removed file 'server/img/dialogs/Thumbs.db' | |||
2507 | 21 | Binary files server/img/dialogs/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/dialogs/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 20 | Binary files server/img/dialogs/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/dialogs/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2508 | === removed file 'server/img/fades/Thumbs.db' | |||
2509 | 22 | Binary files server/img/fades/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/fades/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 21 | Binary files server/img/fades/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/fades/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2510 | === removed file 'server/img/filterform/Thumbs.db' | |||
2511 | 23 | Binary files server/img/filterform/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/filterform/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 22 | Binary files server/img/filterform/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/filterform/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2512 | === removed file 'server/img/forms/Thumbs.db' | |||
2513 | 24 | Binary files server/img/forms/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/forms/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 23 | Binary files server/img/forms/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/forms/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2514 | === removed file 'server/img/login/Thumbs.db' | |||
2515 | 25 | Binary files server/img/login/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/login/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 24 | Binary files server/img/login/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/login/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2516 | === removed file 'server/img/logos/Thumbs.db' | |||
2517 | 26 | Binary files server/img/logos/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/logos/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 25 | Binary files server/img/logos/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/logos/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2518 | === removed file 'server/img/tables/Thumbs.db' | |||
2519 | 27 | Binary files server/img/tables/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/tables/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 26 | Binary files server/img/tables/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/tables/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2520 | === removed file 'server/img/tabs/Thumbs.db' | |||
2521 | 28 | Binary files server/img/tabs/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/tabs/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 27 | Binary files server/img/tabs/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/tabs/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2522 | === removed file 'server/img/titles/Thumbs.db' | |||
2523 | 29 | Binary files server/img/titles/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/titles/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 28 | Binary files server/img/titles/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/titles/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2524 | === removed file 'server/img/weather_rss/Thumbs.db' | |||
2525 | 30 | Binary files server/img/weather_rss/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/weather_rss/Thumbs.db 1970-01-01 00:00:00 +0000 differ | 29 | Binary files server/img/weather_rss/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/weather_rss/Thumbs.db 1970-01-01 00:00:00 +0000 differ |
2526 | === added file 'server/install/database/7.sql' | |||
2527 | --- server/install/database/7.sql 1970-01-01 00:00:00 +0000 | |||
2528 | +++ server/install/database/7.sql 2009-08-08 13:39:17 +0000 | |||
2529 | @@ -0,0 +1,24 @@ | |||
2530 | 1 | |||
2531 | 2 | INSERT INTO `pages` ( | ||
2532 | 3 | `pageID` , | ||
2533 | 4 | `name` , | ||
2534 | 5 | `pagegroupID` | ||
2535 | 6 | ) | ||
2536 | 7 | VALUES ( | ||
2537 | 8 | NULL , 'stats', '9' | ||
2538 | 9 | ); | ||
2539 | 10 | |||
2540 | 11 | INSERT INTO `menuitem` (`MenuID`, `PageID`, `Args`, `Text`, `Class`, `Img`, `Sequence`) | ||
2541 | 12 | SELECT '4', pageID, NULL, 'Statistics', NULL, NULL, '9' FROM pages WHERE name = 'stats'; | ||
2542 | 13 | |||
2543 | 14 | ALTER TABLE `stat` ADD `Tag` VARCHAR( 254 ) NULL ; | ||
2544 | 15 | |||
2545 | 16 | ALTER TABLE `stat` ADD `Type` VARCHAR( 20 ) NOT NULL DEFAULT 'Media' AFTER `statID` ; | ||
2546 | 17 | |||
2547 | 18 | ALTER TABLE `stat` CHANGE `Type` `Type` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; | ||
2548 | 19 | |||
2549 | 20 | ALTER TABLE `stat` CHANGE `mediaID` `mediaID` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL; | ||
2550 | 21 | |||
2551 | 22 | UPDATE `version` SET `app_ver` = '1.0.3'; | ||
2552 | 23 | UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE'; | ||
2553 | 24 | UPDATE `version` SET `DBVersion` = '7'; | ||
2554 | 0 | 25 | ||
2555 | === modified file 'server/lib/app/app_functions.php' | |||
2556 | --- server/lib/app/app_functions.php 2009-02-21 17:52:52 +0000 | |||
2557 | +++ server/lib/app/app_functions.php 2009-07-28 21:08:19 +0000 | |||
2558 | @@ -325,105 +325,6 @@ | |||
2559 | 325 | return $hms; | 325 | return $hms; |
2560 | 326 | } | 326 | } |
2561 | 327 | 327 | ||
2562 | 328 | define('STAT_LAYOUT_START', 'LayoutStart'); | ||
2563 | 329 | define('STAT_LAYOUT_END', 'LayoutEnd'); | ||
2564 | 330 | define('STAT_MEDIA_START', 'MediaStart'); | ||
2565 | 331 | define('STAT_MEDIA_END', 'MediaEnd'); | ||
2566 | 332 | |||
2567 | 333 | /** | ||
2568 | 334 | * Records a Stat Record | ||
2569 | 335 | * @return | ||
2570 | 336 | * @param $statType Object | ||
2571 | 337 | * @param $statDate Object | ||
2572 | 338 | * @param $scheduleID Object | ||
2573 | 339 | * @param $displayID Object | ||
2574 | 340 | * @param $layoutID Object | ||
2575 | 341 | * @param $mediaID Object | ||
2576 | 342 | * @param $start Object | ||
2577 | 343 | * @param $end Object | ||
2578 | 344 | */ | ||
2579 | 345 | function StatRecord($statType, $statDate, $scheduleID, $displayID, $layoutID, $mediaID, $start, $end) | ||
2580 | 346 | { | ||
2581 | 347 | global $db; | ||
2582 | 348 | |||
2583 | 349 | $infinityDate = "2050-12-31 00:00:00"; | ||
2584 | 350 | |||
2585 | 351 | // Look up the stat type | ||
2586 | 352 | switch ($statType) | ||
2587 | 353 | { | ||
2588 | 354 | case STAT_LAYOUT_START: | ||
2589 | 355 | // If its a layout start | ||
2590 | 356 | // Check for an open Layout which has this schedule & close it | ||
2591 | 357 | $SQL = ""; | ||
2592 | 358 | $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND end = '$infinityDate' "; | ||
2593 | 359 | |||
2594 | 360 | if (!$db->query($SQL)) | ||
2595 | 361 | { | ||
2596 | 362 | trigger_error($db->error()); | ||
2597 | 363 | return false; | ||
2598 | 364 | } | ||
2599 | 365 | |||
2600 | 366 | // Insert a new stat record for this layout | ||
2601 | 367 | $SQL = ""; | ||
2602 | 368 | $SQL .= " INSERT INTO stat (statDate, scheduleID, displayID, layoutID, start, end)"; | ||
2603 | 369 | $SQL .= " VALUES ('$statDate', '$scheduleID', '$displayID', '$layoutID', '$start', '$infinityDate')"; | ||
2604 | 370 | |||
2605 | 371 | if (!$db->query($SQL)) | ||
2606 | 372 | { | ||
2607 | 373 | trigger_error($db->error()); | ||
2608 | 374 | return false; | ||
2609 | 375 | } | ||
2610 | 376 | |||
2611 | 377 | break; | ||
2612 | 378 | |||
2613 | 379 | case STAT_LAYOUT_END: | ||
2614 | 380 | // If its a layout end | ||
2615 | 381 | // Close the layout stat record for this schedule (by updating the end time) | ||
2616 | 382 | // Also close any open media records (they should all be shut anyway) | ||
2617 | 383 | $SQL = ""; | ||
2618 | 384 | $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND end = '$infinityDate' "; | ||
2619 | 385 | |||
2620 | 386 | if (!$db->query($SQL)) | ||
2621 | 387 | { | ||
2622 | 388 | trigger_error($db->error()); | ||
2623 | 389 | return false; | ||
2624 | 390 | } | ||
2625 | 391 | break; | ||
2626 | 392 | |||
2627 | 393 | case STAT_MEDIA_START: | ||
2628 | 394 | // If its a media start | ||
2629 | 395 | // Create a new media stat record for this layout | ||
2630 | 396 | $SQL = ""; | ||
2631 | 397 | $SQL .= " INSERT INTO stat (statDate, scheduleID, displayID, layoutID, mediaID, start, end)"; | ||
2632 | 398 | $SQL .= " VALUES ('$statDate', '$scheduleID', '$displayID', '$layoutID', '$mediaID', '$start', '$infinityDate')"; | ||
2633 | 399 | |||
2634 | 400 | if (!$db->query($SQL)) | ||
2635 | 401 | { | ||
2636 | 402 | trigger_error($db->error()); | ||
2637 | 403 | return false; | ||
2638 | 404 | } | ||
2639 | 405 | break; | ||
2640 | 406 | |||
2641 | 407 | case STAT_MEDIA_END: | ||
2642 | 408 | // If its a media end | ||
2643 | 409 | // Close the stat record | ||
2644 | 410 | $SQL = ""; | ||
2645 | 411 | $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND mediaID = '$mediaID' AND end = '$infinityDate' "; | ||
2646 | 412 | |||
2647 | 413 | if (!$db->query($SQL)) | ||
2648 | 414 | { | ||
2649 | 415 | trigger_error($db->error()); | ||
2650 | 416 | return false; | ||
2651 | 417 | } | ||
2652 | 418 | break; | ||
2653 | 419 | |||
2654 | 420 | default: | ||
2655 | 421 | return false; | ||
2656 | 422 | } | ||
2657 | 423 | |||
2658 | 424 | return true; | ||
2659 | 425 | } | ||
2660 | 426 | |||
2661 | 427 | /** | 328 | /** |
2662 | 428 | * Gets web safe colors | 329 | * Gets web safe colors |
2663 | 429 | * @return | 330 | * @return |
2664 | 430 | 331 | ||
2665 | === modified file 'server/lib/app/session.class.php' | |||
2666 | --- server/lib/app/session.class.php 2008-12-19 22:10:39 +0000 | |||
2667 | +++ server/lib/app/session.class.php 2009-07-07 20:01:49 +0000 | |||
2668 | @@ -29,7 +29,8 @@ | |||
2669 | 29 | 29 | ||
2670 | 30 | public $isExpired = 1; | 30 | public $isExpired = 1; |
2671 | 31 | 31 | ||
2673 | 32 | function __construct(database $db) { | 32 | function __construct(database $db) |
2674 | 33 | { | ||
2675 | 33 | $this->db =& $db; | 34 | $this->db =& $db; |
2676 | 34 | 35 | ||
2677 | 35 | session_set_save_handler(array(&$this, 'open'), | 36 | session_set_save_handler(array(&$this, 'open'), |
2678 | @@ -64,38 +65,27 @@ | |||
2679 | 64 | { | 65 | { |
2680 | 65 | $db =& $this->db; | 66 | $db =& $this->db; |
2681 | 66 | 67 | ||
2684 | 67 | $userAgent = $_SERVER['HTTP_USER_AGENT']; | 68 | $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent'); |
2685 | 68 | $remoteAddr = $_SERVER['REMOTE_ADDR']; | 69 | $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING); |
2686 | 70 | $securityToken = Kit::GetParam('SecurityToken', _POST, _STRING, null); | ||
2687 | 69 | 71 | ||
2688 | 70 | $this->key = $key; | 72 | $this->key = $key; |
2689 | 71 | $newExp = time() + $this->max_lifetime; | 73 | $newExp = time() + $this->max_lifetime; |
2690 | 72 | 74 | ||
2691 | 73 | $this->gc($this->max_lifetime); | 75 | $this->gc($this->max_lifetime); |
2692 | 74 | 76 | ||
2708 | 75 | if(isset($_POST['SecurityToken'])) | 77 | // Get this session |
2694 | 76 | { | ||
2695 | 77 | $securityToken = validate($_POST['SecurityToken']); | ||
2696 | 78 | |||
2697 | 79 | if (!$securityToken) | ||
2698 | 80 | { | ||
2699 | 81 | log_entry($db, "error", "Invalid Security Token"); | ||
2700 | 82 | $securityToken = null; | ||
2701 | 83 | } | ||
2702 | 84 | } | ||
2703 | 85 | else | ||
2704 | 86 | { | ||
2705 | 87 | $securityToken = null; | ||
2706 | 88 | } | ||
2707 | 89 | |||
2709 | 90 | $SQL = " SELECT session_data, IsExpired, SecurityToken FROM session "; | 78 | $SQL = " SELECT session_data, IsExpired, SecurityToken FROM session "; |
2714 | 91 | $SQL .= " WHERE session_id = '$key' "; | 79 | $SQL .= " WHERE session_id = '%s' "; |
2715 | 92 | $SQL .= " AND RemoteAddr = '$remoteAddr' "; | 80 | $SQL .= " AND UserAgent = '%s' "; |
2716 | 93 | 81 | ||
2717 | 94 | if (!$result = $db->query($SQL)); | 82 | $SQL = sprintf($SQL, $db->escape_string($key), $db->escape_string($userAgent)); |
2718 | 83 | |||
2719 | 84 | $result = $db->query($SQL); | ||
2720 | 95 | 85 | ||
2721 | 96 | if ($db->num_rows($result) != 0) | 86 | if ($db->num_rows($result) != 0) |
2722 | 97 | { | 87 | { |
2724 | 98 | 88 | // Get the row | |
2725 | 99 | $row = $db->get_row($result); | 89 | $row = $db->get_row($result); |
2726 | 100 | 90 | ||
2727 | 101 | // We have the Key and the Remote Address. | 91 | // We have the Key and the Remote Address. |
2728 | @@ -109,10 +99,10 @@ | |||
2729 | 109 | // We have a security token, so dont require a login | 99 | // We have a security token, so dont require a login |
2730 | 110 | $this->isExpired = 0; | 100 | $this->isExpired = 0; |
2731 | 111 | 101 | ||
2733 | 112 | if (!$db->query("UPDATE session SET session_expiration = $newExp, isExpired = 0 WHERE session_id = '$key' ")) | 102 | if (!$db->query(sprintf("UPDATE session SET session_expiration = $newExp, isExpired = 0 WHERE session_id = '%s' ", $db->escape_string($key)))) |
2734 | 113 | { | 103 | { |
2735 | 114 | log_entry($db, "error", $db->error()); | 104 | log_entry($db, "error", $db->error()); |
2737 | 115 | } | 105 | } |
2738 | 116 | } | 106 | } |
2739 | 117 | else | 107 | else |
2740 | 118 | { | 108 | { |
2741 | @@ -123,49 +113,55 @@ | |||
2742 | 123 | } | 113 | } |
2743 | 124 | 114 | ||
2744 | 125 | // Either way - update this SESSION so that the security token is NULL | 115 | // Either way - update this SESSION so that the security token is NULL |
2746 | 126 | $db->query("UPDATE session SET SecurityToken = NULL WHERE session_id = '$key' "); | 116 | $db->query(sprintf("UPDATE session SET SecurityToken = NULL WHERE session_id = '%s' ", $db->escape_string($key))); |
2747 | 127 | 117 | ||
2748 | 128 | return($row[0]); | 118 | return($row[0]); |
2749 | 129 | } | 119 | } |
2751 | 130 | else { | 120 | else |
2752 | 121 | { | ||
2753 | 131 | $empty = ''; | 122 | $empty = ''; |
2754 | 132 | return settype($empty, "string"); | 123 | return settype($empty, "string"); |
2755 | 133 | } | 124 | } |
2756 | 134 | } | 125 | } |
2757 | 135 | 126 | ||
2763 | 136 | function write($key, $val) { | 127 | function write($key, $val) |
2764 | 137 | 128 | { | |
2765 | 138 | $db =& $this->db; | 129 | $db =& $this->db; |
2761 | 139 | |||
2762 | 140 | $val = addslashes($val); | ||
2766 | 141 | 130 | ||
2767 | 142 | $newExp = time() + $this->max_lifetime; | 131 | $newExp = time() + $this->max_lifetime; |
2768 | 143 | $lastaccessed = date("Y-m-d H:i:s"); | 132 | $lastaccessed = date("Y-m-d H:i:s"); |
2771 | 144 | $userAgent = $_SERVER['HTTP_USER_AGENT']; | 133 | $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent'); |
2772 | 145 | $remoteAddr = $_SERVER['REMOTE_ADDR']; | 134 | $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING); |
2773 | 146 | 135 | ||
2775 | 147 | $result = $db->query("SELECT session_id FROM session WHERE session_id = '$key'"); | 136 | $result = $db->query(sprintf("SELECT session_id FROM session WHERE session_id = '%s'", $db->escape_string($key))); |
2776 | 148 | 137 | ||
2777 | 149 | if ($db->num_rows($result) == 0) | 138 | if ($db->num_rows($result) == 0) |
2778 | 150 | { | 139 | { |
2779 | 151 | //INSERT | 140 | //INSERT |
2780 | 152 | $SQL = "INSERT INTO session (session_id, session_data, session_expiration, LastAccessed, LastPage, userID, IsExpired, UserAgent, RemoteAddr) | 141 | $SQL = "INSERT INTO session (session_id, session_data, session_expiration, LastAccessed, LastPage, userID, IsExpired, UserAgent, RemoteAddr) |
2782 | 153 | VALUES ('$key','$val',$newExp,'$lastaccessed','login', NULL, 0, '$userAgent', '$remoteAddr')"; | 142 | VALUES ('%s', '%s', %d, '%s', 'login', NULL, 0, '%s', '%s')"; |
2783 | 143 | |||
2784 | 144 | $SQL = sprintf($SQL, $db->escape_string($key), $db->escape_string($val), $newExp, $db->escape_string($lastaccessed), $db->escape_string($userAgent), $db->escape_string($remoteAddr)); | ||
2785 | 154 | } | 145 | } |
2786 | 155 | else | 146 | else |
2787 | 156 | { | 147 | { |
2788 | 157 | //UPDATE | 148 | //UPDATE |
2789 | 158 | $SQL = "UPDATE session SET "; | 149 | $SQL = "UPDATE session SET "; |
2794 | 159 | $SQL .= " session_data = '$val', "; | 150 | $SQL .= " session_data = '%s', "; |
2795 | 160 | $SQL .= " session_expiration = '$newExp', "; | 151 | $SQL .= " session_expiration = %d, "; |
2796 | 161 | $SQL .= " lastaccessed = '$lastaccessed' "; | 152 | $SQL .= " lastaccessed = '%s', "; |
2797 | 162 | $SQL .= " WHERE session_id = '$key' "; | 153 | $SQL .= " RemoteAddr = '%s' "; |
2798 | 154 | $SQL .= " WHERE session_id = '%s' "; | ||
2799 | 155 | |||
2800 | 156 | $SQL = sprintf($SQL, $db->escape_string($val), $newExp, $db->escape_string($lastaccessed), $db->escape_string($remoteAddr), $db->escape_string($key)); | ||
2801 | 163 | } | 157 | } |
2802 | 164 | 158 | ||
2804 | 165 | if(!$db->query($SQL)) { | 159 | if(!$db->query($SQL)) |
2805 | 160 | { | ||
2806 | 166 | log_entry($db, "error", $db->error()); | 161 | log_entry($db, "error", $db->error()); |
2807 | 167 | return(false); | 162 | return(false); |
2808 | 168 | } | 163 | } |
2809 | 164 | |||
2810 | 169 | return true; | 165 | return true; |
2811 | 170 | } | 166 | } |
2812 | 171 | 167 | ||
2813 | @@ -173,7 +169,7 @@ | |||
2814 | 173 | { | 169 | { |
2815 | 174 | $db =& $this->db; | 170 | $db =& $this->db; |
2816 | 175 | 171 | ||
2818 | 176 | $SQL = "UPDATE session SET IsExpired = 1 WHERE session_id = '$key'"; | 172 | $SQL = sprintf("UPDATE session SET IsExpired = 1 WHERE session_id = '%s'", $db->escape_string($key)); |
2819 | 177 | 173 | ||
2820 | 178 | $result = $db->query("$SQL"); | 174 | $result = $db->query("$SQL"); |
2821 | 179 | 175 | ||
2822 | @@ -193,26 +189,32 @@ | |||
2823 | 193 | { | 189 | { |
2824 | 194 | $db =& $this->db; | 190 | $db =& $this->db; |
2825 | 195 | 191 | ||
2827 | 196 | $SQL = "UPDATE session SET userID = $userid WHERE session_id = '$key' "; | 192 | $SQL = sprintf("UPDATE session SET userID = %d WHERE session_id = '%s' ",$userid, $db->escape_string($key)); |
2828 | 197 | 193 | ||
2830 | 198 | if(!$db->query($SQL)) { | 194 | if(!$db->query($SQL)) |
2831 | 195 | { | ||
2832 | 199 | trigger_error($db->error(), E_USER_NOTICE); | 196 | trigger_error($db->error(), E_USER_NOTICE); |
2833 | 200 | return(false); | 197 | return(false); |
2834 | 201 | } | 198 | } |
2835 | 202 | return true; | 199 | return true; |
2836 | 203 | } | 200 | } |
2837 | 204 | 201 | ||
2840 | 205 | // Update the session (after login) | 202 | /** |
2841 | 206 | static function RegenerateSessionID() | 203 | * Updates the session ID with a new one |
2842 | 204 | * @return | ||
2843 | 205 | */ | ||
2844 | 206 | public function RegenerateSessionID($oldSessionID) | ||
2845 | 207 | { | 207 | { |
2847 | 208 | $old_sess_id = session_id(); | 208 | $db =& $this->db; |
2848 | 209 | 209 | ||
2849 | 210 | session_regenerate_id(false); | 210 | session_regenerate_id(false); |
2850 | 211 | 211 | ||
2851 | 212 | $new_sess_id = session_id(); | 212 | $new_sess_id = session_id(); |
2852 | 213 | |||
2853 | 214 | $this->key = $new_sess_id; | ||
2854 | 213 | 215 | ||
2857 | 214 | $query = "UPDATE `session` SET `session_id` = '$new_sess_id' WHERE session_id = '$old_sess_id'"; | 216 | $query = sprintf("UPDATE session SET session_id = '%s' WHERE session_id = '%s'", $db->escape_string($new_sess_id), $db->escape_string($oldSessionID)); |
2858 | 215 | mysql_query($query); | 217 | $db->query($query); |
2859 | 216 | } | 218 | } |
2860 | 217 | 219 | ||
2861 | 218 | function set_page($key, $lastpage) | 220 | function set_page($key, $lastpage) |
2862 | @@ -221,9 +223,10 @@ | |||
2863 | 221 | 223 | ||
2864 | 222 | $_SESSION['pagename'] = $lastpage; | 224 | $_SESSION['pagename'] = $lastpage; |
2865 | 223 | 225 | ||
2867 | 224 | $SQL = "UPDATE session SET LastPage = '$lastpage' WHERE session_id = '$key' "; | 226 | $SQL = sprintf("UPDATE session SET LastPage = '%s' WHERE session_id = '%s' ", $db->escape_string($lastpage), $db->escape_string($key)); |
2868 | 225 | 227 | ||
2870 | 226 | if(!$db->query($SQL)) { | 228 | if(!$db->query($SQL)) |
2871 | 229 | { | ||
2872 | 227 | trigger_error($db->error(), E_USER_NOTICE); | 230 | trigger_error($db->error(), E_USER_NOTICE); |
2873 | 228 | return(false); | 231 | return(false); |
2874 | 229 | } | 232 | } |
2875 | @@ -236,7 +239,7 @@ | |||
2876 | 236 | 239 | ||
2877 | 237 | $this->isExpired = $isExpired; | 240 | $this->isExpired = $isExpired; |
2878 | 238 | 241 | ||
2880 | 239 | $SQL = "UPDATE session SET IsExpired = $this->isExpired WHERE session_id = '$this->key'"; | 242 | $SQL = sprintf("UPDATE session SET IsExpired = $this->isExpired WHERE session_id = '%s'", $db->escape_string($this->key)); |
2881 | 240 | 243 | ||
2882 | 241 | if (!$db->query($SQL)) | 244 | if (!$db->query($SQL)) |
2883 | 242 | { | 245 | { |
2884 | @@ -248,7 +251,7 @@ | |||
2885 | 248 | { | 251 | { |
2886 | 249 | $db =& $this->db; | 252 | $db =& $this->db; |
2887 | 250 | 253 | ||
2889 | 251 | $SQL = "UPDATE session SET securityToken = '$token' WHERE session_id = '$this->key'"; | 254 | $SQL = sprintf("UPDATE session SET securityToken = '%s' WHERE session_id = '%s'", $db->escape_string($token), $db->escape_string($this->key)); |
2890 | 252 | 255 | ||
2891 | 253 | if (!$db->query($SQL)) | 256 | if (!$db->query($SQL)) |
2892 | 254 | { | 257 | { |
2893 | 255 | 258 | ||
2894 | === added file 'server/lib/data/layout.data.class.php' | |||
2895 | --- server/lib/data/layout.data.class.php 1970-01-01 00:00:00 +0000 | |||
2896 | +++ server/lib/data/layout.data.class.php 2009-07-30 23:01:31 +0000 | |||
2897 | @@ -0,0 +1,185 @@ | |||
2898 | 1 | <?php | ||
2899 | 2 | /* | ||
2900 | 3 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
2901 | 4 | * Copyright (C) 2009 Daniel Garner | ||
2902 | 5 | * | ||
2903 | 6 | * This file is part of Xibo. | ||
2904 | 7 | * | ||
2905 | 8 | * Xibo is free software: you can redistribute it and/or modify | ||
2906 | 9 | * it under the terms of the GNU Affero General Public License as published by | ||
2907 | 10 | * the Free Software Foundation, either version 3 of the License, or | ||
2908 | 11 | * any later version. | ||
2909 | 12 | * | ||
2910 | 13 | * Xibo is distributed in the hope that it will be useful, | ||
2911 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2912 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2913 | 16 | * GNU Affero General Public License for more details. | ||
2914 | 17 | * | ||
2915 | 18 | * You should have received a copy of the GNU Affero General Public License | ||
2916 | 19 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
2917 | 20 | */ | ||
2918 | 21 | defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser."); | ||
2919 | 22 | |||
2920 | 23 | class Layout extends Data | ||
2921 | 24 | { | ||
2922 | 25 | private $xml; | ||
2923 | 26 | |||
2924 | 27 | public function EditTags($layoutID, $tags) | ||
2925 | 28 | { | ||
2926 | 29 | $db =& $this->db; | ||
2927 | 30 | |||
2928 | 31 | Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'EditTags'); | ||
2929 | 32 | |||
2930 | 33 | // Make sure we get an array | ||
2931 | 34 | if(!is_array($tags)) | ||
2932 | 35 | { | ||
2933 | 36 | $this->SetError(25000, 'Must pass EditTags an array'); | ||
2934 | 37 | return false; | ||
2935 | 38 | } | ||
2936 | 39 | |||
2937 | 40 | // Set the XML | ||
2938 | 41 | if (!$this->SetXml($layoutID)) | ||
2939 | 42 | { | ||
2940 | 43 | Debug::LogEntry($db, 'audit', 'Failed to Set the layout Xml.', 'Layout', 'EditTags'); | ||
2941 | 44 | return false; | ||
2942 | 45 | } | ||
2943 | 46 | |||
2944 | 47 | Debug::LogEntry($db, 'audit', 'Got the XML from the DB. Now creating the tags.', 'Layout', 'EditTags'); | ||
2945 | 48 | |||
2946 | 49 | // Create the tags XML | ||
2947 | 50 | $tagsXml = '<tags>'; | ||
2948 | 51 | |||
2949 | 52 | foreach($tags as $tag) | ||
2950 | 53 | { | ||
2951 | 54 | $tagsXml .= sprintf('<tag>%s</tag>', $tag); | ||
2952 | 55 | } | ||
2953 | 56 | |||
2954 | 57 | $tagsXml .= '</tags>'; | ||
2955 | 58 | |||
2956 | 59 | Debug::LogEntry($db, 'audit', 'Tags XML is:' . $tagsXml, 'Layout', 'EditTags'); | ||
2957 | 60 | |||
2958 | 61 | // Load the tags XML into a document | ||
2959 | 62 | $tagsXmlDoc = new DOMDocument('1.0'); | ||
2960 | 63 | $tagsXmlDoc->loadXML($tagsXml); | ||
2961 | 64 | |||
2962 | 65 | |||
2963 | 66 | // Load the XML for this layout | ||
2964 | 67 | $xml = new DOMDocument("1.0"); | ||
2965 | 68 | $xml->loadXML($this->xml); | ||
2966 | 69 | |||
2967 | 70 | // Import the new node into this document | ||
2968 | 71 | $newTagsNode = $xml->importNode($tagsXmlDoc->documentElement, true); | ||
2969 | 72 | |||
2970 | 73 | // Xpath for an existing tags node | ||
2971 | 74 | $xpath = new DOMXPath($xml); | ||
2972 | 75 | $tagsNode = $xpath->query("//tags"); | ||
2973 | 76 | |||
2974 | 77 | // Does the tags node exist? | ||
2975 | 78 | if ($tagsNode->length < 1) | ||
2976 | 79 | { | ||
2977 | 80 | // We need to append our new node to the layout node | ||
2978 | 81 | $layoutXpath = new DOMXPath($xml); | ||
2979 | 82 | $layoutNode = $xpath->query("//layout"); | ||
2980 | 83 | $layoutNode = $layoutNode->item(0); | ||
2981 | 84 | |||
2982 | 85 | $layoutNode->appendChild($newTagsNode); | ||
2983 | 86 | } | ||
2984 | 87 | else | ||
2985 | 88 | { | ||
2986 | 89 | // We need to swap our new node with the existing one | ||
2987 | 90 | $tagsNode = $tagsNode->item(0); | ||
2988 | 91 | |||
2989 | 92 | // Replace the node | ||
2990 | 93 | $tagsNode->parentNode->replaceChild($newTagsNode, $tagsNode); | ||
2991 | 94 | } | ||
2992 | 95 | |||
2993 | 96 | // Format the output a bit nicer for Alex | ||
2994 | 97 | $xml->formatOutput = true; | ||
2995 | 98 | |||
2996 | 99 | // Convert back to XML | ||
2997 | 100 | $xml = $xml->saveXML(); | ||
2998 | 101 | |||
2999 | 102 | Debug::LogEntry($db, 'audit', $xml, 'layout', 'EditTags'); | ||
3000 | 103 | |||
3001 | 104 | // Save it | ||
3002 | 105 | if (!$this->SetLayoutXml($layoutID, $xml)) return false; | ||
3003 | 106 | |||
3004 | 107 | Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'EditTags'); | ||
3005 | 108 | |||
3006 | 109 | return true; | ||
3007 | 110 | } | ||
3008 | 111 | |||
3009 | 112 | /** | ||
3010 | 113 | * Sets the Layout XML for this layoutid | ||
3011 | 114 | * @return | ||
3012 | 115 | * @param $layoutID Object | ||
3013 | 116 | */ | ||
3014 | 117 | private function SetXml($layoutID) | ||
3015 | 118 | { | ||
3016 | 119 | if(!$this->xml = $this->GetLayoutXml($layoutID)) | ||
3017 | 120 | { | ||
3018 | 121 | return false; | ||
3019 | 122 | } | ||
3020 | 123 | |||
3021 | 124 | return true; | ||
3022 | 125 | } | ||
3023 | 126 | |||
3024 | 127 | /** | ||
3025 | 128 | * Gets the Xml for the specified layout | ||
3026 | 129 | * @return | ||
3027 | 130 | * @param $layoutid Object | ||
3028 | 131 | */ | ||
3029 | 132 | private function GetLayoutXml($layoutid) | ||
3030 | 133 | { | ||
3031 | 134 | $db =& $this->db; | ||
3032 | 135 | |||
3033 | 136 | Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'GetLayoutXml'); | ||
3034 | 137 | |||
3035 | 138 | //Get the Xml for this Layout from the DB | ||
3036 | 139 | $SQL = sprintf("SELECT xml FROM layout WHERE layoutID = %d ", $layoutid); | ||
3037 | 140 | |||
3038 | 141 | if (!$results = $db->query($SQL)) | ||
3039 | 142 | { | ||
3040 | 143 | trigger_error($db->error()); | ||
3041 | 144 | $this->SetError(25000, 'Layout does not exist.'); | ||
3042 | 145 | return false; | ||
3043 | 146 | } | ||
3044 | 147 | |||
3045 | 148 | $row = $db->get_row($results) ; | ||
3046 | 149 | |||
3047 | 150 | Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'GetLayoutXml'); | ||
3048 | 151 | |||
3049 | 152 | return $row[0]; | ||
3050 | 153 | } | ||
3051 | 154 | |||
3052 | 155 | /** | ||
3053 | 156 | * Sets the Layout Xml and writes it back to the database | ||
3054 | 157 | * @return | ||
3055 | 158 | * @param $layoutid Object | ||
3056 | 159 | * @param $xml Object | ||
3057 | 160 | */ | ||
3058 | 161 | private function SetLayoutXml($layoutid, $xml) | ||
3059 | 162 | { | ||
3060 | 163 | $db =& $this->db; | ||
3061 | 164 | |||
3062 | 165 | Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'SetLayoutXml'); | ||
3063 | 166 | |||
3064 | 167 | $xml = addslashes($xml); | ||
3065 | 168 | |||
3066 | 169 | // Write it back to the database | ||
3067 | 170 | $SQL = sprintf("UPDATE layout SET xml = '%s' WHERE layoutID = %d ", $xml, $layoutid); | ||
3068 | 171 | |||
3069 | 172 | |||
3070 | 173 | if (!$db->query($SQL)) | ||
3071 | 174 | { | ||
3072 | 175 | trigger_error($db->error()); | ||
3073 | 176 | $this->SetError(25000, 'Unable to Update Layout.'); | ||
3074 | 177 | return false; | ||
3075 | 178 | } | ||
3076 | 179 | |||
3077 | 180 | Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'SetLayoutXml'); | ||
3078 | 181 | |||
3079 | 182 | return true; | ||
3080 | 183 | } | ||
3081 | 184 | } | ||
3082 | 185 | ?> | ||
3083 | 0 | \ No newline at end of file | 186 | \ No newline at end of file |
3084 | 1 | 187 | ||
3085 | === added file 'server/lib/data/stat.data.class.php' | |||
3086 | --- server/lib/data/stat.data.class.php 1970-01-01 00:00:00 +0000 | |||
3087 | +++ server/lib/data/stat.data.class.php 2009-08-08 11:04:39 +0000 | |||
3088 | @@ -0,0 +1,74 @@ | |||
3089 | 1 | <?php | ||
3090 | 2 | /* | ||
3091 | 3 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
3092 | 4 | * Copyright (C) 2009 Daniel Garner | ||
3093 | 5 | * | ||
3094 | 6 | * This file is part of Xibo. | ||
3095 | 7 | * | ||
3096 | 8 | * Xibo is free software: you can redistribute it and/or modify | ||
3097 | 9 | * it under the terms of the GNU Affero General Public License as published by | ||
3098 | 10 | * the Free Software Foundation, either version 3 of the License, or | ||
3099 | 11 | * any later version. | ||
3100 | 12 | * | ||
3101 | 13 | * Xibo is distributed in the hope that it will be useful, | ||
3102 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3103 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3104 | 16 | * GNU Affero General Public License for more details. | ||
3105 | 17 | * | ||
3106 | 18 | * You should have received a copy of the GNU Affero General Public License | ||
3107 | 19 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
3108 | 20 | */ | ||
3109 | 21 | defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser."); | ||
3110 | 22 | |||
3111 | 23 | class Stat extends data | ||
3112 | 24 | { | ||
3113 | 25 | public function Add($type, $fromDT, $toDT, $scheduleID, $displayID, $layoutID, $mediaID, $tag) | ||
3114 | 26 | { | ||
3115 | 27 | $db =& $this->db; | ||
3116 | 28 | $statDate = date("Y-m-d H:i:s"); | ||
3117 | 29 | $SQL = ''; | ||
3118 | 30 | |||
3119 | 31 | $type = $db->escape_string($type); | ||
3120 | 32 | |||
3121 | 33 | // We should run different SQL depending on what Type we are | ||
3122 | 34 | switch ($type) | ||
3123 | 35 | { | ||
3124 | 36 | case 'Media': | ||
3125 | 37 | case 'media': | ||
3126 | 38 | $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, mediaID, start, end)"; | ||
3127 | 39 | $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s', '%s')", $type, $statDate, $scheduleID, $displayID, $layoutID, $db->escape_string($mediaID), $fromDT, $toDT); | ||
3128 | 40 | |||
3129 | 41 | break; | ||
3130 | 42 | |||
3131 | 43 | case 'Layout': | ||
3132 | 44 | case 'layout': | ||
3133 | 45 | $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, start, end)"; | ||
3134 | 46 | $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", $type, $statDate, $scheduleID, $displayID, $layoutID, $fromDT, $toDT); | ||
3135 | 47 | |||
3136 | 48 | break; | ||
3137 | 49 | |||
3138 | 50 | case 'Event': | ||
3139 | 51 | case 'event': | ||
3140 | 52 | |||
3141 | 53 | $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, start, end, Tag)"; | ||
3142 | 54 | $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s', '%s')", $type, $statDate, $scheduleID, $displayID, 0, $fromDT, $toDT, $db->escape_string($tag)); | ||
3143 | 55 | |||
3144 | 56 | break; | ||
3145 | 57 | |||
3146 | 58 | default: | ||
3147 | 59 | // Nothing to do, just exit | ||
3148 | 60 | return true; | ||
3149 | 61 | } | ||
3150 | 62 | |||
3151 | 63 | // We only get here if we have some SQL to run | ||
3152 | 64 | if (!$db->query($SQL)) | ||
3153 | 65 | { | ||
3154 | 66 | trigger_error($db->error()); | ||
3155 | 67 | $this->SetError(25000, 'Stat Insert Failed.'); | ||
3156 | 68 | return false; | ||
3157 | 69 | } | ||
3158 | 70 | |||
3159 | 71 | return true; | ||
3160 | 72 | } | ||
3161 | 73 | } | ||
3162 | 74 | ?> | ||
3163 | 0 | \ No newline at end of file | 75 | \ No newline at end of file |
3164 | 1 | 76 | ||
3165 | === modified file 'server/lib/modules/module.class.php' | |||
3166 | --- server/lib/modules/module.class.php 2009-04-27 19:28:08 +0000 | |||
3167 | +++ server/lib/modules/module.class.php 2009-08-03 10:54:29 +0000 | |||
3168 | @@ -61,7 +61,7 @@ | |||
3169 | 61 | $this->user =& $user; | 61 | $this->user =& $user; |
3170 | 62 | 62 | ||
3171 | 63 | $this->mediaid = $mediaid; | 63 | $this->mediaid = $mediaid; |
3173 | 64 | $this->name = ""; | 64 | $this->name = ''; |
3174 | 65 | $this->layoutid = $layoutid; | 65 | $this->layoutid = $layoutid; |
3175 | 66 | $this->regionid = $regionid; | 66 | $this->regionid = $regionid; |
3176 | 67 | 67 | ||
3177 | @@ -175,7 +175,7 @@ | |||
3178 | 175 | } | 175 | } |
3179 | 176 | else | 176 | else |
3180 | 177 | { | 177 | { |
3182 | 178 | if ($this->mediaid != '') | 178 | if ($this->mediaid != '' && $this->regionSpecific == 0) |
3183 | 179 | { | 179 | { |
3184 | 180 | // We do not have a region or a layout | 180 | // We do not have a region or a layout |
3185 | 181 | // But this is some existing media | 181 | // But this is some existing media |
3186 | @@ -183,7 +183,9 @@ | |||
3187 | 183 | $this->existingMedia = true; | 183 | $this->existingMedia = true; |
3188 | 184 | 184 | ||
3189 | 185 | // Load what we know about this media into the object | 185 | // Load what we know about this media into the object |
3191 | 186 | $SQL = "SELECT duration,name FROM media WHERE mediaID = '$mediaid'"; | 186 | $SQL = "SELECT duration, name FROM media WHERE mediaID = '$mediaid'"; |
3192 | 187 | |||
3193 | 188 | Debug::LogEntry($db, 'audit', $SQL, 'Module', 'SetMediaInformation'); | ||
3194 | 187 | 189 | ||
3195 | 188 | if (!$result = $db->query($SQL)) | 190 | if (!$result = $db->query($SQL)) |
3196 | 189 | { | 191 | { |
3197 | @@ -194,7 +196,7 @@ | |||
3198 | 194 | { | 196 | { |
3199 | 195 | $row = $db->get_row($result); | 197 | $row = $db->get_row($result); |
3200 | 196 | $this->duration = $row[0]; | 198 | $this->duration = $row[0]; |
3202 | 197 | $this->name = $row[1]; | 199 | $this->name = $row[1]; |
3203 | 198 | } | 200 | } |
3204 | 199 | } | 201 | } |
3205 | 200 | 202 | ||
3206 | @@ -262,7 +264,10 @@ | |||
3207 | 262 | */ | 264 | */ |
3208 | 263 | final protected function SetOption($name, $value) | 265 | final protected function SetOption($name, $value) |
3209 | 264 | { | 266 | { |
3211 | 265 | if ($name == '' || $value == '') return; | 267 | $db =& $this->db; |
3212 | 268 | if ($name == '') return; | ||
3213 | 269 | |||
3214 | 270 | Debug::LogEntry($db, 'audit', sprintf('IN with Name=%s and value=%s', $name, $value), 'module', 'Set Option'); | ||
3215 | 266 | 271 | ||
3216 | 267 | // Get the options node from this document | 272 | // Get the options node from this document |
3217 | 268 | $optionNodes = $this->xml->getElementsByTagName('options'); | 273 | $optionNodes = $this->xml->getElementsByTagName('options'); |
3218 | @@ -272,6 +277,7 @@ | |||
3219 | 272 | // Create a new option node | 277 | // Create a new option node |
3220 | 273 | $newNode = $this->xml->createElement($name, $value); | 278 | $newNode = $this->xml->createElement($name, $value); |
3221 | 274 | 279 | ||
3222 | 280 | Debug::LogEntry($db, 'audit', sprintf('Created a new Option Node with Name=%s and value=%s', $name, $value), 'module', 'Set Option'); | ||
3223 | 275 | 281 | ||
3224 | 276 | // Check to see if we already have this option or not | 282 | // Check to see if we already have this option or not |
3225 | 277 | $xpath = new DOMXPath($this->xml); | 283 | $xpath = new DOMXPath($this->xml); |
3226 | @@ -535,8 +541,11 @@ | |||
3227 | 535 | */ | 541 | */ |
3228 | 536 | public function GetName() | 542 | public function GetName() |
3229 | 537 | { | 543 | { |
3230 | 544 | $db =& $this->db; | ||
3231 | 545 | |||
3232 | 546 | Debug::LogEntry($db, 'audit', sprintf('Module name returned for MediaID: %s is %s', $this->mediaid, $this->name), 'Module', 'GetName'); | ||
3233 | 547 | |||
3234 | 538 | return $this->name; | 548 | return $this->name; |
3235 | 539 | } | 549 | } |
3236 | 540 | |||
3237 | 541 | } | 550 | } |
3238 | 542 | ?> | 551 | ?> |
3239 | 543 | 552 | ||
3240 | === modified file 'server/lib/pages/layout.class.php' | |||
3241 | --- server/lib/pages/layout.class.php 2009-06-20 12:00:21 +0000 | |||
3242 | +++ server/lib/pages/layout.class.php 2009-08-03 10:54:29 +0000 | |||
3243 | @@ -57,6 +57,9 @@ | |||
3244 | 57 | $ajax = Kit::GetParam('ajax', _GET, _WORD, 'false'); | 57 | $ajax = Kit::GetParam('ajax', _GET, _WORD, 'false'); |
3245 | 58 | 58 | ||
3246 | 59 | $this->layoutid = Kit::GetParam('layoutid', _REQUEST, _INT); | 59 | $this->layoutid = Kit::GetParam('layoutid', _REQUEST, _INT); |
3247 | 60 | |||
3248 | 61 | // Include the layout data class | ||
3249 | 62 | include_once("lib/data/layout.data.class.php"); | ||
3250 | 60 | 63 | ||
3251 | 61 | //set the information that we know | 64 | //set the information that we know |
3252 | 62 | if ($usertype == 1) $this->isadmin = true; | 65 | if ($usertype == 1) $this->isadmin = true; |
3253 | @@ -289,6 +292,18 @@ | |||
3254 | 289 | $response->SetError("Unknown error adding layout."); | 292 | $response->SetError("Unknown error adding layout."); |
3255 | 290 | $response->Respond(); | 293 | $response->Respond(); |
3256 | 291 | } | 294 | } |
3257 | 295 | |||
3258 | 296 | // Create an array out of the tags | ||
3259 | 297 | $tagsArray = split(' ', $tags); | ||
3260 | 298 | |||
3261 | 299 | // Add the tags XML to the layout | ||
3262 | 300 | $layoutObject = new Layout($db); | ||
3263 | 301 | |||
3264 | 302 | if (!$layoutObject->EditTags($id, $tagsArray)) | ||
3265 | 303 | { | ||
3266 | 304 | //there was an ERROR | ||
3267 | 305 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); | ||
3268 | 306 | } | ||
3269 | 292 | 307 | ||
3270 | 293 | $response->SetFormSubmitResponse('Layout Details Changed.', true, sprintf("index.php?p=layout&layoutid=%d&modify=true", $id)); | 308 | $response->SetFormSubmitResponse('Layout Details Changed.', true, sprintf("index.php?p=layout&layoutid=%d&modify=true", $id)); |
3271 | 294 | $response->Respond(); | 309 | $response->Respond(); |
3272 | @@ -399,6 +414,18 @@ | |||
3273 | 399 | $response->SetError(sprintf("Unknown error editing %s", $layout)); | 414 | $response->SetError(sprintf("Unknown error editing %s", $layout)); |
3274 | 400 | $response->Respond(); | 415 | $response->Respond(); |
3275 | 401 | } | 416 | } |
3276 | 417 | |||
3277 | 418 | // Create an array out of the tags | ||
3278 | 419 | $tagsArray = split(' ', $tags); | ||
3279 | 420 | |||
3280 | 421 | // Add the tags XML to the layout | ||
3281 | 422 | $layoutObject = new Layout($db); | ||
3282 | 423 | |||
3283 | 424 | if (!$layoutObject->EditTags($this->layoutid, $tagsArray)) | ||
3284 | 425 | { | ||
3285 | 426 | //there was an ERROR | ||
3286 | 427 | trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR); | ||
3287 | 428 | } | ||
3288 | 402 | 429 | ||
3289 | 403 | $response->SetFormSubmitResponse('Layout Details Changed.'); | 430 | $response->SetFormSubmitResponse('Layout Details Changed.'); |
3290 | 404 | $response->Respond(); | 431 | $response->Respond(); |
3291 | @@ -1320,18 +1347,22 @@ | |||
3292 | 1320 | $count++; | 1347 | $count++; |
3293 | 1321 | 1348 | ||
3294 | 1322 | //Build up a button with position information | 1349 | //Build up a button with position information |
3295 | 1350 | $mediaName = ''; | ||
3296 | 1351 | $mediaType = ''; | ||
3297 | 1323 | $mediaid = $mediaNode->getAttribute('id'); | 1352 | $mediaid = $mediaNode->getAttribute('id'); |
3298 | 1324 | $lkid = $mediaNode->getAttribute('lkid'); | 1353 | $lkid = $mediaNode->getAttribute('lkid'); |
3299 | 1325 | $mediaType = $mediaNode->getAttribute('type'); | 1354 | $mediaType = $mediaNode->getAttribute('type'); |
3300 | 1326 | $mediaFileName = $mediaNode->getAttribute('filename'); | 1355 | $mediaFileName = $mediaNode->getAttribute('filename'); |
3301 | 1327 | $mediaDuration = $mediaNode->getAttribute('duration'); | 1356 | $mediaDuration = $mediaNode->getAttribute('duration'); |
3302 | 1328 | 1357 | ||
3304 | 1329 | //Get media name | 1358 | // Get media name |
3305 | 1330 | require_once("modules/$mediaType.module.php"); | 1359 | require_once("modules/$mediaType.module.php"); |
3306 | 1331 | 1360 | ||
3307 | 1332 | // Create the media object without any region and layout information | 1361 | // Create the media object without any region and layout information |
3310 | 1333 | $tmpModule = new $mediaType($db, $user, $mediaid); | 1362 | $tmpModule = new $mediaType($db, $user, $mediaid); |
3311 | 1334 | $mediaName = $tmpModule->GetName(); | 1363 | $mediaName = $tmpModule->GetName(); |
3312 | 1364 | |||
3313 | 1365 | Debug::LogEntry($db, 'audit', sprintf('Module name returned for MediaID: %s is %s', $mediaid, $mediaName), 'layout', 'RegionOptions'); | ||
3314 | 1335 | 1366 | ||
3315 | 1336 | //Do we have a thumbnail for this media? | 1367 | //Do we have a thumbnail for this media? |
3316 | 1337 | if ($mediaType == "image" && file_exists($libraryLocation."tn_$mediaFileName")) | 1368 | if ($mediaType == "image" && file_exists($libraryLocation."tn_$mediaFileName")) |
3317 | 1338 | 1369 | ||
3318 | === modified file 'server/lib/pages/region.class.php' | |||
3319 | --- server/lib/pages/region.class.php 2009-01-23 19:29:48 +0000 | |||
3320 | +++ server/lib/pages/region.class.php 2009-07-30 23:01:31 +0000 | |||
3321 | @@ -404,7 +404,7 @@ | |||
3322 | 404 | $mediaNodeList = $xpath->query("//region[@id='$regionid']/media[@lkid='$lkid']"); | 404 | $mediaNodeList = $xpath->query("//region[@id='$regionid']/media[@lkid='$lkid']"); |
3323 | 405 | } | 405 | } |
3324 | 406 | 406 | ||
3326 | 407 | //Get the old media node (the one we are to replace) | 407 | // Get the old media node (the one we are to replace) |
3327 | 408 | $oldMediaNode = $mediaNodeList->item(0); | 408 | $oldMediaNode = $mediaNodeList->item(0); |
3328 | 409 | 409 | ||
3329 | 410 | //Get the LkId of the current record... if its not blank we want to update this link with the new id | 410 | //Get the LkId of the current record... if its not blank we want to update this link with the new id |
3330 | 411 | 411 | ||
3331 | === modified file 'server/lib/pages/report.class.php' | |||
3332 | --- server/lib/pages/report.class.php 2009-03-13 10:10:07 +0000 | |||
3333 | +++ server/lib/pages/report.class.php 2009-08-03 10:54:29 +0000 | |||
3334 | @@ -210,9 +210,7 @@ | |||
3335 | 210 | <td>$ip</td> | 210 | <td>$ip</td> |
3336 | 211 | <td>$browser</td> | 211 | <td>$browser</td> |
3337 | 212 | <td> | 212 | <td> |
3341 | 213 | <div class="buttons"> | 213 | <button class="XiboFormButton" href="index.php?p=report&q=ConfirmLogout&userid=$userID"><span>Logout</span></a> |
3339 | 214 | <a class="neutral" href="index.php?p=report&q=ConfirmLogout&userid=$userID" onclick="return init_button(this,'Logout User', exec_filter_callback, set_form_size(450,150))"><span>Logout</span></a> | ||
3340 | 215 | </div> | ||
3342 | 216 | </td> | 214 | </td> |
3343 | 217 | </tr> | 215 | </tr> |
3344 | 218 | END; | 216 | END; |
3345 | @@ -234,14 +232,15 @@ | |||
3346 | 234 | $userID = Kit::GetParam('userid', _GET, _INT); | 232 | $userID = Kit::GetParam('userid', _GET, _INT); |
3347 | 235 | 233 | ||
3348 | 236 | $form = <<<END | 234 | $form = <<<END |
3350 | 237 | <form class="dialog_form" method="post" action="index.php?p=report&q=LogoutUser"> | 235 | <form class="XiboForm" method="post" action="index.php?p=report&q=LogoutUser"> |
3351 | 238 | <input type="hidden" name="userid" value="userid" /> | 236 | <input type="hidden" name="userid" value="userid" /> |
3352 | 239 | <p>Are you sure you want to logout this user?</p> | 237 | <p>Are you sure you want to logout this user?</p> |
3353 | 240 | <input type="submit" value="Yes"> | 238 | <input type="submit" value="Yes"> |
3354 | 241 | <input type="submit" value="No" onclick="$('#div_dialog').dialog('close');return false; "> | 239 | <input type="submit" value="No" onclick="$('#div_dialog').dialog('close');return false; "> |
3355 | 242 | </form> | 240 | </form> |
3356 | 243 | END; | 241 | END; |
3358 | 244 | $arh->SetFormSubmitResponse($form); | 242 | |
3359 | 243 | $arh->SetFormRequestResponse($form, 'Logout User', '450px', '300px'); | ||
3360 | 245 | $arh->Respond(); | 244 | $arh->Respond(); |
3361 | 246 | } | 245 | } |
3362 | 247 | 246 | ||
3363 | @@ -424,6 +423,7 @@ | |||
3364 | 424 | $output .= '</tbody></table></div>'; | 423 | $output .= '</tbody></table></div>'; |
3365 | 425 | 424 | ||
3366 | 426 | $response->SetGridResponse($output); | 425 | $response->SetGridResponse($output); |
3367 | 426 | $response->sortable = false; | ||
3368 | 427 | $response->Respond(); | 427 | $response->Respond(); |
3369 | 428 | } | 428 | } |
3370 | 429 | 429 | ||
3371 | 430 | 430 | ||
3372 | === added file 'server/lib/pages/stats.class.php' | |||
3373 | --- server/lib/pages/stats.class.php 1970-01-01 00:00:00 +0000 | |||
3374 | +++ server/lib/pages/stats.class.php 2009-08-08 11:04:39 +0000 | |||
3375 | @@ -0,0 +1,152 @@ | |||
3376 | 1 | <?php | ||
3377 | 2 | /* | ||
3378 | 3 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
3379 | 4 | * Copyright (C) 2009 Daniel Garner | ||
3380 | 5 | * | ||
3381 | 6 | * This file is part of Xibo. | ||
3382 | 7 | * | ||
3383 | 8 | * Xibo is free software: you can redistribute it and/or modify | ||
3384 | 9 | * it under the terms of the GNU Affero General Public License as published by | ||
3385 | 10 | * the Free Software Foundation, either version 3 of the License, or | ||
3386 | 11 | * any later version. | ||
3387 | 12 | * | ||
3388 | 13 | * Xibo is distributed in the hope that it will be useful, | ||
3389 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3390 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3391 | 16 | * GNU Affero General Public License for more details. | ||
3392 | 17 | * | ||
3393 | 18 | * You should have received a copy of the GNU Affero General Public License | ||
3394 | 19 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
3395 | 20 | */ | ||
3396 | 21 | defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser."); | ||
3397 | 22 | |||
3398 | 23 | class statsDAO | ||
3399 | 24 | { | ||
3400 | 25 | private $db; | ||
3401 | 26 | private $user; | ||
3402 | 27 | |||
3403 | 28 | function __construct(database $db, user $user) | ||
3404 | 29 | { | ||
3405 | 30 | $this->db =& $db; | ||
3406 | 31 | $this->user =& $user; | ||
3407 | 32 | } | ||
3408 | 33 | |||
3409 | 34 | function displayPage() | ||
3410 | 35 | { | ||
3411 | 36 | |||
3412 | 37 | include("template/pages/stats_view.php"); | ||
3413 | 38 | |||
3414 | 39 | return false; | ||
3415 | 40 | } | ||
3416 | 41 | |||
3417 | 42 | function on_page_load() | ||
3418 | 43 | { | ||
3419 | 44 | return ''; | ||
3420 | 45 | } | ||
3421 | 46 | |||
3422 | 47 | function echo_page_heading() | ||
3423 | 48 | { | ||
3424 | 49 | echo 'Display Statistics'; | ||
3425 | 50 | return true; | ||
3426 | 51 | } | ||
3427 | 52 | |||
3428 | 53 | public function StatsForm() | ||
3429 | 54 | { | ||
3430 | 55 | $db =& $this->db; | ||
3431 | 56 | $user =& $this->user; | ||
3432 | 57 | $output = ''; | ||
3433 | 58 | |||
3434 | 59 | $fromdt = date("Y-m-d H:i:s", time() - 86400); | ||
3435 | 60 | $todt = date("Y-m-d H:i:s"); | ||
3436 | 61 | $display_list = dropdownlist("SELECT 'All', 'All' UNION SELECT displayID, display FROM display WHERE licensed = 1 ORDER BY 2", "displayid"); | ||
3437 | 62 | |||
3438 | 63 | // We want to build a form which will sit on the page and allow a button press to generate a CSV file. | ||
3439 | 64 | $output .= '<script type="text/javascript">$(document).onload(function(){$(".date-pick").datepicker({dateFormat: "dd/mm/yy"})});</script>'; | ||
3440 | 65 | $output .= '<form action="index.php?p=stats&q=OutputCSV" method="post">'; | ||
3441 | 66 | $output .= ' <table>'; | ||
3442 | 67 | $output .= ' <tr>'; | ||
3443 | 68 | $output .= ' <td>From Date</td>'; | ||
3444 | 69 | $output .= ' <td><input type="text" class="date-pick" name="fromdt" value="' . $fromdt . '"/></td>'; | ||
3445 | 70 | $output .= ' <td>To Date</td>'; | ||
3446 | 71 | $output .= ' <td><input type="text" class="date-pick" name="todt" value="' . $todt . '" /></td>'; | ||
3447 | 72 | $output .= ' </tr>'; | ||
3448 | 73 | $output .= ' <tr>'; | ||
3449 | 74 | $output .= ' <td>Display</td>'; | ||
3450 | 75 | $output .= ' <td>' . $display_list . '</td>'; | ||
3451 | 76 | $output .= ' </tr>'; | ||
3452 | 77 | |||
3453 | 78 | $output .= ' <tr>'; | ||
3454 | 79 | $output .= ' <td><input type="submit" value="Export" /></td>'; | ||
3455 | 80 | $output .= ' </tr>'; | ||
3456 | 81 | $output .= ' </table>'; | ||
3457 | 82 | $output .= '</form>'; | ||
3458 | 83 | |||
3459 | 84 | echo $output; | ||
3460 | 85 | } | ||
3461 | 86 | |||
3462 | 87 | /** | ||
3463 | 88 | * Outputs a CSV of stats | ||
3464 | 89 | * @return | ||
3465 | 90 | */ | ||
3466 | 91 | public function OutputCSV() | ||
3467 | 92 | { | ||
3468 | 93 | $db =& $this->db; | ||
3469 | 94 | $output = ''; | ||
3470 | 95 | |||
3471 | 96 | // We are expecting some parameters | ||
3472 | 97 | $fromdt = Kit::GetParam('fromdt', _POST, _STRING); | ||
3473 | 98 | $todt = Kit::GetParam('todt', _POST, _STRING); | ||
3474 | 99 | $displayID = Kit::GetParam('displayid', _POST, _INT); | ||
3475 | 100 | |||
3476 | 101 | // We want to output a load of stuff to the browser as a text file. | ||
3477 | 102 | header('Content-Type: text/csv'); | ||
3478 | 103 | header('Content-Disposition: attachment; filename="stats.csv"'); | ||
3479 | 104 | header("Content-Transfer-Encoding: binary"); | ||
3480 | 105 | header('Accept-Ranges: bytes'); | ||
3481 | 106 | |||
3482 | 107 | $SQL = 'SELECT stat.*, display.Display, layout.Layout, media.Name AS MediaName '; | ||
3483 | 108 | $SQL .= ' FROM stat '; | ||
3484 | 109 | $SQL .= ' INNER JOIN display ON stat.DisplayID = display.DisplayID '; | ||
3485 | 110 | $SQL .= ' INNER JOIN layout ON layout.LayoutID = stat.LayoutID '; | ||
3486 | 111 | $SQL .= ' LEFT OUTER JOIN media ON media.mediaID = stat.mediaID '; | ||
3487 | 112 | $SQL .= ' WHERE 1=1 '; | ||
3488 | 113 | $SQL .= sprintf(" AND stat.end > '%s' ", $fromdt); | ||
3489 | 114 | $SQL .= sprintf(" AND stat.start <= '%s' ", $todt); | ||
3490 | 115 | |||
3491 | 116 | if ($displayID != 0) | ||
3492 | 117 | { | ||
3493 | 118 | $SQL .= sprintf(" AND stat.displayID = %d ", $displayID); | ||
3494 | 119 | } | ||
3495 | 120 | |||
3496 | 121 | Debug::LogEntry($db, 'audit', $SQL, 'Stats', 'OutputCSV'); | ||
3497 | 122 | |||
3498 | 123 | if (!$result = $db->query($SQL)) | ||
3499 | 124 | { | ||
3500 | 125 | trigger_error($db->error()); | ||
3501 | 126 | trigger_error('Failed to query for Stats.', E_USER_ERROR); | ||
3502 | 127 | } | ||
3503 | 128 | |||
3504 | 129 | // Header row | ||
3505 | 130 | $output .= "Type, FromDT, ToDT, Layout, Display, Media, Tag\n"; | ||
3506 | 131 | |||
3507 | 132 | while($row = $db->get_assoc_row($result)) | ||
3508 | 133 | { | ||
3509 | 134 | // Read the columns | ||
3510 | 135 | $type = Kit::ValidateParam($row['type'], _STRING); | ||
3511 | 136 | $fromdt = Kit::ValidateParam($row['start'], _STRING); | ||
3512 | 137 | $todt = Kit::ValidateParam($row['end'], _STRING); | ||
3513 | 138 | $layout = Kit::ValidateParam($row['Layout'], _STRING); | ||
3514 | 139 | $display = Kit::ValidateParam($row['Display'], _STRING); | ||
3515 | 140 | $media = Kit::ValidateParam($row['MediaName'], _STRING); | ||
3516 | 141 | $tag = Kit::ValidateParam($row['Tag'], _STRING); | ||
3517 | 142 | |||
3518 | 143 | $output .= "$type, $fromdt, $todt, $layout, $display, $media, $tag\n"; | ||
3519 | 144 | } | ||
3520 | 145 | |||
3521 | 146 | //Debug::LogEntry($db, 'audit', 'Output: ' . $output, 'Stats', 'OutputCSV'); | ||
3522 | 147 | |||
3523 | 148 | echo $output; | ||
3524 | 149 | exit; | ||
3525 | 150 | } | ||
3526 | 151 | } | ||
3527 | 152 | ?> | ||
3528 | 0 | \ No newline at end of file | 153 | \ No newline at end of file |
3529 | 1 | 154 | ||
3530 | === modified file 'server/lib/xmds.inc.php' | |||
3531 | --- server/lib/xmds.inc.php 2009-03-22 12:06:30 +0000 | |||
3532 | +++ server/lib/xmds.inc.php 2009-07-28 21:08:19 +0000 | |||
3533 | @@ -27,9 +27,9 @@ | |||
3534 | 27 | require_once("lib/app/app_functions.php"); | 27 | require_once("lib/app/app_functions.php"); |
3535 | 28 | require_once("lib/app/debug.class.php"); | 28 | require_once("lib/app/debug.class.php"); |
3536 | 29 | require_once("lib/app/kit.class.php"); | 29 | require_once("lib/app/kit.class.php"); |
3538 | 30 | 30 | require_once("lib/data/data.class.php"); | |
3539 | 31 | require_once("config/db_config.php"); | 31 | require_once("config/db_config.php"); |
3540 | 32 | require_once("config/config.class.php"); | ||
3541 | 33 | 32 | ||
3542 | 33 | require_once("config/config.class.php"); | ||
3543 | 34 | include_once('lib/data/stat.data.class.php'); | 34 | include_once('lib/data/stat.data.class.php'); |
3544 | 35 | 35 | ||
3545 | 36 | // Sort out magic quotes | 36 | // Sort out magic quotes |
3546 | 37 | if (get_magic_quotes_gpc()) | 37 | if (get_magic_quotes_gpc()) |
3547 | 38 | 38 | ||
3548 | === modified file 'server/modules/embedded.module.php' | |||
3549 | --- server/modules/embedded.module.php 2009-06-20 10:05:53 +0000 | |||
3550 | +++ server/modules/embedded.module.php 2009-08-03 12:10:12 +0000 | |||
3551 | @@ -52,12 +52,29 @@ | |||
3552 | 52 | <table> | 52 | <table> |
3553 | 53 | <tr> | 53 | <tr> |
3554 | 54 | <td><label for="duration" title="The duration in seconds this webpage should be displayed">Duration<span class="required">*</span></label></td> | 54 | <td><label for="duration" title="The duration in seconds this webpage should be displayed">Duration<span class="required">*</span></label></td> |
3556 | 55 | <td><input id="duration" name="duration" type="text"></td> | 55 | <td><input id="duration" name="duration" type="text"></td> |
3557 | 56 | </tr> | 56 | </tr> |
3558 | 57 | <tr> | 57 | <tr> |
3559 | 58 | <td colspan="2"> | 58 | <td colspan="2"> |
3560 | 59 | <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br /> | 59 | <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br /> |
3562 | 60 | <textarea id="embedHtml" name="embedHtml"></textarea> | 60 | <textarea id="embedHtml" name="embedHtml"> |
3563 | 61 | |||
3564 | 62 | </textarea> | ||
3565 | 63 | </td> | ||
3566 | 64 | </tr> | ||
3567 | 65 | <tr> | ||
3568 | 66 | <td colspan="2"> | ||
3569 | 67 | <label for="embedScript" title="The JavaScript you want to Embed in this Layout.">Embed Script<span class="required">*</span></label><br /> | ||
3570 | 68 | <textarea id="embedScript" name="embedScript"> | ||
3571 | 69 | <script type="text/javascript"> | ||
3572 | 70 | function EmbedInit() | ||
3573 | 71 | { | ||
3574 | 72 | // Init will be called when this page is loaded in the client. | ||
3575 | 73 | |||
3576 | 74 | return; | ||
3577 | 75 | } | ||
3578 | 76 | </script> | ||
3579 | 77 | </textarea> | ||
3580 | 61 | </td> | 78 | </td> |
3581 | 62 | </tr> | 79 | </tr> |
3582 | 63 | <tr> | 80 | <tr> |
3583 | @@ -103,6 +120,10 @@ | |||
3584 | 103 | $textNode = $textNodes->item(0); | 120 | $textNode = $textNodes->item(0); |
3585 | 104 | $embedHtml = $textNode->nodeValue; | 121 | $embedHtml = $textNode->nodeValue; |
3586 | 105 | 122 | ||
3587 | 123 | $textNodes = $rawXml->getElementsByTagName('embedScript'); | ||
3588 | 124 | $textNode = $textNodes->item(0); | ||
3589 | 125 | $embedScript= $textNode->nodeValue; | ||
3590 | 126 | |||
3591 | 106 | //Output the form | 127 | //Output the form |
3592 | 107 | $form = <<<FORM | 128 | $form = <<<FORM |
3593 | 108 | <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia"> | 129 | <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia"> |
3594 | @@ -121,6 +142,12 @@ | |||
3595 | 121 | </td> | 142 | </td> |
3596 | 122 | </tr> | 143 | </tr> |
3597 | 123 | <tr> | 144 | <tr> |
3598 | 145 | <td colspan="2"> | ||
3599 | 146 | <label for="embedScript" title="The JavaScript you want to Embed in this Layout.">Embed Script<span class="required">*</span></label><br /> | ||
3600 | 147 | <textarea id="embedScript" name="embedScript">$embedScript</textarea> | ||
3601 | 148 | </td> | ||
3602 | 149 | </tr> | ||
3603 | 150 | <tr> | ||
3604 | 124 | <td></td> | 151 | <td></td> |
3605 | 125 | <td> | 152 | <td> |
3606 | 126 | <input id="btnSave" type="submit" value="Save" /> | 153 | <input id="btnSave" type="submit" value="Save" /> |
3607 | @@ -154,6 +181,7 @@ | |||
3608 | 154 | 181 | ||
3609 | 155 | //Other properties | 182 | //Other properties |
3610 | 156 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); | 183 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); |
3611 | 184 | $embedScript = Kit::GetParam('embedScript', _POST, _HTMLSTRING); | ||
3612 | 157 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | 185 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
3613 | 158 | 186 | ||
3614 | 159 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | 187 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
3615 | @@ -178,7 +206,7 @@ | |||
3616 | 178 | $this->duration = $duration; | 206 | $this->duration = $duration; |
3617 | 179 | 207 | ||
3618 | 180 | // Any Options | 208 | // Any Options |
3620 | 181 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>'); | 209 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml><embedScript><![CDATA[' . $embedScript . ']]></embedScript>'); |
3621 | 182 | 210 | ||
3622 | 183 | // Should have built the media object entirely by this time | 211 | // Should have built the media object entirely by this time |
3623 | 184 | // This saves the Media Object to the Region | 212 | // This saves the Media Object to the Region |
3624 | @@ -208,11 +236,12 @@ | |||
3625 | 208 | 236 | ||
3626 | 209 | //Other properties | 237 | //Other properties |
3627 | 210 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); | 238 | $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING); |
3628 | 239 | $embedScript = Kit::GetParam('embedScript', _POST, _HTMLSTRING); | ||
3629 | 211 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | 240 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
3630 | 212 | 241 | ||
3631 | 213 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | 242 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
3632 | 214 | 243 | ||
3634 | 215 | //Validate the URL? | 244 | // Validate the URL? |
3635 | 216 | if ($embedHtml == "") | 245 | if ($embedHtml == "") |
3636 | 217 | { | 246 | { |
3637 | 218 | $this->response->SetError('Please enter some HTML to embed.'); | 247 | $this->response->SetError('Please enter some HTML to embed.'); |
3638 | @@ -231,7 +260,7 @@ | |||
3639 | 231 | $this->duration = $duration; | 260 | $this->duration = $duration; |
3640 | 232 | 261 | ||
3641 | 233 | // Any Options | 262 | // Any Options |
3643 | 234 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>'); | 263 | $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml><embedScript><![CDATA[' . $embedScript . ']]></embedScript>'); |
3644 | 235 | 264 | ||
3645 | 236 | // Should have built the media object entirely by this time | 265 | // Should have built the media object entirely by this time |
3646 | 237 | // This saves the Media Object to the Region | 266 | // This saves the Media Object to the Region |
3647 | 238 | 267 | ||
3648 | === modified file 'server/modules/flash.module.php' | |||
3649 | --- server/modules/flash.module.php 2009-05-24 09:59:49 +0000 | |||
3650 | +++ server/modules/flash.module.php 2009-06-28 10:47:06 +0000 | |||
3651 | @@ -784,8 +784,11 @@ | |||
3652 | 784 | // Editing the existing record | 784 | // Editing the existing record |
3653 | 785 | $new_mediaid = $mediaid; | 785 | $new_mediaid = $mediaid; |
3654 | 786 | 786 | ||
3657 | 787 | $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid"; | 787 | $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d"; |
3658 | 788 | $SQL .= " WHERE mediaID = $mediaid "; | 788 | $SQL .= " WHERE mediaID = %d "; |
3659 | 789 | $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid); | ||
3660 | 790 | |||
3661 | 791 | Debug::LogEntry($db, 'audit', $SQL); | ||
3662 | 789 | 792 | ||
3663 | 790 | if (!$db->query($SQL)) | 793 | if (!$db->query($SQL)) |
3664 | 791 | { | 794 | { |
3665 | 792 | 795 | ||
3666 | === modified file 'server/modules/image.module.php' | |||
3667 | --- server/modules/image.module.php 2009-05-24 09:59:49 +0000 | |||
3668 | +++ server/modules/image.module.php 2009-06-28 10:47:06 +0000 | |||
3669 | @@ -794,8 +794,11 @@ | |||
3670 | 794 | // Editing the existing record | 794 | // Editing the existing record |
3671 | 795 | $new_mediaid = $mediaid; | 795 | $new_mediaid = $mediaid; |
3672 | 796 | 796 | ||
3675 | 797 | $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid"; | 797 | $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d"; |
3676 | 798 | $SQL .= " WHERE mediaID = $mediaid "; | 798 | $SQL .= " WHERE mediaID = %d "; |
3677 | 799 | $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid); | ||
3678 | 800 | |||
3679 | 801 | Debug::LogEntry($db, 'audit', $SQL); | ||
3680 | 799 | 802 | ||
3681 | 800 | if (!$db->query($SQL)) | 803 | if (!$db->query($SQL)) |
3682 | 801 | { | 804 | { |
3683 | 802 | 805 | ||
3684 | === modified file 'server/modules/module_user_general.php' | |||
3685 | --- server/modules/module_user_general.php 2009-03-25 19:36:36 +0000 | |||
3686 | +++ server/modules/module_user_general.php 2009-07-07 20:01:49 +0000 | |||
3687 | @@ -89,8 +89,6 @@ | |||
3688 | 89 | 89 | ||
3689 | 90 | $sql = sprintf("SELECT UserID, UserName, UserPassword, usertypeid, groupID FROM user WHERE UserName = '%s' AND UserPassword = '%s'", $db->escape_string($username), $db->escape_string($password)); | 90 | $sql = sprintf("SELECT UserID, UserName, UserPassword, usertypeid, groupID FROM user WHERE UserName = '%s' AND UserPassword = '%s'", $db->escape_string($username), $db->escape_string($password)); |
3690 | 91 | 91 | ||
3691 | 92 | Debug::LogEntry($db, 'audit', $sql); | ||
3692 | 93 | |||
3693 | 94 | if(!$result = $db->query($sql)) trigger_error('A database error occurred while checking your login details.', E_USER_ERROR); | 92 | if(!$result = $db->query($sql)) trigger_error('A database error occurred while checking your login details.', E_USER_ERROR); |
3694 | 95 | 93 | ||
3695 | 96 | if ($db->num_rows($result)==0) | 94 | if ($db->num_rows($result)==0) |
3696 | @@ -122,6 +120,7 @@ | |||
3697 | 122 | $db->query($SQL) or trigger_error("Can not write last accessed info.", E_USER_ERROR); | 120 | $db->query($SQL) or trigger_error("Can not write last accessed info.", E_USER_ERROR); |
3698 | 123 | 121 | ||
3699 | 124 | $session->setIsExpired(0); | 122 | $session->setIsExpired(0); |
3700 | 123 | $session->RegenerateSessionID(session_id()); | ||
3701 | 125 | 124 | ||
3702 | 126 | return true; | 125 | return true; |
3703 | 127 | } | 126 | } |
3704 | 128 | 127 | ||
3705 | === modified file 'server/modules/powerpoint.module.php' | |||
3706 | --- server/modules/powerpoint.module.php 2009-05-24 09:59:49 +0000 | |||
3707 | +++ server/modules/powerpoint.module.php 2009-06-28 10:47:06 +0000 | |||
3708 | @@ -784,8 +784,11 @@ | |||
3709 | 784 | // Editing the existing record | 784 | // Editing the existing record |
3710 | 785 | $new_mediaid = $mediaid; | 785 | $new_mediaid = $mediaid; |
3711 | 786 | 786 | ||
3714 | 787 | $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid"; | 787 | $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d"; |
3715 | 788 | $SQL .= " WHERE mediaID = $mediaid "; | 788 | $SQL .= " WHERE mediaID = %d "; |
3716 | 789 | $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid); | ||
3717 | 790 | |||
3718 | 791 | Debug::LogEntry($db, 'audit', $SQL); | ||
3719 | 789 | 792 | ||
3720 | 790 | if (!$db->query($SQL)) | 793 | if (!$db->query($SQL)) |
3721 | 791 | { | 794 | { |
3722 | 792 | 795 | ||
3723 | === modified file 'server/modules/text.module.php' | |||
3724 | --- server/modules/text.module.php 2009-02-27 19:30:45 +0000 | |||
3725 | +++ server/modules/text.module.php 2009-08-03 12:10:12 +0000 | |||
3726 | @@ -62,6 +62,10 @@ | |||
3727 | 62 | <td><input id="duration" name="duration" type="text"></td> | 62 | <td><input id="duration" name="duration" type="text"></td> |
3728 | 63 | </tr> | 63 | </tr> |
3729 | 64 | <tr> | 64 | <tr> |
3730 | 65 | <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td> | ||
3731 | 66 | <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="30"></td> | ||
3732 | 67 | </tr> | ||
3733 | 68 | <tr> | ||
3734 | 65 | <td colspan="4"> | 69 | <td colspan="4"> |
3735 | 66 | <textarea id="ta_text" name="ta_text"></textarea> | 70 | <textarea id="ta_text" name="ta_text"></textarea> |
3736 | 67 | </td> | 71 | </td> |
3737 | @@ -95,11 +99,12 @@ | |||
3738 | 95 | { | 99 | { |
3739 | 96 | $db =& $this->db; | 100 | $db =& $this->db; |
3740 | 97 | 101 | ||
3744 | 98 | $layoutid = $this->layoutid; | 102 | $layoutid = $this->layoutid; |
3745 | 99 | $regionid = $this->regionid; | 103 | $regionid = $this->regionid; |
3746 | 100 | $mediaid = $this->mediaid; | 104 | $mediaid = $this->mediaid; |
3747 | 101 | 105 | ||
3749 | 102 | $direction = $this->GetOption('direction'); | 106 | $direction = $this->GetOption('direction'); |
3750 | 107 | $scrollSpeed = $this->GetOption('scrollSpeed'); | ||
3751 | 103 | 108 | ||
3752 | 104 | // Get the text out of RAW | 109 | // Get the text out of RAW |
3753 | 105 | $rawXml = new DOMDocument(); | 110 | $rawXml = new DOMDocument(); |
3754 | @@ -128,6 +133,10 @@ | |||
3755 | 128 | <td><input id="duration" name="duration" value="$this->duration" type="text"></td> | 133 | <td><input id="duration" name="duration" value="$this->duration" type="text"></td> |
3756 | 129 | </tr> | 134 | </tr> |
3757 | 130 | <tr> | 135 | <tr> |
3758 | 136 | <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td> | ||
3759 | 137 | <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="$scrollSpeed"></td> | ||
3760 | 138 | </tr> | ||
3761 | 139 | <tr> | ||
3762 | 131 | <td colspan="4"> | 140 | <td colspan="4"> |
3763 | 132 | <textarea id="ta_text" name="ta_text">$text</textarea> | 141 | <textarea id="ta_text" name="ta_text">$text</textarea> |
3764 | 133 | </td> | 142 | </td> |
3765 | @@ -169,6 +178,7 @@ | |||
3766 | 169 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); | 178 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
3767 | 170 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | 179 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
3768 | 171 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); | 180 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
3769 | 181 | $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30); | ||
3770 | 172 | 182 | ||
3771 | 173 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | 183 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
3772 | 174 | 184 | ||
3773 | @@ -193,6 +203,7 @@ | |||
3774 | 193 | 203 | ||
3775 | 194 | // Any Options | 204 | // Any Options |
3776 | 195 | $this->SetOption('direction', $direction); | 205 | $this->SetOption('direction', $direction); |
3777 | 206 | $this->SetOption('scrollSpeed', $scrollSpeed); | ||
3778 | 196 | $this->SetRaw('<text><![CDATA[' . $text . ']]></text>'); | 207 | $this->SetRaw('<text><![CDATA[' . $text . ']]></text>'); |
3779 | 197 | 208 | ||
3780 | 198 | // Should have built the media object entirely by this time | 209 | // Should have built the media object entirely by this time |
3781 | @@ -225,6 +236,7 @@ | |||
3782 | 225 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); | 236 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
3783 | 226 | $duration = Kit::GetParam('duration', _POST, _INT, 0); | 237 | $duration = Kit::GetParam('duration', _POST, _INT, 0); |
3784 | 227 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); | 238 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
3785 | 239 | $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30); | ||
3786 | 228 | 240 | ||
3787 | 229 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | 241 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
3788 | 230 | 242 | ||
3789 | @@ -248,6 +260,7 @@ | |||
3790 | 248 | 260 | ||
3791 | 249 | // Any Options | 261 | // Any Options |
3792 | 250 | $this->SetOption('direction', $direction); | 262 | $this->SetOption('direction', $direction); |
3793 | 263 | $this->SetOption('scrollSpeed', $scrollSpeed); | ||
3794 | 251 | $this->SetRaw('<text><![CDATA[' . $text . ']]></text>'); | 264 | $this->SetRaw('<text><![CDATA[' . $text . ']]></text>'); |
3795 | 252 | 265 | ||
3796 | 253 | // Should have built the media object entirely by this time | 266 | // Should have built the media object entirely by this time |
3797 | 254 | 267 | ||
3798 | === modified file 'server/modules/ticker.module.php' | |||
3799 | --- server/modules/ticker.module.php 2009-06-18 18:36:21 +0000 | |||
3800 | +++ server/modules/ticker.module.php 2009-07-05 20:56:48 +0000 | |||
3801 | @@ -272,7 +272,7 @@ | |||
3802 | 272 | $copyright = Kit::GetParam('copyright', _POST, _STRING); | 272 | $copyright = Kit::GetParam('copyright', _POST, _STRING); |
3803 | 273 | 273 | ||
3804 | 274 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; | 274 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
3806 | 275 | 275 | ||
3807 | 276 | //validation | 276 | //validation |
3808 | 277 | if ($text == '') | 277 | if ($text == '') |
3809 | 278 | { | 278 | { |
3810 | 279 | 279 | ||
3811 | === modified file 'server/modules/video.module.php' | |||
3812 | --- server/modules/video.module.php 2009-05-24 09:59:49 +0000 | |||
3813 | +++ server/modules/video.module.php 2009-06-28 10:47:06 +0000 | |||
3814 | @@ -771,8 +771,11 @@ | |||
3815 | 771 | // Editing the existing record | 771 | // Editing the existing record |
3816 | 772 | $new_mediaid = $mediaid; | 772 | $new_mediaid = $mediaid; |
3817 | 773 | 773 | ||
3820 | 774 | $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid"; | 774 | $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d"; |
3821 | 775 | $SQL .= " WHERE mediaID = $mediaid "; | 775 | $SQL .= " WHERE mediaID = %d "; |
3822 | 776 | $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid); | ||
3823 | 777 | |||
3824 | 778 | Debug::LogEntry($db, 'audit', $SQL); | ||
3825 | 776 | 779 | ||
3826 | 777 | if (!$db->query($SQL)) | 780 | if (!$db->query($SQL)) |
3827 | 778 | { | 781 | { |
3828 | 779 | 782 | ||
3829 | === modified file 'server/template/css/xibo.css' | |||
3830 | --- server/template/css/xibo.css 2009-06-20 12:00:21 +0000 | |||
3831 | +++ server/template/css/xibo.css 2009-08-03 12:10:12 +0000 | |||
3832 | @@ -48,7 +48,12 @@ | |||
3833 | 48 | 48 | ||
3834 | 49 | #embedHtml { | 49 | #embedHtml { |
3835 | 50 | width: 500px; | 50 | width: 500px; |
3837 | 51 | height: 310px; | 51 | height: 140px; |
3838 | 52 | } | ||
3839 | 53 | |||
3840 | 54 | #embedScript { | ||
3841 | 55 | width: 500px; | ||
3842 | 56 | height: 140px; | ||
3843 | 52 | } | 57 | } |
3844 | 53 | 58 | ||
3845 | 54 | .regionTransparency { | 59 | .regionTransparency { |
3846 | 55 | 60 | ||
3847 | === added file 'server/template/pages/stats_view.php' | |||
3848 | --- server/template/pages/stats_view.php 1970-01-01 00:00:00 +0000 | |||
3849 | +++ server/template/pages/stats_view.php 2009-08-03 16:42:20 +0000 | |||
3850 | @@ -0,0 +1,42 @@ | |||
3851 | 1 | <?php | ||
3852 | 2 | /* | ||
3853 | 3 | * Xibo - Digitial Signage - http://www.xibo.org.uk | ||
3854 | 4 | * Copyright (C) 2009 Daniel Garner | ||
3855 | 5 | * | ||
3856 | 6 | * This file is part of Xibo. | ||
3857 | 7 | * | ||
3858 | 8 | * Xibo is free software: you can redistribute it and/or modify | ||
3859 | 9 | * it under the terms of the GNU Affero General Public License as published by | ||
3860 | 10 | * the Free Software Foundation, either version 3 of the License, or | ||
3861 | 11 | * any later version. | ||
3862 | 12 | * | ||
3863 | 13 | * Xibo is distributed in the hope that it will be useful, | ||
3864 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3865 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3866 | 16 | * GNU Affero General Public License for more details. | ||
3867 | 17 | * | ||
3868 | 18 | * You should have received a copy of the GNU Affero General Public License | ||
3869 | 19 | * along with Xibo. If not, see <http://www.gnu.org/licenses/>. | ||
3870 | 20 | */ | ||
3871 | 21 | defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser."); | ||
3872 | 22 | ?> | ||
3873 | 23 | <div id="form_container"> | ||
3874 | 24 | <div id="form_header"> | ||
3875 | 25 | <div id="form_header_left"></div> | ||
3876 | 26 | <div id="form_header_right"></div> | ||
3877 | 27 | </div> | ||
3878 | 28 | |||
3879 | 29 | <div id="form_body"> | ||
3880 | 30 | <div class="SecondNav"> | ||
3881 | 31 | |||
3882 | 32 | </div> | ||
3883 | 33 | <?php $this->StatsForm(); ?> | ||
3884 | 34 | </div> | ||
3885 | 35 | |||
3886 | 36 | <div id="form_footer"> | ||
3887 | 37 | <div id="form_footer_left"> | ||
3888 | 38 | </div> | ||
3889 | 39 | <div id="form_footer_right"> | ||
3890 | 40 | </div> | ||
3891 | 41 | </div> | ||
3892 | 42 | </div> | ||
3893 | 0 | \ No newline at end of file | 43 | \ No newline at end of file |
3894 | 1 | 44 | ||
3895 | === modified file 'server/upgrade.php' | |||
3896 | --- server/upgrade.php 2009-06-15 08:16:19 +0000 | |||
3897 | +++ server/upgrade.php 2009-09-21 22:58:45 +0000 | |||
3898 | @@ -205,6 +205,12 @@ | |||
3899 | 205 | } | 205 | } |
3900 | 206 | } | 206 | } |
3901 | 207 | 207 | ||
3902 | 208 | echo '<div class="info"><p>'; | ||
3903 | 209 | echo "Perform automatic database upgrade?"; | ||
3904 | 210 | echo '</p></div><div class="install-table">'; | ||
3905 | 211 | echo '<input type="checkbox" name="doBackup" checked />'; | ||
3906 | 212 | echo '</div><hr width="25%" />'; | ||
3907 | 213 | |||
3908 | 208 | $_SESSION['step'] = 3; | 214 | $_SESSION['step'] = 3; |
3909 | 209 | echo '<input type="hidden" name="includes" value="true" />'; | 215 | echo '<input type="hidden" name="includes" value="true" />'; |
3910 | 210 | echo '<p><input type="submit" value="Next >" /></p>'; | 216 | echo '<p><input type="submit" value="Next >" /></p>'; |
3911 | @@ -242,11 +248,18 @@ | |||
3912 | 242 | echo "FAIL: " . $fault_string; | 248 | echo "FAIL: " . $fault_string; |
3913 | 243 | } | 249 | } |
3914 | 244 | else { | 250 | else { |
3915 | 251 | $doBackup = Kit::GetParam("doBackup", $_POST, _BOOL); | ||
3916 | 252 | |||
3917 | 245 | set_time_limit(0); | 253 | set_time_limit(0); |
3918 | 246 | // Backup the database | 254 | // Backup the database |
3922 | 247 | echo '<div class="info">'; | 255 | echo '<div class="info"><p>'; |
3923 | 248 | echo '<p>Backing up your database'; | 256 | if ($doBackup) { |
3924 | 249 | backup_tables($db, '*'); | 257 | echo 'Backing up your database'; |
3925 | 258 | backup_tables($db, '*'); | ||
3926 | 259 | } | ||
3927 | 260 | else { | ||
3928 | 261 | echo 'Skipping database backup'; | ||
3929 | 262 | } | ||
3930 | 250 | echo '</p>'; | 263 | echo '</p>'; |
3931 | 251 | 264 | ||
3932 | 252 | $sqlStatementCount = 0; | 265 | $sqlStatementCount = 0; |
3933 | 253 | 266 | ||
3934 | === modified file 'server/xmds.php' | |||
3935 | --- server/xmds.php 2009-06-03 11:55:05 +0000 | |||
3936 | +++ server/xmds.php 2009-08-08 11:04:39 +0000 | |||
3937 | @@ -30,8 +30,6 @@ | |||
3938 | 30 | { | 30 | { |
3939 | 31 | global $db; | 31 | global $db; |
3940 | 32 | 32 | ||
3941 | 33 | if (eregi('[^A-Za-z0-9]', $hardwareKey)) return false; | ||
3942 | 34 | |||
3943 | 35 | //check in the database for this hardwareKey | 33 | //check in the database for this hardwareKey |
3944 | 36 | $SQL = "SELECT licensed, inc_schedule, isAuditing, displayID FROM display WHERE license = '$hardwareKey'"; | 34 | $SQL = "SELECT licensed, inc_schedule, isAuditing, displayID FROM display WHERE license = '$hardwareKey'"; |
3945 | 37 | if (!$result = $db->query($SQL)) | 35 | if (!$result = $db->query($SQL)) |
3946 | @@ -554,6 +552,7 @@ | |||
3947 | 554 | $SQL .= " INNER JOIN schedule_detail ON schedule_detail.layoutID = layout.layoutID "; | 552 | $SQL .= " INNER JOIN schedule_detail ON schedule_detail.layoutID = layout.layoutID "; |
3948 | 555 | $SQL .= " INNER JOIN display ON schedule_detail.displayID = display.displayID "; | 553 | $SQL .= " INNER JOIN display ON schedule_detail.displayID = display.displayID "; |
3949 | 556 | $SQL .= " WHERE display.license = '$hardwareKey' "; | 554 | $SQL .= " WHERE display.license = '$hardwareKey' "; |
3950 | 555 | $SQL .= " AND layout.retired = 0 "; | ||
3951 | 557 | 556 | ||
3952 | 558 | // Store the Base SQL for this display | 557 | // Store the Base SQL for this display |
3953 | 559 | $SQLBase = $SQL; | 558 | $SQLBase = $SQL; |
3954 | @@ -648,105 +647,7 @@ | |||
3955 | 648 | { | 647 | { |
3956 | 649 | global $db; | 648 | global $db; |
3957 | 650 | 649 | ||
4057 | 651 | // Sanitize | 650 | return new soap_fault("SOAP-ENV:Client", "", "This is a depricated service call. You should instead call either SubmitLog or SubmitStats", $serverKey); |
3959 | 652 | $serverKey = Kit::ValidateParam($serverKey, _STRING); | ||
3960 | 653 | $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING); | ||
3961 | 654 | $version = Kit::ValidateParam($version, _STRING); | ||
3962 | 655 | |||
3963 | 656 | // Make sure we are talking the same language | ||
3964 | 657 | if (!CheckVersion($version)) | ||
3965 | 658 | { | ||
3966 | 659 | return new soap_fault("SOAP-ENV:Client", "", "Your client is not of the correct version for communication with this server. You can get the latest from http://www.xibo.org.uk", $serverKey); | ||
3967 | 660 | } | ||
3968 | 661 | |||
3969 | 662 | //auth this request... | ||
3970 | 663 | if (!$displayInfo = Auth($hardwareKey)) | ||
3971 | 664 | { | ||
3972 | 665 | return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey); | ||
3973 | 666 | } | ||
3974 | 667 | |||
3975 | 668 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "[IN]", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']); | ||
3976 | 669 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "$xml", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']); | ||
3977 | 670 | |||
3978 | 671 | $document = new DOMDocument("1.0"); | ||
3979 | 672 | $document->loadXML("<log>".$xml."</log>"); | ||
3980 | 673 | |||
3981 | 674 | foreach ($document->documentElement->childNodes as $node) | ||
3982 | 675 | { | ||
3983 | 676 | //Zero out the common vars | ||
3984 | 677 | $date = ""; | ||
3985 | 678 | $message = ""; | ||
3986 | 679 | $scheduleID = ""; | ||
3987 | 680 | $layoutID = ""; | ||
3988 | 681 | $mediaID = ""; | ||
3989 | 682 | $type = ""; | ||
3990 | 683 | $cat = ''; | ||
3991 | 684 | |||
3992 | 685 | // Get the date and the message (all log types have these) | ||
3993 | 686 | foreach ($node->childNodes as $nodeElements) | ||
3994 | 687 | { | ||
3995 | 688 | if ($nodeElements->nodeName == "date") | ||
3996 | 689 | { | ||
3997 | 690 | $date = $nodeElements->textContent; | ||
3998 | 691 | } | ||
3999 | 692 | else if ($nodeElements->nodeName == "message") | ||
4000 | 693 | { | ||
4001 | 694 | $message = $nodeElements->textContent; | ||
4002 | 695 | } | ||
4003 | 696 | else if ($nodeElements->nodeName == "scheduleID") | ||
4004 | 697 | { | ||
4005 | 698 | $scheduleID = $nodeElements->textContent; | ||
4006 | 699 | } | ||
4007 | 700 | else if ($nodeElements->nodeName == "layoutID") | ||
4008 | 701 | { | ||
4009 | 702 | $layoutID = $nodeElements->textContent; | ||
4010 | 703 | } | ||
4011 | 704 | else if ($nodeElements->nodeName == "mediaID") | ||
4012 | 705 | { | ||
4013 | 706 | $mediaID = $nodeElements->textContent; | ||
4014 | 707 | } | ||
4015 | 708 | else if ($nodeElements->nodeName == "type") | ||
4016 | 709 | { | ||
4017 | 710 | $type = $nodeElements->textContent; | ||
4018 | 711 | } | ||
4019 | 712 | else if ($nodeElements->nodeName == "category") | ||
4020 | 713 | { | ||
4021 | 714 | $cat = $nodeElements->textContent; | ||
4022 | 715 | } | ||
4023 | 716 | } | ||
4024 | 717 | |||
4025 | 718 | switch ($node->nodeName) | ||
4026 | 719 | { | ||
4027 | 720 | case "stat": | ||
4028 | 721 | if ($mediaID == '') $mediaID = 0; | ||
4029 | 722 | |||
4030 | 723 | StatRecord($type, $date, $scheduleID, $displayInfo['displayid'], $layoutID, $mediaID, $date, $date); | ||
4031 | 724 | break; | ||
4032 | 725 | |||
4033 | 726 | case "trace": | ||
4034 | 727 | |||
4035 | 728 | // We have a trace message | ||
4036 | 729 | // Either Audit or Error (if *) | ||
4037 | 730 | if (substr($message, 0, 3) == '[*]') | ||
4038 | 731 | { | ||
4039 | 732 | Debug::LogEntry($db, "error", $message, ".NET Client", $cat, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID); | ||
4040 | 733 | } | ||
4041 | 734 | else | ||
4042 | 735 | { | ||
4043 | 736 | Debug::LogEntry($db, "audit", $message, ".NET Client", $cat, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID); | ||
4044 | 737 | } | ||
4045 | 738 | |||
4046 | 739 | break; | ||
4047 | 740 | |||
4048 | 741 | default: | ||
4049 | 742 | Debug::LogEntry($db, "audit", "Unknown entry in client log " . $node->nodeName, "xmds", "RecieveXmlLog", $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID); | ||
4050 | 743 | break; | ||
4051 | 744 | } | ||
4052 | 745 | } | ||
4053 | 746 | |||
4054 | 747 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "[OUT]", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']); | ||
4055 | 748 | |||
4056 | 749 | return true; | ||
4058 | 750 | } | 651 | } |
4059 | 751 | 652 | ||
4060 | 752 | define('BLACKLIST_ALL', "All"); | 653 | define('BLACKLIST_ALL', "All"); |
4061 | @@ -835,6 +736,203 @@ | |||
4062 | 835 | return true; | 736 | return true; |
4063 | 836 | } | 737 | } |
4064 | 837 | 738 | ||
4065 | 739 | /** | ||
4066 | 740 | * Submit client logging | ||
4067 | 741 | * @return | ||
4068 | 742 | * @param $version Object | ||
4069 | 743 | * @param $serverKey Object | ||
4070 | 744 | * @param $hardwareKey Object | ||
4071 | 745 | * @param $logXml Object | ||
4072 | 746 | */ | ||
4073 | 747 | function SubmitLog($version, $serverKey, $hardwareKey, $logXml) | ||
4074 | 748 | { | ||
4075 | 749 | global $db; | ||
4076 | 750 | |||
4077 | 751 | // Sanitize | ||
4078 | 752 | $serverKey = Kit::ValidateParam($serverKey, _STRING); | ||
4079 | 753 | $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING); | ||
4080 | 754 | $version = Kit::ValidateParam($version, _STRING); | ||
4081 | 755 | $logXml = Kit::ValidateParam($logXml, _HTMLSTRING); | ||
4082 | 756 | |||
4083 | 757 | // Make sure we are talking the same language | ||
4084 | 758 | if (!CheckVersion($version)) | ||
4085 | 759 | { | ||
4086 | 760 | return new soap_fault("SOAP-ENV:Client", "", "Your client is not of the correct version for communication with this server. You can get the latest from http://www.xibo.org.uk", $serverKey); | ||
4087 | 761 | } | ||
4088 | 762 | |||
4089 | 763 | // Auth this request... | ||
4090 | 764 | if (!$displayInfo = Auth($hardwareKey)) | ||
4091 | 765 | { | ||
4092 | 766 | return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey); | ||
4093 | 767 | } | ||
4094 | 768 | |||
4095 | 769 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "IN", "xmds", "SubmitLog", "", $displayInfo['displayid']); | ||
4096 | 770 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", 'XML [' . $logXml . ']', "xmds", "SubmitLog", "", $displayInfo['displayid']); | ||
4097 | 771 | |||
4098 | 772 | // Load the XML into a DOMDocument | ||
4099 | 773 | $document = new DOMDocument("1.0"); | ||
4100 | 774 | |||
4101 | 775 | if (!$document->loadXML($logXml)) | ||
4102 | 776 | { | ||
4103 | 777 | return new soap_fault("SOAP-ENV:Client", "", "XML Cannot be loaded into DOM Document.", $hardwareKey); | ||
4104 | 778 | } | ||
4105 | 779 | |||
4106 | 780 | foreach ($document->documentElement->childNodes as $node) | ||
4107 | 781 | { | ||
4108 | 782 | //Zero out the common vars | ||
4109 | 783 | $date = ""; | ||
4110 | 784 | $message = ""; | ||
4111 | 785 | $scheduleID = ""; | ||
4112 | 786 | $layoutID = ""; | ||
4113 | 787 | $mediaID = ""; | ||
4114 | 788 | $cat = ''; | ||
4115 | 789 | $method = ''; | ||
4116 | 790 | |||
4117 | 791 | // This will be a bunch of trace nodes | ||
4118 | 792 | $message = $node->textContent; | ||
4119 | 793 | |||
4120 | 794 | // Each element should have a category and a date | ||
4121 | 795 | $date = $node->getAttribute('date'); | ||
4122 | 796 | $cat = $node->getAttribute('category'); | ||
4123 | 797 | |||
4124 | 798 | if ($date == '' || $cat == '') | ||
4125 | 799 | { | ||
4126 | 800 | trigger_error('Log submitted without a date or category attribute'); | ||
4127 | 801 | continue; | ||
4128 | 802 | } | ||
4129 | 803 | |||
4130 | 804 | // Get the date and the message (all log types have these) | ||
4131 | 805 | foreach ($node->childNodes as $nodeElements) | ||
4132 | 806 | { | ||
4133 | 807 | if ($nodeElements->nodeName == "scheduleID") | ||
4134 | 808 | { | ||
4135 | 809 | $scheduleID = $nodeElements->textContent; | ||
4136 | 810 | } | ||
4137 | 811 | else if ($nodeElements->nodeName == "layoutID") | ||
4138 | 812 | { | ||
4139 | 813 | $layoutID = $nodeElements->textContent; | ||
4140 | 814 | } | ||
4141 | 815 | else if ($nodeElements->nodeName == "mediaID") | ||
4142 | 816 | { | ||
4143 | 817 | $mediaID = $nodeElements->textContent; | ||
4144 | 818 | } | ||
4145 | 819 | else if ($nodeElements->nodeName == "type") | ||
4146 | 820 | { | ||
4147 | 821 | $type = $nodeElements->textContent; | ||
4148 | 822 | } | ||
4149 | 823 | else if ($nodeElements->nodeName == "method") | ||
4150 | 824 | { | ||
4151 | 825 | $method = $nodeElements->textContent; | ||
4152 | 826 | } | ||
4153 | 827 | } | ||
4154 | 828 | |||
4155 | 829 | // We should have enough information to log this now. | ||
4156 | 830 | if ($cat == 'error' || $cat == 'Error') | ||
4157 | 831 | { | ||
4158 | 832 | Debug::LogEntry($db, $cat, $message, 'Client', $method, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID); | ||
4159 | 833 | } | ||
4160 | 834 | else | ||
4161 | 835 | { | ||
4162 | 836 | Debug::LogEntry($db, 'audit', $message, 'Client', $method, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID); | ||
4163 | 837 | } | ||
4164 | 838 | } | ||
4165 | 839 | |||
4166 | 840 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "OUT", "xmds", "SubmitLog", "", $displayInfo['displayid']); | ||
4167 | 841 | |||
4168 | 842 | return true; | ||
4169 | 843 | } | ||
4170 | 844 | |||
4171 | 845 | /** | ||
4172 | 846 | * Submit display statistics to the server | ||
4173 | 847 | * @return | ||
4174 | 848 | * @param $version Object | ||
4175 | 849 | * @param $serverKey Object | ||
4176 | 850 | * @param $hardwareKey Object | ||
4177 | 851 | * @param $statXml Object | ||
4178 | 852 | */ | ||
4179 | 853 | function SubmitStats($version, $serverKey, $hardwareKey, $statXml) | ||
4180 | 854 | { | ||
4181 | 855 | global $db; | ||
4182 | 856 | |||
4183 | 857 | // Sanitize | ||
4184 | 858 | $serverKey = Kit::ValidateParam($serverKey, _STRING); | ||
4185 | 859 | $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING); | ||
4186 | 860 | $version = Kit::ValidateParam($version, _STRING); | ||
4187 | 861 | $statXml = Kit::ValidateParam($statXml, _HTMLSTRING); | ||
4188 | 862 | |||
4189 | 863 | // Make sure we are talking the same language | ||
4190 | 864 | if (!CheckVersion($version)) | ||
4191 | 865 | { | ||
4192 | 866 | return new soap_fault("SOAP-ENV:Client", "", "Your client is not of the correct version for communication with this server. You can get the latest from http://www.xibo.org.uk", $serverKey); | ||
4193 | 867 | } | ||
4194 | 868 | |||
4195 | 869 | // Auth this request... | ||
4196 | 870 | if (!$displayInfo = Auth($hardwareKey)) | ||
4197 | 871 | { | ||
4198 | 872 | return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey); | ||
4199 | 873 | } | ||
4200 | 874 | |||
4201 | 875 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "IN", "xmds", "SubmitStats", "", $displayInfo['displayid']); | ||
4202 | 876 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "StatXml: [" . $statXml . "]", "xmds", "SubmitStats", "", $displayInfo['displayid']); | ||
4203 | 877 | |||
4204 | 878 | if ($statXml == "") | ||
4205 | 879 | { | ||
4206 | 880 | return new soap_fault("SOAP-ENV:Client", "", "Stat XML is empty.", $hardwareKey); | ||
4207 | 881 | } | ||
4208 | 882 | |||
4209 | 883 | // Log | ||
4210 | 884 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "About to create Stat Object.", "xmds", "SubmitStats", "", $displayInfo['displayid']); | ||
4211 | 885 | |||
4212 | 886 | $statObject = new Stat($db); | ||
4213 | 887 | |||
4214 | 888 | // Log | ||
4215 | 889 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "About to Create DOMDocument.", "xmds", "SubmitStats", "", $displayInfo['displayid']); | ||
4216 | 890 | |||
4217 | 891 | // Load the XML into a DOMDocument | ||
4218 | 892 | $document = new DOMDocument("1.0"); | ||
4219 | 893 | $document->loadXML($statXml); | ||
4220 | 894 | |||
4221 | 895 | foreach ($document->documentElement->childNodes as $node) | ||
4222 | 896 | { | ||
4223 | 897 | //Zero out the common vars | ||
4224 | 898 | $fromdt = ''; | ||
4225 | 899 | $todt = ''; | ||
4226 | 900 | $type = ''; | ||
4227 | 901 | |||
4228 | 902 | $scheduleID = 0; | ||
4229 | 903 | $layoutID = 0; | ||
4230 | 904 | $mediaID = ''; | ||
4231 | 905 | $tag = ''; | ||
4232 | 906 | |||
4233 | 907 | // Each element should have these attributes | ||
4234 | 908 | $fromdt = $node->getAttribute('fromdt'); | ||
4235 | 909 | $todt = $node->getAttribute('todt'); | ||
4236 | 910 | $type = $node->getAttribute('type'); | ||
4237 | 911 | |||
4238 | 912 | if ($fromdt == '' || $todt == '' || $type == '') | ||
4239 | 913 | { | ||
4240 | 914 | trigger_error('Stat submitted without the fromdt, todt or type attributes.'); | ||
4241 | 915 | continue; | ||
4242 | 916 | } | ||
4243 | 917 | |||
4244 | 918 | $scheduleID = $node->getAttribute('scheduleid'); | ||
4245 | 919 | $layoutID = $node->getAttribute('layoutid'); | ||
4246 | 920 | $mediaID = $node->getAttribute('mediaid'); | ||
4247 | 921 | $tag = $node->getAttribute('tag'); | ||
4248 | 922 | |||
4249 | 923 | // Write the stat record with the information we have available to us. | ||
4250 | 924 | if (!$statObject->Add($type, $fromdt, $todt, $scheduleID, $displayInfo['displayid'], $layoutID, $mediaID, $tag)) | ||
4251 | 925 | { | ||
4252 | 926 | trigger_error(sprintf('Stat Add failed with error: %s', $statObject->GetErrorMessage())); | ||
4253 | 927 | continue; | ||
4254 | 928 | } | ||
4255 | 929 | } | ||
4256 | 930 | |||
4257 | 931 | if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "OUT", "xmds", "SubmitStats", "", $displayInfo['displayid']); | ||
4258 | 932 | |||
4259 | 933 | return true; | ||
4260 | 934 | } | ||
4261 | 935 | |||
4262 | 838 | //$debug = 1; | 936 | //$debug = 1; |
4263 | 839 | $service = new soap_server(); | 937 | $service = new soap_server(); |
4264 | 840 | 938 | ||
4265 | @@ -899,10 +997,32 @@ | |||
4266 | 899 | 'encoded', | 997 | 'encoded', |
4267 | 900 | 'Set media to be blacklisted' | 998 | 'Set media to be blacklisted' |
4268 | 901 | ); | 999 | ); |
4269 | 1000 | |||
4270 | 1001 | $service->register("SubmitLog", | ||
4271 | 1002 | array('version' => 'xsd:string', 'serverKey' => 'xsd:string', 'hardwareKey' => 'xsd:string', 'logXml' => 'xsd:string'), | ||
4272 | 1003 | array('success' => 'xsd:boolean'), | ||
4273 | 1004 | 'urn:xmds', | ||
4274 | 1005 | 'urn:xmds#SubmitLog', | ||
4275 | 1006 | 'rpc', | ||
4276 | 1007 | 'encoded', | ||
4277 | 1008 | 'Submit Logging from the Client' | ||
4278 | 1009 | ); | ||
4279 | 1010 | |||
4280 | 1011 | $service->register("SubmitStats", | ||
4281 | 1012 | array('version' => 'xsd:string', 'serverKey' => 'xsd:string', 'hardwareKey' => 'xsd:string', 'statXml' => 'xsd:string'), | ||
4282 | 1013 | array('success' => 'xsd:boolean'), | ||
4283 | 1014 | 'urn:xmds', | ||
4284 | 1015 | 'urn:xmds#SubmitLog', | ||
4285 | 1016 | 'rpc', | ||
4286 | 1017 | 'encoded', | ||
4287 | 1018 | 'Submit Display statistics from the Client' | ||
4288 | 1019 | ); | ||
4289 | 1020 | |||
4290 | 1021 | |||
4291 | 902 | 1022 | ||
4292 | 903 | $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; | 1023 | $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : ''; |
4293 | 904 | $service->service($HTTP_RAW_POST_DATA); | 1024 | $service->service($HTTP_RAW_POST_DATA); |
4294 | 905 | 1025 | ||
4296 | 906 | Debug::LogEntry($db, 'audit',$service->debug_str); | 1026 | //Debug::LogEntry($db, 'audit', $service->debug_str, "xmds", "NuSOAP"); |
4297 | 907 | 1027 | ||
4298 | 908 | ?> | 1028 | ?> |
4299 | 909 | \ No newline at end of file | 1029 | \ No newline at end of file |
Generates a Text Conflict in Upgrade.php - I am not sure how to resolve.