Merge lp:~dangarner/xibo/396735 into lp:~xibo-maintainers/xibo/encke

Proposed by Dan Garner
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dangarner/xibo/396735
Merge into: lp:~xibo-maintainers/xibo/encke
Diff against target: None lines
To merge this branch: bzr merge lp:~dangarner/xibo/396735
Reviewer Review Type Date Requested Status
Xibo Maintainters Pending
Review via email: mp+8783@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2009-03-07 23:21:15 +0000
3+++ .bzrignore 2009-06-20 10:05:53 +0000
4@@ -1,3 +1,4 @@
5 server/settings.php
6 .project
7 server/.project
8+Thumbs.db
9
10=== modified file 'client/dotNET/Region.cs'
11--- client/dotNET/Region.cs 2009-03-08 11:40:17 +0000
12+++ client/dotNET/Region.cs 2009-06-20 10:05:53 +0000
13@@ -124,6 +124,10 @@
14 media = new Rss(options);
15 break;
16
17+ case "embedded":
18+ media = new Text(options);
19+ break;
20+
21 default:
22 //do nothing
23 SetNextMediaNode();
24@@ -197,7 +201,10 @@
25 options.text = "";
26 options.documentTemplate = "";
27 options.copyrightNotice = "";
28+ options.scrollSpeed = 1;
29+ options.updateInterval = 6;
30 options.uri = "";
31+ options.direction = "none";
32
33 // Get a media node
34 bool validNode = false;
35@@ -266,6 +273,28 @@
36 {
37 options.copyrightNotice = option.InnerText;
38 }
39+ else if (option.Name == "scrollSpeed")
40+ {
41+ try
42+ {
43+ options.scrollSpeed = int.Parse(option.InnerText);
44+ }
45+ catch
46+ {
47+ System.Diagnostics.Trace.WriteLine("Non integer scrollSpeed in XLF", "Region - SetNextMediaNode");
48+ }
49+ }
50+ else if (option.Name == "updateInverval")
51+ {
52+ try
53+ {
54+ options.updateInterval = int.Parse(option.InnerText);
55+ }
56+ catch
57+ {
58+ System.Diagnostics.Trace.WriteLine("Non integer updateInterval in XLF", "Region - SetNextMediaNode");
59+ }
60+ }
61 }
62
63 // And some stuff on Raw nodes
64@@ -281,6 +310,10 @@
65 {
66 options.documentTemplate = raw.InnerText;
67 }
68+ else if (raw.Name == "embedHtml")
69+ {
70+ options.text = raw.InnerText;
71+ }
72 }
73
74 // That should cover all the new options
75@@ -398,6 +431,8 @@
76 public string text;
77 public string documentTemplate;
78 public string copyrightNotice;
79+ public int updateInterval;
80+ public int scrollSpeed;
81
82 //The identification for this region
83 public string mediaid;
84
85=== removed file 'client/dotNET/Resources/Thumbs.db'
86Binary 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
87=== modified file 'client/dotNET/Rss.cs'
88--- client/dotNET/Rss.cs 2009-03-13 09:21:56 +0000
89+++ client/dotNET/Rss.cs 2009-06-20 10:39:40 +0000
90@@ -64,6 +64,12 @@
91 scheduleId = options.scheduleId;
92 layoutId = options.layoutId;
93
94+ // Update interval and scrolling speed
95+ _updateInterval = options.updateInterval;
96+ _scrollSpeed = options.scrollSpeed;
97+
98+ System.Diagnostics.Trace.WriteLine(String.Format("Scrolling Speed: {0}, Update Interval: {1})", _scrollSpeed.ToString(), _updateInterval.ToString()), "Rss - Constructor");
99+
100 // Set up the backgrounds
101 backgroundTop = options.backgroundTop + "px";
102 backgroundLeft = options.backgroundLeft + "px";
103@@ -77,7 +83,7 @@
104
105 try
106 {
107- webBrowser.DocumentText = String.Format("<html><head><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());
108+ 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());
109 }
110 catch (Exception e)
111 {
112@@ -96,6 +102,9 @@
113 try
114 {
115 wc = new System.Net.WebClient();
116+ wc.Encoding = System.Text.Encoding.UTF8;
117+
118+ System.Diagnostics.Debug.WriteLine("Created at WebClient and set the Encoding to UTF8", "RSS - Refresh local RSS");
119
120 wc.OpenReadCompleted += new System.Net.OpenReadCompletedEventHandler(wc_OpenReadCompleted);
121
122@@ -109,6 +118,8 @@
123
124 void wc_OpenReadCompleted(object sender, System.Net.OpenReadCompletedEventArgs e)
125 {
126+ String rssContents;
127+
128 if (e.Error != null)
129 {
130 System.Diagnostics.Trace.WriteLine(String.Format("[*]ScheduleID:{1},LayoutID:{2},MediaID:{3},Message:{0}", e.Error, scheduleId, layoutId, mediaid));
131@@ -122,11 +133,14 @@
132
133 try
134 {
135- System.IO.StreamReader sr = new System.IO.StreamReader(data);
136+ System.IO.StreamReader sr = new System.IO.StreamReader(data, Encoding.UTF8);
137+ rssContents = sr.ReadToEnd();
138
139 StreamWriter sw = new StreamWriter(File.Open(rssFilePath, FileMode.Create, FileAccess.Write, FileShare.Read));
140
141- sw.Write(sr.ReadToEnd());
142+ System.Diagnostics.Debug.WriteLine("Retrieved RSS - about to write it", "RSS - wc_OpenReadCompleted");
143+
144+ sw.Write(rssContents);
145
146 sr.Close();
147 sw.Close();
148@@ -172,16 +186,23 @@
149 }
150 else
151 {
152- // It exists - therefore we want to get the last time it was updated
153- DateTime lastWriteDate = System.IO.File.GetLastWriteTime(rssFilePath);
154-
155- if (DateTime.Now.CompareTo(lastWriteDate.AddHours(6.0)) > 0)
156+ if (_updateInterval == 0)
157 {
158 refreshLocalRss();
159 }
160 else
161 {
162- rssReady = true;
163+ // It exists - therefore we want to get the last time it was updated
164+ DateTime lastWriteDate = System.IO.File.GetLastWriteTime(rssFilePath);
165+
166+ if (DateTime.Now.CompareTo(lastWriteDate.AddHours(_updateInterval * 1.0 / 60.0)) > 0)
167+ {
168+ refreshLocalRss();
169+ }
170+ else
171+ {
172+ rssReady = true;
173+ }
174 }
175 }
176
177@@ -330,7 +351,7 @@
178 // Call the JavaScript on the page
179 Object[] objArray = new Object[2];
180 objArray[0] = direction;
181- objArray[1] = 30;
182+ objArray[1] = _scrollSpeed;
183
184 htmlDoc.InvokeScript("init", objArray);
185 }
186@@ -451,6 +472,8 @@
187 private WebBrowser webBrowser;
188 private string copyrightNotice;
189 private string mediaid;
190+ private int _updateInterval;
191+ private int _scrollSpeed;
192
193 private string rssFilePath;
194
195
196=== modified file 'client/dotNET/Schedule.cs'
197--- client/dotNET/Schedule.cs 2009-03-08 11:40:17 +0000
198+++ client/dotNET/Schedule.cs 2009-06-18 18:36:21 +0000
199@@ -69,6 +69,7 @@
200 xmds2.RequiredFilesCompleted += new XiboClient.xmds.RequiredFilesCompletedEventHandler(xmds2_RequiredFilesCompleted);
201 xmds2.ScheduleCompleted += new XiboClient.xmds.ScheduleCompletedEventHandler(xmds2_ScheduleCompleted);
202
203+ System.Diagnostics.Trace.WriteLine(String.Format("Collection Interval: {0}", Properties.Settings.Default.collectInterval), "Schedule - InitializeComponents");
204 //
205 // The Timer for the Service call
206 //
207
208=== modified file 'client/dotNET/Text.cs'
209--- client/dotNET/Text.cs 2008-12-19 23:34:13 +0000
210+++ client/dotNET/Text.cs 2009-06-20 10:39:40 +0000
211@@ -55,11 +55,12 @@
212
213 try
214 {
215- webBrowser.DocumentText = String.Format("<html><head><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());
216+ 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());
217 }
218 catch (Exception e)
219 {
220- MessageBox.Show(e.Message);
221+ System.Diagnostics.Trace.WriteLine(e.Message);
222+ return;
223 }
224
225 webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);
226
227=== modified file 'client/dotNET/VideoPlayer.resx'
228--- client/dotNET/VideoPlayer.resx 2008-12-19 23:34:13 +0000
229+++ client/dotNET/VideoPlayer.resx 2009-05-24 10:19:36 +0000
230@@ -123,8 +123,8 @@
231 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0
232 ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAuQAAAAIB
233 AAAAAQAAAAAAAAAAAAAAAKQAAAAAAwAACAACAAAAAAAFAAAAAAAAAPA/AwAAAAAABQAAAAAAAAAAAAgA
234- AgAAAAAAAwABAAAACwD//wMAAAAAAAsA//8IAAIAAAAAAAMAMgAAAAsAAAAIAAoAAABuAG8AbgBlAAAA
235- CwD//wsA//8LAAAACwAAAAsAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAAIAAIAAAAAAAsAAAATHgAA
236+ AgAAAAAAAwABAAAACwD//wMAAAAAAAsAAAAIAAIAAAAAAAMAMgAAAAsAAAAIAAoAAABuAG8AbgBlAAAA
237+ CwD//wsAAAALAAAACwAAAAsAAAAIAAIAAAAAAAgAAgAAAAAACAACAAAAAAAIAAIAAAAAAAsAAAATHgAA
238 zRsAAAs=
239 </value>
240 </data>
241
242=== modified file 'client/dotNET/bin/Release/XiboClient.XmlSerializers.dll'
243Binary files client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.XmlSerializers.dll 2009-06-20 10:39:40 +0000 differ
244=== modified file 'client/dotNET/bin/Release/XiboClient.exe'
245Binary files client/dotNET/bin/Release/XiboClient.exe 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.exe 2009-06-20 10:39:40 +0000 differ
246=== modified file 'client/dotNET/bin/Release/XiboClient.pdb'
247Binary files client/dotNET/bin/Release/XiboClient.pdb 2009-03-28 19:13:50 +0000 and client/dotNET/bin/Release/XiboClient.pdb 2009-06-20 10:39:40 +0000 differ
248=== modified file 'server/config/config.class.php'
249--- server/config/config.class.php 2009-05-02 10:10:54 +0000
250+++ server/config/config.class.php 2009-06-20 10:59:41 +0000
251@@ -192,7 +192,7 @@
252 $output .= $imgBad.$message.'<br />';
253 $output .= <<<END
254 <div class="check_explain">
255- <p>Xibo requires a MySQL database.</p>
256+ <p>Xibo requires the PHP MySQL Extension to function.</p>
257 </div>
258 END;
259 }
260
261=== removed file 'server/img/Thumbs.db'
262Binary files server/img/Thumbs.db 2008-12-14 14:42:52 +0000 and server/img/Thumbs.db 1970-01-01 00:00:00 +0000 differ
263=== removed file 'server/img/bodys/Thumbs.db'
264Binary files server/img/bodys/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/bodys/Thumbs.db 1970-01-01 00:00:00 +0000 differ
265=== removed file 'server/img/dashboard/Thumbs.db'
266Binary files server/img/dashboard/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/dashboard/Thumbs.db 1970-01-01 00:00:00 +0000 differ
267=== removed file 'server/img/dialogs/Thumbs.db'
268Binary files server/img/dialogs/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/dialogs/Thumbs.db 1970-01-01 00:00:00 +0000 differ
269=== removed file 'server/img/fades/Thumbs.db'
270Binary files server/img/fades/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/fades/Thumbs.db 1970-01-01 00:00:00 +0000 differ
271=== removed file 'server/img/filterform/Thumbs.db'
272Binary files server/img/filterform/Thumbs.db 2008-12-14 14:42:52 +0000 and server/img/filterform/Thumbs.db 1970-01-01 00:00:00 +0000 differ
273=== removed file 'server/img/forms/Thumbs.db'
274Binary files server/img/forms/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/forms/Thumbs.db 1970-01-01 00:00:00 +0000 differ
275=== added file 'server/img/forms/embedded.png'
276Binary files server/img/forms/embedded.png 1970-01-01 00:00:00 +0000 and server/img/forms/embedded.png 2009-06-20 12:00:21 +0000 differ
277=== removed file 'server/img/login/Thumbs.db'
278Binary files server/img/login/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/login/Thumbs.db 1970-01-01 00:00:00 +0000 differ
279=== removed file 'server/img/logos/Thumbs.db'
280Binary files server/img/logos/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/logos/Thumbs.db 1970-01-01 00:00:00 +0000 differ
281=== removed file 'server/img/tables/Thumbs.db'
282Binary files server/img/tables/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/tables/Thumbs.db 1970-01-01 00:00:00 +0000 differ
283=== removed file 'server/img/tabs/Thumbs.db'
284Binary files server/img/tabs/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/tabs/Thumbs.db 1970-01-01 00:00:00 +0000 differ
285=== removed file 'server/img/titles/Thumbs.db'
286Binary files server/img/titles/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/titles/Thumbs.db 1970-01-01 00:00:00 +0000 differ
287=== removed file 'server/img/weather_rss/Thumbs.db'
288Binary files server/img/weather_rss/Thumbs.db 2008-12-10 23:48:58 +0000 and server/img/weather_rss/Thumbs.db 1970-01-01 00:00:00 +0000 differ
289=== modified file 'server/install.php'
290--- server/install.php 2009-04-30 17:49:26 +0000
291+++ server/install.php 2009-06-15 08:16:19 +0000
292@@ -266,6 +266,7 @@
293 // NB this is broken for 0 padded files
294 // eg 01.sql would be incorrectly sorted in the above example.
295
296+ $sqlStatementCount = 0;
297 natcasesort($sql_files);
298
299 foreach ($sql_files as $filename) {
300@@ -280,10 +281,11 @@
301 $sql_file = split_sql_file($sql_file, $delimiter);
302
303 foreach ($sql_file as $sql) {
304- print ".";
305+ print ".";
306+ $sqlStatementCount++;
307 flush();
308 if (! @mysql_query($sql,$db)) {
309- reportError("4", "An error occured populating the database.<br /><br />MySQL Error:<br />" . mysql_error());
310+ reportError("4", "An error occured populating the database.<br /><br />MySQL Error:<br />" . mysql_error() . "<br /><br />SQL executed:<br />" . $sql . "<br /><br />Statement number: " . $sqlStatementCount);
311 }
312 }
313 print "</p>";
314
315=== added file 'server/install/database/6.sql'
316--- server/install/database/6.sql 1970-01-01 00:00:00 +0000
317+++ server/install/database/6.sql 2009-06-20 09:34:43 +0000
318@@ -0,0 +1,16 @@
319+INSERT INTO `module` (
320+`ModuleID` ,
321+`Module` ,
322+`Enabled` ,
323+`RegionSpecific` ,
324+`Description` ,
325+`ImageUri` ,
326+`SchemaVersion`
327+)
328+VALUES (
329+NULL , 'Embedded', '1', '1', 'Embedded HTML', 'img/forms/webpage.gif', '1'
330+);
331+
332+UPDATE `version` SET `app_ver` = '1.0.2';
333+UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
334+UPDATE `version` SET `DBVersion` = '6';
335\ No newline at end of file
336
337=== modified file 'server/lib/app/session.class.php'
338--- server/lib/app/session.class.php 2008-12-19 22:10:39 +0000
339+++ server/lib/app/session.class.php 2009-07-07 20:01:49 +0000
340@@ -29,7 +29,8 @@
341
342 public $isExpired = 1;
343
344- function __construct(database $db) {
345+ function __construct(database $db)
346+ {
347 $this->db =& $db;
348
349 session_set_save_handler(array(&$this, 'open'),
350@@ -64,38 +65,27 @@
351 {
352 $db =& $this->db;
353
354- $userAgent = $_SERVER['HTTP_USER_AGENT'];
355- $remoteAddr = $_SERVER['REMOTE_ADDR'];
356+ $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent');
357+ $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
358+ $securityToken = Kit::GetParam('SecurityToken', _POST, _STRING, null);
359
360 $this->key = $key;
361 $newExp = time() + $this->max_lifetime;
362
363 $this->gc($this->max_lifetime);
364
365- if(isset($_POST['SecurityToken']))
366- {
367- $securityToken = validate($_POST['SecurityToken']);
368-
369- if (!$securityToken)
370- {
371- log_entry($db, "error", "Invalid Security Token");
372- $securityToken = null;
373- }
374- }
375- else
376- {
377- $securityToken = null;
378- }
379-
380+ // Get this session
381 $SQL = " SELECT session_data, IsExpired, SecurityToken FROM session ";
382- $SQL .= " WHERE session_id = '$key' ";
383- $SQL .= " AND RemoteAddr = '$remoteAddr' ";
384-
385- if (!$result = $db->query($SQL));
386+ $SQL .= " WHERE session_id = '%s' ";
387+ $SQL .= " AND UserAgent = '%s' ";
388+
389+ $SQL = sprintf($SQL, $db->escape_string($key), $db->escape_string($userAgent));
390+
391+ $result = $db->query($SQL);
392
393 if ($db->num_rows($result) != 0)
394 {
395-
396+ // Get the row
397 $row = $db->get_row($result);
398
399 // We have the Key and the Remote Address.
400@@ -109,10 +99,10 @@
401 // We have a security token, so dont require a login
402 $this->isExpired = 0;
403
404- if (!$db->query("UPDATE session SET session_expiration = $newExp, isExpired = 0 WHERE session_id = '$key' "))
405+ if (!$db->query(sprintf("UPDATE session SET session_expiration = $newExp, isExpired = 0 WHERE session_id = '%s' ", $db->escape_string($key))))
406 {
407 log_entry($db, "error", $db->error());
408- }
409+ }
410 }
411 else
412 {
413@@ -123,49 +113,55 @@
414 }
415
416 // Either way - update this SESSION so that the security token is NULL
417- $db->query("UPDATE session SET SecurityToken = NULL WHERE session_id = '$key' ");
418+ $db->query(sprintf("UPDATE session SET SecurityToken = NULL WHERE session_id = '%s' ", $db->escape_string($key)));
419
420 return($row[0]);
421 }
422- else {
423+ else
424+ {
425 $empty = '';
426 return settype($empty, "string");
427 }
428 }
429
430- function write($key, $val) {
431-
432- $db =& $this->db;
433-
434- $val = addslashes($val);
435+ function write($key, $val)
436+ {
437+ $db =& $this->db;
438
439 $newExp = time() + $this->max_lifetime;
440 $lastaccessed = date("Y-m-d H:i:s");
441- $userAgent = $_SERVER['HTTP_USER_AGENT'];
442- $remoteAddr = $_SERVER['REMOTE_ADDR'];
443+ $userAgent = Kit::GetParam('HTTP_USER_AGENT', $_SERVER, _STRING, 'No user agent');
444+ $remoteAddr = Kit::GetParam('REMOTE_ADDR', $_SERVER, _STRING);
445
446- $result = $db->query("SELECT session_id FROM session WHERE session_id = '$key'");
447+ $result = $db->query(sprintf("SELECT session_id FROM session WHERE session_id = '%s'", $db->escape_string($key)));
448
449 if ($db->num_rows($result) == 0)
450 {
451 //INSERT
452 $SQL = "INSERT INTO session (session_id, session_data, session_expiration, LastAccessed, LastPage, userID, IsExpired, UserAgent, RemoteAddr)
453- VALUES ('$key','$val',$newExp,'$lastaccessed','login', NULL, 0, '$userAgent', '$remoteAddr')";
454+ VALUES ('%s', '%s', %d, '%s', 'login', NULL, 0, '%s', '%s')";
455+
456+ $SQL = sprintf($SQL, $db->escape_string($key), $db->escape_string($val), $newExp, $db->escape_string($lastaccessed), $db->escape_string($userAgent), $db->escape_string($remoteAddr));
457 }
458 else
459 {
460 //UPDATE
461 $SQL = "UPDATE session SET ";
462- $SQL .= " session_data = '$val', ";
463- $SQL .= " session_expiration = '$newExp', ";
464- $SQL .= " lastaccessed = '$lastaccessed' ";
465- $SQL .= " WHERE session_id = '$key' ";
466+ $SQL .= " session_data = '%s', ";
467+ $SQL .= " session_expiration = %d, ";
468+ $SQL .= " lastaccessed = '%s', ";
469+ $SQL .= " RemoteAddr = '%s' ";
470+ $SQL .= " WHERE session_id = '%s' ";
471+
472+ $SQL = sprintf($SQL, $db->escape_string($val), $newExp, $db->escape_string($lastaccessed), $db->escape_string($remoteAddr), $db->escape_string($key));
473 }
474
475- if(!$db->query($SQL)) {
476+ if(!$db->query($SQL))
477+ {
478 log_entry($db, "error", $db->error());
479 return(false);
480 }
481+
482 return true;
483 }
484
485@@ -173,7 +169,7 @@
486 {
487 $db =& $this->db;
488
489- $SQL = "UPDATE session SET IsExpired = 1 WHERE session_id = '$key'";
490+ $SQL = sprintf("UPDATE session SET IsExpired = 1 WHERE session_id = '%s'", $db->escape_string($key));
491
492 $result = $db->query("$SQL");
493
494@@ -193,26 +189,32 @@
495 {
496 $db =& $this->db;
497
498- $SQL = "UPDATE session SET userID = $userid WHERE session_id = '$key' ";
499+ $SQL = sprintf("UPDATE session SET userID = %d WHERE session_id = '%s' ",$userid, $db->escape_string($key));
500
501- if(!$db->query($SQL)) {
502+ if(!$db->query($SQL))
503+ {
504 trigger_error($db->error(), E_USER_NOTICE);
505 return(false);
506 }
507 return true;
508 }
509
510- // Update the session (after login)
511- static function RegenerateSessionID()
512+ /**
513+ * Updates the session ID with a new one
514+ * @return
515+ */
516+ public function RegenerateSessionID($oldSessionID)
517 {
518- $old_sess_id = session_id();
519+ $db =& $this->db;
520
521 session_regenerate_id(false);
522
523 $new_sess_id = session_id();
524+
525+ $this->key = $new_sess_id;
526
527- $query = "UPDATE `session` SET `session_id` = '$new_sess_id' WHERE session_id = '$old_sess_id'";
528- mysql_query($query);
529+ $query = sprintf("UPDATE session SET session_id = '%s' WHERE session_id = '%s'", $db->escape_string($new_sess_id), $db->escape_string($oldSessionID));
530+ $db->query($query);
531 }
532
533 function set_page($key, $lastpage)
534@@ -221,9 +223,10 @@
535
536 $_SESSION['pagename'] = $lastpage;
537
538- $SQL = "UPDATE session SET LastPage = '$lastpage' WHERE session_id = '$key' ";
539+ $SQL = sprintf("UPDATE session SET LastPage = '%s' WHERE session_id = '%s' ", $db->escape_string($lastpage), $db->escape_string($key));
540
541- if(!$db->query($SQL)) {
542+ if(!$db->query($SQL))
543+ {
544 trigger_error($db->error(), E_USER_NOTICE);
545 return(false);
546 }
547@@ -236,7 +239,7 @@
548
549 $this->isExpired = $isExpired;
550
551- $SQL = "UPDATE session SET IsExpired = $this->isExpired WHERE session_id = '$this->key'";
552+ $SQL = sprintf("UPDATE session SET IsExpired = $this->isExpired WHERE session_id = '%s'", $db->escape_string($this->key));
553
554 if (!$db->query($SQL))
555 {
556@@ -248,7 +251,7 @@
557 {
558 $db =& $this->db;
559
560- $SQL = "UPDATE session SET securityToken = '$token' WHERE session_id = '$this->key'";
561+ $SQL = sprintf("UPDATE session SET securityToken = '%s' WHERE session_id = '%s'", $db->escape_string($token), $db->escape_string($this->key));
562
563 if (!$db->query($SQL))
564 {
565
566=== modified file 'server/lib/pages/layout.class.php'
567--- server/lib/pages/layout.class.php 2009-04-27 19:28:08 +0000
568+++ server/lib/pages/layout.class.php 2009-06-20 12:00:21 +0000
569@@ -1194,8 +1194,12 @@
570 $paddingTop = $regionHeight / 2 - 16;
571 $paddingTop = $paddingTop . "px";
572
573+ $regionTransparency = '<div class="regionTransparency" style="width:100%; height:100%;">';
574+ $regionTransparency .= '</div>';
575+
576 $doubleClickLink = "XiboFormRender($(this).attr('href'))";
577- $regionHtml .= "<div id='region_$regionid' regionid='$regionid' layoutid='$this->layoutid' href='index.php?p=layout&layoutid=$this->layoutid&regionid=$regionid&q=RegionOptions' ondblclick=\"$doubleClickLink\"' class='region' style=\"position:absolute; width:$regionWidth; height:$regionHeight; top: $regionTop; left: $regionLeft; background-color: #FFF; opacity: .75; filter: alpha(opacity=75); border: 1px dashed #000\">
578+ $regionHtml .= "<div id='region_$regionid' regionid='$regionid' layoutid='$this->layoutid' href='index.php?p=layout&layoutid=$this->layoutid&regionid=$regionid&q=RegionOptions' ondblclick=\"$doubleClickLink\"' class='region' style=\"position:absolute; width:$regionWidth; height:$regionHeight; top: $regionTop; left: $regionLeft; border: 1px dashed #000\">
579+ $regionTransparency
580 <div class='preview' style='$previewStyle'>
581 <div class='previewContent'></div>
582 <div class='previewNav' style='display:none;'></div>
583@@ -1435,7 +1439,7 @@
584 while ($modulesItem = $enabledModules->GetNextModule())
585 {
586 $mod = Kit::ValidateParam($modulesItem['Module'], _STRING);
587- $caption = 'Add ' . $mod;
588+ $caption = '+ ' . $mod;
589 $mod = strtolower($mod);
590 $title = Kit::ValidateParam($modulesItem['Description'], _STRING);
591 $img = Kit::ValidateParam($modulesItem['ImageUri'], _STRING);
592@@ -1445,7 +1449,7 @@
593 $buttons .= <<<HTML
594 <div class="regionicons">
595 <a class="XiboFormButton" title="$title" href="$uri">
596- <img class="dash_button" src="$img" />
597+ <img class="dash_button moduleButtonImage" src="$img" />
598 <span class="dash_text">$caption</span></a>
599 </div>
600 HTML;
601@@ -1456,7 +1460,7 @@
602 <div id="buttons">
603 <div class="regionicons">
604 <a class="XiboFormButton" href="index.php?p=content&q=LibraryAssignForm&layoutid=$this->layoutid&regionid=$regionid" title="Library">
605- <img class="region_button" src="img/forms/library.gif"/>
606+ <img class="region_button moduleButtonImage" src="img/forms/library.gif"/>
607 <span class="region_text">Library</span></a>
608 </div>
609 $buttons
610@@ -1635,7 +1639,7 @@
611 $type = (string) $node->getAttribute("type");
612 $mediaDurationText = (string) $node->getAttribute("duration");
613
614- $return .= "<div class='info' style='display:none; position:absolute; top: 15px; left: 150px; background-color:#FFF; z-index: 50;'>
615+ $return .= "<div class='info regionTransparency' style='display:none; position:absolute; top: 15px; left: 150px; background-color:#FFF; z-index: 50;'>
616 <h5>Media Information</h5>
617 <ul>
618 <li>Type: $type</li>
619
620=== modified file 'server/lib/pages/report.class.php'
621--- server/lib/pages/report.class.php 2009-03-13 10:10:07 +0000
622+++ server/lib/pages/report.class.php 2009-07-07 19:44:46 +0000
623@@ -210,9 +210,7 @@
624 <td>$ip</td>
625 <td>$browser</td>
626 <td>
627- <div class="buttons">
628- <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>
629- </div>
630+ <button class="XiboFormButton" href="index.php?p=report&q=ConfirmLogout&userid=$userID"><span>Logout</span></a>
631 </td>
632 </tr>
633 END;
634@@ -234,14 +232,15 @@
635 $userID = Kit::GetParam('userid', _GET, _INT);
636
637 $form = <<<END
638- <form class="dialog_form" method="post" action="index.php?p=report&q=LogoutUser">
639+ <form class="XiboForm" method="post" action="index.php?p=report&q=LogoutUser">
640 <input type="hidden" name="userid" value="userid" />
641 <p>Are you sure you want to logout this user?</p>
642 <input type="submit" value="Yes">
643 <input type="submit" value="No" onclick="$('#div_dialog').dialog('close');return false; ">
644 </form>
645 END;
646- $arh->SetFormSubmitResponse($form);
647+
648+ $arh->SetFormRequestResponse($form, 'Logout User', '450px', '300px');
649 $arh->Respond();
650 }
651
652
653=== added file 'server/modules/embedded.module.php'
654--- server/modules/embedded.module.php 1970-01-01 00:00:00 +0000
655+++ server/modules/embedded.module.php 2009-06-20 10:05:53 +0000
656@@ -0,0 +1,251 @@
657+<?php
658+/*
659+ * Xibo - Digitial Signage - http://www.xibo.org.uk
660+ * Copyright (C) 2009 Daniel Garner
661+ *
662+ * This file is part of Xibo.
663+ *
664+ * Xibo is free software: you can redistribute it and/or modify
665+ * it under the terms of the GNU Affero General Public License as published by
666+ * the Free Software Foundation, either version 3 of the License, or
667+ * any later version.
668+ *
669+ * Xibo is distributed in the hope that it will be useful,
670+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
671+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
672+ * GNU Affero General Public License for more details.
673+ *
674+ * You should have received a copy of the GNU Affero General Public License
675+ * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
676+ */
677+class embedded extends Module
678+{
679+
680+ public function __construct(database $db, user $user, $mediaid = '', $layoutid = '', $regionid = '')
681+ {
682+ // Must set the type of the class
683+ $this->type = 'embedded';
684+
685+ // Must call the parent class
686+ parent::__construct($db, $user, $mediaid, $layoutid, $regionid);
687+ }
688+
689+ /**
690+ * Return the Add Form as HTML
691+ * @return
692+ */
693+ public function AddForm()
694+ {
695+ $db =& $this->db;
696+ $user =& $this->user;
697+
698+ // Would like to get the regions width / height
699+ $layoutid = $this->layoutid;
700+ $regionid = $this->regionid;
701+ $rWidth = Kit::GetParam('rWidth', _REQUEST, _STRING);
702+ $rHeight = Kit::GetParam('rHeight', _REQUEST, _STRING);
703+
704+ $form = <<<FORM
705+ <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=AddMedia">
706+ <input type="hidden" name="layoutid" value="$layoutid">
707+ <input type="hidden" id="iRegionId" name="regionid" value="$regionid">
708+ <table>
709+ <tr>
710+ <td><label for="duration" title="The duration in seconds this webpage should be displayed">Duration<span class="required">*</span></label></td>
711+ <td><input id="duration" name="duration" type="text"></td>
712+ </tr>
713+ <tr>
714+ <td colspan="2">
715+ <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br />
716+ <textarea id="embedHtml" name="embedHtml"></textarea>
717+ </td>
718+ </tr>
719+ <tr>
720+ <td></td>
721+ <td>
722+ <input id="btnSave" type="submit" value="Save" />
723+ <input class="XiboFormButton" id="btnCancel" type="button" title="Return to the Region Options" href="index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions" value="Cancel" />
724+ </td>
725+ </tr>
726+ </table>
727+ </form>
728+FORM;
729+
730+ $this->response->html = $form;
731+ $this->response->dialogTitle = 'Add Embedded HTML';
732+ $this->response->dialogSize = true;
733+ $this->response->dialogWidth = '650px';
734+ $this->response->dialogHeight = '450px';
735+
736+ return $this->response;
737+ }
738+
739+ /**
740+ * Return the Edit Form as HTML
741+ * @return
742+ */
743+ public function EditForm()
744+ {
745+ $db =& $this->db;
746+
747+ $layoutid = $this->layoutid;
748+ $regionid = $this->regionid;
749+ $mediaid = $this->mediaid;
750+
751+ // Get the embedded HTML out of RAW
752+ $rawXml = new DOMDocument();
753+ $rawXml->loadXML($this->GetRaw());
754+
755+ Debug::LogEntry($db, 'audit', 'Raw XML returned: ' . $this->GetRaw());
756+
757+ // Get the HTML Node out of this
758+ $textNodes = $rawXml->getElementsByTagName('embedHtml');
759+ $textNode = $textNodes->item(0);
760+ $embedHtml = $textNode->nodeValue;
761+
762+ //Output the form
763+ $form = <<<FORM
764+ <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia">
765+ <input type="hidden" name="layoutid" value="$layoutid">
766+ <input type="hidden" name="mediaid" value="$mediaid">
767+ <input type="hidden" id="iRegionId" name="regionid" value="$regionid">
768+ <table>
769+ <tr>
770+ <td><label for="duration" title="The duration in seconds this webpage should be displayed (may be overridden on each layout)">Duration<span class="required">*</span></label></td>
771+ <td><input id="duration" name="duration" value="$this->duration" type="text"></td>
772+ </tr>
773+ <tr>
774+ <td colspan="2">
775+ <label for="embedHtml" title="The HTML you want to Embed in this Layout.">Embed HTML<span class="required">*</span></label><br />
776+ <textarea id="embedHtml" name="embedHtml">$embedHtml</textarea>
777+ </td>
778+ </tr>
779+ <tr>
780+ <td></td>
781+ <td>
782+ <input id="btnSave" type="submit" value="Save" />
783+ <input class="XiboFormButton" id="btnCancel" type="button" title="Return to the Region Options" href="index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions" value="Cancel" />
784+ </td>
785+ </tr>
786+ </table>
787+ </form>
788+FORM;
789+
790+ $this->response->html = $form;
791+ $this->response->dialogTitle = 'Edit Embedded HTML';
792+ $this->response->dialogSize = true;
793+ $this->response->dialogWidth = '650px';
794+ $this->response->dialogHeight = '450px';
795+
796+ return $this->response;
797+ }
798+
799+ /**
800+ * Add Media to the Database
801+ * @return
802+ */
803+ public function AddMedia()
804+ {
805+ $db =& $this->db;
806+
807+ $layoutid = $this->layoutid;
808+ $regionid = $this->regionid;
809+ $mediaid = $this->mediaid;
810+
811+ //Other properties
812+ $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);
813+ $duration = Kit::GetParam('duration', _POST, _INT, 0);
814+
815+ $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
816+
817+ //Validate the URL?
818+ if ($embedHtml == "")
819+ {
820+ $this->response->SetError('Please enter some HTML to embed.');
821+ $this->response->keepOpen = true;
822+ return $this->response;
823+ }
824+
825+ if ($duration == 0)
826+ {
827+ $this->response->SetError('You must enter a duration.');
828+ $this->response->keepOpen = true;
829+ return $this->response;
830+ }
831+
832+ // Required Attributes
833+ $this->mediaid = md5(uniqid());
834+ $this->duration = $duration;
835+
836+ // Any Options
837+ $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>');
838+
839+ // Should have built the media object entirely by this time
840+ // This saves the Media Object to the Region
841+ $this->UpdateRegion();
842+
843+ //Set this as the session information
844+ setSession('content', 'type', $this->type);
845+
846+ // We want to load a new form
847+ $this->response->loadForm = true;
848+ $this->response->loadFormUri= $url;
849+
850+ return $this->response;
851+ }
852+
853+ /**
854+ * Edit Media in the Database
855+ * @return
856+ */
857+ public function EditMedia()
858+ {
859+ $db =& $this->db;
860+
861+ $layoutid = $this->layoutid;
862+ $regionid = $this->regionid;
863+ $mediaid = $this->mediaid;
864+
865+ //Other properties
866+ $embedHtml = Kit::GetParam('embedHtml', _POST, _HTMLSTRING);
867+ $duration = Kit::GetParam('duration', _POST, _INT, 0);
868+
869+ $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
870+
871+ //Validate the URL?
872+ if ($embedHtml == "")
873+ {
874+ $this->response->SetError('Please enter some HTML to embed.');
875+ $this->response->keepOpen = true;
876+ return $this->response;
877+ }
878+
879+ if ($duration == 0)
880+ {
881+ $this->response->SetError('You must enter a duration.');
882+ $this->response->keepOpen = true;
883+ return $this->response;
884+ }
885+
886+ // Required Attributes
887+ $this->duration = $duration;
888+
889+ // Any Options
890+ $this->SetRaw('<embedHtml><![CDATA[' . $embedHtml . ']]></embedHtml>');
891+
892+ // Should have built the media object entirely by this time
893+ // This saves the Media Object to the Region
894+ $this->UpdateRegion();
895+
896+ //Set this as the session information
897+ setSession('content', 'type', $this->type);
898+
899+ // We want to load a new form
900+ $this->response->loadForm = true;
901+ $this->response->loadFormUri= $url;
902+
903+ return $this->response;
904+ }
905+}
906+
907+?>
908\ No newline at end of file
909
910=== modified file 'server/modules/flash.module.php'
911--- server/modules/flash.module.php 2009-03-10 19:29:40 +0000
912+++ server/modules/flash.module.php 2009-05-24 09:59:49 +0000
913@@ -300,7 +300,8 @@
914 <img src="img/loading.gif"><span style="padding-left:10px">You may fill in the form while your file is uploading.</span>
915 </div>
916 <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia">
917- <input type="hidden" name="MAX_FILE_SIZE" value="1048576000">
918+ <input type="hidden" name="hidFileID" id="hidFileID" value="" />
919+ <input type="hidden" id="txtFileName" name="txtFileName" readonly="true" />
920 <input type="hidden" name="layoutid" value="$layoutid">
921 <input type="hidden" name="regionid" value="$regionid">
922 <input type="hidden" name="mediaid" value="$mediaid">
923@@ -727,8 +728,17 @@
924
925 $SQL = sprintf($SQL, $db->escape_string($name), $this->type, $db->escape_string($duration), $db->escape_string($fileName), $permissionid, $userid);
926
927+ if (!$new_mediaid = $db->insert_query($SQL))
928+ {
929+ trigger_error($db->error());
930+ trigger_error('Error inserting replacement media record.', E_USER_ERROR);
931+ }
932+
933 //What are we going to store this media as...
934 $storedAs = $new_mediaid.".".$ext;
935+
936+ // File upload directory.. get this from the settings object
937+ $databaseDir = Config::GetSetting($db, "LIBRARY_LOCATION");
938
939 //Now we need to move the file
940 if (!$result = rename($databaseDir."/temp/".$tmpName, $databaseDir.$storedAs))
941@@ -754,9 +764,11 @@
942 return $this->response;
943 }
944
945- //Update the existing record with the new record's id
946- $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $mediaid ";
947- $SQL .= " WHERE editedMediaID = $mediaid and mediaID <> $new_mediaid ";
948+ // Update the existing record with the new record's id
949+ $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $new_mediaid ";
950+ $SQL .= " WHERE IFNULL(editedMediaID,0) <> $new_mediaid AND mediaID = $mediaid ";
951+
952+ Debug::LogEntry($db, 'audit', $SQL);
953
954 if (!$db->query($SQL))
955 {
956
957=== modified file 'server/modules/image.module.php'
958--- server/modules/image.module.php 2009-03-08 00:23:29 +0000
959+++ server/modules/image.module.php 2009-05-24 09:59:49 +0000
960@@ -300,7 +300,8 @@
961 <img src="img/loading.gif"><span style="padding-left:10px">You may fill in the form while your file is uploading.</span>
962 </div>
963 <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia">
964- <input type="hidden" name="MAX_FILE_SIZE" value="1048576000">
965+ <input type="hidden" name="hidFileID" id="hidFileID" value="" />
966+ <input type="hidden" id="txtFileName" name="txtFileName" readonly="true" />
967 <input type="hidden" name="layoutid" value="$layoutid">
968 <input type="hidden" name="regionid" value="$regionid">
969 <input type="hidden" name="mediaid" value="$mediaid">
970@@ -729,9 +730,18 @@
971 $SQL .= "VALUES ('%s', 'image', '%s', '%s', %d, %d, 0) ";
972
973 $SQL = sprintf($SQL, $db->escape_string($name), $db->escape_string($duration), $db->escape_string($fileName), $permissionid, $userid);
974+
975+ if (!$new_mediaid = $db->insert_query($SQL))
976+ {
977+ trigger_error($db->error());
978+ trigger_error('Error inserting replacement media record.', E_USER_ERROR);
979+ }
980
981 //What are we going to store this media as...
982 $storedAs = $new_mediaid.".".$ext;
983+
984+ // File upload directory.. get this from the settings object
985+ $databaseDir = Config::GetSetting($db, "LIBRARY_LOCATION");
986
987 //Now we need to move the file
988 if (!$result = rename($databaseDir."/temp/".$tmpName, $databaseDir.$storedAs))
989@@ -764,9 +774,11 @@
990 ResizeImage($databaseDir.$storedAs, $databaseDir."tn_".$storedAs, 80, 80);
991 }
992
993- //Update the existing record with the new record's id
994- $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $mediaid ";
995- $SQL .= " WHERE editedMediaID = $mediaid and mediaID <> $new_mediaid ";
996+ // Update the existing record with the new record's id
997+ $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $new_mediaid ";
998+ $SQL .= " WHERE IFNULL(editedMediaID,0) <> $new_mediaid AND mediaID = $mediaid ";
999+
1000+ Debug::LogEntry($db, 'audit', $SQL);
1001
1002 if (!$db->query($SQL))
1003 {
1004
1005=== modified file 'server/modules/module_user_general.php'
1006--- server/modules/module_user_general.php 2009-03-25 19:36:36 +0000
1007+++ server/modules/module_user_general.php 2009-07-07 20:01:49 +0000
1008@@ -89,8 +89,6 @@
1009
1010 $sql = sprintf("SELECT UserID, UserName, UserPassword, usertypeid, groupID FROM user WHERE UserName = '%s' AND UserPassword = '%s'", $db->escape_string($username), $db->escape_string($password));
1011
1012- Debug::LogEntry($db, 'audit', $sql);
1013-
1014 if(!$result = $db->query($sql)) trigger_error('A database error occurred while checking your login details.', E_USER_ERROR);
1015
1016 if ($db->num_rows($result)==0)
1017@@ -122,6 +120,7 @@
1018 $db->query($SQL) or trigger_error("Can not write last accessed info.", E_USER_ERROR);
1019
1020 $session->setIsExpired(0);
1021+ $session->RegenerateSessionID(session_id());
1022
1023 return true;
1024 }
1025
1026=== modified file 'server/modules/powerpoint.module.php'
1027--- server/modules/powerpoint.module.php 2009-03-10 19:29:40 +0000
1028+++ server/modules/powerpoint.module.php 2009-05-24 09:59:49 +0000
1029@@ -300,7 +300,8 @@
1030 <img src="img/loading.gif"><span style="padding-left:10px">You may fill in the form while your file is uploading.</span>
1031 </div>
1032 <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia">
1033- <input type="hidden" name="MAX_FILE_SIZE" value="1048576000">
1034+ <input type="hidden" name="hidFileID" id="hidFileID" value="" />
1035+ <input type="hidden" id="txtFileName" name="txtFileName" readonly="true" />
1036 <input type="hidden" name="layoutid" value="$layoutid">
1037 <input type="hidden" name="regionid" value="$regionid">
1038 <input type="hidden" name="mediaid" value="$mediaid">
1039@@ -726,9 +727,18 @@
1040 $SQL .= "VALUES ('%s', '%s', '%s', '%s', %d, %d, 0) ";
1041
1042 $SQL = sprintf($SQL, $db->escape_string($name), $this->type, $db->escape_string($duration), $db->escape_string($fileName), $permissionid, $userid);
1043+
1044+ if (!$new_mediaid = $db->insert_query($SQL))
1045+ {
1046+ trigger_error($db->error());
1047+ trigger_error('Error inserting replacement media record.', E_USER_ERROR);
1048+ }
1049
1050 //What are we going to store this media as...
1051 $storedAs = $new_mediaid.".".$ext;
1052+
1053+ // File upload directory.. get this from the settings object
1054+ $databaseDir = Config::GetSetting($db, "LIBRARY_LOCATION");
1055
1056 //Now we need to move the file
1057 if (!$result = rename($databaseDir."/temp/".$tmpName, $databaseDir.$storedAs))
1058@@ -754,9 +764,11 @@
1059 return $this->response;
1060 }
1061
1062- //Update the existing record with the new record's id
1063- $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $mediaid ";
1064- $SQL .= " WHERE editedMediaID = $mediaid and mediaID <> $new_mediaid ";
1065+ // Update the existing record with the new record's id
1066+ $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $new_mediaid ";
1067+ $SQL .= " WHERE IFNULL(editedMediaID,0) <> $new_mediaid AND mediaID = $mediaid ";
1068+
1069+ Debug::LogEntry($db, 'audit', $SQL);
1070
1071 if (!$db->query($SQL))
1072 {
1073
1074=== modified file 'server/modules/ticker.module.php'
1075--- server/modules/ticker.module.php 2009-03-13 09:30:23 +0000
1076+++ server/modules/ticker.module.php 2009-06-18 18:36:21 +0000
1077@@ -48,7 +48,7 @@
1078 $rWidth = Kit::GetParam('rWidth', _REQUEST, _STRING);
1079 $rHeight = Kit::GetParam('rHeight', _REQUEST, _STRING);
1080
1081- $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down", "direction");
1082+ $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down,single|Single", "direction");
1083
1084 $form = <<<FORM
1085 <form class="XiboTextForm" method="post" action="index.php?p=module&mod=ticker&q=Exec&method=AddMedia">
1086@@ -68,6 +68,12 @@
1087 <td><input id="duration" name="duration" type="text"></td>
1088 </tr>
1089 <tr>
1090+ <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td>
1091+ <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="30"></td>
1092+ <td><label for="updateInterval" title="The Interval at which the client should cache the feed.">Update Interval (mins)<span class="required">*</span></label></td>
1093+ <td><input id="updateInterval" name="updateInterval" type="text" value="360"></td>
1094+ </tr>
1095+ <tr>
1096 <td colspan="4">
1097 <textarea id="ta_text" name="ta_text">
1098 [Title] - [Date] - [Description]
1099@@ -104,9 +110,11 @@
1100 $regionid = $this->regionid;
1101 $mediaid = $this->mediaid;
1102
1103- $direction = $this->GetOption('direction');
1104- $copyright = $this->GetOption('copyright');
1105- $uri = urldecode($this->GetOption('uri'));
1106+ $direction = $this->GetOption('direction');
1107+ $copyright = $this->GetOption('copyright');
1108+ $scrollSpeed = $this->GetOption('scrollSpeed');
1109+ $updateInterval = $this->GetOption('updateInterval');
1110+ $uri = urldecode($this->GetOption('uri'));
1111
1112 // Get the text out of RAW
1113 $rawXml = new DOMDocument();
1114@@ -119,7 +127,7 @@
1115 $textNode = $textNodes->item(0);
1116 $text = $textNode->nodeValue;
1117
1118- $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down", "direction", $direction);
1119+ $direction_list = listcontent("none|None,left|Left,right|Right,up|Up,down|Down,single|Single", "direction", $direction);
1120
1121 //Output the form
1122 $form = <<<FORM
1123@@ -141,6 +149,12 @@
1124 <td><input id="duration" name="duration" value="$this->duration" type="text"></td>
1125 </tr>
1126 <tr>
1127+ <td><label for="scrollSpeed" title="The scroll speed of the ticker.">Scroll Speed<span class="required">*</span> (lower is faster)</label></td>
1128+ <td><input id="scrollSpeed" name="scrollSpeed" type="text" value="$scrollSpeed"></td>
1129+ <td><label for="updateInterval" title="The Interval at which the client should cache the feed.">Update Interval (mins)<span class="required">*</span></label></td>
1130+ <td><input id="updateInterval" name="updateInterval" type="text" value="$updateInterval"></td>
1131+ </tr>
1132+ <tr>
1133 <td colspan="4">
1134 <textarea id="ta_text" name="ta_text">$text</textarea>
1135 </td>
1136@@ -179,6 +193,8 @@
1137 $uri = Kit::GetParam('uri', _POST, _URI);
1138 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
1139 $duration = Kit::GetParam('duration', _POST, _INT, 0);
1140+ $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30);
1141+ $updateInterval = Kit::GetParam('updateInterval', _POST, _INT, 360);
1142 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
1143 $copyright = Kit::GetParam('copyright', _POST, _STRING);
1144
1145@@ -214,6 +230,8 @@
1146 // Any Options
1147 $this->SetOption('direction', $direction);
1148 $this->SetOption('copyright', $copyright);
1149+ $this->SetOption('scrollSpeed', $scrollSpeed);
1150+ $this->SetOption('updateInterval', $updateInterval);
1151 $this->SetOption('uri', $uri);
1152
1153 $this->SetRaw('<template><![CDATA[' . $text . ']]></template>');
1154@@ -249,6 +267,8 @@
1155 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
1156 $duration = Kit::GetParam('duration', _POST, _INT, 0);
1157 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
1158+ $scrollSpeed = Kit::GetParam('scrollSpeed', _POST, _INT, 30);
1159+ $updateInterval = Kit::GetParam('updateInterval', _POST, _INT, 360);
1160 $copyright = Kit::GetParam('copyright', _POST, _STRING);
1161
1162 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
1163@@ -282,6 +302,8 @@
1164 // Any Options
1165 $this->SetOption('direction', $direction);
1166 $this->SetOption('copyright', $copyright);
1167+ $this->SetOption('scrollSpeed', $scrollSpeed);
1168+ $this->SetOption('updateInterval', $updateInterval);
1169 $this->SetOption('uri', $uri);
1170
1171 $this->SetRaw('<template><![CDATA[' . $text . ']]></template>');
1172
1173=== modified file 'server/modules/video.module.php'
1174--- server/modules/video.module.php 2009-04-01 18:31:33 +0000
1175+++ server/modules/video.module.php 2009-05-24 09:59:49 +0000
1176@@ -300,11 +300,12 @@
1177 <img src="img/loading.gif"><span style="padding-left:10px">You may fill in the form while your file is uploading.</span>
1178 </div>
1179 <form class="XiboForm" method="post" action="index.php?p=module&mod=$this->type&q=Exec&method=EditMedia">
1180- <input type="hidden" name="MAX_FILE_SIZE" value="1048576000">
1181 <input type="hidden" name="layoutid" value="$layoutid">
1182 <input type="hidden" name="regionid" value="$regionid">
1183 <input type="hidden" name="mediaid" value="$mediaid">
1184 <input type="hidden" name="lkid" value="$lkid">
1185+ <input type="hidden" name="hidFileID" id="hidFileID" value="" />
1186+ <input type="hidden" id="txtFileName" name="txtFileName" readonly="true" />
1187 <input type="hidden" id="PHPSESSID" value="$sessionId" />
1188 <input type="hidden" id="SecurityToken" value="$securityToken" />
1189 <table>
1190@@ -713,9 +714,18 @@
1191 $SQL .= "VALUES ('%s', '%s', '%s', '%s', %d, %d, 0) ";
1192
1193 $SQL = sprintf($SQL, $db->escape_string($name), $this->type, $db->escape_string($duration), $db->escape_string($fileName), $permissionid, $userid);
1194+
1195+ if (!$new_mediaid = $db->insert_query($SQL))
1196+ {
1197+ trigger_error($db->error());
1198+ trigger_error('Error inserting replacement media record.', E_USER_ERROR);
1199+ }
1200
1201 //What are we going to store this media as...
1202 $storedAs = $new_mediaid.".".$ext;
1203+
1204+ // File upload directory.. get this from the settings object
1205+ $databaseDir = Config::GetSetting($db, "LIBRARY_LOCATION");
1206
1207 //Now we need to move the file
1208 if (!$result = rename($databaseDir."/temp/".$tmpName, $databaseDir.$storedAs))
1209@@ -731,7 +741,7 @@
1210 }
1211 }
1212
1213- //Update the media record to include this information
1214+ // Update the media record to include this information
1215 $SQL = "UPDATE media SET storedAs = '$storedAs' WHERE mediaid = $new_mediaid";
1216 if (!$db->query($SQL))
1217 {
1218@@ -741,9 +751,11 @@
1219 return $this->response;
1220 }
1221
1222- //Update the existing record with the new record's id
1223- $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $mediaid ";
1224- $SQL .= " WHERE editedMediaID = $mediaid and mediaID <> $new_mediaid ";
1225+ // Update the existing record with the new record's id
1226+ $SQL = "UPDATE media SET isEdited = 1, editedMediaID = $new_mediaid ";
1227+ $SQL .= " WHERE IFNULL(editedMediaID,0) <> $new_mediaid AND mediaID = $mediaid ";
1228+
1229+ Debug::LogEntry($db, 'audit', $SQL);
1230
1231 if (!$db->query($SQL))
1232 {
1233
1234=== modified file 'server/template/css/presentation.css'
1235--- server/template/css/presentation.css 2009-01-04 12:59:11 +0000
1236+++ server/template/css/presentation.css 2009-06-20 09:34:43 +0000
1237@@ -1153,6 +1153,21 @@
1238 margin-left:9px;
1239 }
1240
1241+.timebar_embedded_left{
1242+ background:url(../../img/forms/green_bar.gif) no-repeat;
1243+ background-position:top left;
1244+ height:59px;
1245+ width:9px;
1246+ float:left;
1247+}
1248+
1249+.timebar_embedded_right{
1250+ background:url(../../img/forms/green_bar.gif) no-repeat;
1251+ background-position:top right;
1252+ height:59px;
1253+ margin-left:9px;
1254+}
1255+
1256 .timebar_text_left{
1257 background:url(../../img/forms/yellow_bar.gif) no-repeat;
1258 background-position:top left;
1259
1260=== modified file 'server/template/css/xibo.css'
1261--- server/template/css/xibo.css 2009-03-22 17:58:21 +0000
1262+++ server/template/css/xibo.css 2009-06-20 12:00:21 +0000
1263@@ -41,3 +41,19 @@
1264 .ReportFault ol li {
1265 display: list-item;
1266 }
1267+
1268+.moduleButtonImage {
1269+ width: 65px;
1270+}
1271+
1272+#embedHtml {
1273+ width: 500px;
1274+ height: 310px;
1275+}
1276+
1277+.regionTransparency {
1278+ position: absolute;
1279+ background-color: #FFF;
1280+ opacity: .75;
1281+ filter: alpha(opacity=75);
1282+}
1283
1284=== modified file 'server/upgrade.php'
1285--- server/upgrade.php 2009-05-02 10:12:58 +0000
1286+++ server/upgrade.php 2009-06-15 08:16:19 +0000
1287@@ -249,6 +249,7 @@
1288 backup_tables($db, '*');
1289 echo '</p>';
1290
1291+ $sqlStatementCount = 0;
1292 // Now loop over the entire upgrade. Run the SQLs and PHP interleaved.
1293 for ($i=$_SESSION['upgradeFrom'] + 1; (($i <= $_SESSION['upgradeTo']) && ($fault==false)) ; $i++) {
1294 if (file_exists('install/database/' . $i . '.sql')) {
1295@@ -260,11 +261,12 @@
1296 $sql_file = split_sql_file($sql_file, $delimiter);
1297
1298 foreach ($sql_file as $sql) {
1299- print ".";
1300+ print ".";
1301+ $sqlStatementCount++;
1302 flush();
1303 if (! $db->query($sql)) {
1304- $fault = true;
1305- reportError("0", "An error occured populating the database.<br /><br />MySQL Error:<br />" . $db->error());
1306+ $fault = true;
1307+ reportError("0", "An error occured populating the database.<br /><br />MySQL Error:<br />" . $db->error() . "<br /><br />SQL executed:<br />" . $sql . "<br /><br />Statement number: " . $sqlStatementCount);
1308 }
1309 }
1310 echo '</p>';
1311
1312=== modified file 'server/xmds.php'
1313--- server/xmds.php 2009-03-30 18:34:54 +0000
1314+++ server/xmds.php 2009-06-03 11:55:05 +0000
1315@@ -374,7 +374,12 @@
1316 if (Config::GetSetting($db,'PHONE_HOME') == 'On') {
1317 // Find out when we last PHONED_HOME :D
1318 // If it's been > 28 days since last PHONE_HOME then
1319- if (Config::GetSetting($db,'PHONE_HOME_DATE') < (time() - (60 * 60 * 24 * 28))) {
1320+ if (Config::GetSetting($db,'PHONE_HOME_DATE') < (time() - (60 * 60 * 24 * 28))) {
1321+
1322+ if ($displayInfo['isAuditing'] == 1)
1323+ {
1324+ Debug::LogEntry($db, "audit", "PHONE_HOME [IN]", "xmds", "RequiredFiles");
1325+ }
1326
1327 // Retrieve number of displays
1328 $SQL = "SELECT COUNT(*)
1329@@ -397,9 +402,7 @@
1330 if ($displayInfo['isAuditing'] == 1)
1331 {
1332 Debug::LogEntry($db, "audit", "PHONE_HOME_URL " . $PHONE_HOME_URL , "xmds", "RequiredFiles");
1333- }
1334-
1335- @file_get_contents($PHONE_HOME_URL);
1336+ }
1337
1338 // Set PHONE_HOME_TIME to NOW.
1339 $SQL = "UPDATE `setting`
1340@@ -410,6 +413,13 @@
1341 {
1342 trigger_error($db->error());
1343 }
1344+
1345+ @file_get_contents($PHONE_HOME_URL);
1346+
1347+ if ($displayInfo['isAuditing'] == 1)
1348+ {
1349+ Debug::LogEntry($db, "audit", "PHONE_HOME [OUT]", "xmds", "RequiredFiles");
1350+ }
1351 //endif
1352 }
1353 }

Subscribers

People subscribed via source and target branches