Merge lp:~dangarner/xibo/334359 into lp:xibo/1.0

Proposed by Dan Garner
Status: Merged
Approved by: Dan Garner
Approved revision: 9
Merged at revision: not available
Proposed branch: lp:~dangarner/xibo/334359
Merge into: lp:xibo/1.0
Diff against target: None lines
To merge this branch: bzr merge lp:~dangarner/xibo/334359
Reviewer Review Type Date Requested Status
Dan Garner Approve
Review via email: mp+4024@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) wrote :

Fixed the two bugs as indicated in the Bug reports.

Revision history for this message
Dan Garner (dangarner) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'server/modules/flash.module.php'
--- server/modules/flash.module.php 2009-01-11 18:20:19 +0000
+++ server/modules/flash.module.php 2009-02-27 19:30:45 +0000
@@ -504,7 +504,7 @@
504 504
505 // Other properties505 // Other properties
506 $name = Kit::GetParam('name', _POST, _STRING);506 $name = Kit::GetParam('name', _POST, _STRING);
507 $duration = Kit::GetParam('duration', _POST, _INT, 1);507 $duration = Kit::GetParam('duration', _POST, _INT, 0);
508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
509 509
510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);
@@ -525,6 +525,13 @@
525 return $this->response;525 return $this->response;
526 }526 }
527 527
528 if ($duration == 0)
529 {
530 $this->response->SetError('You must enter a duration.');
531 $this->response->keepOpen = true;
532 return $this->response;
533 }
534
528 // Ensure the name is not already in the database535 // Ensure the name is not already in the database
529 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);536 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);
530537
@@ -653,7 +660,7 @@
653 660
654 // Other properties661 // Other properties
655 $name = Kit::GetParam('name', _POST, _STRING);662 $name = Kit::GetParam('name', _POST, _STRING);
656 $duration = Kit::GetParam('duration', _POST, _INT, 1);663 $duration = Kit::GetParam('duration', _POST, _INT, 0);
657 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);664 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
658 665
659 if ($name == '')666 if ($name == '')
@@ -678,6 +685,13 @@
678 return $this->response;685 return $this->response;
679 }686 }
680 687
688 if ($duration == 0)
689 {
690 $this->response->SetError('You must enter a duration.');
691 $this->response->keepOpen = true;
692 return $this->response;
693 }
694
681 // Ensure the name is not already in the database695 // Ensure the name is not already in the database
682 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);696 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);
683697
@@ -804,6 +818,18 @@
804 818
805 // Stored As from the XML819 // Stored As from the XML
806 $this->uri = $this->GetOption('uri');820 $this->uri = $this->GetOption('uri');
821
822 // Do we need to remove this from a layout?
823 if ($layoutid != '')
824 {
825 // Call base method - which will set up the response
826 parent::DeleteMedia();
827 }
828 else
829 {
830 // Set this message now in preparation
831 $this->response->message = 'Deleted the Media.';
832 }
807 833
808 // If we are set to retire we retire834 // If we are set to retire we retire
809 if ($options == "retire")835 if ($options == "retire")
@@ -838,20 +864,8 @@
838 864
839 $this->DeleteMediaFiles();865 $this->DeleteMediaFiles();
840 }866 }
841 867
842 // Options868 return $this->response;
843 if ($layoutid != '')
844 {
845 // Call base method - which will handle the response too
846 return parent::DeleteMedia();
847 }
848 else
849 {
850 // We want to load a new form
851 $this->response->message = 'Deleted the Media.';
852
853 return $this->response;
854 }
855 }869 }
856 870
857 /**871 /**
858872
=== modified file 'server/modules/image.module.php'
--- server/modules/image.module.php 2009-01-11 17:55:31 +0000
+++ server/modules/image.module.php 2009-02-27 19:30:45 +0000
@@ -504,7 +504,7 @@
504 504
505 // Other properties505 // Other properties
506 $name = Kit::GetParam('name', _POST, _STRING);506 $name = Kit::GetParam('name', _POST, _STRING);
507 $duration = Kit::GetParam('duration', _POST, _INT, 1);507 $duration = Kit::GetParam('duration', _POST, _INT, 0);
508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
509 509
510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);
@@ -525,6 +525,13 @@
525 return $this->response;525 return $this->response;
526 }526 }
527 527
528 if ($duration == 0)
529 {
530 $this->response->SetError('You must enter a duration.');
531 $this->response->keepOpen = true;
532 return $this->response;
533 }
534
528 // Ensure the name is not already in the database535 // Ensure the name is not already in the database
529 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);536 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);
530537
@@ -656,7 +663,7 @@
656 663
657 // Other properties664 // Other properties
658 $name = Kit::GetParam('name', _POST, _STRING);665 $name = Kit::GetParam('name', _POST, _STRING);
659 $duration = Kit::GetParam('duration', _POST, _INT, 1);666 $duration = Kit::GetParam('duration', _POST, _INT, 0);
660 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);667 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
661 668
662 if ($name == '')669 if ($name == '')
@@ -681,6 +688,13 @@
681 return $this->response;688 return $this->response;
682 }689 }
683 690
691 if ($duration == 0)
692 {
693 $this->response->SetError('You must enter a duration.');
694 $this->response->keepOpen = true;
695 return $this->response;
696 }
697
684 // Ensure the name is not already in the database698 // Ensure the name is not already in the database
685 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);699 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);
686700
@@ -814,6 +828,18 @@
814 828
815 // Stored As from the XML829 // Stored As from the XML
816 $this->uri = $this->GetOption('uri');830 $this->uri = $this->GetOption('uri');
831
832 // Do we need to remove this from a layout?
833 if ($layoutid != '')
834 {
835 // Call base method - which will set up the response
836 parent::DeleteMedia();
837 }
838 else
839 {
840 // Set this message now in preparation
841 $this->response->message = 'Deleted the Media.';
842 }
817 843
818 // If we are set to retire we retire844 // If we are set to retire we retire
819 if ($options == "retire")845 if ($options == "retire")
@@ -849,19 +875,7 @@
849 $this->DeleteMediaFiles();875 $this->DeleteMediaFiles();
850 }876 }
851 877
852 // Options878 return $this->response;
853 if ($layoutid != '')
854 {
855 // Call base method - which will handle the response too
856 return parent::DeleteMedia();
857 }
858 else
859 {
860 // We want to load a new form
861 $this->response->message = 'Deleted the Media.';
862
863 return $this->response;
864 }
865 }879 }
866 880
867 /**881 /**
868882
=== modified file 'server/modules/powerpoint.module.php'
--- server/modules/powerpoint.module.php 2009-01-11 18:20:19 +0000
+++ server/modules/powerpoint.module.php 2009-02-27 19:30:45 +0000
@@ -504,7 +504,7 @@
504 504
505 // Other properties505 // Other properties
506 $name = Kit::GetParam('name', _POST, _STRING);506 $name = Kit::GetParam('name', _POST, _STRING);
507 $duration = Kit::GetParam('duration', _POST, _INT, 1);507 $duration = Kit::GetParam('duration', _POST, _INT, 0);
508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
509 509
510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);
@@ -525,6 +525,13 @@
525 return $this->response;525 return $this->response;
526 }526 }
527 527
528 if ($duration == 0)
529 {
530 $this->response->SetError('You must enter a duration.');
531 $this->response->keepOpen = true;
532 return $this->response;
533 }
534
528 // Ensure the name is not already in the database535 // Ensure the name is not already in the database
529 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);536 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);
530537
@@ -653,7 +660,7 @@
653 660
654 // Other properties661 // Other properties
655 $name = Kit::GetParam('name', _POST, _STRING);662 $name = Kit::GetParam('name', _POST, _STRING);
656 $duration = Kit::GetParam('duration', _POST, _INT, 1);663 $duration = Kit::GetParam('duration', _POST, _INT, 0);
657 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);664 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
658 665
659 if ($name == '')666 if ($name == '')
@@ -678,6 +685,13 @@
678 return $this->response;685 return $this->response;
679 }686 }
680 687
688 if ($duration == 0)
689 {
690 $this->response->SetError('You must enter a duration.');
691 $this->response->keepOpen = true;
692 return $this->response;
693 }
694
681 // Ensure the name is not already in the database695 // Ensure the name is not already in the database
682 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);696 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);
683697
@@ -804,6 +818,18 @@
804 818
805 // Stored As from the XML819 // Stored As from the XML
806 $this->uri = $this->GetOption('uri');820 $this->uri = $this->GetOption('uri');
821
822 // Do we need to remove this from a layout?
823 if ($layoutid != '')
824 {
825 // Call base method - which will set up the response
826 parent::DeleteMedia();
827 }
828 else
829 {
830 // Set this message now in preparation
831 $this->response->message = 'Deleted the Media.';
832 }
807 833
808 // If we are set to retire we retire834 // If we are set to retire we retire
809 if ($options == "retire")835 if ($options == "retire")
@@ -838,20 +864,8 @@
838 864
839 $this->DeleteMediaFiles();865 $this->DeleteMediaFiles();
840 }866 }
841
842 // Options
843 if ($layoutid != '')
844 {
845 // Call base method - which will handle the response too
846 return parent::DeleteMedia();
847 }
848 else
849 {
850 // We want to load a new form
851 $this->response->message = 'Deleted the Media.';
852 867
853 return $this->response;868 return $this->response;
854 }
855 }869 }
856 870
857 /**871 /**
858872
=== modified file 'server/modules/text.module.php'
--- server/modules/text.module.php 2009-01-10 14:57:08 +0000
+++ server/modules/text.module.php 2009-02-27 19:30:45 +0000
@@ -167,7 +167,7 @@
167 167
168 //Other properties168 //Other properties
169 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');169 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
170 $duration = Kit::GetParam('duration', _POST, _INT, 1);170 $duration = Kit::GetParam('duration', _POST, _INT, 0);
171 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);171 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
172 172
173 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";173 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
@@ -180,6 +180,13 @@
180 return $this->response;180 return $this->response;
181 }181 }
182 182
183 if ($duration == 0)
184 {
185 $this->response->SetError('You must enter a duration.');
186 $this->response->keepOpen = true;
187 return $this->response;
188 }
189
183 // Required Attributes190 // Required Attributes
184 $this->mediaid = md5(uniqid());191 $this->mediaid = md5(uniqid());
185 $this->duration = $duration;192 $this->duration = $duration;
@@ -216,7 +223,7 @@
216 223
217 //Other properties224 //Other properties
218 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');225 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
219 $duration = Kit::GetParam('duration', _POST, _INT, 1);226 $duration = Kit::GetParam('duration', _POST, _INT, 0);
220 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);227 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
221 228
222 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";229 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
@@ -229,6 +236,13 @@
229 return $this->response;236 return $this->response;
230 }237 }
231 238
239 if ($duration == 0)
240 {
241 $this->response->SetError('You must enter a duration.');
242 $this->response->keepOpen = true;
243 return $this->response;
244 }
245
232 // Required Attributes246 // Required Attributes
233 $this->duration = $duration;247 $this->duration = $duration;
234 248
235249
=== modified file 'server/modules/ticker.module.php'
--- server/modules/ticker.module.php 2009-02-23 19:48:15 +0000
+++ server/modules/ticker.module.php 2009-02-27 19:30:45 +0000
@@ -178,7 +178,7 @@
178 //Other properties178 //Other properties
179 $uri = Kit::GetParam('uri', _POST, _URI);179 $uri = Kit::GetParam('uri', _POST, _URI);
180 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');180 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
181 $duration = Kit::GetParam('duration', _POST, _INT, 1);181 $duration = Kit::GetParam('duration', _POST, _INT, 0);
182 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);182 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
183 $copyright = Kit::GetParam('copyright', _POST, _STRING);183 $copyright = Kit::GetParam('copyright', _POST, _STRING);
184 184
@@ -200,6 +200,13 @@
200 return $this->response;200 return $this->response;
201 }201 }
202 202
203 if ($duration == 0)
204 {
205 $this->response->SetError('You must enter a duration.');
206 $this->response->keepOpen = true;
207 return $this->response;
208 }
209
203 // Required Attributes210 // Required Attributes
204 $this->mediaid = md5(uniqid());211 $this->mediaid = md5(uniqid());
205 $this->duration = $duration;212 $this->duration = $duration;
@@ -240,7 +247,7 @@
240 //Other properties247 //Other properties
241 $uri = Kit::GetParam('uri', _POST, _URI);248 $uri = Kit::GetParam('uri', _POST, _URI);
242 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');249 $direction = Kit::GetParam('direction', _POST, _WORD, 'none');
243 $duration = Kit::GetParam('duration', _POST, _INT, 1);250 $duration = Kit::GetParam('duration', _POST, _INT, 0);
244 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);251 $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING);
245 $copyright = Kit::GetParam('copyright', _POST, _STRING);252 $copyright = Kit::GetParam('copyright', _POST, _STRING);
246 253
@@ -262,6 +269,13 @@
262 return $this->response;269 return $this->response;
263 }270 }
264 271
272 if ($duration == 0)
273 {
274 $this->response->SetError('You must enter a duration.');
275 $this->response->keepOpen = true;
276 return $this->response;
277 }
278
265 // Required Attributes279 // Required Attributes
266 $this->duration = $duration;280 $this->duration = $duration;
267 281
268282
=== modified file 'server/modules/video.module.php'
--- server/modules/video.module.php 2009-01-11 18:20:19 +0000
+++ server/modules/video.module.php 2009-02-27 19:30:45 +0000
@@ -504,7 +504,7 @@
504 504
505 // Other properties505 // Other properties
506 $name = Kit::GetParam('name', _POST, _STRING);506 $name = Kit::GetParam('name', _POST, _STRING);
507 $duration = Kit::GetParam('duration', _POST, _INT, 1);507 $duration = Kit::GetParam('duration', _POST, _INT, 0);
508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);508 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
509 509
510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);510 if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME);
@@ -525,6 +525,13 @@
525 return $this->response;525 return $this->response;
526 }526 }
527 527
528 if ($duration == 0)
529 {
530 $this->response->SetError('You must enter a duration.');
531 $this->response->keepOpen = true;
532 return $this->response;
533 }
534
528 // Ensure the name is not already in the database535 // Ensure the name is not already in the database
529 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);536 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid);
530537
@@ -654,7 +661,7 @@
654 661
655 // Other properties662 // Other properties
656 $name = Kit::GetParam('name', _POST, _STRING);663 $name = Kit::GetParam('name', _POST, _STRING);
657 $duration = Kit::GetParam('duration', _POST, _INT, 1);664 $duration = Kit::GetParam('duration', _POST, _INT, 0);
658 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);665 $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1);
659 666
660 if ($name == '')667 if ($name == '')
@@ -679,6 +686,13 @@
679 return $this->response;686 return $this->response;
680 }687 }
681 688
689 if ($duration == 0)
690 {
691 $this->response->SetError('You must enter a duration.');
692 $this->response->keepOpen = true;
693 return $this->response;
694 }
695
682 // Ensure the name is not already in the database696 // Ensure the name is not already in the database
683 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);697 $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid);
684698
@@ -805,6 +819,18 @@
805 819
806 // Stored As from the XML820 // Stored As from the XML
807 $this->uri = $this->GetOption('uri');821 $this->uri = $this->GetOption('uri');
822
823 // Do we need to remove this from a layout?
824 if ($layoutid != '')
825 {
826 // Call base method - which will set up the response
827 parent::DeleteMedia();
828 }
829 else
830 {
831 // Set this message now in preparation
832 $this->response->message = 'Deleted the Media.';
833 }
808 834
809 // If we are set to retire we retire835 // If we are set to retire we retire
810 if ($options == "retire")836 if ($options == "retire")
@@ -839,20 +865,8 @@
839 865
840 $this->DeleteMediaFiles();866 $this->DeleteMediaFiles();
841 }867 }
842
843 // Options
844 if ($layoutid != '')
845 {
846 // Call base method - which will handle the response too
847 return parent::DeleteMedia();
848 }
849 else
850 {
851 // We want to load a new form
852 $this->response->message = 'Deleted the Media.';
853 868
854 return $this->response;869 return $this->response;
855 }
856 }870 }
857 871
858 /**872 /**
859873
=== modified file 'server/modules/webpage.module.php'
--- server/modules/webpage.module.php 2009-01-10 15:24:06 +0000
+++ server/modules/webpage.module.php 2009-02-27 19:30:45 +0000
@@ -149,7 +149,7 @@
149 149
150 //Other properties150 //Other properties
151 $uri = Kit::GetParam('uri', _POST, _URI);151 $uri = Kit::GetParam('uri', _POST, _URI);
152 $duration = Kit::GetParam('duration', _POST, _INT, 1);152 $duration = Kit::GetParam('duration', _POST, _INT, 0);
153 153
154 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";154 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
155 155
@@ -161,6 +161,13 @@
161 return $this->response;161 return $this->response;
162 }162 }
163 163
164 if ($duration == 0)
165 {
166 $this->response->SetError('You must enter a duration.');
167 $this->response->keepOpen = true;
168 return $this->response;
169 }
170
164 // Required Attributes171 // Required Attributes
165 $this->mediaid = md5(uniqid());172 $this->mediaid = md5(uniqid());
166 $this->duration = $duration;173 $this->duration = $duration;
@@ -196,7 +203,7 @@
196 203
197 //Other properties204 //Other properties
198 $uri = Kit::GetParam('uri', _POST, _URI);205 $uri = Kit::GetParam('uri', _POST, _URI);
199 $duration = Kit::GetParam('duration', _POST, _INT, 1);206 $duration = Kit::GetParam('duration', _POST, _INT, 0);
200 207
201 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";208 $url = "index.php?p=layout&layoutid=$layoutid&regionid=$regionid&q=RegionOptions";
202 209
@@ -208,6 +215,13 @@
208 return $this->response;215 return $this->response;
209 }216 }
210 217
218 if ($duration == 0)
219 {
220 $this->response->SetError('You must enter a duration.');
221 $this->response->keepOpen = true;
222 return $this->response;
223 }
224
211 // Required Attributes225 // Required Attributes
212 $this->duration = $duration;226 $this->duration = $duration;
213 227

Subscribers

People subscribed via source and target branches