Merge lp:~alexharrington/xibo/upgrade-db-backup-switch into lp:~xibo-maintainers/xibo/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
Reviewer Review Type Date Requested Status
Dan Garner Needs Information
Review via email: mp+12199@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) wrote :

Generates a Text Conflict in Upgrade.php - I am not sure how to resolve.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'client/dotNET/FileCollector.cs'
--- client/dotNET/FileCollector.cs 2009-03-13 09:21:56 +0000
+++ client/dotNET/FileCollector.cs 2009-07-26 11:40:59 +0000
@@ -236,6 +236,9 @@
236 }236 }
237 else237 else
238 {238 {
239 // Set the flag to indicate we have a connection to XMDS
240 Properties.Settings.Default.XmdsLastConnection = DateTime.Now;
241
239 // What file type were we getting242 // What file type were we getting
240 if (currentFileList.type == "layout")243 if (currentFileList.type == "layout")
241 { 244 {
242245
=== modified file 'client/dotNET/HardwareKey.cs'
--- client/dotNET/HardwareKey.cs 2009-03-02 23:21:22 +0000
+++ client/dotNET/HardwareKey.cs 2009-07-26 11:40:59 +0000
@@ -31,7 +31,18 @@
31 {31 {
32 System.Diagnostics.Debug.WriteLine("[IN]", "HardwareKey");32 System.Diagnostics.Debug.WriteLine("[IN]", "HardwareKey");
3333
34 hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C"));34 // Get the key from the Settings
35 hardwareKey = Properties.Settings.Default.hardwareKey;
36
37 // Is the key empty?
38 if (hardwareKey == "")
39 {
40 // Calculate the Hardware key from the CPUID and Volume Serial
41 hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C"));
42
43 // Store the key
44 Properties.Settings.Default.hardwareKey = hardwareKey;
45 }
3546
36 System.Diagnostics.Debug.WriteLine("[OUT]", "HardwareKey");47 System.Diagnostics.Debug.WriteLine("[OUT]", "HardwareKey");
37 }48 }
@@ -48,6 +59,19 @@
48 }59 }
4960
50 /// <summary>61 /// <summary>
62 /// Regenerates the hardware key
63 /// </summary>
64 public void Regenerate()
65 {
66 // Calculate the Hardware key from the CPUID and Volume Serial
67 hardwareKey = Hashes.MD5(GetCPUId() + GetVolumeSerial("C"));
68
69 // Store the key
70 Properties.Settings.Default.hardwareKey = hardwareKey;
71 Properties.Settings.Default.Save();
72 }
73
74 /// <summary>
51 /// return Volume Serial Number from hard drive75 /// return Volume Serial Number from hard drive
52 /// </summary>76 /// </summary>
53 /// <param name="strDriveLetter">[optional] Drive letter</param>77 /// <param name="strDriveLetter">[optional] Drive letter</param>
5478
=== modified file 'client/dotNET/Image.cs'
--- client/dotNET/Image.cs 2009-02-25 22:57:05 +0000
+++ client/dotNET/Image.cs 2009-08-03 14:09:45 +0000
@@ -27,30 +27,37 @@
27{27{
28 class ImagePosition : Media28 class ImagePosition : Media
29 {29 {
30 private string _filePath;
31 PictureBox _pictureBox;
32
30 public ImagePosition(RegionOptions options)33 public ImagePosition(RegionOptions options)
31 : base(options.width, options.height, options.top, options.left)34 : base(options.width, options.height, options.top, options.left)
32 {35 {
33 this.filePath = options.uri;36 _filePath = options.uri;
34 37
35 if (!System.IO.File.Exists(this.filePath))38 if (!System.IO.File.Exists(_filePath))
36 {39 {
37 // Exit40 // Exit
38 this.loaded = false;41 System.Diagnostics.Trace.WriteLine(new LogMessage("Image - Dispose", "Cannot Create image object. Invalid Filepath."), LogType.Error.ToString());
39 return;42 return;
40 }43 }
4144
42 Bitmap img = new Bitmap(this.filePath);45 try
43 46 {
44 this.pictureBox = new PictureBox();47 _pictureBox = new PictureBox();
45 this.pictureBox.SizeMode = PictureBoxSizeMode.Zoom;48 _pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
46 this.pictureBox.Image = img;49 _pictureBox.Image = new Bitmap(_filePath);
47 this.pictureBox.Size = new Size(width, height);50 _pictureBox.Size = new Size(width, height);
48 this.pictureBox.Location = new Point(0, 0);51 _pictureBox.Location = new Point(0, 0);
49 this.pictureBox.BorderStyle = BorderStyle.None;52 _pictureBox.BorderStyle = BorderStyle.None;
50 this.pictureBox.BackColor = Color.Transparent;53 _pictureBox.BackColor = Color.Transparent;
51 this.loaded = true;54
5255 this.Controls.Add(this._pictureBox);
53 this.Controls.Add(this.pictureBox);56 }
57 catch (Exception ex)
58 {
59 System.Diagnostics.Trace.WriteLine(new LogMessage("ImagePosition", String.Format("Cannot create Image Object with exception: {0}", ex.Message)), LogType.Error.ToString());
60 }
54 }61 }
5562
56 public override void RenderMedia()63 public override void RenderMedia()
@@ -60,16 +67,22 @@
6067
61 protected override void Dispose(bool disposing)68 protected override void Dispose(bool disposing)
62 {69 {
63 if (disposing && loaded)70 if (disposing)
64 {71 {
65 this.pictureBox.Dispose();72 try
73 {
74 Controls.Remove(_pictureBox);
75
76 _pictureBox.Image.Dispose();
77 _pictureBox.Dispose();
78 }
79 catch (Exception ex)
80 {
81 System.Diagnostics.Trace.WriteLine(new LogMessage("Image - Dispose", String.Format("Cannot dispose Image Object with exception: {0}", ex.Message)), LogType.Error.ToString());
82 }
66 }83 }
6784
68 base.Dispose(disposing);85 base.Dispose(disposing);
69 }86 }
70
71 private string filePath;
72 private bool loaded;
73 PictureBox pictureBox;
74 }87 }
75}88}
7689
=== added file 'client/dotNET/LogMessage.cs'
--- client/dotNET/LogMessage.cs 1970-01-01 00:00:00 +0000
+++ client/dotNET/LogMessage.cs 2009-07-26 11:40:59 +0000
@@ -0,0 +1,75 @@
1/*
2 * Xibo - Digitial Signage - http://www.xibo.org.uk
3 * Copyright (C) 2009 Daniel Garner
4 *
5 * This file is part of Xibo.
6 *
7 * Xibo is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * any later version.
11 *
12 * Xibo is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
19 */
20using System;
21using System.Collections.Generic;
22using System.Text;
23
24namespace XiboClient
25{
26 class LogMessage
27 {
28 String _method;
29 String _message;
30 int _scheduleId;
31 int _layoutId;
32 int _mediaId;
33
34 public LogMessage(String method, String message)
35 {
36 _method = method;
37 _message = message;
38 }
39
40 public LogMessage(String method, String message, int scheduleId, int layoutId)
41 {
42 _method = method;
43 _message = message;
44 _scheduleId = scheduleId;
45 _layoutId = layoutId;
46 }
47
48 public LogMessage(String method, String message, int scheduleId, int layoutId, int mediaId)
49 {
50 _method = method;
51 _message = message;
52 _scheduleId = scheduleId;
53 _layoutId = layoutId;
54 _mediaId = mediaId;
55 }
56
57 public override string ToString()
58 {
59 // Format the message into the expected XML sub nodes.
60 // Just do this with a string builder rather than an XML builder.
61 String theMessage;
62
63 theMessage = String.Format("<message>{0}</message>", _message);
64 theMessage += String.Format("<method>{0}</method>", _method);
65
66 if (_scheduleId != 0) theMessage += String.Format("<scheduleid>{0}</scheduleid>", _scheduleId.ToString());
67 if (_layoutId != 0) theMessage += String.Format("<layoutid>{0}</layoutid>", _scheduleId.ToString());
68 if (_mediaId != 0) theMessage += String.Format("<mediaid>{0}</mediaid>", _scheduleId.ToString());
69
70 return theMessage;
71 }
72 }
73
74 public enum LogType { Info, Audit, Error }
75}
076
=== modified file 'client/dotNET/MainForm.cs'
--- client/dotNET/MainForm.cs 2009-03-08 11:40:17 +0000
+++ client/dotNET/MainForm.cs 2009-07-30 23:01:31 +0000
@@ -34,9 +34,24 @@
34{34{
35 public partial class MainForm : Form35 public partial class MainForm : Form
36 {36 {
37 private Schedule schedule;
38 private Collection<Region> regions;
39 private bool isExpired = false;
40 private int scheduleId;
41 private int layoutId;
42
43 double layoutWidth;
44 double layoutHeight;
45 double scaleFactor;
46
47 private StatLog _statLog;
48 private Stat _stat;
49
37 public MainForm()50 public MainForm()
38 {51 {
39 InitializeComponent();52 InitializeComponent();
53
54 _statLog = new StatLog();
40 }55 }
4156
42 private void MainForm_Load(object sender, EventArgs e)57 private void MainForm_Load(object sender, EventArgs e)
@@ -50,7 +65,7 @@
50 Directory.CreateDirectory(Properties.Settings.Default.LibraryPath + @"\backgrounds");65 Directory.CreateDirectory(Properties.Settings.Default.LibraryPath + @"\backgrounds");
51 }66 }
52 catch (Exception ex)67 catch (Exception ex)
53 { System.Diagnostics.Debug.WriteLine(ex.Message); }68 { System.Diagnostics.Trace.WriteLine(ex.Message); }
54 }69 }
5570
56 // Hide the cursor71 // Hide the cursor
@@ -71,7 +86,7 @@
71 }86 }
72 catch (Exception ex)87 catch (Exception ex)
73 {88 {
74 System.Diagnostics.Debug.WriteLine(ex.Message);89 System.Diagnostics.Debug.WriteLine(ex.Message, LogType.Error.ToString());
75 MessageBox.Show("Fatal Error initialising the application", "Fatal Error");90 MessageBox.Show("Fatal Error initialising the application", "Fatal Error");
76 this.Close();91 this.Close();
77 this.Dispose();92 this.Dispose();
@@ -89,6 +104,15 @@
89 this.scheduleId = scheduleId;104 this.scheduleId = scheduleId;
90 this.layoutId = layoutId;105 this.layoutId = layoutId;
91106
107 if (_stat != null)
108 {
109 // Log the end of the currently running layout.
110 _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
111
112 // Record this stat event in the statLog object
113 _statLog.RecordStat(_stat);
114 }
115
92 try116 try
93 {117 {
94 this.DestroyLayout();118 this.DestroyLayout();
@@ -102,9 +126,6 @@
102 System.Diagnostics.Debug.WriteLine(ex.Message);126 System.Diagnostics.Debug.WriteLine(ex.Message);
103 isExpired = true;127 isExpired = true;
104 }128 }
105
106 // Flush the TraceListener
107 System.Diagnostics.Trace.Flush();
108 }129 }
109130
110131
@@ -113,7 +134,12 @@
113 /// </summary>134 /// </summary>
114 private void PrepareLayout(string layoutPath)135 private void PrepareLayout(string layoutPath)
115 {136 {
116 XmlLog.AppendStat("Layout Started", StatType.LayoutStart, scheduleId, layoutId, "0");137 // Create a start record for this layout
138 _stat = new Stat();
139 _stat.type = StatType.Layout;
140 _stat.scheduleID = scheduleId;
141 _stat.layoutID = layoutId;
142 _stat.fromDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
117143
118 // Get this layouts XML144 // Get this layouts XML
119 XmlDocument layoutXml = new XmlDocument();145 XmlDocument layoutXml = new XmlDocument();
@@ -213,20 +239,6 @@
213 leftOverY = 0;239 leftOverY = 0;
214 }240 }
215241
216 // Are we licensed?
217 if (Properties.Settings.Default.licensed == 0)
218 {
219 // Show a label indicating this fact
220 notLic = new Label();
221 notLic.Location = new Point(0, 0);
222 notLic.Size = new System.Drawing.Size(500, 200);
223 notLic.Text = "This Display is not Licensed.";
224 notLic.BackColor = Color.WhiteSmoke;
225 this.Controls.Add(notLic);
226 notLic.BringToFront();
227 notLic.Show();
228 }
229
230 // New region and region options objects242 // New region and region options objects
231 regions = new Collection<Region>();243 regions = new Collection<Region>();
232 RegionOptions options = new RegionOptions();244 RegionOptions options = new RegionOptions();
@@ -305,7 +317,7 @@
305 // All the media nodes for this region / layout combination317 // All the media nodes for this region / layout combination
306 options.mediaNodes = region.ChildNodes;318 options.mediaNodes = region.ChildNodes;
307319
308 Region temp = new Region();320 Region temp = new Region(ref _statLog);
309 temp.DurationElapsedEvent += new Region.DurationElapsedDelegate(temp_DurationElapsedEvent);321 temp.DurationElapsedEvent += new Region.DurationElapsedDelegate(temp_DurationElapsedEvent);
310322
311 System.Diagnostics.Debug.WriteLine("Created new region", "MainForm - Prepare Layout");323 System.Diagnostics.Debug.WriteLine("Created new region", "MainForm - Prepare Layout");
@@ -368,6 +380,8 @@
368380
369 foreach (Region region in regions)381 foreach (Region region in regions)
370 {382 {
383 region.Clear();
384
371 this.Controls.Remove(region);385 this.Controls.Remove(region);
372386
373 try387 try
@@ -384,27 +398,21 @@
384398
385 regions.Clear();399 regions.Clear();
386 regions = null;400 regions = null;
387401 }
388 this.Controls.Remove(notLic);402
389 403 /// <summary>
390 // Want a check for powerpoint instances left open by this user404 /// Force a flush of the stats log
391 /*foreach (System.Diagnostics.Process proc in System.Diagnostics.Process.GetProcessesByName("POWERPNT"))405 /// </summary>
392 {406 public void FlushStats()
393 System.Diagnostics.Debug.WriteLine("Killing leftover Powerpoint process.", "MainForm - DestoryLayout");407 {
394 // Close them (End Process)408 try
395 proc.Kill();409 {
396 }*/410 _statLog.Flush();
397 }411 }
398412 catch
399 private Schedule schedule;413 {
400 private Collection<Region> regions;414 System.Diagnostics.Trace.WriteLine(new LogMessage("MainForm - FlushStats", "Unable to Flush Stats"), LogType.Error.ToString());
401 private bool isExpired = false;415 }
402 private Label notLic;416 }
403 private int scheduleId;
404 private int layoutId;
405
406 double layoutWidth;
407 double layoutHeight;
408 double scaleFactor;
409 }417 }
410}418}
411\ No newline at end of file419\ No newline at end of file
412420
=== modified file 'client/dotNET/Media.cs'
--- client/dotNET/Media.cs 2008-12-19 23:34:13 +0000
+++ client/dotNET/Media.cs 2009-08-03 21:56:06 +0000
@@ -28,6 +28,8 @@
28 {28 {
29 public Media(int width, int height, int top, int left)29 public Media(int width, int height, int top, int left)
30 {30 {
31 Hide();
32
31 this.width = width;33 this.width = width;
32 this.height = height;34 this.height = height;
33 this.top = top;35 this.top = top;
@@ -45,9 +47,12 @@
45 this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);47 this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
46 this.BackColor = System.Drawing.Color.Transparent;48 this.BackColor = System.Drawing.Color.Transparent;
47 this.TransparencyKey = System.Drawing.Color.White;49 this.TransparencyKey = System.Drawing.Color.White;
50
51 SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
52 SetStyle(ControlStyles.AllPaintingInWmPaint, true);
48 }53 }
4954
50 public virtual void RenderMedia() 55 protected void StartTimer()
51 {56 {
52 //start the timer57 //start the timer
53 if (!timerStarted && duration != 0)58 if (!timerStarted && duration != 0)
@@ -60,9 +65,15 @@
6065
61 timerStarted = true;66 timerStarted = true;
62 }67 }
68 }
69
70 public virtual void RenderMedia()
71 {
72 // Start the timer for this media
73 StartTimer();
6374
64 // Show the form75 // Show the form
65 this.Show();76 Show();
66 }77 }
6778
68 protected virtual void timer_Tick(object sender, EventArgs e)79 protected virtual void timer_Tick(object sender, EventArgs e)
6980
=== modified file 'client/dotNET/OptionForm.cs'
--- client/dotNET/OptionForm.cs 2009-03-08 11:40:17 +0000
+++ client/dotNET/OptionForm.cs 2009-07-26 11:40:59 +0000
@@ -58,6 +58,9 @@
58 System.Diagnostics.Debug.WriteLine("Getting the Hardware Key", "OptionForm");58 System.Diagnostics.Debug.WriteLine("Getting the Hardware Key", "OptionForm");
59 hardwareKey = new HardwareKey();59 hardwareKey = new HardwareKey();
6060
61 // Regenerate the key
62 hardwareKey.Regenerate();
63
61 System.Diagnostics.Debug.WriteLine("Getting the Library Path", "OptionForm");64 System.Diagnostics.Debug.WriteLine("Getting the Library Path", "OptionForm");
62 if (Properties.Settings.Default.LibraryPath == "DEFAULT")65 if (Properties.Settings.Default.LibraryPath == "DEFAULT")
63 {66 {
@@ -114,6 +117,8 @@
114 {117 {
115 textBoxResults.Text = "Sending Request";118 textBoxResults.Text = "Sending Request";
116119
120 this.xmds1.Url = Properties.Settings.Default.XiboClient_xmds_xmds;
121
117 Properties.Settings.Default.displayName = textBoxDisplayName.Text;122 Properties.Settings.Default.displayName = textBoxDisplayName.Text;
118 Properties.Settings.Default.Save();123 Properties.Settings.Default.Save();
119124
120125
=== modified file 'client/dotNET/Program.cs'
--- client/dotNET/Program.cs 2009-03-08 12:51:18 +0000
+++ client/dotNET/Program.cs 2009-07-26 11:40:59 +0000
@@ -35,25 +35,25 @@
35 Application.SetCompatibleTextRenderingDefault(false);35 Application.SetCompatibleTextRenderingDefault(false);
3636
37 System.Diagnostics.Trace.Listeners.Add(new XiboTraceListener());37 System.Diagnostics.Trace.Listeners.Add(new XiboTraceListener());
38 System.Diagnostics.Trace.AutoFlush = true;38 System.Diagnostics.Trace.AutoFlush = false;
3939
40 Form formMain;40 Form formMain;
4141
42 if (arg.GetLength(0) > 0)42 if (arg.GetLength(0) > 0)
43 {43 {
44 System.Diagnostics.Trace.WriteLine("Options Started", "Main");44 System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Options Started"), LogType.Info.ToString());
45 formMain = new OptionForm(); 45 formMain = new OptionForm();
46 }46 }
47 else47 else
48 {48 {
49 System.Diagnostics.Trace.WriteLine("Client Started", "Main");49 System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Client Started"), LogType.Info.ToString());
50 formMain = new MainForm();50 formMain = new MainForm();
51 }51 }
52 52
53 Application.Run(formMain);53 Application.Run(formMain);
5454
55 // Always flush at the end55 // Always flush at the end
56 System.Diagnostics.Trace.WriteLine("Application Finished", "Main");56 System.Diagnostics.Trace.WriteLine(new LogMessage("Main", "Application Finished"), LogType.Info.ToString());
57 System.Diagnostics.Trace.Flush();57 System.Diagnostics.Trace.Flush();
58 }58 }
59 }59 }
6060
=== modified file 'client/dotNET/Properties/Settings.Designer.cs'
--- client/dotNET/Properties/Settings.Designer.cs 2009-03-08 11:40:17 +0000
+++ client/dotNET/Properties/Settings.Designer.cs 2009-07-30 23:01:31 +0000
@@ -47,7 +47,7 @@
47 [global::System.Configuration.UserScopedSettingAttribute()]47 [global::System.Configuration.UserScopedSettingAttribute()]
48 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]48 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
49 [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]49 [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.WebServiceUrl)]
50 [global::System.Configuration.DefaultSettingValueAttribute("http://localhost/Xibo/server/xmds.php")]50 [global::System.Configuration.DefaultSettingValueAttribute("http://localhost/1.0.0/server/xmds.php")]
51 public string XiboClient_xmds_xmds {51 public string XiboClient_xmds_xmds {
52 get {52 get {
53 return ((string)(this["XiboClient_xmds_xmds"]));53 return ((string)(this["XiboClient_xmds_xmds"]));
@@ -93,18 +93,6 @@
93 }93 }
94 }94 }
95 95
96 [global::System.Configuration.UserScopedSettingAttribute()]
97 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
98 [global::System.Configuration.DefaultSettingValueAttribute("900")]
99 public decimal collectInterval {
100 get {
101 return ((decimal)(this["collectInterval"]));
102 }
103 set {
104 this["collectInterval"] = value;
105 }
106 }
107
108 [global::System.Configuration.ApplicationScopedSettingAttribute()]96 [global::System.Configuration.ApplicationScopedSettingAttribute()]
109 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]97 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
110 [global::System.Configuration.DefaultSettingValueAttribute("log.xml")]98 [global::System.Configuration.DefaultSettingValueAttribute("log.xml")]
@@ -215,5 +203,61 @@
215 return ((string)(this["Version"]));203 return ((string)(this["Version"]));
216 }204 }
217 }205 }
206
207 [global::System.Configuration.UserScopedSettingAttribute()]
208 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
209 [global::System.Configuration.DefaultSettingValueAttribute("")]
210 public string hardwareKey {
211 get {
212 return ((string)(this["hardwareKey"]));
213 }
214 set {
215 this["hardwareKey"] = value;
216 }
217 }
218
219 [global::System.Configuration.UserScopedSettingAttribute()]
220 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
221 [global::System.Configuration.DefaultSettingValueAttribute("50")]
222 public int StatsFlushCount {
223 get {
224 return ((int)(this["StatsFlushCount"]));
225 }
226 set {
227 this["StatsFlushCount"] = value;
228 }
229 }
230
231 [global::System.Configuration.ApplicationScopedSettingAttribute()]
232 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
233 [global::System.Configuration.DefaultSettingValueAttribute("stats.xml")]
234 public string StatsLogFile {
235 get {
236 return ((string)(this["StatsLogFile"]));
237 }
238 }
239
240 [global::System.Configuration.UserScopedSettingAttribute()]
241 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
242 public global::System.DateTime XmdsLastConnection {
243 get {
244 return ((global::System.DateTime)(this["XmdsLastConnection"]));
245 }
246 set {
247 this["XmdsLastConnection"] = value;
248 }
249 }
250
251 [global::System.Configuration.UserScopedSettingAttribute()]
252 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
253 [global::System.Configuration.DefaultSettingValueAttribute("900")]
254 public decimal collectInterval {
255 get {
256 return ((decimal)(this["collectInterval"]));
257 }
258 set {
259 this["collectInterval"] = value;
260 }
261 }
218 }262 }
219}263}
220264
=== modified file 'client/dotNET/Properties/Settings.settings'
--- client/dotNET/Properties/Settings.settings 2009-03-08 11:40:17 +0000
+++ client/dotNET/Properties/Settings.settings 2009-07-30 23:01:31 +0000
@@ -9,7 +9,7 @@
9 <Value Profile="(Default)">schedule.xml</Value>9 <Value Profile="(Default)">schedule.xml</Value>
10 </Setting>10 </Setting>
11 <Setting Name="XiboClient_xmds_xmds" Type="(Web Service URL)" Scope="User">11 <Setting Name="XiboClient_xmds_xmds" Type="(Web Service URL)" Scope="User">
12 <Value Profile="(Default)">http://localhost/Xibo/server/xmds.php</Value>12 <Value Profile="(Default)">http://localhost/1.0.0/server/xmds.php</Value>
13 </Setting>13 </Setting>
14 <Setting Name="ServerKey" Type="System.String" Scope="User">14 <Setting Name="ServerKey" Type="System.String" Scope="User">
15 <Value Profile="(Default)">changetocustomerkey</Value>15 <Value Profile="(Default)">changetocustomerkey</Value>
@@ -20,9 +20,6 @@
20 <Setting Name="licensed" Type="System.Int32" Scope="User">20 <Setting Name="licensed" Type="System.Int32" Scope="User">
21 <Value Profile="(Default)">0</Value>21 <Value Profile="(Default)">0</Value>
22 </Setting>22 </Setting>
23 <Setting Name="collectInterval" Type="System.Decimal" Scope="User">
24 <Value Profile="(Default)">900</Value>
25 </Setting>
26 <Setting Name="logLocation" Type="System.String" Scope="Application">23 <Setting Name="logLocation" Type="System.String" Scope="Application">
27 <Value Profile="(Default)">log.xml</Value>24 <Value Profile="(Default)">log.xml</Value>
28 </Setting>25 </Setting>
@@ -53,5 +50,20 @@
53 <Setting Name="Version" Type="System.String" Scope="Application">50 <Setting Name="Version" Type="System.String" Scope="Application">
54 <Value Profile="(Default)">1</Value>51 <Value Profile="(Default)">1</Value>
55 </Setting>52 </Setting>
53 <Setting Name="hardwareKey" Type="System.String" Scope="User">
54 <Value Profile="(Default)" />
55 </Setting>
56 <Setting Name="StatsFlushCount" Type="System.Int32" Scope="User">
57 <Value Profile="(Default)">50</Value>
58 </Setting>
59 <Setting Name="StatsLogFile" Type="System.String" Scope="Application">
60 <Value Profile="(Default)">stats.xml</Value>
61 </Setting>
62 <Setting Name="XmdsLastConnection" Type="System.DateTime" Scope="User">
63 <Value Profile="(Default)" />
64 </Setting>
65 <Setting Name="collectInterval" Type="System.Decimal" Scope="User">
66 <Value Profile="(Default)">900</Value>
67 </Setting>
56 </Settings>68 </Settings>
57</SettingsFile>69</SettingsFile>
58\ No newline at end of file70\ No newline at end of file
5971
=== modified file 'client/dotNET/Region.cs'
--- client/dotNET/Region.cs 2009-06-20 10:05:53 +0000
+++ client/dotNET/Region.cs 2009-08-03 21:56:06 +0000
@@ -31,9 +31,24 @@
31 class Region : Panel31 class Region : Panel
32 {32 {
33 private BlackList blackList;33 private BlackList blackList;
3434 public delegate void DurationElapsedDelegate();
35 public Region()35 public event DurationElapsedDelegate DurationElapsedEvent;
36
37 private Media media;
38 private RegionOptions options;
39 public bool hasExpired = false;
40 public bool layoutExpired = false;
41 private int currentSequence = -1;
42
43 // Stat objects
44 private StatLog _statLog;
45 private Stat _stat;
46
47 public Region(ref StatLog statLog)
36 {48 {
49 // Store the statLog
50 _statLog = statLog;
51
37 //default options52 //default options
38 options.width = 1024;53 options.width = 1024;
39 options.height = 768;54 options.height = 768;
@@ -45,6 +60,9 @@
45 this.Size = new System.Drawing.Size(options.width, options.height);60 this.Size = new System.Drawing.Size(options.width, options.height);
46 this.BackColor = System.Drawing.Color.Transparent;61 this.BackColor = System.Drawing.Color.Transparent;
4762
63 SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
64 SetStyle(ControlStyles.AllPaintingInWmPaint, true);
65
48 // Create a new BlackList for us to use66 // Create a new BlackList for us to use
49 blackList = new BlackList();67 blackList = new BlackList();
50 }68 }
@@ -139,19 +157,21 @@
139157
140 //add event handler158 //add event handler
141 media.DurationElapsedEvent += new Media.DurationElapsedDelegate(media_DurationElapsedEvent);159 media.DurationElapsedEvent += new Media.DurationElapsedDelegate(media_DurationElapsedEvent);
142 160
143 //any additional media specific render options (and starts the timer)161 //any additional media specific render options (and starts the timer)
144 media.RenderMedia();162 media.RenderMedia();
145163
164 Controls.Add(media);
165
146 // This media has started and is being replaced166 // This media has started and is being replaced
147 XmlLog.AppendStat("Media Start", StatType.MediaStart, options.scheduleId, options.layoutId, options.mediaid);167 _stat = new Stat();
148168 _stat.type = StatType.Media;
149 //media.Opacity = 0F; // Completely Opaque169 _stat.fromDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
150170 _stat.scheduleID = options.scheduleId;
151 this.Controls.Add(media);171 _stat.layoutID = options.layoutId;
172 _stat.mediaID = options.mediaid;
152173
153 System.Diagnostics.Debug.WriteLine("Showing new media", "Region - Eval Options");174 System.Diagnostics.Debug.WriteLine("Showing new media", "Region - Eval Options");
154
155 }175 }
156176
157 /// <summary>177 /// <summary>
@@ -180,7 +200,7 @@
180 return;200 return;
181 }201 }
182202
183203 // Move the sequence on
184 currentSequence++;204 currentSequence++;
185205
186 if (currentSequence >= options.mediaNodes.Count)206 if (currentSequence >= options.mediaNodes.Count)
@@ -201,10 +221,11 @@
201 options.text = "";221 options.text = "";
202 options.documentTemplate = "";222 options.documentTemplate = "";
203 options.copyrightNotice = "";223 options.copyrightNotice = "";
204 options.scrollSpeed = 1;224 options.scrollSpeed = 30;
205 options.updateInterval = 6;225 options.updateInterval = 6;
206 options.uri = "";226 options.uri = "";
207 options.direction = "none";227 options.direction = "none";
228 options.javaScript = "";
208229
209 // Get a media node230 // Get a media node
210 bool validNode = false;231 bool validNode = false;
@@ -284,7 +305,7 @@
284 System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode");305 System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode");
285 }306 }
286 }307 }
287 else if (option.Name == "updateInverval")308 else if (option.Name == "updateInterval")
288 {309 {
289 try310 try
290 {311 {
@@ -314,6 +335,10 @@
314 {335 {
315 options.text = raw.InnerText;336 options.text = raw.InnerText;
316 }337 }
338 else if (raw.Name == "embedScript")
339 {
340 options.javaScript = raw.InnerText;
341 }
317 }342 }
318343
319 // That should cover all the new options344 // That should cover all the new options
@@ -350,8 +375,18 @@
350 System.Diagnostics.Debug.WriteLine(ex.Message);375 System.Diagnostics.Debug.WriteLine(ex.Message);
351 }376 }
352377
353 // This media has expired and is being replaced378 try
354 XmlLog.AppendStat("Media Expired", StatType.MediaEnd, options.scheduleId, options.layoutId, options.mediaid);379 {
380 // Here we say that this media is expired
381 _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
382
383 // Record this stat event in the statLog object
384 _statLog.RecordStat(_stat);
385 }
386 catch
387 {
388 System.Diagnostics.Trace.WriteLine("No Stat record when one was expected", LogType.Error.ToString());
389 }
355 }390 }
356 }391 }
357392
@@ -367,6 +402,29 @@
367 }402 }
368403
369 /// <summary>404 /// <summary>
405 /// Clears the Region of anything that it shouldnt still have...
406 /// </summary>
407 public void Clear()
408 {
409 try
410 {
411 // What happens if we are disposing this region but we have not yet completed the stat event?
412 if (String.IsNullOrEmpty(_stat.toDate))
413 {
414 // Say that this media has ended
415 _stat.toDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
416
417 // Record this stat event in the statLog object
418 _statLog.RecordStat(_stat);
419 }
420 }
421 catch
422 {
423 System.Diagnostics.Trace.WriteLine(new LogMessage("Region - Clear", "Error closing off stat record"), LogType.Error.ToString());
424 }
425 }
426
427 /// <summary>
370 /// Performs the disposal.428 /// Performs the disposal.
371 /// </summary>429 /// </summary>
372 protected override void Dispose(bool disposing)430 protected override void Dispose(bool disposing)
@@ -393,16 +451,6 @@
393451
394 base.Dispose(disposing);452 base.Dispose(disposing);
395 }453 }
396
397 public delegate void DurationElapsedDelegate();
398 public event DurationElapsedDelegate DurationElapsedEvent;
399
400 private Media media;
401 private RegionOptions options;
402 public bool hasExpired = false;
403 public bool layoutExpired = false;
404 private int currentSequence = -1;
405
406 }454 }
407455
408 /// <summary>456 /// <summary>
@@ -431,6 +479,7 @@
431 public string text;479 public string text;
432 public string documentTemplate;480 public string documentTemplate;
433 public string copyrightNotice;481 public string copyrightNotice;
482 public string javaScript;
434 public int updateInterval;483 public int updateInterval;
435 public int scrollSpeed;484 public int scrollSpeed;
436 485
437486
=== removed file 'client/dotNET/Resources/Thumbs.db'
438Binary 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 differ487Binary 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
=== modified file 'client/dotNET/Rss.cs'
--- client/dotNET/Rss.cs 2009-06-20 10:39:40 +0000
+++ client/dotNET/Rss.cs 2009-08-03 21:56:06 +0000
@@ -81,9 +81,25 @@
81 this.documentText = options.text;81 this.documentText = options.text;
82 this.documentTemplate = options.documentTemplate;82 this.documentTemplate = options.documentTemplate;
8383
84 // What do we want the background to look like
85 String bodyStyle;
86 String document;
87
88 if (backgroundImage == null || backgroundImage == "")
89 {
90 bodyStyle = "background-color:" + backgroundColor + " ;";
91 }
92 else
93 {
94 bodyStyle = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";";
95 }
96
97 // Build the document string
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);
99
84 try100 try
85 {101 {
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;
87 }103 }
88 catch (Exception e)104 catch (Exception e)
89 {105 {
@@ -102,9 +118,10 @@
102 try118 try
103 {119 {
104 wc = new System.Net.WebClient();120 wc = new System.Net.WebClient();
105 wc.Encoding = System.Text.Encoding.UTF8;121
122 //wc.Encoding = System.Text.Encoding.UTF8;
106123
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");
108125
109 wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted);126 wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted);
110 127
@@ -119,6 +136,7 @@
119 void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)136 void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
120 {137 {
121 String rssContents;138 String rssContents;
139 System.Net.WebClient wc = (System.Net.WebClient) sender;
122140
123 if (e.Error != null)141 if (e.Error != null)
124 {142 {
@@ -133,10 +151,10 @@
133151
134 try152 try
135 {153 {
136 System.IO.StreamReader sr = new System.IO.StreamReader(data, Encoding.UTF8);154 System.IO.StreamReader sr = new System.IO.StreamReader(data, wc.Encoding);
137 rssContents = sr.ReadToEnd();155 rssContents = sr.ReadToEnd();
138156
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);
140158
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");
142 160
@@ -218,21 +236,14 @@
218236
219 //Add the control237 //Add the control
220 this.Controls.Add(webBrowser);238 this.Controls.Add(webBrowser);
239
240 Show();
221 }241 }
222242
223 private void loadLoading()243 private void loadLoading()
224 {244 {
225 HtmlDocument htmlDoc = webBrowser.Document;245 HtmlDocument htmlDoc = webBrowser.Document;
226246
227 if (backgroundImage == null || backgroundImage == "")
228 {
229 htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;";
230 }
231 else
232 {
233 htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";";
234 }
235
236 htmlDoc.Body.InnerHtml = "<h1>Loading...</h1>";247 htmlDoc.Body.InnerHtml = "<h1>Loading...</h1>";
237 }248 }
238249
@@ -243,15 +254,6 @@
243 254
244 htmlDoc.Body.InnerHtml = "";255 htmlDoc.Body.InnerHtml = "";
245256
246 if (backgroundImage == null || backgroundImage == "")
247 {
248 htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;";
249 }
250 else
251 {
252 htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";";
253 }
254
255 //Get the RSS257 //Get the RSS
256 rssReader = new RssReader();258 rssReader = new RssReader();
257 rssReader.Url = rssFilePath;259 rssReader.Url = rssFilePath;
@@ -343,7 +345,7 @@
343 textWrap = String.Format("width: {0}px;", this.width - 50);345 textWrap = String.Format("width: {0}px;", this.width - 50);
344 }346 }
345347
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);
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);
348 350
349 htmlDoc.Body.InnerHtml = textRender;351 htmlDoc.Body.InnerHtml = textRender;
@@ -423,7 +425,7 @@
423 /// </summary>425 /// </summary>
424 public override void RenderMedia()426 public override void RenderMedia()
425 {427 {
426 base.RenderMedia();428 base.StartTimer();
427 }429 }
428430
429 protected override void Dispose(bool disposing)431 protected override void Dispose(bool disposing)
430432
=== modified file 'client/dotNET/RssReader.cs'
--- client/dotNET/RssReader.cs 2008-12-19 23:34:13 +0000
+++ client/dotNET/RssReader.cs 2009-07-07 06:05:50 +0000
@@ -85,11 +85,8 @@
85 throw new ArgumentException("You must provide a feed URL");85 throw new ArgumentException("You must provide a feed URL");
86 }86 }
8787
88 //start the parsing process
89 XmlReader reader = XmlReader.Create(Url);
90
91 XmlDocument xmlDoc = new XmlDocument();88 XmlDocument xmlDoc = new XmlDocument();
92 xmlDoc.Load(reader);89 xmlDoc.Load(Url);
9390
94 //parse the items of the feed91 //parse the items of the feed
95 ParseDocElements(xmlDoc.SelectSingleNode("//channel"), "title", ref feedTitle);92 ParseDocElements(xmlDoc.SelectSingleNode("//channel"), "title", ref feedTitle);
@@ -97,8 +94,6 @@
9794
98 ParseRssItems(xmlDoc);95 ParseRssItems(xmlDoc);
9996
100 reader.Close();
101
102 //return the feed items97 //return the feed items
103 return feedItems;98 return feedItems;
104 }99 }
105100
=== modified file 'client/dotNET/Schedule.cs'
--- client/dotNET/Schedule.cs 2009-06-18 18:36:21 +0000
+++ client/dotNET/Schedule.cs 2009-08-03 21:56:06 +0000
@@ -95,24 +95,25 @@
95 if (e.Error != null)95 if (e.Error != null)
96 {96 {
97 //There was an error - what do we do?97 //There was an error - what do we do?
98 System.Diagnostics.Debug.WriteLine(e.Error.Message);98 System.Diagnostics.Trace.WriteLine(e.Error.Message);
9999
100 // Is it a "not licensed" error100 // Is it a "not licensed" error
101 if (e.Error.Message == "This display client is not licensed")101 if (e.Error.Message == "This display client is not licensed")
102 {102 {
103 Properties.Settings.Default.licensed = 0;103 Properties.Settings.Default.licensed = 0;
104 Properties.Settings.Default.Save();
105 }104 }
106105
107 xmdsProcessing = false;106 xmdsProcessing = false;
108 }107 }
109 else108 else
110 {109 {
110 // Set the flag to indicate we have a connection to XMDS
111 Properties.Settings.Default.XmdsLastConnection = DateTime.Now;
112
111 // Firstly we know we are licensed if we get this far113 // Firstly we know we are licensed if we get this far
112 if (Properties.Settings.Default.licensed == 0)114 if (Properties.Settings.Default.licensed == 0)
113 {115 {
114 Properties.Settings.Default.licensed = 1;116 Properties.Settings.Default.licensed = 1;
115 Properties.Settings.Default.Save();
116 }117 }
117118
118 try119 try
@@ -156,11 +157,6 @@
156 {157 {
157 System.Diagnostics.Debug.WriteLine("Schedule Retrival Complete.");158 System.Diagnostics.Debug.WriteLine("Schedule Retrival Complete.");
158159
159 // Send the XML log here if necessary
160 XmlLog log = new XmlLog();
161
162 log.PrepareAndSend();
163
164 // Set XMDS to no longer be processing160 // Set XMDS to no longer be processing
165 xmdsProcessing = false;161 xmdsProcessing = false;
166162
@@ -168,13 +164,16 @@
168 if (e.Error != null)164 if (e.Error != null)
169 {165 {
170 //There was an error - what do we do?166 //There was an error - what do we do?
171 System.Diagnostics.Debug.WriteLine(e.Error.Message);167 System.Diagnostics.Trace.WriteLine(e.Error.Message);
172 }168 }
173 else169 else
174 {170 {
175 // Only update the schedule if its changed.171 // Only update the schedule if its changed.
176 String md5CurrentSchedule = "";172 String md5CurrentSchedule = "";
177173
174 // Set the flag to indicate we have a connection to XMDS
175 Properties.Settings.Default.XmdsLastConnection = DateTime.Now;
176
178 try177 try
179 {178 {
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));
@@ -217,10 +216,17 @@
217 System.Diagnostics.Debug.WriteLine("Layout file changed");216 System.Diagnostics.Debug.WriteLine("Layout file changed");
218217
219 // If the layout that got changed is the current layout, move on218 // If the layout that got changed is the current layout, move on
220 if (layoutSchedule[currentLayout].layoutFile == Properties.Settings.Default.LibraryPath + @"\" + layoutPath)219 try
221 {220 {
222 forceChange = true;221 if (layoutSchedule[currentLayout].layoutFile == Properties.Settings.Default.LibraryPath + @"\" + layoutPath)
223 NextLayout();222 {
223 forceChange = true;
224 NextLayout();
225 }
226 }
227 catch (Exception ex)
228 {
229 System.Diagnostics.Trace.WriteLine(new LogMessage("fileCollector_LayoutFileChanged", String.Format("Unable to determine current layout with exception {0}", ex.Message)), LogType.Error.ToString());
224 }230 }
225 }231 }
226232
@@ -235,7 +241,7 @@
235 }241 }
236 else242 else
237 {243 {
238 Application.DoEvents(); // Make sure everything that is cued to render does244 Application.DoEvents(); // Make sure everything that is queued to render does
239245
240 xmdsProcessing = true;246 xmdsProcessing = true;
241247
@@ -244,6 +250,9 @@
244 // Fire off a get required files event - async250 // Fire off a get required files event - async
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);
246 }252 }
253
254 // Flush the log
255 System.Diagnostics.Trace.Flush();
247 }256 }
248257
249 /// <summary>258 /// <summary>
@@ -270,8 +279,6 @@
270279
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");
272281
273 XmlLog.AppendStat("Layout Finished", StatType.LayoutEnd, layoutSchedule[previousLayout].scheduleid, layoutSchedule[previousLayout].id, "0");
274
275 forceChange = false;282 forceChange = false;
276283
277 //Raise the event284 //Raise the event
278285
=== added file 'client/dotNET/StatLog.cs'
--- client/dotNET/StatLog.cs 1970-01-01 00:00:00 +0000
+++ client/dotNET/StatLog.cs 2009-08-02 15:54:18 +0000
@@ -0,0 +1,330 @@
1/*
2 * Xibo - Digitial Signage - http://www.xibo.org.uk
3 * Copyright (C) 2009 Daniel Garner
4 *
5 * This file is part of Xibo.
6 *
7 * Xibo is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * any later version.
11 *
12 * Xibo is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
19 */
20using System;
21using System.Collections.Generic;
22using System.Collections.ObjectModel;
23using System.Text;
24using System.IO;
25using System.Windows.Forms;
26using System.Xml;
27
28namespace XiboClient
29{
30 class StatLog
31 {
32 private Collection<Stat> _stats;
33 private xmds.xmds _xmds;
34 private String _lastSubmit;
35 private HardwareKey _hardwareKey;
36 private Boolean _xmdsProcessing;
37
38 public StatLog()
39 {
40 _stats = new Collection<Stat>();
41 _xmds = new xmds.xmds();
42
43 // Register a listener for the XMDS stats
44 _xmds.SubmitStatsCompleted += new XiboClient.xmds.SubmitStatsCompletedEventHandler(_xmds_SubmitStatsCompleted);
45
46 // Get the key for this display
47 _hardwareKey = new HardwareKey();
48
49 _xmdsProcessing = false;
50 }
51
52 /// <summary>
53 /// Record a complete Layout Event
54 /// </summary>
55 /// <param name="fromDT"></param>
56 /// <param name="toDT"></param>
57 /// <param name="scheduleID"></param>
58 /// <param name="layoutID"></param>
59 public void RecordLayout(String fromDT, String toDT, int scheduleID, int layoutID)
60 {
61 if (!Properties.Settings.Default.statsEnabled) return;
62
63 Stat stat = new Stat();
64
65 stat.type = StatType.Layout;
66 stat.fromDate = fromDT;
67 stat.toDate = toDT;
68 stat.scheduleID = scheduleID;
69 stat.layoutID = layoutID;
70
71 _stats.Add(stat);
72
73 return;
74 }
75
76 /// <summary>
77 /// Record a complete Media Event
78 /// </summary>
79 /// <param name="fromDT"></param>
80 /// <param name="toDT"></param>
81 /// <param name="layoutID"></param>
82 /// <param name="mediaID"></param>
83 public void RecordMedia(String fromDT, String toDT, int layoutID, String mediaID)
84 {
85 if (!Properties.Settings.Default.statsEnabled) return;
86
87 Stat stat = new Stat();
88
89 stat.type = StatType.Media;
90 stat.fromDate = fromDT;
91 stat.toDate = toDT;
92 stat.layoutID = layoutID;
93 stat.mediaID = mediaID;
94
95 _stats.Add(stat);
96
97 return;
98 }
99
100 /// <summary>
101 /// Record a complete Event
102 /// </summary>
103 /// <param name="fromDT"></param>
104 /// <param name="toDT"></param>
105 /// <param name="tag"></param>
106 public void RecordEvent(String fromDT, String toDT, String tag)
107 {
108 if (!Properties.Settings.Default.statsEnabled) return;
109
110 Stat stat = new Stat();
111
112 stat.type = StatType.Event;
113 stat.fromDate = fromDT;
114 stat.toDate = toDT;
115 stat.tag = tag;
116
117 _stats.Add(stat);
118
119 return;
120 }
121
122 /// <summary>
123 /// RecordStat
124 /// </summary>
125 /// <param name="stat"></param>
126 public void RecordStat(Stat stat)
127 {
128 System.Diagnostics.Debug.WriteLine(String.Format("Recording a Stat Record. Current Count = {0}", _stats.Count.ToString()), LogType.Audit.ToString());
129
130 _stats.Add(stat);
131
132 // At some point we will need to flush the stats
133 if (_stats.Count >= Properties.Settings.Default.StatsFlushCount)
134 {
135 Flush();
136 }
137
138 return;
139 }
140
141 /// <summary>
142 /// Flush the stats
143 /// </summary>
144 public void Flush()
145 {
146 System.Diagnostics.Debug.WriteLine(new LogMessage("Flush", String.Format("IN")), LogType.Audit.ToString());
147
148 // Determine if there is anything to flush
149 if (_stats.Count < 1 || _xmdsProcessing) return;
150
151 int threshold = ((int)Properties.Settings.Default.collectInterval * 5);
152
153 // Determine where we want to log.
154 if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now)
155 {
156 FlushToFile();
157 }
158 else
159 {
160 FlushToXmds();
161 }
162
163 System.Diagnostics.Debug.WriteLine(new LogMessage("Flush", String.Format("OUT")), LogType.Audit.ToString());
164 }
165
166 /// <summary>
167 /// Send the Stat to a File
168 /// </summary>
169 private void FlushToFile()
170 {
171 System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToFile", String.Format("IN")), LogType.Audit.ToString());
172
173 // There is something to flush - we want to parse the collection adding to the TextWriter each time.
174 try
175 {
176 // Open the Text Writer
177 StreamWriter tw = new StreamWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.StatsLogFile, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);
178
179 try
180 {
181 foreach (Stat stat in _stats)
182 {
183 tw.WriteLine(stat.ToString());
184 }
185 }
186 catch (Exception ex)
187 {
188 System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToFile", String.Format("Error writing stats line to file with exception {0}", ex.Message)), LogType.Error.ToString());
189 }
190 finally
191 {
192 // Close the tw.
193 tw.Close();
194 tw.Dispose();
195 }
196 }
197 catch (Exception ex)
198 {
199 // Log this exception
200 System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToFile", String.Format("Error writing stats to file with exception {0}", ex.Message)), LogType.Error.ToString());
201 }
202 finally
203 {
204 // Always clear the stats. If the file open failed for some reason then we dont want to try again
205 _stats.Clear();
206 }
207
208 System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToFile", String.Format("OUT")), LogType.Audit.ToString());
209 }
210
211 /// <summary>
212 /// Send the Stats to XMDS
213 /// </summary>
214 private void FlushToXmds()
215 {
216 System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToXmds", String.Format("IN")), LogType.Audit.ToString());
217
218 String stats;
219
220 stats = "<log>";
221
222 // Load the Stats collection into a string
223 try
224 {
225 foreach (Stat stat in _stats)
226 {
227 stats += stat.ToString();
228 }
229 }
230 catch (Exception ex)
231 {
232 System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToXmds", String.Format("Error converting stat to a string {0}", ex.Message)), LogType.Error.ToString());
233 }
234
235 stats += "</log>";
236
237 // Store the stats as the last sent (so we have a record if it fails)
238 _lastSubmit = stats;
239
240 // Clear the stats collection
241 _stats.Clear();
242
243 // Submit the string to XMDS
244 _xmdsProcessing = true;
245
246 _xmds.SubmitStatsAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, _hardwareKey.Key, stats);
247
248 // Log out
249 System.Diagnostics.Debug.WriteLine(new LogMessage("FlushToXmds", String.Format("OUT")), LogType.Audit.ToString());
250 }
251
252 /// <summary>
253 /// Capture the XMDS call and see if it went well
254 /// </summary>
255 /// <param name="sender"></param>
256 /// <param name="e"></param>
257 void _xmds_SubmitStatsCompleted(object sender, XiboClient.xmds.SubmitStatsCompletedEventArgs e)
258 {
259 System.Diagnostics.Debug.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("IN")), LogType.Audit.ToString());
260
261 _xmdsProcessing = false;
262
263 // Test if we succeeded or not
264 if (e.Error != null)
265 {
266 // We had an error, log it.
267 System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Error during Submit to XMDS {0}", e.Error.Message)), LogType.Error.ToString());
268
269 // Dump the stats to a file instead
270 if (_lastSubmit != "")
271 {
272 try
273 {
274 // Open the Text Writer
275 StreamWriter tw = new StreamWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.StatsLogFile, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);
276
277 try
278 {
279 tw.Write(_lastSubmit);
280 }
281 catch (Exception ex)
282 {
283 // Log this exception
284 System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Error writing stats to file with exception {0}", ex.Message)), LogType.Error.ToString());
285 }
286 finally
287 {
288 tw.Close();
289 tw.Dispose();
290 }
291 }
292 catch (Exception ex)
293 {
294 // Log this exception
295 System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("Could not open the file with exception {0}", ex.Message)), LogType.Error.ToString());
296 }
297 }
298 }
299
300 // Clear the last sumbit
301 _lastSubmit = "";
302
303 System.Diagnostics.Debug.WriteLine(new LogMessage("_xmds_SubmitStatsCompleted", String.Format("OUT")), LogType.Audit.ToString());
304 }
305 }
306
307 class Stat
308 {
309 public StatType type;
310 public String fromDate;
311 public String toDate;
312 public int layoutID;
313 public int scheduleID;
314 public String mediaID;
315 public String tag;
316
317 public override string ToString()
318 {
319 // Format the message into the expected XML sub nodes.
320 // Just do this with a string builder rather than an XML builder.
321 String theMessage;
322
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);
324
325 return theMessage;
326 }
327 }
328
329 public enum StatType { Layout, Media, Event };
330}
0331
=== modified file 'client/dotNET/Text.cs'
--- client/dotNET/Text.cs 2009-06-20 10:39:40 +0000
+++ client/dotNET/Text.cs 2009-08-03 21:56:06 +0000
@@ -27,7 +27,17 @@
27{27{
28 class Text : Media28 class Text : Media
29 {29 {
30 private double scaleFactor;30 private string filePath;
31 private string direction;
32 private string backgroundImage;
33 private string backgroundColor;
34 private WebBrowser webBrowser;
35 private string _documentText;
36
37 private string backgroundTop;
38 private string backgroundLeft;
39 private double _scaleFactor;
40 private int _scrollSpeed;
3141
32 //<summary>42 //<summary>
33 //Creates a Text display control43 //Creates a Text display control
@@ -41,7 +51,7 @@
41 this.backgroundImage = options.backgroundImage;51 this.backgroundImage = options.backgroundImage;
42 this.backgroundColor = options.backgroundColor;52 this.backgroundColor = options.backgroundColor;
43 53
44 scaleFactor = options.scaleFactor;54 _scaleFactor = options.scaleFactor;
4555
46 backgroundTop = options.backgroundTop + "px";56 backgroundTop = options.backgroundTop + "px";
47 backgroundLeft = options.backgroundLeft + "px";57 backgroundLeft = options.backgroundLeft + "px";
@@ -50,12 +60,28 @@
50 webBrowser.Size = this.Size;60 webBrowser.Size = this.Size;
51 webBrowser.ScrollBarsEnabled = false;61 webBrowser.ScrollBarsEnabled = false;
5262
53 //set the text63 // set the text
54 documentText = options.text;64 _documentText = options.text;
65 _scrollSpeed = options.scrollSpeed;
66
67 // What do we want the background to look like
68 String bodyStyle;
69 String document;
70
71 if (backgroundImage == null || backgroundImage == "")
72 {
73 bodyStyle = "background-color:" + backgroundColor + " ;";
74 }
75 else
76 {
77 bodyStyle = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";";
78 }
79
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);
5581
56 try82 try
57 {83 {
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;
59 }85 }
60 catch (Exception e)86 catch (Exception e)
61 {87 {
@@ -68,24 +94,14 @@
6894
69 void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)95 void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
70 {96 {
71
72 HtmlDocument htmlDoc = webBrowser.Document;97 HtmlDocument htmlDoc = webBrowser.Document;
73
74 if (backgroundImage == null || backgroundImage == "")
75 {
76 htmlDoc.Body.Style = "background-color:" + backgroundColor + " ;";
77 }
78 else
79 {
80 htmlDoc.Body.Style = "background-image: url('" + backgroundImage + "'); background-attachment:fixed; background-color:" + backgroundColor + " background-repeat: no-repeat; background-position: " + backgroundLeft + " " + backgroundTop + ";";
81 }
8298
83 //decide whether we need a marquee or not99 //decide whether we need a marquee or not
84 if (direction == "none")100 if (direction == "none")
85 {101 {
86 //we dont102 //we dont
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
88 htmlDoc.Body.InnerHtml = documentText;104 htmlDoc.Body.InnerHtml = _documentText;
89 }105 }
90 else106 else
91 {107 {
@@ -93,24 +109,36 @@
93 String textWrap = "";109 String textWrap = "";
94 if (direction == "left" || direction == "right") textWrap = "white-space: nowrap";110 if (direction == "left" || direction == "right") textWrap = "white-space: nowrap";
95111
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);
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);
98114
99 htmlDoc.Body.InnerHtml = textRender;115 htmlDoc.Body.InnerHtml = textRender;
100116
101 Object[] objArray = new Object[2];117 Object[] objArray = new Object[2];
102 objArray[0] = direction;118 objArray[0] = direction;
103 objArray[1] = 30;119 objArray[1] = _scrollSpeed;
104120
105 htmlDoc.InvokeScript("init", objArray);121 htmlDoc.InvokeScript("init", objArray);
106 }122 }
107123
124 System.Diagnostics.Debug.WriteLine(htmlDoc.Body.InnerHtml, LogType.Audit.ToString());
125
126 // Try to call the EmbedInit Function
127 try
128 {
129 htmlDoc.InvokeScript("EmbedInit");
130 }
131 catch { }
132
133 // Add the control
108 this.Controls.Add(webBrowser);134 this.Controls.Add(webBrowser);
135
136 Show();
109 }137 }
110138
111 public override void RenderMedia()139 public override void RenderMedia()
112 {140 {
113 base.RenderMedia();141 base.StartTimer();
114 }142 }
115143
116 protected override void Dispose(bool disposing)144 protected override void Dispose(bool disposing)
@@ -123,15 +151,5 @@
123151
124 base.Dispose(disposing);152 base.Dispose(disposing);
125 }153 }
126
127 private string filePath;
128 private string direction;
129 private string backgroundImage;
130 private string backgroundColor;
131 private WebBrowser webBrowser;
132 private string documentText;
133
134 private string backgroundTop;
135 private string backgroundLeft;
136 }154 }
137}155}
138156
=== modified file 'client/dotNET/Web References/xmds/Reference.cs'
--- client/dotNET/Web References/xmds/Reference.cs 2008-12-19 23:34:13 +0000
+++ client/dotNET/Web References/xmds/Reference.cs 2009-07-26 11:40:59 +0000
@@ -41,6 +41,10 @@
41 41
42 private System.Threading.SendOrPostCallback BlackListOperationCompleted;42 private System.Threading.SendOrPostCallback BlackListOperationCompleted;
43 43
44 private System.Threading.SendOrPostCallback SubmitLogOperationCompleted;
45
46 private System.Threading.SendOrPostCallback SubmitStatsOperationCompleted;
47
44 private bool useDefaultCredentialsSetExplicitly;48 private bool useDefaultCredentialsSetExplicitly;
45 49
46 /// <remarks/>50 /// <remarks/>
@@ -98,6 +102,12 @@
98 public event BlackListCompletedEventHandler BlackListCompleted;102 public event BlackListCompletedEventHandler BlackListCompleted;
99 103
100 /// <remarks/>104 /// <remarks/>
105 public event SubmitLogCompletedEventHandler SubmitLogCompleted;
106
107 /// <remarks/>
108 public event SubmitStatsCompletedEventHandler SubmitStatsCompleted;
109
110 /// <remarks/>
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")]
102 [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")]112 [return: System.Xml.Serialization.SoapElementAttribute("ActivationMessage")]
103 public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) {113 public string RegisterDisplay(string serverKey, string hardwareKey, string displayName, string version) {
@@ -320,6 +330,78 @@
320 }330 }
321 331
322 /// <remarks/>332 /// <remarks/>
333 [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#SubmitLog", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")]
334 [return: System.Xml.Serialization.SoapElementAttribute("success")]
335 public bool SubmitLog(string version, string serverKey, string hardwareKey, string logXml) {
336 object[] results = this.Invoke("SubmitLog", new object[] {
337 version,
338 serverKey,
339 hardwareKey,
340 logXml});
341 return ((bool)(results[0]));
342 }
343
344 /// <remarks/>
345 public void SubmitLogAsync(string version, string serverKey, string hardwareKey, string logXml) {
346 this.SubmitLogAsync(version, serverKey, hardwareKey, logXml, null);
347 }
348
349 /// <remarks/>
350 public void SubmitLogAsync(string version, string serverKey, string hardwareKey, string logXml, object userState) {
351 if ((this.SubmitLogOperationCompleted == null)) {
352 this.SubmitLogOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitLogOperationCompleted);
353 }
354 this.InvokeAsync("SubmitLog", new object[] {
355 version,
356 serverKey,
357 hardwareKey,
358 logXml}, this.SubmitLogOperationCompleted, userState);
359 }
360
361 private void OnSubmitLogOperationCompleted(object arg) {
362 if ((this.SubmitLogCompleted != null)) {
363 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
364 this.SubmitLogCompleted(this, new SubmitLogCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
365 }
366 }
367
368 /// <remarks/>
369 [System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:xmds#SubmitLog", RequestNamespace="urn:xmds", ResponseNamespace="urn:xmds")]
370 [return: System.Xml.Serialization.SoapElementAttribute("success")]
371 public bool SubmitStats(string version, string serverKey, string hardwareKey, string statXml) {
372 object[] results = this.Invoke("SubmitStats", new object[] {
373 version,
374 serverKey,
375 hardwareKey,
376 statXml});
377 return ((bool)(results[0]));
378 }
379
380 /// <remarks/>
381 public void SubmitStatsAsync(string version, string serverKey, string hardwareKey, string statXml) {
382 this.SubmitStatsAsync(version, serverKey, hardwareKey, statXml, null);
383 }
384
385 /// <remarks/>
386 public void SubmitStatsAsync(string version, string serverKey, string hardwareKey, string statXml, object userState) {
387 if ((this.SubmitStatsOperationCompleted == null)) {
388 this.SubmitStatsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitStatsOperationCompleted);
389 }
390 this.InvokeAsync("SubmitStats", new object[] {
391 version,
392 serverKey,
393 hardwareKey,
394 statXml}, this.SubmitStatsOperationCompleted, userState);
395 }
396
397 private void OnSubmitStatsOperationCompleted(object arg) {
398 if ((this.SubmitStatsCompleted != null)) {
399 System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
400 this.SubmitStatsCompleted(this, new SubmitStatsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
401 }
402 }
403
404 /// <remarks/>
323 public new void CancelAsync(object userState) {405 public new void CancelAsync(object userState) {
324 base.CancelAsync(userState);406 base.CancelAsync(userState);
325 }407 }
@@ -493,6 +575,58 @@
493 }575 }
494 }576 }
495 }577 }
578
579 /// <remarks/>
580 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
581 public delegate void SubmitLogCompletedEventHandler(object sender, SubmitLogCompletedEventArgs e);
582
583 /// <remarks/>
584 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
585 [System.Diagnostics.DebuggerStepThroughAttribute()]
586 [System.ComponentModel.DesignerCategoryAttribute("code")]
587 public partial class SubmitLogCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
588
589 private object[] results;
590
591 internal SubmitLogCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
592 base(exception, cancelled, userState) {
593 this.results = results;
594 }
595
596 /// <remarks/>
597 public bool Result {
598 get {
599 this.RaiseExceptionIfNecessary();
600 return ((bool)(this.results[0]));
601 }
602 }
603 }
604
605 /// <remarks/>
606 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
607 public delegate void SubmitStatsCompletedEventHandler(object sender, SubmitStatsCompletedEventArgs e);
608
609 /// <remarks/>
610 [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.1433")]
611 [System.Diagnostics.DebuggerStepThroughAttribute()]
612 [System.ComponentModel.DesignerCategoryAttribute("code")]
613 public partial class SubmitStatsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
614
615 private object[] results;
616
617 internal SubmitStatsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
618 base(exception, cancelled, userState) {
619 this.results = results;
620 }
621
622 /// <remarks/>
623 public bool Result {
624 get {
625 this.RaiseExceptionIfNecessary();
626 return ((bool)(this.results[0]));
627 }
628 }
629 }
496}630}
497631
498#pragma warning restore 1591632#pragma warning restore 1591
499\ No newline at end of file633\ No newline at end of file
500634
=== modified file 'client/dotNET/Web References/xmds/Reference.map'
--- client/dotNET/Web References/xmds/Reference.map 2009-01-23 20:51:50 +0000
+++ client/dotNET/Web References/xmds/Reference.map 2009-07-26 11:40:59 +0000
@@ -1,6 +1,6 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
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">
3 <Results>3 <Results>
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" />
5 </Results>5 </Results>
6</DiscoveryClientResultsFile>6</DiscoveryClientResultsFile>
7\ No newline at end of file7\ No newline at end of file
88
=== modified file 'client/dotNET/Web References/xmds/xmds.wsdl'
--- client/dotNET/Web References/xmds/xmds.wsdl 2009-01-23 20:51:50 +0000
+++ client/dotNET/Web References/xmds/xmds.wsdl 2009-07-26 11:40:59 +0000
@@ -63,6 +63,24 @@
63 <wsdl:message name="BlackListResponse">63 <wsdl:message name="BlackListResponse">
64 <wsdl:part name="success" type="xsd:boolean" />64 <wsdl:part name="success" type="xsd:boolean" />
65 </wsdl:message>65 </wsdl:message>
66 <wsdl:message name="SubmitLogRequest">
67 <wsdl:part name="version" type="xsd:string" />
68 <wsdl:part name="serverKey" type="xsd:string" />
69 <wsdl:part name="hardwareKey" type="xsd:string" />
70 <wsdl:part name="logXml" type="xsd:string" />
71 </wsdl:message>
72 <wsdl:message name="SubmitLogResponse">
73 <wsdl:part name="success" type="xsd:boolean" />
74 </wsdl:message>
75 <wsdl:message name="SubmitStatsRequest">
76 <wsdl:part name="version" type="xsd:string" />
77 <wsdl:part name="serverKey" type="xsd:string" />
78 <wsdl:part name="hardwareKey" type="xsd:string" />
79 <wsdl:part name="statXml" type="xsd:string" />
80 </wsdl:message>
81 <wsdl:message name="SubmitStatsResponse">
82 <wsdl:part name="success" type="xsd:boolean" />
83 </wsdl:message>
66 <wsdl:portType name="xmdsPortType">84 <wsdl:portType name="xmdsPortType">
67 <wsdl:operation name="RegisterDisplay">85 <wsdl:operation name="RegisterDisplay">
68 <documentation>Registered the Display on the Xibo Network</documentation>86 <documentation>Registered the Display on the Xibo Network</documentation>
@@ -94,6 +112,16 @@
94 <wsdl:input message="tns:BlackListRequest" />112 <wsdl:input message="tns:BlackListRequest" />
95 <wsdl:output message="tns:BlackListResponse" />113 <wsdl:output message="tns:BlackListResponse" />
96 </wsdl:operation>114 </wsdl:operation>
115 <wsdl:operation name="SubmitLog">
116 <documentation>Submit Logging from the Client</documentation>
117 <wsdl:input message="tns:SubmitLogRequest" />
118 <wsdl:output message="tns:SubmitLogResponse" />
119 </wsdl:operation>
120 <wsdl:operation name="SubmitStats">
121 <documentation>Submit Display statistics from the Client</documentation>
122 <wsdl:input message="tns:SubmitStatsRequest" />
123 <wsdl:output message="tns:SubmitStatsResponse" />
124 </wsdl:operation>
97 </wsdl:portType>125 </wsdl:portType>
98 <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType">126 <wsdl:binding name="xmdsBinding" type="tns:xmdsPortType">
99 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />127 <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
@@ -151,10 +179,28 @@
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/" />
152 </wsdl:output>180 </wsdl:output>
153 </wsdl:operation>181 </wsdl:operation>
182 <wsdl:operation name="SubmitLog">
183 <soap:operation soapAction="urn:xmds#SubmitLog" style="rpc" />
184 <wsdl:input>
185 <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
186 </wsdl:input>
187 <wsdl:output>
188 <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
189 </wsdl:output>
190 </wsdl:operation>
191 <wsdl:operation name="SubmitStats">
192 <soap:operation soapAction="urn:xmds#SubmitLog" style="rpc" />
193 <wsdl:input>
194 <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
195 </wsdl:input>
196 <wsdl:output>
197 <soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
198 </wsdl:output>
199 </wsdl:operation>
154 </wsdl:binding>200 </wsdl:binding>
155 <wsdl:service name="xmds">201 <wsdl:service name="xmds">
156 <wsdl:port name="xmdsPort" binding="tns:xmdsBinding">202 <wsdl:port name="xmdsPort" binding="tns:xmdsBinding">
157 <soap:address location="http://localhost/Xibo/server/xmds.php" />203 <soap:address location="http://localhost/1.0.0/server/xmds.php" />
158 </wsdl:port>204 </wsdl:port>
159 </wsdl:service>205 </wsdl:service>
160</wsdl:definitions>206</wsdl:definitions>
161\ No newline at end of file207\ No newline at end of file
162208
=== modified file 'client/dotNET/XiboClient.csproj'
--- client/dotNET/XiboClient.csproj 2009-03-28 19:13:50 +0000
+++ client/dotNET/XiboClient.csproj 2009-07-26 11:40:59 +0000
@@ -141,9 +141,11 @@
141 <Compile Include="RssReader.cs" />141 <Compile Include="RssReader.cs" />
142 <Compile Include="Schedule.cs" />142 <Compile Include="Schedule.cs" />
143 <Compile Include="Settings.cs" />143 <Compile Include="Settings.cs" />
144 <Compile Include="StatLog.cs" />
144 <Compile Include="Text.cs">145 <Compile Include="Text.cs">
145 <SubType>Form</SubType>146 <SubType>Form</SubType>
146 </Compile>147 </Compile>
148 <Compile Include="LogMessage.cs" />
147 <Compile Include="Video.cs">149 <Compile Include="Video.cs">
148 <SubType>Form</SubType>150 <SubType>Form</SubType>
149 </Compile>151 </Compile>
@@ -163,7 +165,6 @@
163 </Compile>165 </Compile>
164 <Compile Include="WindowAnimator.cs" />166 <Compile Include="WindowAnimator.cs" />
165 <Compile Include="XiboTraceListener.cs" />167 <Compile Include="XiboTraceListener.cs" />
166 <Compile Include="XmlLog.cs" />
167 </ItemGroup>168 </ItemGroup>
168 <ItemGroup>169 <ItemGroup>
169 <COMReference Include="AxShockwaveFlashObjects">170 <COMReference Include="AxShockwaveFlashObjects">
@@ -226,10 +227,10 @@
226 <WebReferences Include="Web References\" />227 <WebReferences Include="Web References\" />
227 </ItemGroup>228 </ItemGroup>
228 <ItemGroup>229 <ItemGroup>
229 <WebReferenceUrl Include="http://localhost/Xibo/server/xmds.php%3fwsdl">230 <WebReferenceUrl Include="http://localhost/1.0.0/server/xmds.php%3fwsdl">
230 <UrlBehavior>Dynamic</UrlBehavior>231 <UrlBehavior>Dynamic</UrlBehavior>
231 <RelPath>Web References\xmds\</RelPath>232 <RelPath>Web References\xmds\</RelPath>
232 <UpdateFromURL>http://localhost/Xibo/server/xmds.php%3fwsdl</UpdateFromURL>233 <UpdateFromURL>http://localhost/1.0.0/server/xmds.php%3fwsdl</UpdateFromURL>
233 <ServiceLocationURL>234 <ServiceLocationURL>
234 </ServiceLocationURL>235 </ServiceLocationURL>
235 <CachedDynamicPropName>236 <CachedDynamicPropName>
236237
=== modified file 'client/dotNET/XiboTraceListener.cs'
--- client/dotNET/XiboTraceListener.cs 2009-03-08 12:41:17 +0000
+++ client/dotNET/XiboTraceListener.cs 2009-08-02 15:54:18 +0000
@@ -30,6 +30,13 @@
30{30{
31 class XiboTraceListener : TraceListener31 class XiboTraceListener : TraceListener
32 {32 {
33 private Collection<TraceMessage> _traceMessages;
34 private String _logPath;
35 private Boolean _xmdsProcessing;
36 private xmds.xmds _xmds;
37 private String _lastSubmit;
38 private HardwareKey _hardwareKey;
39
33 public XiboTraceListener()40 public XiboTraceListener()
34 {41 {
35 InitializeListener();42 InitializeListener();
@@ -44,8 +51,17 @@
44 private void InitializeListener()51 private void InitializeListener()
45 {52 {
46 // Make a new collection of TraceMessages53 // Make a new collection of TraceMessages
47 traceMessages = new Collection<TraceMessage>();54 _traceMessages = new Collection<TraceMessage>();
48 logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation;55 _logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation;
56
57 _xmdsProcessing = false;
58 _xmds = new xmds.xmds();
59
60 // Register a listener for the XMDS stats
61 _xmds.SubmitLogCompleted += new XiboClient.xmds.SubmitLogCompletedEventHandler(_xmds_SubmitLogCompleted);
62
63 // Get the key for this display
64 _hardwareKey = new HardwareKey();
49 }65 }
5066
51 private void AddToCollection(string message, string category)67 private void AddToCollection(string message, string category)
@@ -56,62 +72,133 @@
56 traceMessage.dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");72 traceMessage.dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
57 traceMessage.message = message;73 traceMessage.message = message;
5874
59 traceMessages.Add(traceMessage);75 _traceMessages.Add(traceMessage);
60 }76 }
6177
62 private void FlushToFile()78 private void FlushToFile()
63 {79 {
80 if (_traceMessages.Count < 1) return;
81
64 try82 try
65 {83 {
66 XmlTextWriter xw = new XmlTextWriter(File.Open(logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);84 // Open the Text Writer
6785 StreamWriter tw = new StreamWriter(File.Open(_logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);
68 foreach (TraceMessage message in traceMessages)86
87 String theMessage;
88
89 foreach (TraceMessage message in _traceMessages)
69 {90 {
70 xw.WriteStartElement("trace");91 String traceMsg = message.message.ToString();
71 xw.WriteElementString("category", message.category);92
72 xw.WriteElementString("date", message.dateTime);93 theMessage = String.Format("<trace date=\"{0}\" category=\"{1}\">{2}</trace>", message.dateTime, message.category, traceMsg);
73 xw.WriteElementString("message", message.message);94 tw.WriteLine(theMessage);
74 xw.WriteEndElement();
75 }95 }
7696
77 xw.Close();97 // Close the tw.
98 tw.Close();
99 tw.Dispose();
78100
79 // Remove the messages we have just added101 // Remove the messages we have just added
80 traceMessages.Clear();102 _traceMessages.Clear();
81 }103 }
82 catch (Exception e)104 catch
83 {105 {
84 // What can we do?106 // What can we do?
85 }107 }
86108 finally
87 // Test the size of the XML file109 {
88 FileInfo fileInfo = new FileInfo(logPath);110 _traceMessages.Clear();
89111 }
90 // If its greater than a certain size - send it to the WebService112 }
91 if (fileInfo.Length > 6000)113
92 {114 /// <summary>
93 // Move the current log file to a ready file115 /// Flush the log to XMDS
94 try116 /// </summary>
95 {117 private void FlushToXmds()
96 String logPathTemp = Application.UserAppDataPath + @"/" + String.Format("{0}.ready", DateTime.Now.ToFileTime().ToString());118 {
97 119 String log;
98 File.Move(logPath, logPathTemp);120
99 }121 log = "<log>";
100 catch (Exception ex)122
101 {123 // Load the Stats collection into a string
102 124 try
103 }125 {
104 }126 foreach (TraceMessage traceMessage in _traceMessages)
127 {
128 String traceMsg = traceMessage.message.ToString();
129
130 log += String.Format("<trace date=\"{0}\" category=\"{1}\">{2}</trace>", traceMessage.dateTime, traceMessage.category, traceMsg);
131 }
132 }
133 catch (Exception ex)
134 {
135 System.Diagnostics.Trace.WriteLine(new LogMessage("FlushToXmds", String.Format("Error converting stat to a string {0}", ex.Message)), LogType.Error.ToString());
136 }
137
138 log += "</log>";
139
140 // Store the stats as the last sent (so we have a record if it fails)
141 _lastSubmit = log;
142
143 // Clear the stats collection
144 _traceMessages.Clear();
145
146 // Submit the string to XMDS
147 _xmdsProcessing = true;
148
149 _xmds.SubmitLogAsync(Properties.Settings.Default.Version, Properties.Settings.Default.ServerKey, _hardwareKey.Key, log);
150 }
151
152 /// <summary>
153 /// Capture the XMDS call and see if it went well
154 /// </summary>
155 /// <param name="sender"></param>
156 /// <param name="e"></param>
157 void _xmds_SubmitLogCompleted(object sender, XiboClient.xmds.SubmitLogCompletedEventArgs e)
158 {
159 _xmdsProcessing = false;
160
161 // Test if we succeeded or not
162 if (e.Error != null)
163 {
164 // We had an error, log it.
165 System.Diagnostics.Trace.WriteLine(new LogMessage("_xmds_SubmitLogCompleted", String.Format("Error during Submit to XMDS {0}", e.Error.Message)), LogType.Error.ToString());
166
167 // Dump the stats to a file instead
168 if (_lastSubmit != "")
169 {
170 try
171 {
172 // Open the Text Writer
173 StreamWriter tw = new StreamWriter(File.Open(_logPath, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);
174
175 try
176 {
177 tw.Write(_lastSubmit);
178 }
179 catch {}
180 finally
181 {
182 tw.Close();
183 tw.Dispose();
184 }
185 }
186 catch {}
187 }
188 }
189
190 // Clear the last sumbit
191 _lastSubmit = "";
105 }192 }
106193
107 public override void Write(string message)194 public override void Write(string message)
108 {195 {
109 AddToCollection(message, "");196 AddToCollection(message, "Audit");
110 }197 }
111198
112 public override void Write(object o)199 public override void Write(object o)
113 {200 {
114 AddToCollection(o.ToString(), "");201 AddToCollection(o.ToString(), "Audit");
115 }202 }
116203
117 public override void Write(string message, string category)204 public override void Write(string message, string category)
@@ -162,16 +249,47 @@
162249
163 public override void Close()250 public override void Close()
164 {251 {
165 FlushToFile();252 // Determine if there is anything to flush
253 if (_traceMessages.Count < 1) return;
254
255 // As we are closing if XMDS is already busy just log to file.
256 if (_xmdsProcessing)
257 {
258 FlushToFile();
259 }
260 else
261 {
262 int threshold = ((int)Properties.Settings.Default.collectInterval * 5);
263
264 // Determine where we want to log.
265 if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now)
266 {
267 FlushToFile();
268 }
269 else
270 {
271 FlushToXmds();
272 }
273 }
166 }274 }
167275
168 public override void Flush()276 public override void Flush()
169 {277 {
170 FlushToFile();278 // Determine if there is anything to flush
279 if (_traceMessages.Count < 1 || _xmdsProcessing) return;
280
281 int threshold = ((int)Properties.Settings.Default.collectInterval * 5);
282
283 // Determine where we want to log.
284 if (Properties.Settings.Default.XmdsLastConnection.AddSeconds(threshold) < DateTime.Now)
285 {
286 FlushToFile();
287 }
288 else
289 {
290 FlushToXmds();
291 }
171 }292 }
172
173 private Collection<TraceMessage> traceMessages;
174 private String logPath;
175 }293 }
176294
177 [Serializable]295 [Serializable]
178296
=== removed file 'client/dotNET/XmlLog.cs'
--- client/dotNET/XmlLog.cs 2009-03-08 12:51:18 +0000
+++ client/dotNET/XmlLog.cs 1970-01-01 00:00:00 +0000
@@ -1,172 +0,0 @@
1/*
2 * Xibo - Digitial Signage - http://www.xibo.org.uk
3 * Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
4 *
5 * This file is part of Xibo.
6 *
7 * Xibo is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * any later version.
11 *
12 * Xibo is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
19 */
20using System;
21using System.Collections.Generic;
22using System.IO;
23using System.Text;
24using System.Windows.Forms;
25using System.Xml;
26
27namespace XiboClient
28{
29 class XmlLog
30 {
31 /// <summary>
32 /// Creates a new XmlLog Class used for sending the log
33 /// </summary>
34 /// <param name="logPath"></param>
35 public XmlLog()
36 {
37 logPath = Application.UserAppDataPath + @"/" + Properties.Settings.Default.logLocation;
38
39 // Get the key for this display
40 hardwareKey = new HardwareKey();
41
42 // Setup the WebService call
43 xmds1 = new XiboClient.xmds.xmds();
44 xmds1.RecieveXmlLogCompleted += new XiboClient.xmds.RecieveXmlLogCompletedEventHandler(xmds1_RecieveXmlLogCompleted);
45
46 return;
47 }
48
49 /// <summary>
50 /// Prepares the log for sending
51 /// </summary>
52 public void PrepareAndSend()
53 {
54 currentFile = 0;
55
56 // Get a list of all the log files avaiable to process
57 DirectoryInfo di = new DirectoryInfo(Application.UserAppDataPath);
58
59 files = di.GetFiles("*.ready");
60
61 // There thought never be no files
62 if (files.Length == 0) return;
63
64 // Send them (one by one)
65 SendLog(files[currentFile].FullName);
66
67 return;
68 }
69
70 /// <summary>
71 /// Sends and XmlLog files that are ready to send
72 /// Binds a xmds1.RecieveXmlLogCompleted event
73 /// </summary>
74 public void SendLog(string filePath)
75 {
76 // Read the Xml
77 try
78 {
79 StreamReader tr = new StreamReader(File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite));
80 xmds1.RecieveXmlLogAsync(Properties.Settings.Default.ServerKey, hardwareKey.Key, tr.ReadToEnd(), Properties.Settings.Default.Version);
81 tr.Close();
82 }
83 catch (Exception ex)
84 {
85 System.Diagnostics.Debug.WriteLine(ex.Message);
86 }
87 }
88
89 /// <summary>
90 /// Completed sending the XML Log
91 /// </summary>
92 /// <param name="sender"></param>
93 /// <param name="e"></param>
94 void xmds1_RecieveXmlLogCompleted(object sender, XiboClient.xmds.RecieveXmlLogCompletedEventArgs e)
95 {
96 // Delete the Log File if success
97 if (e.Error != null)
98 {
99 System.Diagnostics.Debug.WriteLine(e.Error.Message);
100 }
101 else
102 {
103 if (e.Result)
104 {
105 try
106 {
107 // Do the delete
108 File.Delete(files[currentFile].FullName);
109 }
110 catch (Exception ex)
111 {
112 System.Diagnostics.Debug.WriteLine(ex.Message);
113 }
114 }
115 }
116
117 // Process the next file in the que
118 currentFile++;
119
120 if (currentFile < files.Length)
121 {
122 SendLog(files[currentFile].FullName);
123 }
124
125 return;
126 }
127
128 /// <summary>
129 /// Appends a Stats XML message to the current Log
130 /// </summary>
131 /// <param name="message"></param>
132 /// <param name="cat"></param>
133 /// <param name="type"></param>
134 /// <param name="scheduleID"></param>
135 /// <param name="layoutID"></param>
136 /// <param name="mediaID"></param>
137 public static void AppendStat(String message, StatType type, int scheduleID, int layoutID, string mediaID)
138 {
139 if (!Properties.Settings.Default.statsEnabled) return;
140
141 try
142 {
143 XmlTextWriter xw = new XmlTextWriter(File.Open(Application.UserAppDataPath + "//" + Properties.Settings.Default.logLocation, FileMode.Append, FileAccess.Write, FileShare.Read), Encoding.UTF8);
144
145 xw.WriteStartElement("stat");
146
147 xw.WriteElementString("date", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
148 xw.WriteElementString("message", message);
149 xw.WriteElementString("type", type.ToString());
150 xw.WriteElementString("scheduleID", scheduleID.ToString());
151 xw.WriteElementString("layoutID", layoutID.ToString());
152 if (mediaID != "0") xw.WriteElementString("mediaID", mediaID.ToString());
153
154 xw.WriteEndElement();
155
156 xw.Close();
157 }
158 catch (Exception ex)
159 {
160 }
161 }
162
163 private XiboClient.xmds.xmds xmds1;
164 private HardwareKey hardwareKey;
165 string logPath;
166
167 FileInfo[] files;
168 int currentFile;
169 }
170
171 public enum StatType { LayoutStart, LayoutEnd, MediaStart, MediaEnd };
172}
1730
=== modified file 'client/dotNET/app.config'
--- client/dotNET/app.config 2009-03-08 11:40:17 +0000
+++ client/dotNET/app.config 2009-07-30 23:01:31 +0000
@@ -14,7 +14,7 @@
14 <value>DEFAULT</value>14 <value>DEFAULT</value>
15 </setting>15 </setting>
16 <setting name="XiboClient_xmds_xmds" serializeAs="String">16 <setting name="XiboClient_xmds_xmds" serializeAs="String">
17 <value>http://localhost/Xibo/server/xmds.php</value>17 <value>http://localhost/1.0.0/server/xmds.php</value>
18 </setting>18 </setting>
19 <setting name="ServerKey" serializeAs="String">19 <setting name="ServerKey" serializeAs="String">
20 <value>changetocustomerkey</value>20 <value>changetocustomerkey</value>
@@ -25,9 +25,6 @@
25 <setting name="licensed" serializeAs="String">25 <setting name="licensed" serializeAs="String">
26 <value>0</value>26 <value>0</value>
27 </setting>27 </setting>
28 <setting name="collectInterval" serializeAs="String">
29 <value>900</value>
30 </setting>
31 <setting name="powerpointEnabled" serializeAs="String">28 <setting name="powerpointEnabled" serializeAs="String">
32 <value>False</value>29 <value>False</value>
33 </setting>30 </setting>
@@ -49,6 +46,18 @@
49 <setting name="ProxyPort" serializeAs="String">46 <setting name="ProxyPort" serializeAs="String">
50 <value />47 <value />
51 </setting>48 </setting>
49 <setting name="hardwareKey" serializeAs="String">
50 <value />
51 </setting>
52 <setting name="StatsFlushCount" serializeAs="String">
53 <value>50</value>
54 </setting>
55 <setting name="XmdsLastConnection" serializeAs="String">
56 <value />
57 </setting>
58 <setting name="collectInterval" serializeAs="String">
59 <value>900</value>
60 </setting>
52 </XiboClient.Properties.Settings>61 </XiboClient.Properties.Settings>
53 </userSettings>62 </userSettings>
54 <applicationSettings>63 <applicationSettings>
@@ -65,6 +74,9 @@
65 <setting name="Version" serializeAs="String">74 <setting name="Version" serializeAs="String">
66 <value>1</value>75 <value>1</value>
67 </setting>76 </setting>
77 <setting name="StatsLogFile" serializeAs="String">
78 <value>stats.xml</value>
79 </setting>
68 </XiboClient.Properties.Settings>80 </XiboClient.Properties.Settings>
69 </applicationSettings>81 </applicationSettings>
70</configuration>82</configuration>
71\ No newline at end of file83\ No newline at end of file
7284
=== removed file 'client/dotNET/bin/Release/XiboClient.XmlSerializers.dll'
73Binary 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 differ85Binary 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
=== removed file 'client/dotNET/bin/Release/XiboClient.exe'
74Binary 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 differ86Binary 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
=== modified file 'client/dotNET/bin/Release/XiboClient.exe.config'
--- client/dotNET/bin/Release/XiboClient.exe.config 2009-03-08 12:41:17 +0000
+++ client/dotNET/bin/Release/XiboClient.exe.config 2009-07-30 23:01:31 +0000
@@ -14,7 +14,7 @@
14 <value>DEFAULT</value>14 <value>DEFAULT</value>
15 </setting>15 </setting>
16 <setting name="XiboClient_xmds_xmds" serializeAs="String">16 <setting name="XiboClient_xmds_xmds" serializeAs="String">
17 <value>http://localhost/Xibo/server/xmds.php</value>17 <value>http://localhost/1.0.0/server/xmds.php</value>
18 </setting>18 </setting>
19 <setting name="ServerKey" serializeAs="String">19 <setting name="ServerKey" serializeAs="String">
20 <value>changetocustomerkey</value>20 <value>changetocustomerkey</value>
@@ -25,9 +25,6 @@
25 <setting name="licensed" serializeAs="String">25 <setting name="licensed" serializeAs="String">
26 <value>0</value>26 <value>0</value>
27 </setting>27 </setting>
28 <setting name="collectInterval" serializeAs="String">
29 <value>900</value>
30 </setting>
31 <setting name="powerpointEnabled" serializeAs="String">28 <setting name="powerpointEnabled" serializeAs="String">
32 <value>False</value>29 <value>False</value>
33 </setting>30 </setting>
@@ -49,6 +46,18 @@
49 <setting name="ProxyPort" serializeAs="String">46 <setting name="ProxyPort" serializeAs="String">
50 <value />47 <value />
51 </setting>48 </setting>
49 <setting name="hardwareKey" serializeAs="String">
50 <value />
51 </setting>
52 <setting name="StatsFlushCount" serializeAs="String">
53 <value>50</value>
54 </setting>
55 <setting name="XmdsLastConnection" serializeAs="String">
56 <value />
57 </setting>
58 <setting name="collectInterval" serializeAs="String">
59 <value>900</value>
60 </setting>
52 </XiboClient.Properties.Settings>61 </XiboClient.Properties.Settings>
53 </userSettings>62 </userSettings>
54 <applicationSettings>63 <applicationSettings>
@@ -65,6 +74,9 @@
65 <setting name="Version" serializeAs="String">74 <setting name="Version" serializeAs="String">
66 <value>1</value>75 <value>1</value>
67 </setting>76 </setting>
77 <setting name="StatsLogFile" serializeAs="String">
78 <value>stats.xml</value>
79 </setting>
68 </XiboClient.Properties.Settings>80 </XiboClient.Properties.Settings>
69 </applicationSettings>81 </applicationSettings>
70</configuration>82</configuration>
71\ No newline at end of file83\ No newline at end of file
7284
=== removed file 'client/dotNET/bin/Release/XiboClient.pdb'
73Binary 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 differ85Binary 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
=== modified file 'client/dotNET/bin/Release/XiboClient.vshost.exe.config'
--- client/dotNET/bin/Release/XiboClient.vshost.exe.config 2009-03-08 12:41:17 +0000
+++ client/dotNET/bin/Release/XiboClient.vshost.exe.config 2009-07-30 23:01:31 +0000
@@ -14,7 +14,7 @@
14 <value>DEFAULT</value>14 <value>DEFAULT</value>
15 </setting>15 </setting>
16 <setting name="XiboClient_xmds_xmds" serializeAs="String">16 <setting name="XiboClient_xmds_xmds" serializeAs="String">
17 <value>http://localhost/Xibo/server/xmds.php</value>17 <value>http://localhost/1.0.0/server/xmds.php</value>
18 </setting>18 </setting>
19 <setting name="ServerKey" serializeAs="String">19 <setting name="ServerKey" serializeAs="String">
20 <value>changetocustomerkey</value>20 <value>changetocustomerkey</value>
@@ -25,9 +25,6 @@
25 <setting name="licensed" serializeAs="String">25 <setting name="licensed" serializeAs="String">
26 <value>0</value>26 <value>0</value>
27 </setting>27 </setting>
28 <setting name="collectInterval" serializeAs="String">
29 <value>900</value>
30 </setting>
31 <setting name="powerpointEnabled" serializeAs="String">28 <setting name="powerpointEnabled" serializeAs="String">
32 <value>False</value>29 <value>False</value>
33 </setting>30 </setting>
@@ -49,6 +46,18 @@
49 <setting name="ProxyPort" serializeAs="String">46 <setting name="ProxyPort" serializeAs="String">
50 <value />47 <value />
51 </setting>48 </setting>
49 <setting name="hardwareKey" serializeAs="String">
50 <value />
51 </setting>
52 <setting name="StatsFlushCount" serializeAs="String">
53 <value>50</value>
54 </setting>
55 <setting name="XmdsLastConnection" serializeAs="String">
56 <value />
57 </setting>
58 <setting name="collectInterval" serializeAs="String">
59 <value>900</value>
60 </setting>
52 </XiboClient.Properties.Settings>61 </XiboClient.Properties.Settings>
53 </userSettings>62 </userSettings>
54 <applicationSettings>63 <applicationSettings>
@@ -65,6 +74,9 @@
65 <setting name="Version" serializeAs="String">74 <setting name="Version" serializeAs="String">
66 <value>1</value>75 <value>1</value>
67 </setting>76 </setting>
77 <setting name="StatsLogFile" serializeAs="String">
78 <value>stats.xml</value>
79 </setting>
68 </XiboClient.Properties.Settings>80 </XiboClient.Properties.Settings>
69 </applicationSettings>81 </applicationSettings>
70</configuration>82</configuration>
71\ No newline at end of file83\ No newline at end of file
7284
=== modified file 'server/3rdparty/fckeditor/editor/css/fck_editorarea.css'
--- server/3rdparty/fckeditor/editor/css/fck_editorarea.css 2008-12-14 14:41:09 +0000
+++ server/3rdparty/fckeditor/editor/css/fck_editorarea.css 2009-08-03 12:54:45 +0000
@@ -40,7 +40,7 @@
4040
41body, td41body, td
42{42{
43 font-family: Arial, Verdana, sans-serif;43 font-family: "Times New Roman", Times, serif;
44 font-size: 12px;44 font-size: 12px;
45}45}
4646
4747
=== modified file 'server/3rdparty/jQuery/jquery.tablesorter.pack.js'
--- server/3rdparty/jQuery/jquery.tablesorter.pack.js 2008-12-14 14:42:52 +0000
+++ server/3rdparty/jQuery/jquery.tablesorter.pack.js 2009-06-27 10:56:12 +0000
@@ -1,8 +1,7 @@
1/*1/*
2 * 2 *
3 * TableSorter 2.0 - Client-side table sorting with ease!3 * TableSorter 2.0 - Client-side table sorting with ease!
4 * Version 2.04 * Version 2.0.3
5 * @requires jQuery v1.1.3
6 * 5 *
7 * Copyright (c) 2007 Christian Bach6 * Copyright (c) 2007 Christian Bach
8 * Examples and docs at: http://tablesorter.com7 * Examples and docs at: http://tablesorter.com
@@ -11,4 +10,4 @@
11 * http://www.gnu.org/licenses/gpl.html10 * http://www.gnu.org/licenses/gpl.html
12 * 11 *
13 */12 */
14eval(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,{}))
15\ No newline at end of file13\ No newline at end of file
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);
16\ No newline at end of file15\ No newline at end of file
1716
=== removed file 'server/img/Thumbs.db'
18Binary files server/img/Thumbs.db 2009-06-20 12:00:21 +0000 and server/img/Thumbs.db 1970-01-01 00:00:00 +0000 differ17Binary 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
=== removed file 'server/img/bodys/Thumbs.db'
19Binary 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 differ18Binary 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
=== removed file 'server/img/dashboard/Thumbs.db'
20Binary 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 differ19Binary 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
=== removed file 'server/img/dialogs/Thumbs.db'
21Binary 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 differ20Binary 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
=== removed file 'server/img/fades/Thumbs.db'
22Binary 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 differ21Binary 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
=== removed file 'server/img/filterform/Thumbs.db'
23Binary 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 differ22Binary 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
=== removed file 'server/img/forms/Thumbs.db'
24Binary 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 differ23Binary 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
=== removed file 'server/img/login/Thumbs.db'
25Binary 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 differ24Binary 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
=== removed file 'server/img/logos/Thumbs.db'
26Binary 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 differ25Binary 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
=== removed file 'server/img/tables/Thumbs.db'
27Binary 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 differ26Binary 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
=== removed file 'server/img/tabs/Thumbs.db'
28Binary 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 differ27Binary 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
=== removed file 'server/img/titles/Thumbs.db'
29Binary 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 differ28Binary 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
=== removed file 'server/img/weather_rss/Thumbs.db'
30Binary 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 differ29Binary 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
=== added file 'server/install/database/7.sql'
--- server/install/database/7.sql 1970-01-01 00:00:00 +0000
+++ server/install/database/7.sql 2009-08-08 13:39:17 +0000
@@ -0,0 +1,24 @@
1
2INSERT INTO `pages` (
3`pageID` ,
4`name` ,
5`pagegroupID`
6)
7VALUES (
8NULL , 'stats', '9'
9);
10
11INSERT INTO `menuitem` (`MenuID`, `PageID`, `Args`, `Text`, `Class`, `Img`, `Sequence`)
12SELECT '4', pageID, NULL, 'Statistics', NULL, NULL, '9' FROM pages WHERE name = 'stats';
13
14ALTER TABLE `stat` ADD `Tag` VARCHAR( 254 ) NULL ;
15
16ALTER TABLE `stat` ADD `Type` VARCHAR( 20 ) NOT NULL DEFAULT 'Media' AFTER `statID` ;
17
18ALTER TABLE `stat` CHANGE `Type` `Type` VARCHAR( 20 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
19
20ALTER TABLE `stat` CHANGE `mediaID` `mediaID` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
21
22UPDATE `version` SET `app_ver` = '1.0.3';
23UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
24UPDATE `version` SET `DBVersion` = '7';
025
=== modified file 'server/lib/app/app_functions.php'
--- server/lib/app/app_functions.php 2009-02-21 17:52:52 +0000
+++ server/lib/app/app_functions.php 2009-07-28 21:08:19 +0000
@@ -325,105 +325,6 @@
325 return $hms;325 return $hms;
326}326}
327327
328define('STAT_LAYOUT_START', 'LayoutStart');
329define('STAT_LAYOUT_END', 'LayoutEnd');
330define('STAT_MEDIA_START', 'MediaStart');
331define('STAT_MEDIA_END', 'MediaEnd');
332
333/**
334 * Records a Stat Record
335 * @return
336 * @param $statType Object
337 * @param $statDate Object
338 * @param $scheduleID Object
339 * @param $displayID Object
340 * @param $layoutID Object
341 * @param $mediaID Object
342 * @param $start Object
343 * @param $end Object
344 */
345function StatRecord($statType, $statDate, $scheduleID, $displayID, $layoutID, $mediaID, $start, $end)
346{
347 global $db;
348
349 $infinityDate = "2050-12-31 00:00:00";
350
351 // Look up the stat type
352 switch ($statType)
353 {
354 case STAT_LAYOUT_START:
355 // If its a layout start
356 // Check for an open Layout which has this schedule & close it
357 $SQL = "";
358 $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND end = '$infinityDate' ";
359
360 if (!$db->query($SQL))
361 {
362 trigger_error($db->error());
363 return false;
364 }
365
366 // Insert a new stat record for this layout
367 $SQL = "";
368 $SQL .= " INSERT INTO stat (statDate, scheduleID, displayID, layoutID, start, end)";
369 $SQL .= " VALUES ('$statDate', '$scheduleID', '$displayID', '$layoutID', '$start', '$infinityDate')";
370
371 if (!$db->query($SQL))
372 {
373 trigger_error($db->error());
374 return false;
375 }
376
377 break;
378
379 case STAT_LAYOUT_END:
380 // If its a layout end
381 // Close the layout stat record for this schedule (by updating the end time)
382 // Also close any open media records (they should all be shut anyway)
383 $SQL = "";
384 $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND end = '$infinityDate' ";
385
386 if (!$db->query($SQL))
387 {
388 trigger_error($db->error());
389 return false;
390 }
391 break;
392
393 case STAT_MEDIA_START:
394 // If its a media start
395 // Create a new media stat record for this layout
396 $SQL = "";
397 $SQL .= " INSERT INTO stat (statDate, scheduleID, displayID, layoutID, mediaID, start, end)";
398 $SQL .= " VALUES ('$statDate', '$scheduleID', '$displayID', '$layoutID', '$mediaID', '$start', '$infinityDate')";
399
400 if (!$db->query($SQL))
401 {
402 trigger_error($db->error());
403 return false;
404 }
405 break;
406
407 case STAT_MEDIA_END:
408 // If its a media end
409 // Close the stat record
410 $SQL = "";
411 $SQL .= " UPDATE stat SET end = '$end' WHERE scheduleID = '$scheduleID' AND layoutID = '$layoutID' AND mediaID = '$mediaID' AND end = '$infinityDate' ";
412
413 if (!$db->query($SQL))
414 {
415 trigger_error($db->error());
416 return false;
417 }
418 break;
419
420 default:
421 return false;
422 }
423
424 return true;
425}
426
427/**328/**
428 * Gets web safe colors329 * Gets web safe colors
429 * @return 330 * @return
430331
=== modified file 'server/lib/app/session.class.php'
--- server/lib/app/session.class.php 2008-12-19 22:10:39 +0000
+++ server/lib/app/session.class.php 2009-07-07 20:01:49 +0000
@@ -29,7 +29,8 @@
29 29
30 public $isExpired = 1;30 public $isExpired = 1;
3131
32 function __construct(database $db) {32 function __construct(database $db)
33 {
33 $this->db =& $db;34 $this->db =& $db;
34 35
35 session_set_save_handler(array(&$this, 'open'),36 session_set_save_handler(array(&$this, 'open'),
@@ -64,38 +65,27 @@
64 {65 {
65 $db =& $this->db;66 $db =& $this->db;
66 67
67 $userAgent = $_SERVER['HTTP_USER_AGENT'];68 $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent');
68 $remoteAddr = $_SERVER['REMOTE_ADDR'];69 $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
70 $securityToken = Kit::GetParam('SecurityToken', _POST, _STRING, null);
69 71
70 $this->key = $key;72 $this->key = $key;
71 $newExp = time() + $this->max_lifetime;73 $newExp = time() + $this->max_lifetime;
72 74
73 $this->gc($this->max_lifetime);75 $this->gc($this->max_lifetime);
74 76
75 if(isset($_POST['SecurityToken'])) 77 // Get this session
76 {
77 $securityToken = validate($_POST['SecurityToken']);
78
79 if (!$securityToken)
80 {
81 log_entry($db, "error", "Invalid Security Token");
82 $securityToken = null;
83 }
84 }
85 else
86 {
87 $securityToken = null;
88 }
89
90 $SQL = " SELECT session_data, IsExpired, SecurityToken FROM session ";78 $SQL = " SELECT session_data, IsExpired, SecurityToken FROM session ";
91 $SQL .= " WHERE session_id = '$key' ";79 $SQL .= " WHERE session_id = '%s' ";
92 $SQL .= " AND RemoteAddr = '$remoteAddr' ";80 $SQL .= " AND UserAgent = '%s' ";
93 81
94 if (!$result = $db->query($SQL));82 $SQL = sprintf($SQL, $db->escape_string($key), $db->escape_string($userAgent));
83
84 $result = $db->query($SQL);
95 85
96 if ($db->num_rows($result) != 0) 86 if ($db->num_rows($result) != 0)
97 {87 {
98 88 // Get the row
99 $row = $db->get_row($result);89 $row = $db->get_row($result);
100 90
101 // We have the Key and the Remote Address.91 // We have the Key and the Remote Address.
@@ -109,10 +99,10 @@
109 // We have a security token, so dont require a login99 // We have a security token, so dont require a login
110 $this->isExpired = 0;100 $this->isExpired = 0;
111 101
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))))
113 {103 {
114 log_entry($db, "error", $db->error());104 log_entry($db, "error", $db->error());
115 } 105 }
116 }106 }
117 else107 else
118 {108 {
@@ -123,49 +113,55 @@
123 }113 }
124 114
125 // Either way - update this SESSION so that the security token is NULL115 // Either way - update this SESSION so that the security token is NULL
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)));
127 117
128 return($row[0]);118 return($row[0]);
129 }119 }
130 else {120 else
121 {
131 $empty = '';122 $empty = '';
132 return settype($empty, "string");123 return settype($empty, "string");
133 }124 }
134 }125 }
135 126
136 function write($key, $val) {127 function write($key, $val)
137 128 {
138 $db =& $this->db;129 $db =& $this->db;
139
140 $val = addslashes($val);
141 130
142 $newExp = time() + $this->max_lifetime;131 $newExp = time() + $this->max_lifetime;
143 $lastaccessed = date("Y-m-d H:i:s");132 $lastaccessed = date("Y-m-d H:i:s");
144 $userAgent = $_SERVER['HTTP_USER_AGENT'];133 $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent');
145 $remoteAddr = $_SERVER['REMOTE_ADDR'];134 $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
146 135
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)));
148 137
149 if ($db->num_rows($result) == 0) 138 if ($db->num_rows($result) == 0)
150 {139 {
151 //INSERT140 //INSERT
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)
153 VALUES ('$key','$val',$newExp,'$lastaccessed','login', NULL, 0, '$userAgent', '$remoteAddr')";142 VALUES ('%s', '%s', %d, '%s', 'login', NULL, 0, '%s', '%s')";
143
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));
154 }145 }
155 else 146 else
156 {147 {
157 //UPDATE148 //UPDATE
158 $SQL = "UPDATE session SET ";149 $SQL = "UPDATE session SET ";
159 $SQL .= " session_data = '$val', ";150 $SQL .= " session_data = '%s', ";
160 $SQL .= " session_expiration = '$newExp', ";151 $SQL .= " session_expiration = %d, ";
161 $SQL .= " lastaccessed = '$lastaccessed' ";152 $SQL .= " lastaccessed = '%s', ";
162 $SQL .= " WHERE session_id = '$key' ";153 $SQL .= " RemoteAddr = '%s' ";
154 $SQL .= " WHERE session_id = '%s' ";
155
156 $SQL = sprintf($SQL, $db->escape_string($val), $newExp, $db->escape_string($lastaccessed), $db->escape_string($remoteAddr), $db->escape_string($key));
163 }157 }
164 158
165 if(!$db->query($SQL)) {159 if(!$db->query($SQL))
160 {
166 log_entry($db, "error", $db->error());161 log_entry($db, "error", $db->error());
167 return(false);162 return(false);
168 }163 }
164
169 return true;165 return true;
170 }166 }
171167
@@ -173,7 +169,7 @@
173 {169 {
174 $db =& $this->db;170 $db =& $this->db;
175 171
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));
177 173
178 $result = $db->query("$SQL"); 174 $result = $db->query("$SQL");
179 175
@@ -193,26 +189,32 @@
193 {189 {
194 $db =& $this->db;190 $db =& $this->db;
195 191
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));
197 193
198 if(!$db->query($SQL)) {194 if(!$db->query($SQL))
195 {
199 trigger_error($db->error(), E_USER_NOTICE);196 trigger_error($db->error(), E_USER_NOTICE);
200 return(false);197 return(false);
201 }198 }
202 return true;199 return true;
203 }200 }
204 201
205 // Update the session (after login)202 /**
206 static function RegenerateSessionID() 203 * Updates the session ID with a new one
204 * @return
205 */
206 public function RegenerateSessionID($oldSessionID)
207 {207 {
208 $old_sess_id = session_id();208 $db =& $this->db;
209 209
210 session_regenerate_id(false);210 session_regenerate_id(false);
211 211
212 $new_sess_id = session_id();212 $new_sess_id = session_id();
213
214 $this->key = $new_sess_id;
213 215
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));
215 mysql_query($query);217 $db->query($query);
216 }218 }
217 219
218 function set_page($key, $lastpage) 220 function set_page($key, $lastpage)
@@ -221,9 +223,10 @@
221 223
222 $_SESSION['pagename'] = $lastpage;224 $_SESSION['pagename'] = $lastpage;
223 225
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));
225 227
226 if(!$db->query($SQL)) {228 if(!$db->query($SQL))
229 {
227 trigger_error($db->error(), E_USER_NOTICE);230 trigger_error($db->error(), E_USER_NOTICE);
228 return(false);231 return(false);
229 }232 }
@@ -236,7 +239,7 @@
236239
237 $this->isExpired = $isExpired;240 $this->isExpired = $isExpired;
238 241
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));
240 243
241 if (!$db->query($SQL))244 if (!$db->query($SQL))
242 {245 {
@@ -248,7 +251,7 @@
248 {251 {
249 $db =& $this->db;252 $db =& $this->db;
250 253
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));
252 255
253 if (!$db->query($SQL))256 if (!$db->query($SQL))
254 {257 {
255258
=== added file 'server/lib/data/layout.data.class.php'
--- server/lib/data/layout.data.class.php 1970-01-01 00:00:00 +0000
+++ server/lib/data/layout.data.class.php 2009-07-30 23:01:31 +0000
@@ -0,0 +1,185 @@
1<?php
2/*
3 * Xibo - Digitial Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009 Daniel Garner
5 *
6 * This file is part of Xibo.
7 *
8 * Xibo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * Xibo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
22
23class Layout extends Data
24{
25 private $xml;
26
27 public function EditTags($layoutID, $tags)
28 {
29 $db =& $this->db;
30
31 Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'EditTags');
32
33 // Make sure we get an array
34 if(!is_array($tags))
35 {
36 $this->SetError(25000, 'Must pass EditTags an array');
37 return false;
38 }
39
40 // Set the XML
41 if (!$this->SetXml($layoutID))
42 {
43 Debug::LogEntry($db, 'audit', 'Failed to Set the layout Xml.', 'Layout', 'EditTags');
44 return false;
45 }
46
47 Debug::LogEntry($db, 'audit', 'Got the XML from the DB. Now creating the tags.', 'Layout', 'EditTags');
48
49 // Create the tags XML
50 $tagsXml = '<tags>';
51
52 foreach($tags as $tag)
53 {
54 $tagsXml .= sprintf('<tag>%s</tag>', $tag);
55 }
56
57 $tagsXml .= '</tags>';
58
59 Debug::LogEntry($db, 'audit', 'Tags XML is:' . $tagsXml, 'Layout', 'EditTags');
60
61 // Load the tags XML into a document
62 $tagsXmlDoc = new DOMDocument('1.0');
63 $tagsXmlDoc->loadXML($tagsXml);
64
65
66 // Load the XML for this layout
67 $xml = new DOMDocument("1.0");
68 $xml->loadXML($this->xml);
69
70 // Import the new node into this document
71 $newTagsNode = $xml->importNode($tagsXmlDoc->documentElement, true);
72
73 // Xpath for an existing tags node
74 $xpath = new DOMXPath($xml);
75 $tagsNode = $xpath->query("//tags");
76
77 // Does the tags node exist?
78 if ($tagsNode->length < 1)
79 {
80 // We need to append our new node to the layout node
81 $layoutXpath = new DOMXPath($xml);
82 $layoutNode = $xpath->query("//layout");
83 $layoutNode = $layoutNode->item(0);
84
85 $layoutNode->appendChild($newTagsNode);
86 }
87 else
88 {
89 // We need to swap our new node with the existing one
90 $tagsNode = $tagsNode->item(0);
91
92 // Replace the node
93 $tagsNode->parentNode->replaceChild($newTagsNode, $tagsNode);
94 }
95
96 // Format the output a bit nicer for Alex
97 $xml->formatOutput = true;
98
99 // Convert back to XML
100 $xml = $xml->saveXML();
101
102 Debug::LogEntry($db, 'audit', $xml, 'layout', 'EditTags');
103
104 // Save it
105 if (!$this->SetLayoutXml($layoutID, $xml)) return false;
106
107 Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'EditTags');
108
109 return true;
110 }
111
112 /**
113 * Sets the Layout XML for this layoutid
114 * @return
115 * @param $layoutID Object
116 */
117 private function SetXml($layoutID)
118 {
119 if(!$this->xml = $this->GetLayoutXml($layoutID))
120 {
121 return false;
122 }
123
124 return true;
125 }
126
127 /**
128 * Gets the Xml for the specified layout
129 * @return
130 * @param $layoutid Object
131 */
132 private function GetLayoutXml($layoutid)
133 {
134 $db =& $this->db;
135
136 Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'GetLayoutXml');
137
138 //Get the Xml for this Layout from the DB
139 $SQL = sprintf("SELECT xml FROM layout WHERE layoutID = %d ", $layoutid);
140
141 if (!$results = $db->query($SQL))
142 {
143 trigger_error($db->error());
144 $this->SetError(25000, 'Layout does not exist.');
145 return false;
146 }
147
148 $row = $db->get_row($results) ;
149
150 Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'GetLayoutXml');
151
152 return $row[0];
153 }
154
155 /**
156 * Sets the Layout Xml and writes it back to the database
157 * @return
158 * @param $layoutid Object
159 * @param $xml Object
160 */
161 private function SetLayoutXml($layoutid, $xml)
162 {
163 $db =& $this->db;
164
165 Debug::LogEntry($db, 'audit', 'IN', 'Layout', 'SetLayoutXml');
166
167 $xml = addslashes($xml);
168
169 // Write it back to the database
170 $SQL = sprintf("UPDATE layout SET xml = '%s' WHERE layoutID = %d ", $xml, $layoutid);
171
172
173 if (!$db->query($SQL))
174 {
175 trigger_error($db->error());
176 $this->SetError(25000, 'Unable to Update Layout.');
177 return false;
178 }
179
180 Debug::LogEntry($db, 'audit', 'OUT', 'Layout', 'SetLayoutXml');
181
182 return true;
183 }
184}
185?>
0\ No newline at end of file186\ No newline at end of file
1187
=== added file 'server/lib/data/stat.data.class.php'
--- server/lib/data/stat.data.class.php 1970-01-01 00:00:00 +0000
+++ server/lib/data/stat.data.class.php 2009-08-08 11:04:39 +0000
@@ -0,0 +1,74 @@
1<?php
2/*
3 * Xibo - Digitial Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009 Daniel Garner
5 *
6 * This file is part of Xibo.
7 *
8 * Xibo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * Xibo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
22
23class Stat extends data
24{
25 public function Add($type, $fromDT, $toDT, $scheduleID, $displayID, $layoutID, $mediaID, $tag)
26 {
27 $db =& $this->db;
28 $statDate = date("Y-m-d H:i:s");
29 $SQL = '';
30
31 $type = $db->escape_string($type);
32
33 // We should run different SQL depending on what Type we are
34 switch ($type)
35 {
36 case 'Media':
37 case 'media':
38 $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, mediaID, start, end)";
39 $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s', '%s')", $type, $statDate, $scheduleID, $displayID, $layoutID, $db->escape_string($mediaID), $fromDT, $toDT);
40
41 break;
42
43 case 'Layout':
44 case 'layout':
45 $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, start, end)";
46 $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s')", $type, $statDate, $scheduleID, $displayID, $layoutID, $fromDT, $toDT);
47
48 break;
49
50 case 'Event':
51 case 'event':
52
53 $SQL .= " INSERT INTO stat (Type, statDate, scheduleID, displayID, layoutID, start, end, Tag)";
54 $SQL .= sprintf(" VALUES ('%s', '%s', %d, %d, %d, '%s', '%s', '%s')", $type, $statDate, $scheduleID, $displayID, 0, $fromDT, $toDT, $db->escape_string($tag));
55
56 break;
57
58 default:
59 // Nothing to do, just exit
60 return true;
61 }
62
63 // We only get here if we have some SQL to run
64 if (!$db->query($SQL))
65 {
66 trigger_error($db->error());
67 $this->SetError(25000, 'Stat Insert Failed.');
68 return false;
69 }
70
71 return true;
72 }
73}
74?>
0\ No newline at end of file75\ No newline at end of file
176
=== modified file 'server/lib/modules/module.class.php'
--- server/lib/modules/module.class.php 2009-04-27 19:28:08 +0000
+++ server/lib/modules/module.class.php 2009-08-03 10:54:29 +0000
@@ -61,7 +61,7 @@
61 $this->user =& $user;61 $this->user =& $user;
62 62
63 $this->mediaid = $mediaid;63 $this->mediaid = $mediaid;
64 $this->name = "";64 $this->name = '';
65 $this->layoutid = $layoutid;65 $this->layoutid = $layoutid;
66 $this->regionid = $regionid;66 $this->regionid = $regionid;
67 67
@@ -175,7 +175,7 @@
175 }175 }
176 else176 else
177 {177 {
178 if ($this->mediaid != '')178 if ($this->mediaid != '' && $this->regionSpecific == 0)
179 {179 {
180 // We do not have a region or a layout180 // We do not have a region or a layout
181 // But this is some existing media181 // But this is some existing media
@@ -183,7 +183,9 @@
183 $this->existingMedia = true;183 $this->existingMedia = true;
184 184
185 // Load what we know about this media into the object185 // Load what we know about this media into the object
186 $SQL = "SELECT duration,name FROM media WHERE mediaID = '$mediaid'";186 $SQL = "SELECT duration, name FROM media WHERE mediaID = '$mediaid'";
187
188 Debug::LogEntry($db, 'audit', $SQL, 'Module', 'SetMediaInformation');
187 189
188 if (!$result = $db->query($SQL))190 if (!$result = $db->query($SQL))
189 {191 {
@@ -194,7 +196,7 @@
194 {196 {
195 $row = $db->get_row($result);197 $row = $db->get_row($result);
196 $this->duration = $row[0];198 $this->duration = $row[0];
197 $this->name = $row[1];199 $this->name = $row[1];
198 }200 }
199 }201 }
200 202
@@ -262,7 +264,10 @@
262 */264 */
263 final protected function SetOption($name, $value)265 final protected function SetOption($name, $value)
264 {266 {
265 if ($name == '' || $value == '') return;267 $db =& $this->db;
268 if ($name == '') return;
269
270 Debug::LogEntry($db, 'audit', sprintf('IN with Name=%s and value=%s', $name, $value), 'module', 'Set Option');
266 271
267 // Get the options node from this document272 // Get the options node from this document
268 $optionNodes = $this->xml->getElementsByTagName('options');273 $optionNodes = $this->xml->getElementsByTagName('options');
@@ -272,6 +277,7 @@
272 // Create a new option node277 // Create a new option node
273 $newNode = $this->xml->createElement($name, $value);278 $newNode = $this->xml->createElement($name, $value);
274 279
280 Debug::LogEntry($db, 'audit', sprintf('Created a new Option Node with Name=%s and value=%s', $name, $value), 'module', 'Set Option');
275 281
276 // Check to see if we already have this option or not282 // Check to see if we already have this option or not
277 $xpath = new DOMXPath($this->xml);283 $xpath = new DOMXPath($this->xml);
@@ -535,8 +541,11 @@
535 */541 */
536 public function GetName()542 public function GetName()
537 {543 {
544 $db =& $this->db;
545
546 Debug::LogEntry($db, 'audit', sprintf('Module name returned for MediaID: %s is %s', $this->mediaid, $this->name), 'Module', 'GetName');
547
538 return $this->name;548 return $this->name;
539 }549 }
540
541}550}
542?>551?>
543552
=== modified file 'server/lib/pages/layout.class.php'
--- server/lib/pages/layout.class.php 2009-06-20 12:00:21 +0000
+++ server/lib/pages/layout.class.php 2009-08-03 10:54:29 +0000
@@ -57,6 +57,9 @@
57 $ajax = Kit::GetParam('ajax', _GET, _WORD, 'false');57 $ajax = Kit::GetParam('ajax', _GET, _WORD, 'false');
58 58
59 $this->layoutid = Kit::GetParam('layoutid', _REQUEST, _INT);59 $this->layoutid = Kit::GetParam('layoutid', _REQUEST, _INT);
60
61 // Include the layout data class
62 include_once("lib/data/layout.data.class.php");
60 63
61 //set the information that we know64 //set the information that we know
62 if ($usertype == 1) $this->isadmin = true;65 if ($usertype == 1) $this->isadmin = true;
@@ -289,6 +292,18 @@
289 $response->SetError("Unknown error adding layout.");292 $response->SetError("Unknown error adding layout.");
290 $response->Respond();293 $response->Respond();
291 }294 }
295
296 // Create an array out of the tags
297 $tagsArray = split(' ', $tags);
298
299 // Add the tags XML to the layout
300 $layoutObject = new Layout($db);
301
302 if (!$layoutObject->EditTags($id, $tagsArray))
303 {
304 //there was an ERROR
305 trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
306 }
292307
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));
294 $response->Respond();309 $response->Respond();
@@ -399,6 +414,18 @@
399 $response->SetError(sprintf("Unknown error editing %s", $layout));414 $response->SetError(sprintf("Unknown error editing %s", $layout));
400 $response->Respond();415 $response->Respond();
401 }416 }
417
418 // Create an array out of the tags
419 $tagsArray = split(' ', $tags);
420
421 // Add the tags XML to the layout
422 $layoutObject = new Layout($db);
423
424 if (!$layoutObject->EditTags($this->layoutid, $tagsArray))
425 {
426 //there was an ERROR
427 trigger_error($layoutObject->GetErrorMessage(), E_USER_ERROR);
428 }
402429
403 $response->SetFormSubmitResponse('Layout Details Changed.');430 $response->SetFormSubmitResponse('Layout Details Changed.');
404 $response->Respond();431 $response->Respond();
@@ -1320,18 +1347,22 @@
1320 $count++;1347 $count++;
1321 1348
1322 //Build up a button with position information1349 //Build up a button with position information
1350 $mediaName = '';
1351 $mediaType = '';
1323 $mediaid = $mediaNode->getAttribute('id');1352 $mediaid = $mediaNode->getAttribute('id');
1324 $lkid = $mediaNode->getAttribute('lkid');1353 $lkid = $mediaNode->getAttribute('lkid');
1325 $mediaType = $mediaNode->getAttribute('type');1354 $mediaType = $mediaNode->getAttribute('type');
1326 $mediaFileName = $mediaNode->getAttribute('filename');1355 $mediaFileName = $mediaNode->getAttribute('filename');
1327 $mediaDuration = $mediaNode->getAttribute('duration');1356 $mediaDuration = $mediaNode->getAttribute('duration');
13281357
1329 //Get media name1358 // Get media name
1330 require_once("modules/$mediaType.module.php");1359 require_once("modules/$mediaType.module.php");
1331 1360
1332 // Create the media object without any region and layout information1361 // Create the media object without any region and layout information
1333 $tmpModule = new $mediaType($db, $user, $mediaid);1362 $tmpModule = new $mediaType($db, $user, $mediaid);
1334 $mediaName = $tmpModule->GetName();1363 $mediaName = $tmpModule->GetName();
1364
1365 Debug::LogEntry($db, 'audit', sprintf('Module name returned for MediaID: %s is %s', $mediaid, $mediaName), 'layout', 'RegionOptions');
1335 1366
1336 //Do we have a thumbnail for this media?1367 //Do we have a thumbnail for this media?
1337 if ($mediaType == "image" && file_exists($libraryLocation."tn_$mediaFileName"))1368 if ($mediaType == "image" && file_exists($libraryLocation."tn_$mediaFileName"))
13381369
=== modified file 'server/lib/pages/region.class.php'
--- server/lib/pages/region.class.php 2009-01-23 19:29:48 +0000
+++ server/lib/pages/region.class.php 2009-07-30 23:01:31 +0000
@@ -404,7 +404,7 @@
404 $mediaNodeList = $xpath->query("//region[@id='$regionid']/media[@lkid='$lkid']");404 $mediaNodeList = $xpath->query("//region[@id='$regionid']/media[@lkid='$lkid']");
405 }405 }
406 406
407 //Get the old media node (the one we are to replace)407 // Get the old media node (the one we are to replace)
408 $oldMediaNode = $mediaNodeList->item(0);408 $oldMediaNode = $mediaNodeList->item(0);
409 409
410 //Get the LkId of the current record... if its not blank we want to update this link with the new id410 //Get the LkId of the current record... if its not blank we want to update this link with the new id
411411
=== modified file 'server/lib/pages/report.class.php'
--- server/lib/pages/report.class.php 2009-03-13 10:10:07 +0000
+++ server/lib/pages/report.class.php 2009-08-03 10:54:29 +0000
@@ -210,9 +210,7 @@
210 <td>$ip</td>210 <td>$ip</td>
211 <td>$browser</td>211 <td>$browser</td>
212 <td>212 <td>
213 <div class="buttons">213 <button class="XiboFormButton" href="index.php?p=report&q=ConfirmLogout&userid=$userID"><span>Logout</span></a>
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>
215 </div>
216 </td>214 </td>
217 </tr>215 </tr>
218END;216END;
@@ -234,14 +232,15 @@
234 $userID = Kit::GetParam('userid', _GET, _INT);232 $userID = Kit::GetParam('userid', _GET, _INT);
235 233
236 $form = <<<END234 $form = <<<END
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">
238 <input type="hidden" name="userid" value="userid" />236 <input type="hidden" name="userid" value="userid" />
239 <p>Are you sure you want to logout this user?</p>237 <p>Are you sure you want to logout this user?</p>
240 <input type="submit" value="Yes">238 <input type="submit" value="Yes">
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; ">
242 </form>240 </form>
243END;241END;
244 $arh->SetFormSubmitResponse($form);242
243 $arh->SetFormRequestResponse($form, 'Logout User', '450px', '300px');
245 $arh->Respond();244 $arh->Respond();
246 }245 }
247 246
@@ -424,6 +423,7 @@
424 $output .= '</tbody></table></div>';423 $output .= '</tbody></table></div>';
425 424
426 $response->SetGridResponse($output);425 $response->SetGridResponse($output);
426 $response->sortable = false;
427 $response->Respond();427 $response->Respond();
428 }428 }
429 429
430430
=== added file 'server/lib/pages/stats.class.php'
--- server/lib/pages/stats.class.php 1970-01-01 00:00:00 +0000
+++ server/lib/pages/stats.class.php 2009-08-08 11:04:39 +0000
@@ -0,0 +1,152 @@
1<?php
2/*
3 * Xibo - Digitial Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009 Daniel Garner
5 *
6 * This file is part of Xibo.
7 *
8 * Xibo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * Xibo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
22
23class statsDAO
24{
25 private $db;
26 private $user;
27
28 function __construct(database $db, user $user)
29 {
30 $this->db =& $db;
31 $this->user =& $user;
32 }
33
34 function displayPage()
35 {
36
37 include("template/pages/stats_view.php");
38
39 return false;
40 }
41
42 function on_page_load()
43 {
44 return '';
45 }
46
47 function echo_page_heading()
48 {
49 echo 'Display Statistics';
50 return true;
51 }
52
53 public function StatsForm()
54 {
55 $db =& $this->db;
56 $user =& $this->user;
57 $output = '';
58
59 $fromdt = date("Y-m-d H:i:s", time() - 86400);
60 $todt = date("Y-m-d H:i:s");
61 $display_list = dropdownlist("SELECT 'All', 'All' UNION SELECT displayID, display FROM display WHERE licensed = 1 ORDER BY 2", "displayid");
62
63 // We want to build a form which will sit on the page and allow a button press to generate a CSV file.
64 $output .= '<script type="text/javascript">$(document).onload(function(){$(".date-pick").datepicker({dateFormat: "dd/mm/yy"})});</script>';
65 $output .= '<form action="index.php?p=stats&q=OutputCSV" method="post">';
66 $output .= ' <table>';
67 $output .= ' <tr>';
68 $output .= ' <td>From Date</td>';
69 $output .= ' <td><input type="text" class="date-pick" name="fromdt" value="' . $fromdt . '"/></td>';
70 $output .= ' <td>To Date</td>';
71 $output .= ' <td><input type="text" class="date-pick" name="todt" value="' . $todt . '" /></td>';
72 $output .= ' </tr>';
73 $output .= ' <tr>';
74 $output .= ' <td>Display</td>';
75 $output .= ' <td>' . $display_list . '</td>';
76 $output .= ' </tr>';
77
78 $output .= ' <tr>';
79 $output .= ' <td><input type="submit" value="Export" /></td>';
80 $output .= ' </tr>';
81 $output .= ' </table>';
82 $output .= '</form>';
83
84 echo $output;
85 }
86
87 /**
88 * Outputs a CSV of stats
89 * @return
90 */
91 public function OutputCSV()
92 {
93 $db =& $this->db;
94 $output = '';
95
96 // We are expecting some parameters
97 $fromdt = Kit::GetParam('fromdt', _POST, _STRING);
98 $todt = Kit::GetParam('todt', _POST, _STRING);
99 $displayID = Kit::GetParam('displayid', _POST, _INT);
100
101 // We want to output a load of stuff to the browser as a text file.
102 header('Content-Type: text/csv');
103 header('Content-Disposition: attachment; filename="stats.csv"');
104 header("Content-Transfer-Encoding: binary");
105 header('Accept-Ranges: bytes');
106
107 $SQL = 'SELECT stat.*, display.Display, layout.Layout, media.Name AS MediaName ';
108 $SQL .= ' FROM stat ';
109 $SQL .= ' INNER JOIN display ON stat.DisplayID = display.DisplayID ';
110 $SQL .= ' INNER JOIN layout ON layout.LayoutID = stat.LayoutID ';
111 $SQL .= ' LEFT OUTER JOIN media ON media.mediaID = stat.mediaID ';
112 $SQL .= ' WHERE 1=1 ';
113 $SQL .= sprintf(" AND stat.end > '%s' ", $fromdt);
114 $SQL .= sprintf(" AND stat.start <= '%s' ", $todt);
115
116 if ($displayID != 0)
117 {
118 $SQL .= sprintf(" AND stat.displayID = %d ", $displayID);
119 }
120
121 Debug::LogEntry($db, 'audit', $SQL, 'Stats', 'OutputCSV');
122
123 if (!$result = $db->query($SQL))
124 {
125 trigger_error($db->error());
126 trigger_error('Failed to query for Stats.', E_USER_ERROR);
127 }
128
129 // Header row
130 $output .= "Type, FromDT, ToDT, Layout, Display, Media, Tag\n";
131
132 while($row = $db->get_assoc_row($result))
133 {
134 // Read the columns
135 $type = Kit::ValidateParam($row['type'], _STRING);
136 $fromdt = Kit::ValidateParam($row['start'], _STRING);
137 $todt = Kit::ValidateParam($row['end'], _STRING);
138 $layout = Kit::ValidateParam($row['Layout'], _STRING);
139 $display = Kit::ValidateParam($row['Display'], _STRING);
140 $media = Kit::ValidateParam($row['MediaName'], _STRING);
141 $tag = Kit::ValidateParam($row['Tag'], _STRING);
142
143 $output .= "$type, $fromdt, $todt, $layout, $display, $media, $tag\n";
144 }
145
146 //Debug::LogEntry($db, 'audit', 'Output: ' . $output, 'Stats', 'OutputCSV');
147
148 echo $output;
149 exit;
150 }
151}
152?>
0\ No newline at end of file153\ No newline at end of file
1154
=== modified file 'server/lib/xmds.inc.php'
--- server/lib/xmds.inc.php 2009-03-22 12:06:30 +0000
+++ server/lib/xmds.inc.php 2009-07-28 21:08:19 +0000
@@ -27,9 +27,9 @@
27require_once("lib/app/app_functions.php");27require_once("lib/app/app_functions.php");
28require_once("lib/app/debug.class.php");28require_once("lib/app/debug.class.php");
29require_once("lib/app/kit.class.php");29require_once("lib/app/kit.class.php");
3030require_once("lib/data/data.class.php");
31require_once("config/db_config.php");31require_once("config/db_config.php");
32require_once("config/config.class.php");
3332
33require_once("config/config.class.php");
34include_once('lib/data/stat.data.class.php');34include_once('lib/data/stat.data.class.php');
3535
36// Sort out magic quotes36// Sort out magic quotes
37if (get_magic_quotes_gpc()) 37if (get_magic_quotes_gpc())
3838
=== modified file 'server/modules/embedded.module.php'
--- server/modules/embedded.module.php 2009-06-20 10:05:53 +0000
+++ server/modules/embedded.module.php 2009-08-03 12:10:12 +0000
@@ -52,12 +52,29 @@
52 <table>52 <table>
53 <tr>53 <tr>
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>
55 <td><input id="duration" name="duration" type="text"></td> 55 <td><input id="duration" name="duration" type="text"></td>
56 </tr>56 </tr>
57 <tr>57 <tr>
58 <td colspan="2">58 <td colspan="2">
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 />
60 <textarea id="embedHtml" name="embedHtml"></textarea>60<textarea id="embedHtml" name="embedHtml">
61
62</textarea>
63 </td>
64 </tr>
65 <tr>
66 <td colspan="2">
67 <label for="embedScript" title="The JavaScript you want to Embed in this Layout.">Embed Script<span class="required">*</span></label><br />
68<textarea id="embedScript" name="embedScript">
69<script type="text/javascript">
70function EmbedInit()
71{
72 // Init will be called when this page is loaded in the client.
73
74 return;
75}
76</script>
77</textarea>
61 </td>78 </td>
62 </tr>79 </tr>
63 <tr>80 <tr>
@@ -103,6 +120,10 @@
103 $textNode = $textNodes->item(0);120 $textNode = $textNodes->item(0);
104 $embedHtml = $textNode->nodeValue;121 $embedHtml = $textNode->nodeValue;
105 122
123 $textNodes = $rawXml->getElementsByTagName('embedScript');
124 $textNode = $textNodes->item(0);
125 $embedScript= $textNode->nodeValue;
126
106 //Output the form127 //Output the form
107 $form = <<<FORM128 $form = <<<FORM
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">
@@ -121,6 +142,12 @@
121 </td>142 </td>
122 </tr>143 </tr>
123 <tr>144 <tr>
145 <td colspan="2">
146 <label for="embedScript" title="The JavaScript you want to Embed in this Layout.">Embed Script<span class="required">*</span></label><br />
147 <textarea id="embedScript" name="embedScript">$embedScript</textarea>
148 </td>
149 </tr>
150 <tr>
124 <td></td>151 <td></td>
125 <td>152 <td>
126 <input id="btnSave" type="submit" value="Save" />153 <input id="btnSave" type="submit" value="Save" />
@@ -154,6 +181,7 @@
154 181
155 //Other properties182 //Other properties
156 $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);183 $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);
184 $embedScript = Kit::GetParam('embedScript', _POST, _HTMLSTRING);
157 $duration = Kit::GetParam('duration', _POST, _INT, 0);185 $duration = Kit::GetParam('duration', _POST, _INT, 0);
158 186
159 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";187 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
@@ -178,7 +206,7 @@
178 $this->duration = $duration;206 $this->duration = $duration;
179 207
180 // Any Options208 // Any Options
181 $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>');209 $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml><embedScript><![CDATA[' . $embedScript . ']]></embedScript>');
182210
183 // Should have built the media object entirely by this time211 // Should have built the media object entirely by this time
184 // This saves the Media Object to the Region212 // This saves the Media Object to the Region
@@ -208,11 +236,12 @@
208 236
209 //Other properties237 //Other properties
210 $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);238 $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);
239 $embedScript = Kit::GetParam('embedScript', _POST, _HTMLSTRING);
211 $duration = Kit::GetParam('duration', _POST, _INT, 0);240 $duration = Kit::GetParam('duration', _POST, _INT, 0);
212 241
213 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";242 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
214 243
215 //Validate the URL?244 // Validate the URL?
216 if ($embedHtml == "")245 if ($embedHtml == "")
217 {246 {
218 $this->response->SetError('Please enter some HTML to embed.');247 $this->response->SetError('Please enter some HTML to embed.');
@@ -231,7 +260,7 @@
231 $this->duration = $duration;260 $this->duration = $duration;
232 261
233 // Any Options262 // Any Options
234 $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>');263 $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml><embedScript><![CDATA[' . $embedScript . ']]></embedScript>');
235264
236 // Should have built the media object entirely by this time265 // Should have built the media object entirely by this time
237 // This saves the Media Object to the Region266 // This saves the Media Object to the Region
238267
=== modified file 'server/modules/flash.module.php'
--- server/modules/flash.module.php 2009-05-24 09:59:49 +0000
+++ server/modules/flash.module.php 2009-06-28 10:47:06 +0000
@@ -784,8 +784,11 @@
784 // Editing the existing record784 // Editing the existing record
785 $new_mediaid = $mediaid;785 $new_mediaid = $mediaid;
786 786
787 $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid";787 $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d";
788 $SQL .= " WHERE mediaID = $mediaid ";788 $SQL .= " WHERE mediaID = %d ";
789 $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid);
790
791 Debug::LogEntry($db, 'audit', $SQL);
789 792
790 if (!$db->query($SQL))793 if (!$db->query($SQL))
791 {794 {
792795
=== modified file 'server/modules/image.module.php'
--- server/modules/image.module.php 2009-05-24 09:59:49 +0000
+++ server/modules/image.module.php 2009-06-28 10:47:06 +0000
@@ -794,8 +794,11 @@
794 // Editing the existing record794 // Editing the existing record
795 $new_mediaid = $mediaid;795 $new_mediaid = $mediaid;
796 796
797 $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid";797 $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d";
798 $SQL .= " WHERE mediaID = $mediaid ";798 $SQL .= " WHERE mediaID = %d ";
799 $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid);
800
801 Debug::LogEntry($db, 'audit', $SQL);
799 802
800 if (!$db->query($SQL))803 if (!$db->query($SQL))
801 {804 {
802805
=== modified file 'server/modules/module_user_general.php'
--- server/modules/module_user_general.php 2009-03-25 19:36:36 +0000
+++ server/modules/module_user_general.php 2009-07-07 20:01:49 +0000
@@ -89,8 +89,6 @@
89 89
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));
91 91
92 Debug::LogEntry($db, 'audit', $sql);
93
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);
9593
96 if ($db->num_rows($result)==0) 94 if ($db->num_rows($result)==0)
@@ -122,6 +120,7 @@
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);
123121
124 $session->setIsExpired(0);122 $session->setIsExpired(0);
123 $session->RegenerateSessionID(session_id());
125124
126 return true;125 return true;
127 }126 }
128127
=== modified file 'server/modules/powerpoint.module.php'
--- server/modules/powerpoint.module.php 2009-05-24 09:59:49 +0000
+++ server/modules/powerpoint.module.php 2009-06-28 10:47:06 +0000
@@ -784,8 +784,11 @@
784 // Editing the existing record784 // Editing the existing record
785 $new_mediaid = $mediaid;785 $new_mediaid = $mediaid;
786 786
787 $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid";787 $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d";
788 $SQL .= " WHERE mediaID = $mediaid ";788 $SQL .= " WHERE mediaID = %d ";
789 $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid);
790
791 Debug::LogEntry($db, 'audit', $SQL);
789 792
790 if (!$db->query($SQL))793 if (!$db->query($SQL))
791 {794 {
792795
=== modified file 'server/modules/text.module.php'
--- server/modules/text.module.php 2009-02-27 19:30:45 +0000
+++ server/modules/text.module.php 2009-08-03 12:10:12 +0000
@@ -62,6 +62,10 @@
62 <td><input id="duration" name="duration" type="text"></td> 62 <td><input id="duration" name="duration" type="text"></td>
63 </tr>63 </tr>
64 <tr>64 <tr>
65 <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td>
66 <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="30"></td>
67 </tr>
68 <tr>
65 <td colspan="4">69 <td colspan="4">
66 <textarea id="ta_text" name="ta_text"></textarea>70 <textarea id="ta_text" name="ta_text"></textarea>
67 </td>71 </td>
@@ -95,11 +99,12 @@
95 {99 {
96 $db =& $this->db;100 $db =& $this->db;
97 101
98 $layoutid = $this->layoutid;102 $layoutid = $this->layoutid;
99 $regionid = $this->regionid;103 $regionid = $this->regionid;
100 $mediaid = $this->mediaid;104 $mediaid = $this->mediaid;
101 105
102 $direction = $this->GetOption('direction');106 $direction = $this->GetOption('direction');
107 $scrollSpeed = $this->GetOption('scrollSpeed');
103 108
104 // Get the text out of RAW109 // Get the text out of RAW
105 $rawXml = new DOMDocument();110 $rawXml = new DOMDocument();
@@ -128,6 +133,10 @@
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>
129 </tr>134 </tr>
130 <tr>135 <tr>
136 <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td>
137 <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="$scrollSpeed"></td>
138 </tr>
139 <tr>
131 <td colspan="4">140 <td colspan="4">
132 <textarea id="ta_text" name="ta_text">$text</textarea>141 <textarea id="ta_text" name="ta_text">$text</textarea>
133 </td>142 </td>
@@ -169,6 +178,7 @@
169 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');178 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
170 $duration = Kit::GetParam('duration', _POST, _INT, 0);179 $duration = Kit::GetParam('duration', _POST, _INT, 0);
171 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);180 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
181 $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30);
172 182
173 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";183 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
174 184
@@ -193,6 +203,7 @@
193 203
194 // Any Options204 // Any Options
195 $this->SetOption('direction', $direction);205 $this->SetOption('direction', $direction);
206 $this->SetOption('scrollSpeed', $scrollSpeed);
196 $this->SetRaw('<text><![CDATA[' . $text . ']]></text>');207 $this->SetRaw('<text><![CDATA[' . $text . ']]></text>');
197 208
198 // Should have built the media object entirely by this time209 // Should have built the media object entirely by this time
@@ -225,6 +236,7 @@
225 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');236 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
226 $duration = Kit::GetParam('duration', _POST, _INT, 0);237 $duration = Kit::GetParam('duration', _POST, _INT, 0);
227 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);238 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
239 $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30);
228 240
229 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";241 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
230 242
@@ -248,6 +260,7 @@
248 260
249 // Any Options261 // Any Options
250 $this->SetOption('direction', $direction);262 $this->SetOption('direction', $direction);
263 $this->SetOption('scrollSpeed', $scrollSpeed);
251 $this->SetRaw('<text><![CDATA[' . $text . ']]></text>');264 $this->SetRaw('<text><![CDATA[' . $text . ']]></text>');
252 265
253 // Should have built the media object entirely by this time266 // Should have built the media object entirely by this time
254267
=== modified file 'server/modules/ticker.module.php'
--- server/modules/ticker.module.php 2009-06-18 18:36:21 +0000
+++ server/modules/ticker.module.php 2009-07-05 20:56:48 +0000
@@ -272,7 +272,7 @@
272 $copyright = Kit::GetParam('copyright', _POST, _STRING);272 $copyright = Kit::GetParam('copyright', _POST, _STRING);
273 273
274 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";274 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
275 275
276 //validation276 //validation
277 if ($text == '')277 if ($text == '')
278 {278 {
279279
=== modified file 'server/modules/video.module.php'
--- server/modules/video.module.php 2009-05-24 09:59:49 +0000
+++ server/modules/video.module.php 2009-06-28 10:47:06 +0000
@@ -771,8 +771,11 @@
771 // Editing the existing record771 // Editing the existing record
772 $new_mediaid = $mediaid;772 $new_mediaid = $mediaid;
773 773
774 $SQL = "UPDATE media SET name = '$name', duration = '$duration', permissionID = $permissionid";774 $SQL = "UPDATE media SET name = '%s', duration = %d, permissionID = %d";
775 $SQL .= " WHERE mediaID = $mediaid ";775 $SQL .= " WHERE mediaID = %d ";
776 $SQL = sprintf($SQL, $db->escape_string($name), $duration, $permissionid, $mediaid);
777
778 Debug::LogEntry($db, 'audit', $SQL);
776 779
777 if (!$db->query($SQL))780 if (!$db->query($SQL))
778 {781 {
779782
=== modified file 'server/template/css/xibo.css'
--- server/template/css/xibo.css 2009-06-20 12:00:21 +0000
+++ server/template/css/xibo.css 2009-08-03 12:10:12 +0000
@@ -48,7 +48,12 @@
4848
49#embedHtml {49#embedHtml {
50 width: 500px;50 width: 500px;
51 height: 310px;51 height: 140px;
52}
53
54#embedScript {
55 width: 500px;
56 height: 140px;
52}57}
5358
54.regionTransparency {59.regionTransparency {
5560
=== added file 'server/template/pages/stats_view.php'
--- server/template/pages/stats_view.php 1970-01-01 00:00:00 +0000
+++ server/template/pages/stats_view.php 2009-08-03 16:42:20 +0000
@@ -0,0 +1,42 @@
1<?php
2/*
3 * Xibo - Digitial Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009 Daniel Garner
5 *
6 * This file is part of Xibo.
7 *
8 * Xibo is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * Xibo is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */
21 defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
22?>
23<div id="form_container">
24 <div id="form_header">
25 <div id="form_header_left"></div>
26 <div id="form_header_right"></div>
27 </div>
28
29 <div id="form_body">
30 <div class="SecondNav">
31
32 </div>
33 <?php $this->StatsForm(); ?>
34 </div>
35
36 <div id="form_footer">
37 <div id="form_footer_left">
38 </div>
39 <div id="form_footer_right">
40 </div>
41 </div>
42</div>
0\ No newline at end of file43\ No newline at end of file
144
=== modified file 'server/upgrade.php'
--- server/upgrade.php 2009-06-15 08:16:19 +0000
+++ server/upgrade.php 2009-09-21 22:58:45 +0000
@@ -205,6 +205,12 @@
205 }205 }
206 }206 }
207207
208 echo '<div class="info"><p>';
209 echo "Perform automatic database upgrade?";
210 echo '</p></div><div class="install-table">';
211 echo '<input type="checkbox" name="doBackup" checked />';
212 echo '</div><hr width="25%" />';
213
208 $_SESSION['step'] = 3;214 $_SESSION['step'] = 3;
209 echo '<input type="hidden" name="includes" value="true" />';215 echo '<input type="hidden" name="includes" value="true" />';
210 echo '<p><input type="submit" value="Next >" /></p>';216 echo '<p><input type="submit" value="Next >" /></p>';
@@ -242,11 +248,18 @@
242 echo "FAIL: " . $fault_string;248 echo "FAIL: " . $fault_string;
243 }249 }
244 else {250 else {
251 $doBackup = Kit::GetParam("doBackup", $_POST, _BOOL);
252
245 set_time_limit(0);253 set_time_limit(0);
246 // Backup the database254 // Backup the database
247 echo '<div class="info">';255 echo '<div class="info"><p>';
248 echo '<p>Backing up your database';256 if ($doBackup) {
249 backup_tables($db, '*');257 echo 'Backing up your database';
258 backup_tables($db, '*');
259 }
260 else {
261 echo 'Skipping database backup';
262 }
250 echo '</p>';263 echo '</p>';
251264
252 $sqlStatementCount = 0;265 $sqlStatementCount = 0;
253266
=== modified file 'server/xmds.php'
--- server/xmds.php 2009-06-03 11:55:05 +0000
+++ server/xmds.php 2009-08-08 11:04:39 +0000
@@ -30,8 +30,6 @@
30{30{
31 global $db;31 global $db;
32 32
33 if (eregi('[^A-Za-z0-9]', $hardwareKey)) return false;
34
35 //check in the database for this hardwareKey33 //check in the database for this hardwareKey
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'";
37 if (!$result = $db->query($SQL)) 35 if (!$result = $db->query($SQL))
@@ -554,6 +552,7 @@
554 $SQL .= " INNER JOIN schedule_detail ON schedule_detail.layoutID = layout.layoutID ";552 $SQL .= " INNER JOIN schedule_detail ON schedule_detail.layoutID = layout.layoutID ";
555 $SQL .= " INNER JOIN display ON schedule_detail.displayID = display.displayID ";553 $SQL .= " INNER JOIN display ON schedule_detail.displayID = display.displayID ";
556 $SQL .= " WHERE display.license = '$hardwareKey' ";554 $SQL .= " WHERE display.license = '$hardwareKey' ";
555 $SQL .= " AND layout.retired = 0 ";
557 556
558 // Store the Base SQL for this display557 // Store the Base SQL for this display
559 $SQLBase = $SQL;558 $SQLBase = $SQL;
@@ -648,105 +647,7 @@
648{647{
649 global $db;648 global $db;
650 649
651 // Sanitize650 return new soap_fault("SOAP-ENV:Client", "", "This is a depricated service call. You should instead call either SubmitLog or SubmitStats", $serverKey);
652 $serverKey = Kit::ValidateParam($serverKey, _STRING);
653 $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING);
654 $version = Kit::ValidateParam($version, _STRING);
655
656 // Make sure we are talking the same language
657 if (!CheckVersion($version))
658 {
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);
660 }
661
662 //auth this request...
663 if (!$displayInfo = Auth($hardwareKey))
664 {
665 return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey);
666 }
667
668 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "[IN]", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']);
669 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "$xml", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']);
670
671 $document = new DOMDocument("1.0");
672 $document->loadXML("<log>".$xml."</log>");
673
674 foreach ($document->documentElement->childNodes as $node)
675 {
676 //Zero out the common vars
677 $date = "";
678 $message = "";
679 $scheduleID = "";
680 $layoutID = "";
681 $mediaID = "";
682 $type = "";
683 $cat = '';
684
685 // Get the date and the message (all log types have these)
686 foreach ($node->childNodes as $nodeElements)
687 {
688 if ($nodeElements->nodeName == "date")
689 {
690 $date = $nodeElements->textContent;
691 }
692 else if ($nodeElements->nodeName == "message")
693 {
694 $message = $nodeElements->textContent;
695 }
696 else if ($nodeElements->nodeName == "scheduleID")
697 {
698 $scheduleID = $nodeElements->textContent;
699 }
700 else if ($nodeElements->nodeName == "layoutID")
701 {
702 $layoutID = $nodeElements->textContent;
703 }
704 else if ($nodeElements->nodeName == "mediaID")
705 {
706 $mediaID = $nodeElements->textContent;
707 }
708 else if ($nodeElements->nodeName == "type")
709 {
710 $type = $nodeElements->textContent;
711 }
712 else if ($nodeElements->nodeName == "category")
713 {
714 $cat = $nodeElements->textContent;
715 }
716 }
717
718 switch ($node->nodeName)
719 {
720 case "stat":
721 if ($mediaID == '') $mediaID = 0;
722
723 StatRecord($type, $date, $scheduleID, $displayInfo['displayid'], $layoutID, $mediaID, $date, $date);
724 break;
725
726 case "trace":
727
728 // We have a trace message
729 // Either Audit or Error (if *)
730 if (substr($message, 0, 3) == '[*]')
731 {
732 Debug::LogEntry($db, "error", $message, ".NET Client", $cat, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID);
733 }
734 else
735 {
736 Debug::LogEntry($db, "audit", $message, ".NET Client", $cat, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID);
737 }
738
739 break;
740
741 default:
742 Debug::LogEntry($db, "audit", "Unknown entry in client log " . $node->nodeName, "xmds", "RecieveXmlLog", $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID);
743 break;
744 }
745 }
746
747 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "[OUT]", "xmds", "RecieveXmlLog", "", $displayInfo['displayid']);
748
749 return true;
750}651}
751652
752define('BLACKLIST_ALL', "All");653define('BLACKLIST_ALL', "All");
@@ -835,6 +736,203 @@
835 return true;736 return true;
836}737}
837738
739/**
740 * Submit client logging
741 * @return
742 * @param $version Object
743 * @param $serverKey Object
744 * @param $hardwareKey Object
745 * @param $logXml Object
746 */
747function SubmitLog($version, $serverKey, $hardwareKey, $logXml)
748{
749 global $db;
750
751 // Sanitize
752 $serverKey = Kit::ValidateParam($serverKey, _STRING);
753 $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING);
754 $version = Kit::ValidateParam($version, _STRING);
755 $logXml = Kit::ValidateParam($logXml, _HTMLSTRING);
756
757 // Make sure we are talking the same language
758 if (!CheckVersion($version))
759 {
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);
761 }
762
763 // Auth this request...
764 if (!$displayInfo = Auth($hardwareKey))
765 {
766 return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey);
767 }
768
769 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "IN", "xmds", "SubmitLog", "", $displayInfo['displayid']);
770 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", 'XML [' . $logXml . ']', "xmds", "SubmitLog", "", $displayInfo['displayid']);
771
772 // Load the XML into a DOMDocument
773 $document = new DOMDocument("1.0");
774
775 if (!$document->loadXML($logXml))
776 {
777 return new soap_fault("SOAP-ENV:Client", "", "XML Cannot be loaded into DOM Document.", $hardwareKey);
778 }
779
780 foreach ($document->documentElement->childNodes as $node)
781 {
782 //Zero out the common vars
783 $date = "";
784 $message = "";
785 $scheduleID = "";
786 $layoutID = "";
787 $mediaID = "";
788 $cat = '';
789 $method = '';
790
791 // This will be a bunch of trace nodes
792 $message = $node->textContent;
793
794 // Each element should have a category and a date
795 $date = $node->getAttribute('date');
796 $cat = $node->getAttribute('category');
797
798 if ($date == '' || $cat == '')
799 {
800 trigger_error('Log submitted without a date or category attribute');
801 continue;
802 }
803
804 // Get the date and the message (all log types have these)
805 foreach ($node->childNodes as $nodeElements)
806 {
807 if ($nodeElements->nodeName == "scheduleID")
808 {
809 $scheduleID = $nodeElements->textContent;
810 }
811 else if ($nodeElements->nodeName == "layoutID")
812 {
813 $layoutID = $nodeElements->textContent;
814 }
815 else if ($nodeElements->nodeName == "mediaID")
816 {
817 $mediaID = $nodeElements->textContent;
818 }
819 else if ($nodeElements->nodeName == "type")
820 {
821 $type = $nodeElements->textContent;
822 }
823 else if ($nodeElements->nodeName == "method")
824 {
825 $method = $nodeElements->textContent;
826 }
827 }
828
829 // We should have enough information to log this now.
830 if ($cat == 'error' || $cat == 'Error')
831 {
832 Debug::LogEntry($db, $cat, $message, 'Client', $method, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID);
833 }
834 else
835 {
836 Debug::LogEntry($db, 'audit', $message, 'Client', $method, $date, $displayInfo['displayid'], $scheduleID, $layoutID, $mediaID);
837 }
838 }
839
840 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "OUT", "xmds", "SubmitLog", "", $displayInfo['displayid']);
841
842 return true;
843}
844
845/**
846 * Submit display statistics to the server
847 * @return
848 * @param $version Object
849 * @param $serverKey Object
850 * @param $hardwareKey Object
851 * @param $statXml Object
852 */
853function SubmitStats($version, $serverKey, $hardwareKey, $statXml)
854{
855 global $db;
856
857 // Sanitize
858 $serverKey = Kit::ValidateParam($serverKey, _STRING);
859 $hardwareKey = Kit::ValidateParam($hardwareKey, _STRING);
860 $version = Kit::ValidateParam($version, _STRING);
861 $statXml = Kit::ValidateParam($statXml, _HTMLSTRING);
862
863 // Make sure we are talking the same language
864 if (!CheckVersion($version))
865 {
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);
867 }
868
869 // Auth this request...
870 if (!$displayInfo = Auth($hardwareKey))
871 {
872 return new soap_fault("SOAP-ENV:Client", "", "This display client is not licensed", $hardwareKey);
873 }
874
875 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "IN", "xmds", "SubmitStats", "", $displayInfo['displayid']);
876 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "StatXml: [" . $statXml . "]", "xmds", "SubmitStats", "", $displayInfo['displayid']);
877
878 if ($statXml == "")
879 {
880 return new soap_fault("SOAP-ENV:Client", "", "Stat XML is empty.", $hardwareKey);
881 }
882
883 // Log
884 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "About to create Stat Object.", "xmds", "SubmitStats", "", $displayInfo['displayid']);
885
886 $statObject = new Stat($db);
887
888 // Log
889 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "About to Create DOMDocument.", "xmds", "SubmitStats", "", $displayInfo['displayid']);
890
891 // Load the XML into a DOMDocument
892 $document = new DOMDocument("1.0");
893 $document->loadXML($statXml);
894
895 foreach ($document->documentElement->childNodes as $node)
896 {
897 //Zero out the common vars
898 $fromdt = '';
899 $todt = '';
900 $type = '';
901
902 $scheduleID = 0;
903 $layoutID = 0;
904 $mediaID = '';
905 $tag = '';
906
907 // Each element should have these attributes
908 $fromdt = $node->getAttribute('fromdt');
909 $todt = $node->getAttribute('todt');
910 $type = $node->getAttribute('type');
911
912 if ($fromdt == '' || $todt == '' || $type == '')
913 {
914 trigger_error('Stat submitted without the fromdt, todt or type attributes.');
915 continue;
916 }
917
918 $scheduleID = $node->getAttribute('scheduleid');
919 $layoutID = $node->getAttribute('layoutid');
920 $mediaID = $node->getAttribute('mediaid');
921 $tag = $node->getAttribute('tag');
922
923 // Write the stat record with the information we have available to us.
924 if (!$statObject->Add($type, $fromdt, $todt, $scheduleID, $displayInfo['displayid'], $layoutID, $mediaID, $tag))
925 {
926 trigger_error(sprintf('Stat Add failed with error: %s', $statObject->GetErrorMessage()));
927 continue;
928 }
929 }
930
931 if ($displayInfo['isAuditing'] == 1) Debug::LogEntry ($db, "audit", "OUT", "xmds", "SubmitStats", "", $displayInfo['displayid']);
932
933 return true;
934}
935
838//$debug = 1;936//$debug = 1;
839$service = new soap_server();937$service = new soap_server();
840938
@@ -899,10 +997,32 @@
899 'encoded',997 'encoded',
900 'Set media to be blacklisted'998 'Set media to be blacklisted'
901 );999 );
1000
1001$service->register("SubmitLog",
1002 array('version' => 'xsd:string', 'serverKey' => 'xsd:string', 'hardwareKey' => 'xsd:string', 'logXml' => 'xsd:string'),
1003 array('success' => 'xsd:boolean'),
1004 'urn:xmds',
1005 'urn:xmds#SubmitLog',
1006 'rpc',
1007 'encoded',
1008 'Submit Logging from the Client'
1009 );
1010
1011$service->register("SubmitStats",
1012 array('version' => 'xsd:string', 'serverKey' => 'xsd:string', 'hardwareKey' => 'xsd:string', 'statXml' => 'xsd:string'),
1013 array('success' => 'xsd:boolean'),
1014 'urn:xmds',
1015 'urn:xmds#SubmitLog',
1016 'rpc',
1017 'encoded',
1018 'Submit Display statistics from the Client'
1019 );
1020
1021
902 1022
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 : '';
904$service->service($HTTP_RAW_POST_DATA);1024$service->service($HTTP_RAW_POST_DATA);
9051025
906Debug::LogEntry($db, 'audit',$service->debug_str);1026//Debug::LogEntry($db, 'audit', $service->debug_str, "xmds", "NuSOAP");
9071027
908?>1028?>
909\ No newline at end of file1029\ No newline at end of file

Subscribers

People subscribed via source and target branches