Merge lp:~dangarner/xibo/server-170alpha into lp:xibo/1.7

Proposed by Dan Garner
Status: Merged
Merged at revision: 341
Proposed branch: lp:~dangarner/xibo/server-170alpha
Merge into: lp:xibo/1.7
Diff against target: 72436 lines (+29845/-33980)
454 files modified
.bzrignore (+3/-0)
Vagrantfile (+23/-0)
library/readme.txt (+1/-0)
server-tests/features/login-about-popup.feature (+9/-0)
server-tests/features/login-admin-user.feature (+10/-0)
server-tests/features/schedule_view.feature (+7/-0)
server-tests/features/step_definitions/generic.js (+97/-0)
server-tests/features/step_definitions/login-admin-user.js (+14/-0)
server-tests/features/support/teardown.js (+9/-0)
server-tests/features/support/testproperties.json (+9/-0)
server-tests/features/support/world.js (+37/-0)
server-tests/package.json (+16/-0)
server-tests/readme.md (+13/-0)
server/3rdparty/jquery-file-upload/UploadHandler.php (+1/-36)
server/3rdparty/jquery-file-upload/XiboUploadHandler.php (+38/-0)
server/config/client.config.php (+477/-0)
server/config/config.class.php (+218/-124)
server/install.php (+117/-719)
server/install/database/80.sql (+178/-0)
server/install/header_upgrade.inc (+0/-50)
server/install/master/data.sql (+97/-99)
server/install/master/structure.sql (+56/-14)
server/install/upgradestep.class.php (+51/-0)
server/lib/app/app_functions.php (+0/-171)
server/lib/app/datemanager.class.php (+1/-8)
server/lib/app/formmanager.class.php (+222/-132)
server/lib/app/helpmanager.class.php (+1/-17)
server/lib/app/kit.class.php (+13/-6)
server/lib/app/menumanager.class.php (+2/-12)
server/lib/app/pagemanager.class.php (+20/-9)
server/lib/app/pdoconnect.class.php (+44/-8)
server/lib/app/responsemanager.class.php (+40/-25)
server/lib/app/thememanager.class.php (+18/-14)
server/lib/app/translationengine.class.php (+9/-6)
server/lib/data/bandwidth.data.class.php (+62/-0)
server/lib/data/data.class.php (+3/-2)
server/lib/data/dataset.data.class.php (+2/-3)
server/lib/data/datasetdata.data.class.php (+1/-1)
server/lib/data/display.data.class.php (+325/-225)
server/lib/data/displaygroup.data.class.php (+15/-10)
server/lib/data/displaygroupsecurity.data.class.php (+3/-9)
server/lib/data/displayprofile.data.class.php (+213/-0)
server/lib/data/file.data.class.php (+6/-3)
server/lib/data/layout.data.class.php (+407/-19)
server/lib/data/media.data.class.php (+7/-0)
server/lib/data/nonce.data.class.php (+248/-0)
server/lib/data/region.data.class.php (+36/-17)
server/lib/data/resolution.data.class.php (+16/-6)
server/lib/data/schedule.data.class.php (+16/-49)
server/lib/data/template.data.class.php (+2/-3)
server/lib/data/userdata.data.class.php (+28/-0)
server/lib/data/usergroup.data.class.php (+1/-1)
server/lib/include.php (+25/-15)
server/lib/modules/module.class.php (+436/-259)
server/lib/modules/module.interface.php (+15/-3)
server/lib/pages/admin.class.php (+221/-422)
server/lib/pages/base.class.php (+44/-0)
server/lib/pages/campaign.class.php (+138/-28)
server/lib/pages/clock.class.php (+1/-16)
server/lib/pages/content.class.php (+124/-45)
server/lib/pages/dashboard.class.php (+1/-10)
server/lib/pages/dataset.class.php (+167/-70)
server/lib/pages/display.class.php (+409/-241)
server/lib/pages/displaygroup.class.php (+57/-36)
server/lib/pages/displayprofile.class.php (+352/-0)
server/lib/pages/error.class.php (+1/-21)
server/lib/pages/fault.class.php (+1/-10)
server/lib/pages/group.class.php (+59/-24)
server/lib/pages/help.class.php (+54/-30)
server/lib/pages/index.class.php (+210/-190)
server/lib/pages/install.class.php (+619/-0)
server/lib/pages/layout.class.php (+828/-676)
server/lib/pages/license.class.php (+1/-10)
server/lib/pages/log.class.php (+122/-55)
server/lib/pages/mediamanager.class.php (+63/-22)
server/lib/pages/module.class.php (+164/-30)
server/lib/pages/oauth.class.php (+51/-18)
server/lib/pages/preview.class.php (+1/-9)
server/lib/pages/resolution.class.php (+76/-54)
server/lib/pages/schedule.class.php (+668/-1660)
server/lib/pages/sessions.class.php (+55/-24)
server/lib/pages/stats.class.php (+196/-23)
server/lib/pages/statusdashboard.class.php (+165/-115)
server/lib/pages/template.class.php (+65/-48)
server/lib/pages/timeline.class.php (+120/-107)
server/lib/pages/transition.class.php (+30/-31)
server/lib/pages/upgrade.class.php (+301/-0)
server/lib/pages/user.class.php (+197/-101)
server/lib/service/rest.class.php (+2/-1)
server/lib/service/service.wsdl (+51/-24)
server/lib/service/xmdssoap.class.php (+842/-628)
server/lib/xmds.inc.php (+13/-2)
server/locale/dbtranslate.php (+112/-44)
server/maintenance.php (+2/-2)
server/manual/content/admin/api_layouts.php (+40/-16)
server/manual/content/admin/displayprofiles.php (+47/-0)
server/manual/content/admin/module_overview.php (+41/-0)
server/manual/content/admin/module_template.php (+229/-0)
server/manual/content/admin/modules.php (+10/-2)
server/manual/content/admin/release_notes_1.6.3.php (+83/-0)
server/manual/content/admin/release_notes_1.7.0-alpha.php (+82/-0)
server/manual/content/admin/settings.php (+84/-250)
server/manual/content/admin/settings_maintenance.php (+187/-0)
server/manual/content/install/install_client.php (+55/-73)
server/manual/content/layout/overview.php (+6/-1)
server/manual/content/routes.php (+10/-0)
server/manual/content/templates/overview.php (+2/-40)
server/manual/content/templates/template_resolution.php (+41/-2)
server/manual/content/toc_developer.php (+1/-0)
server/manual/content/toc_developer_module.php (+5/-0)
server/manual/content/toc_developer_releasenotes.php (+7/-1)
server/manual/content/toc_getting_started.php (+1/-0)
server/manual/content/toc_user_and_display.php (+1/-0)
server/manual/template.php (+1/-1)
server/modules/clock.module.php (+542/-0)
server/modules/counter.module.php (+31/-18)
server/modules/datasetview.module.php (+79/-64)
server/modules/embedded.module.php (+51/-30)
server/modules/flash.module.php (+0/-1)
server/modules/image.module.php (+76/-24)
server/modules/localvideo.module.php (+29/-48)
server/modules/module_template.php (+286/-0)
server/modules/module_user_general.php (+196/-28)
server/modules/powerpoint.module.php (+1/-2)
server/modules/preview/HtmlTemplate.html (+20/-0)
server/modules/preview/HtmlTemplateForGetResource.html (+10/-11)
server/modules/preview/HtmlTemplateSimple.html (+1/-1)
server/modules/preview/html-preview.js (+18/-4)
server/modules/preview/vendor/fittext.js (+43/-0)
server/modules/preview/vendor/flipclock.css (+430/-0)
server/modules/preview/vendor/flipclock.min.js (+2/-0)
server/modules/preview/vendor/moment.js (+7/-0)
server/modules/preview/xibo-text-render.js (+8/-4)
server/modules/preview/xibo-webpage-render.js (+6/-1)
server/modules/shellcommand.module.php (+24/-12)
server/modules/text.module.php (+86/-67)
server/modules/theme/HtmlTemplateForClock.html (+130/-0)
server/modules/theme/HtmlTemplateForFlipClock.html (+71/-0)
server/modules/ticker.module.php (+565/-464)
server/modules/video.module.php (+0/-1)
server/modules/webpage.module.php (+57/-56)
server/services.php (+44/-0)
server/theme/default/config.php (+6/-2)
server/theme/default/css/calendar.css (+11/-144)
server/theme/default/css/dashboard.css (+369/-0)
server/theme/default/css/install.css (+38/-19)
server/theme/default/css/timeline.css (+17/-14)
server/theme/default/css/xibo.css (+36/-22)
server/theme/default/fonts/montserrat-regular-webfont.eot (+568/-0)
server/theme/default/fonts/montserrat-regular-webfont.svg (+5835/-0)
server/theme/default/fonts/montserrat-regular-webfont.ttf (+553/-0)
server/theme/default/fonts/montserrat-regular-webfont.woff (+561/-0)
server/theme/default/html/about_page.php (+1/-10)
server/theme/default/html/application_form_register.php (+0/-57)
server/theme/default/html/applications_page.php (+0/-54)
server/theme/default/html/campaign_form_add.php (+0/-35)
server/theme/default/html/campaign_form_delete.php (+0/-31)
server/theme/default/html/campaign_form_edit.php (+0/-36)
server/theme/default/html/campaign_form_layout_assign.php (+2/-2)
server/theme/default/html/campaign_form_layout_assign_list.php (+2/-1)
server/theme/default/html/campaign_form_permissions.php (+0/-53)
server/theme/default/html/campaign_page.php (+0/-52)
server/theme/default/html/campaign_page_grid.php (+0/-60)
server/theme/default/html/dataset_dataentry_page.php (+0/-51)
server/theme/default/html/dataset_form_add.php (+0/-46)
server/theme/default/html/dataset_form_column_add.php (+0/-68)
server/theme/default/html/dataset_form_column_delete.php (+0/-31)
server/theme/default/html/dataset_form_column_edit.php (+0/-68)
server/theme/default/html/dataset_form_column_grid.php (+1/-1)
server/theme/default/html/dataset_form_csv_import.php (+0/-70)
server/theme/default/html/dataset_form_delete.php (+0/-31)
server/theme/default/html/dataset_form_edit.php (+0/-46)
server/theme/default/html/dataset_form_permissions.php (+0/-53)
server/theme/default/html/dataset_page.php (+0/-51)
server/theme/default/html/dataset_page_grid.php (+0/-65)
server/theme/default/html/display_form_default_layout.php (+0/-36)
server/theme/default/html/display_form_delete.php (+0/-31)
server/theme/default/html/display_form_edit.php (+0/-129)
server/theme/default/html/display_form_group_assign.php (+21/-15)
server/theme/default/html/display_form_wakeonlan.php (+0/-31)
server/theme/default/html/display_page.php (+0/-60)
server/theme/default/html/display_page_grid.php (+0/-85)
server/theme/default/html/displaygroup_fileassociations_form_assign.php (+2/-2)
server/theme/default/html/displaygroup_fileassociations_form_assign_list.php (+2/-1)
server/theme/default/html/displaygroup_form_add.php (+0/-39)
server/theme/default/html/displaygroup_form_delete.php (+0/-31)
server/theme/default/html/displaygroup_form_display_assign.php (+21/-15)
server/theme/default/html/displaygroup_form_edit.php (+0/-41)
server/theme/default/html/displaygroup_form_permissions.php (+0/-53)
server/theme/default/html/displaygroup_page.php (+0/-51)
server/theme/default/html/displaygroup_page_grid.php (+0/-60)
server/theme/default/html/fault_page.php (+1/-10)
server/theme/default/html/footer.php (+13/-8)
server/theme/default/html/form_file_upload_single.php (+6/-33)
server/theme/default/html/form_grid_pager.php (+41/-0)
server/theme/default/html/form_render.php (+279/-0)
server/theme/default/html/grid_pager.php (+7/-7)
server/theme/default/html/grid_render.php (+206/-0)
server/theme/default/html/header.php (+124/-58)
server/theme/default/html/help_form_add.php (+0/-43)
server/theme/default/html/help_form_delete.php (+0/-31)
server/theme/default/html/help_form_edit.php (+0/-44)
server/theme/default/html/help_page.php (+0/-51)
server/theme/default/html/help_page_grid.php (+0/-63)
server/theme/default/html/homepage_mediamanager.php (+0/-64)
server/theme/default/html/homepage_mediamanager_grid.php (+1/-1)
server/theme/default/html/install_footer.php (+9/-7)
server/theme/default/html/install_header.php (+30/-21)
server/theme/default/html/layout_designer.php (+17/-28)
server/theme/default/html/layout_designer_form_timeline.php (+1/-1)
server/theme/default/html/layout_form_add.php (+0/-56)
server/theme/default/html/layout_form_background.php (+0/-55)
server/theme/default/html/layout_form_copy.php (+0/-46)
server/theme/default/html/layout_form_delete.php (+0/-31)
server/theme/default/html/layout_form_edit.php (+0/-61)
server/theme/default/html/layout_form_retire.php (+0/-32)
server/theme/default/html/layout_jumplist_grid.php (+0/-40)
server/theme/default/html/layout_page.php (+0/-76)
server/theme/default/html/layout_page_grid.php (+0/-70)
server/theme/default/html/library_form_add.php (+3/-3)
server/theme/default/html/library_form_assign.php (+1/-1)
server/theme/default/html/library_form_assign_list.php (+1/-1)
server/theme/default/html/library_form_media_add.php (+8/-8)
server/theme/default/html/library_page.php (+0/-80)
server/theme/default/html/library_page_grid.php (+0/-90)
server/theme/default/html/log_form_display_last100.php (+0/-47)
server/theme/default/html/log_form_truncate.php (+0/-31)
server/theme/default/html/log_page.php (+0/-77)
server/theme/default/html/log_page_grid.php (+0/-47)
server/theme/default/html/login_page.php (+8/-8)
server/theme/default/html/media_form_counter_add.php (+0/-46)
server/theme/default/html/media_form_counter_edit.php (+0/-46)
server/theme/default/html/media_form_datasetview_add.php (+0/-40)
server/theme/default/html/media_form_datasetview_edit.php (+8/-77)
server/theme/default/html/media_form_embedded_add.php (+0/-63)
server/theme/default/html/media_form_embedded_edit.php (+0/-63)
server/theme/default/html/media_form_microblog_add.php (+28/-28)
server/theme/default/html/media_form_microblog_edit.php (+26/-26)
server/theme/default/html/media_form_shellcommand_add.php (+0/-42)
server/theme/default/html/media_form_shellcommand_edit.php (+0/-42)
server/theme/default/html/media_form_text_add.php (+0/-78)
server/theme/default/html/media_form_text_edit.php (+7/-52)
server/theme/default/html/media_form_ticker_add.php (+0/-57)
server/theme/default/html/media_form_ticker_dataset_edit.php (+8/-115)
server/theme/default/html/media_form_ticker_edit.php (+8/-121)
server/theme/default/html/media_form_webpage_add.php (+0/-67)
server/theme/default/html/media_form_webpage_edit.php (+0/-67)
server/theme/default/html/message_box.php (+23/-0)
server/theme/default/html/module_form_edit.php (+0/-47)
server/theme/default/html/module_page.php (+0/-50)
server/theme/default/html/module_page_grid.php (+0/-77)
server/theme/default/html/module_page_install_modules.php (+40/-0)
server/theme/default/html/new_user_welcome.php (+88/-0)
server/theme/default/html/region_form_options.php (+0/-64)
server/theme/default/html/region_form_options_no_transition.php (+0/-52)
server/theme/default/html/resolution_form_add.php (+0/-44)
server/theme/default/html/resolution_form_delete.php (+0/-31)
server/theme/default/html/resolution_form_edit.php (+0/-49)
server/theme/default/html/resolution_page.php (+0/-52)
server/theme/default/html/resolution_page_grid.php (+0/-67)
server/theme/default/html/schedule_form_add_event.php (+0/-96)
server/theme/default/html/schedule_form_edit_event.php (+0/-96)
server/theme/default/html/schedule_form_schedule_now.php (+0/-62)
server/theme/default/html/schedule_page.php (+54/-26)
server/theme/default/html/schedule_page_display_list.php (+0/-59)
server/theme/default/html/sessions_form_logout.php (+0/-31)
server/theme/default/html/sessions_page.php (+0/-61)
server/theme/default/html/sessions_page_grid.php (+0/-62)
server/theme/default/html/settings_page.php (+89/-21)
server/theme/default/html/stats_page.php (+0/-64)
server/theme/default/html/stats_page_bandwidth.php (+47/-0)
server/theme/default/html/stats_page_grid.php (+19/-92)
server/theme/default/html/status_dashboard.php (+184/-40)
server/theme/default/html/table_render.php (+76/-0)
server/theme/default/html/template_form_add.php (+0/-42)
server/theme/default/html/template_form_delete.php (+0/-31)
server/theme/default/html/template_form_permissions.php (+0/-53)
server/theme/default/html/template_page.php (+0/-66)
server/theme/default/html/template_page_grid.php (+0/-66)
server/theme/default/html/transition_form_edit.php (+0/-40)
server/theme/default/html/transition_page.php (+0/-50)
server/theme/default/html/transition_page_grid.php (+0/-66)
server/theme/default/html/upgrade_page.php (+35/-0)
server/theme/default/html/user_form_add.php (+0/-57)
server/theme/default/html/user_form_change_password.php (+0/-45)
server/theme/default/html/user_form_delete.php (+0/-32)
server/theme/default/html/user_form_edit.php (+0/-53)
server/theme/default/html/user_form_set_homepage.php (+0/-37)
server/theme/default/html/user_form_set_password.php (+0/-41)
server/theme/default/html/user_page.php (+0/-65)
server/theme/default/html/user_page_grid.php (+0/-63)
server/theme/default/html/usergroup_form_add.php (+0/-35)
server/theme/default/html/usergroup_form_delete.php (+0/-31)
server/theme/default/html/usergroup_form_edit.php (+0/-35)
server/theme/default/html/usergroup_form_pagesecurity.php (+1/-1)
server/theme/default/html/usergroup_form_user_assign.php (+21/-15)
server/theme/default/html/usergroup_page.php (+0/-62)
server/theme/default/html/usergroup_page_grid.php (+0/-58)
server/theme/default/js/install.js (+23/-0)
server/theme/default/js/xibo-calendar.js (+110/-150)
server/theme/default/js/xibo-cms.js (+175/-79)
server/theme/default/js/xibo-forms.js (+7/-36)
server/theme/default/js/xibo-layout-designer.js (+34/-57)
server/theme/default/js/xibo-preview-timeline.js (+7/-8)
server/theme/default/libraries/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css (+9/-0)
server/theme/default/libraries/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js (+1/-0)
server/theme/default/libraries/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css (+9/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js (+1/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ar.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.bg.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ca.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.cs.js (+19/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.da.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.de.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ee.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.el.js (+15/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.es.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fi.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.he.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.hr.js (+15/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.hu.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.id.js (+15/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.is.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.it.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ja.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ko.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.lt.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.lv.js (+18/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ms.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.nb.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.nl.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.no.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.pl.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.pt-BR.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.pt.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ro.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.rs-latin.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.rs.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ru.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.sk.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.sl.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.sv.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.sw.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.th.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.tr.js (+17/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ua.js (+15/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.uk.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js (+16/-0)
server/theme/default/libraries/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-TW.js (+16/-0)
server/theme/default/libraries/bootstrap-select/css/bootstrap-select.css (+274/-0)
server/theme/default/libraries/bootstrap-select/js/bootstrap-select.js.map (+1/-0)
server/theme/default/libraries/bootstrap-select/js/bootstrap-select.min.js (+8/-0)
server/theme/default/libraries/bootstrap/css/bootstrap-datetimepicker.min.css (+0/-8)
server/theme/default/libraries/bootstrap/css/bootstrap-responsive.css (+0/-1109)
server/theme/default/libraries/bootstrap/css/bootstrap-responsive.min.css (+0/-9)
server/theme/default/libraries/bootstrap/css/bootstrap-theme.min.css (+5/-0)
server/theme/default/libraries/bootstrap/css/bootstrap.css (+0/-6158)
server/theme/default/libraries/bootstrap/css/bootstrap.min.css (+4/-8)
server/theme/default/libraries/bootstrap/fonts/glyphicons-halflings-regular.svg (+229/-0)
server/theme/default/libraries/bootstrap/js/bootbox.min.js (+2/-13)
server/theme/default/libraries/bootstrap/js/bootstrap-datetimepicker.min.js (+0/-26)
server/theme/default/libraries/bootstrap/js/bootstrap.js (+0/-2276)
server/theme/default/libraries/bootstrap/js/bootstrap.min.js (+5/-5)
server/theme/default/libraries/calendar/css/calendar.css (+506/-0)
server/theme/default/libraries/calendar/css/calendar.min.css (+1/-0)
server/theme/default/libraries/calendar/js/calendar.js (+1134/-0)
server/theme/default/libraries/calendar/js/language/ar-SA.js (+63/-0)
server/theme/default/libraries/calendar/js/language/bs-BA.js (+68/-0)
server/theme/default/libraries/calendar/js/language/cs-CZ.js (+109/-0)
server/theme/default/libraries/calendar/js/language/da-DK.js (+74/-0)
server/theme/default/libraries/calendar/js/language/de-AT.js (+79/-0)
server/theme/default/libraries/calendar/js/language/de-DE.js (+73/-0)
server/theme/default/libraries/calendar/js/language/el-GR.js (+80/-0)
server/theme/default/libraries/calendar/js/language/es-ES.js (+80/-0)
server/theme/default/libraries/calendar/js/language/es-MX.js (+73/-0)
server/theme/default/libraries/calendar/js/language/fi-FI.js (+109/-0)
server/theme/default/libraries/calendar/js/language/fr-FR.js (+75/-0)
server/theme/default/libraries/calendar/js/language/hr-HR.js (+61/-0)
server/theme/default/libraries/calendar/js/language/hu-HU.js (+78/-0)
server/theme/default/libraries/calendar/js/language/it-IT.js (+75/-0)
server/theme/default/libraries/calendar/js/language/ja-JP.js (+105/-0)
server/theme/default/libraries/calendar/js/language/ko-KR.js (+70/-0)
server/theme/default/libraries/calendar/js/language/nl-NL.js (+75/-0)
server/theme/default/libraries/calendar/js/language/no-NO.js (+64/-0)
server/theme/default/libraries/calendar/js/language/pl-PL.js (+77/-0)
server/theme/default/libraries/calendar/js/language/pt-BR.js (+72/-0)
server/theme/default/libraries/calendar/js/language/ro-RO.js (+91/-0)
server/theme/default/libraries/calendar/js/language/ru-RU.js (+74/-0)
server/theme/default/libraries/calendar/js/language/sl-SL.js (+109/-0)
server/theme/default/libraries/calendar/js/language/sv-SE.js (+75/-0)
server/theme/default/libraries/calendar/js/language/template.js (+109/-0)
server/theme/default/libraries/calendar/js/language/tr-TR.js (+71/-0)
server/theme/default/libraries/calendar/js/language/zh-CN.js (+70/-0)
server/theme/default/libraries/calendar/js/language/zh-TW.js (+66/-0)
server/theme/default/libraries/calendar/tmpls/day.html (+73/-0)
server/theme/default/libraries/calendar/tmpls/events-list.html (+13/-0)
server/theme/default/libraries/calendar/tmpls/modal.html (+10/-0)
server/theme/default/libraries/calendar/tmpls/month-day.html (+25/-0)
server/theme/default/libraries/calendar/tmpls/month.html (+19/-0)
server/theme/default/libraries/calendar/tmpls/week-days.html (+7/-0)
server/theme/default/libraries/calendar/tmpls/week.html (+18/-0)
server/theme/default/libraries/calendar/tmpls/year-month.html (+11/-0)
server/theme/default/libraries/calendar/tmpls/year.html (+20/-0)
server/theme/default/libraries/ckeditor/config.js (+3/-0)
server/theme/default/libraries/ckeditor/contents.css (+5/-0)
server/theme/default/libraries/flot/LICENSE.txt (+0/-22)
server/theme/default/libraries/flot/excanvas.js (+0/-1428)
server/theme/default/libraries/flot/excanvas.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.colorhelpers.js (+0/-180)
server/theme/default/libraries/flot/jquery.colorhelpers.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.canvas.js (+0/-345)
server/theme/default/libraries/flot/jquery.flot.canvas.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.categories.js (+0/-190)
server/theme/default/libraries/flot/jquery.flot.categories.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.crosshair.js (+0/-176)
server/theme/default/libraries/flot/jquery.flot.crosshair.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.errorbars.js (+0/-353)
server/theme/default/libraries/flot/jquery.flot.errorbars.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.fillbetween.js (+0/-226)
server/theme/default/libraries/flot/jquery.flot.fillbetween.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.image.js (+0/-241)
server/theme/default/libraries/flot/jquery.flot.image.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.js (+0/-3137)
server/theme/default/libraries/flot/jquery.flot.min.js (+0/-2)
server/theme/default/libraries/flot/jquery.flot.navigate.js (+0/-346)
server/theme/default/libraries/flot/jquery.flot.navigate.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.pie.js (+0/-817)
server/theme/default/libraries/flot/jquery.flot.pie.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.resize.js (+0/-60)
server/theme/default/libraries/flot/jquery.flot.resize.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.selection.js (+0/-360)
server/theme/default/libraries/flot/jquery.flot.selection.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.stack.js (+0/-188)
server/theme/default/libraries/flot/jquery.flot.stack.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.symbol.js (+0/-71)
server/theme/default/libraries/flot/jquery.flot.symbol.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.threshold.js (+0/-142)
server/theme/default/libraries/flot/jquery.flot.threshold.min.js (+0/-1)
server/theme/default/libraries/flot/jquery.flot.time.js (+0/-431)
server/theme/default/libraries/flot/jquery.flot.time.min.js (+0/-1)
server/theme/default/libraries/font-awesome/css/font-awesome.min.css (+4/-0)
server/theme/default/libraries/font-awesome/fonts/fontawesome-webfont.svg (+504/-0)
server/theme/default/libraries/jquery/additional-methods.min.js (+4/-2)
server/theme/default/libraries/jquery/jquery-1.11.1.min.js (+4/-0)
server/theme/default/libraries/jquery/jquery.min.map (+1/-0)
server/theme/default/libraries/jquery/jquery.validate.min.js (+4/-2)
server/theme/default/libraries/jstimezonedetect/LICENCE.txt (+22/-0)
server/theme/default/libraries/jstimezonedetect/jstz.min.js (+2/-0)
server/theme/default/libraries/morrisjs/morris.css (+2/-0)
server/theme/default/libraries/morrisjs/morris.min.js (+7/-0)
server/theme/default/libraries/morrisjs/raphael.min.js (+11/-0)
server/theme/default/libraries/underscore/underscore-min.js (+1/-0)
server/upgrade.php (+0/-679)
To merge this branch: bzr merge lp:~dangarner/xibo/server-170alpha
Reviewer Review Type Date Requested Status
Xibo Maintainters Pending
Review via email: mp+235276@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
=== modified file '.bzrignore'
--- .bzrignore 2013-05-01 19:24:35 +0000
+++ .bzrignore 2014-09-19 11:39:09 +0000
@@ -2,3 +2,6 @@
2.project2.project
3server/.project3server/.project
4Thumbs.db4Thumbs.db
5.vagrant
6library/*
7server-tests/node_modules
58
=== added file 'Vagrantfile'
--- Vagrantfile 1970-01-01 00:00:00 +0000
+++ Vagrantfile 2014-09-19 11:39:09 +0000
@@ -0,0 +1,23 @@
1# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5VAGRANTFILE_API_VERSION = "2"
6
7$script = <<SCRIPT
8apt-get update
9apt-get install libapache2-mod-xsendfile
10SCRIPT
11
12$ip = <<IP
13ifconfig
14IP
15
16Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
17 config.vm.box = "avenuefactory/lamp"
18 config.vm.provision "shell", inline: $script
19 config.vm.provision "shell", inline: $ip, run: "always"
20 config.vm.network :private_network, type: "dhcp"
21 config.vm.synced_folder "server/", "/var/www/html"
22 config.vm.synced_folder "library/", "/var/www/library"
23end
024
=== added directory 'library'
=== added file 'library/readme.txt'
--- library/readme.txt 1970-01-01 00:00:00 +0000
+++ library/readme.txt 2014-09-19 11:39:09 +0000
@@ -0,0 +1,1 @@
1This folder acts as a non-web serviceable location for the Xibo Library when using Vagrant.
0\ No newline at end of file2\ No newline at end of file
13
=== added directory 'server-tests'
=== added directory 'server-tests/features'
=== added file 'server-tests/features/login-about-popup.feature'
--- server-tests/features/login-about-popup.feature 1970-01-01 00:00:00 +0000
+++ server-tests/features/login-about-popup.feature 2014-09-19 11:39:09 +0000
@@ -0,0 +1,9 @@
1Feature: About Popup
2 While we are logged out
3 We need to make sure the about link is visible
4 And that the popup opens when we click it
5
6 Scenario: Visit the Xibo CMS
7 Given I visit the Xibo CMS
8 When I press the 'About' link
9 Then I should see the dialog titled 'About'
0\ No newline at end of file10\ No newline at end of file
111
=== added file 'server-tests/features/login-admin-user.feature'
--- server-tests/features/login-admin-user.feature 1970-01-01 00:00:00 +0000
+++ server-tests/features/login-admin-user.feature 2014-09-19 11:39:09 +0000
@@ -0,0 +1,10 @@
1Feature: Login
2 I visit the Xibo CMS and want to login
3
4 Scenario: Login
5 Given I visit the Xibo CMS
6 When the 'login-form' form is visible
7 And I enter 'dan' into 'username'
8 And I enter 'dan' into 'password'
9 And I press the login button
10 Then I should see the dashboard
0\ No newline at end of file11\ No newline at end of file
112
=== added file 'server-tests/features/schedule_view.feature'
--- server-tests/features/schedule_view.feature 1970-01-01 00:00:00 +0000
+++ server-tests/features/schedule_view.feature 2014-09-19 11:39:09 +0000
@@ -0,0 +1,7 @@
1Feature: View the Calendar
2
3 Scenario: View the Calendar without any Display Groups selected
4 Given I visit the Xibo CMS
5 And I am logged in as a 'super admin'
6 And I visit 'the schedule'
7 Then the 'Calendar' is visible
08
=== added directory 'server-tests/features/step_definitions'
=== added file 'server-tests/features/step_definitions/generic.js'
--- server-tests/features/step_definitions/generic.js 1970-01-01 00:00:00 +0000
+++ server-tests/features/step_definitions/generic.js 2014-09-19 11:39:09 +0000
@@ -0,0 +1,97 @@
1module.exports = function () {
2
3 this.World = require('../support/world.js');
4 var PROPERTIES = require('../support/testproperties.json');
5 var assert = require("assert");
6
7 /* "<Given> I visit <url>" */
8 this.Given(/^I visit (.*)$/, function (url, callback) {
9
10 if (url == "the Xibo CMS") {
11
12 url = PROPERTIES.url;
13 this
14 .init()
15 .url(url, callback);
16
17 return;
18 }
19 else if ("the schedule")
20 url = PROPERTIES.url + "?p=schedule";
21 else
22 url = PROPERTIES.url + url;
23
24 this.url(url, callback);
25 });
26
27 /* "<Given>I am logged in as a <usertype>" */
28 this.Given(/^I am logged in as a (.*)$/, function (userType, callback) {
29
30 var username = "dan";
31 var password = "dan";
32
33 this.waitFor("#login-form", 3000, function (err, found) {
34
35 if (!err) {
36 this.setValue("#username", username);
37 this.setValue("#password", password);
38 this.click("#login-form button", callback);
39 return;
40 }
41
42 callback.fail(new Error('Login form was not found after 3s'));
43 });
44 });
45
46 /* "<When> I enter <text> into <inputId>" */
47 this.When(/^I enter '(.*)' into '(.*)'$/, function (text, inputId, callback) {
48
49 inputId = '#' + inputId;
50
51 this.waitFor(inputId, 3000, function (err, found) {
52
53 if (!err) {
54 this.setValue(inputId, text, callback);
55 return;
56 }
57
58 callback.fail(new Error('Element ' + inputId + ' was not found after 3s'));
59 });
60 });
61
62 /* "<When> I press the <id> link" */
63 this.When(/^I press the '(.*)' link$/, function (link, callback) {
64 this.click("=" + link, callback);
65 });
66
67 /* "<When> I press the <id> button" */
68 this.When(/^I press the '(.*)' button$/, function (link, callback) {
69 this.click("#" + link, callback);
70 });
71
72 this.When(/^the '(.*)' form is visible$/, function (link, callback) {
73 this.isVisible("#" + link, callback);
74 });
75
76 this.Then(/^the '(.*)' is visible$/, function (link, callback) {
77 this.isVisible("#" + link, callback);
78 });
79
80 /* "<Then>I should see the dialog titled <title>" */
81 this.Then(/^I should see the dialog titled '(.*)'$/, function (title, callback) {
82
83 this.waitFor("h4.modal-title", 5000, function (err, found) {
84
85 if (!err) {
86 this.getText("h4.modal-title", function (err, result) {
87
88 assert.equal(result, title, "Cannot find " + title + " form.");
89 });
90 this.call(callback);
91 return;
92 }
93
94 callback.fail(new Error('A form was not found after 3s'));
95 });
96 });
97};
0\ No newline at end of file98\ No newline at end of file
199
=== added file 'server-tests/features/step_definitions/login-admin-user.js'
--- server-tests/features/step_definitions/login-admin-user.js 1970-01-01 00:00:00 +0000
+++ server-tests/features/step_definitions/login-admin-user.js 2014-09-19 11:39:09 +0000
@@ -0,0 +1,14 @@
1module.exports = function () {
2
3 this.World = require('../support/world.js');
4 var PROPERTIES = require('../support/testproperties.json');
5 var assert = require("assert");
6
7 this.Then(/^I should see the dashboard$/, function (callback) {
8 this.isVisible("li.sidebar-main", callback);
9 });
10
11 this.When(/^I press the login button$/, function (link, callback) {
12 this.click("#login-form button", callback);
13 });
14};
0\ No newline at end of file15\ No newline at end of file
116
=== added directory 'server-tests/features/support'
=== added file 'server-tests/features/support/teardown.js'
--- server-tests/features/support/teardown.js 1970-01-01 00:00:00 +0000
+++ server-tests/features/support/teardown.js 2014-09-19 11:39:09 +0000
@@ -0,0 +1,9 @@
1//module.exports = function () {
2//
3// this.After(function(callback) {
4//
5// this.end(callback);
6//
7// });
8//
9//};
0\ No newline at end of file10\ No newline at end of file
111
=== added file 'server-tests/features/support/testproperties.json'
--- server-tests/features/support/testproperties.json 1970-01-01 00:00:00 +0000
+++ server-tests/features/support/testproperties.json 2014-09-19 11:39:09 +0000
@@ -0,0 +1,9 @@
1{
2 "logLevel": "silent",
3
4 "host": "127.0.0.1",
5
6 "browser": "firefox",
7
8 "url": "http://172.28.128.4/index.php"
9}
0\ No newline at end of file10\ No newline at end of file
111
=== added file 'server-tests/features/support/world.js'
--- server-tests/features/support/world.js 1970-01-01 00:00:00 +0000
+++ server-tests/features/support/world.js 2014-09-19 11:39:09 +0000
@@ -0,0 +1,37 @@
1module.exports = function(callback) {
2
3 if ( callback ) {
4
5 // Get our test properties
6 var PROPERTIES = require('./testproperties.json');
7
8 // Override any testproperty from command line with --[PROPERTY]=[VALUE]
9 process.argv.forEach(function (arg) {
10 arg = arg.match(/^--([A-Za-z]+)=(.*)/);
11
12 // Only look for --[PROPERTY] style args, everything else can be forgotten
13 if (arg === null || !arg[1]) return;
14
15 // If the JSON file has the argument to override, then override it.
16 if (PROPERTIES.hasOwnProperty(arg[1])) {
17 PROPERTIES[arg[1]] = arg[2];
18
19 // Otherwise proclaim that it is an unrecognised argument
20 } else {
21 console.log('Unrecognised argument ' + arg[1]);
22 }
23
24 });
25
26 var browser = require("webdriverio").remote({
27 logLevel: PROPERTIES.logLevel || 'none',
28 host: PROPERTIES.host,
29 desiredCapabilities: {
30 browserName: PROPERTIES.browser || 'firefox'
31 }
32 });
33
34 // Inject the browser into the callback, we don't need anything else
35 callback(browser);
36 }
37};
0\ No newline at end of file38\ No newline at end of file
139
=== added file 'server-tests/package.json'
--- server-tests/package.json 1970-01-01 00:00:00 +0000
+++ server-tests/package.json 2014-09-19 11:39:09 +0000
@@ -0,0 +1,16 @@
1{
2 "name": "xibo",
3 "version": "1.7.0-alpha",
4 "description": "Xibo Digital Signage - Test Suite",
5 "main": "xibo",
6 "scripts": {
7 "test": "echo \"Error: no test specified\" && exit 1"
8 },
9 "dependencies":{
10 "webdriverio":"*",
11 "cucumber":"*",
12 "selenium-standalone":"*"
13 },
14 "author": "Spring Signage Ltd and the Xibo Developers",
15 "license": "AGPL-3.0"
16}
017
=== added file 'server-tests/readme.md'
--- server-tests/readme.md 1970-01-01 00:00:00 +0000
+++ server-tests/readme.md 2014-09-19 11:39:09 +0000
@@ -0,0 +1,13 @@
1Tests written in:
2
3Nodejs
4
5With:
6
7https://github.com/webdriverio/webdriverio
8https://github.com/cucumber/cucumber/wiki
9
10
11Run npm install
12node_modules/.bin/start-selenium
13node_modules/.bin/cucumber
0\ No newline at end of file14\ No newline at end of file
115
=== modified file 'server/3rdparty/jquery-file-upload/UploadHandler.php'
--- server/3rdparty/jquery-file-upload/UploadHandler.php 2013-11-02 15:32:17 +0000
+++ server/3rdparty/jquery-file-upload/UploadHandler.php 2014-09-19 11:39:09 +0000
@@ -36,10 +36,7 @@
36 'min_height' => 'Image requires a minimum height'36 'min_height' => 'Image requires a minimum height'
37 );37 );
3838
39 function __construct($db, $user, $options = null, $initialize = true, $error_messages = null) {39 function __construct($options = null, $initialize = true, $error_messages = null) {
40 $this->db =& $db;
41 $this->user =& $user;
42
43 $this->options = array(40 $this->options = array(
44 'script_url' => $this->get_full_url().'/',41 'script_url' => $this->get_full_url().'/',
45 'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',42 'upload_dir' => dirname($this->get_server_var('SCRIPT_FILENAME')).'/files/',
@@ -508,38 +505,6 @@
508 );505 );
509 }506 }
510507
511 protected function handle_form_data($file, $index) {
512 // Handle form data, e.g. $_REQUEST['description'][$index]
513
514 // Link the file to the module
515 $name = $_REQUEST['name'][$index];
516 $duration = $_REQUEST['duration'][$index];
517
518 $layoutid = Kit::GetParam('layoutid', _REQUEST, _INT);
519 $regionid = Kit::GetParam('regionid', _REQUEST, _STRING);
520 $type = Kit::GetParam('type', _REQUEST, _WORD);
521
522 Debug::LogEntry('audit', 'Upload complete for Type: ' . $type . ' and file name: ' . $file->name . '. Name: ' . $name . '. Duration:' . $duration);
523
524 // We want to create a module for each of the uploaded files.
525 // Do not pass in the region ID so that we only assign to the library and not to the layout
526 require_once("modules/$type.module.php");
527 if (!$module = new $type($this->db, $this->user, '', $layoutid, '', '')) {
528 $file->error = $module->GetErrorMessage();
529 }
530
531 // We want to add this item to our library
532 if (!$storedAs = $module->AddLibraryMedia($file->name, $name, $duration, $file->name)) {
533 $file->error = $module->GetErrorMessage();
534 }
535
536 // Set new file details
537 $file->storedas = $storedAs;
538
539 // Delete the file
540 @unlink($this->get_upload_path($file->name));
541 }
542
543 protected function orient_image($file_path) {508 protected function orient_image($file_path) {
544 if (!function_exists('exif_read_data')) {509 if (!function_exists('exif_read_data')) {
545 return false;510 return false;
546511
=== added file 'server/3rdparty/jquery-file-upload/XiboUploadHandler.php'
--- server/3rdparty/jquery-file-upload/XiboUploadHandler.php 1970-01-01 00:00:00 +0000
+++ server/3rdparty/jquery-file-upload/XiboUploadHandler.php 2014-09-19 11:39:09 +0000
@@ -0,0 +1,38 @@
1<?php
2
3require_once("3rdparty/jquery-file-upload/UploadHandler.php");
4
5class XiboUploadHandler extends UploadHandler {
6
7 protected function handle_form_data($file, $index) {
8 // Handle form data, e.g. $_REQUEST['description'][$index]
9
10 // Link the file to the module
11 $name = $_REQUEST['name'][$index];
12 $duration = $_REQUEST['duration'][$index];
13
14 $layoutid = Kit::GetParam('layoutid', _REQUEST, _INT);
15 $regionid = Kit::GetParam('regionid', _REQUEST, _STRING);
16 $type = Kit::GetParam('type', _REQUEST, _WORD);
17
18 Debug::LogEntry('audit', 'Upload complete for Type: ' . $type . ' and file name: ' . $file->name . '. Name: ' . $name . '. Duration:' . $duration);
19
20 // We want to create a module for each of the uploaded files.
21 // Do not pass in the region ID so that we only assign to the library and not to the layout
22 require_once("modules/$type.module.php");
23 if (!$module = new $type($this->options['db'], $this->options['user'], '', $layoutid, '', '')) {
24 $file->error = $module->GetErrorMessage();
25 }
26
27 // We want to add this item to our library
28 if (!$storedAs = $module->AddLibraryMedia($file->name, $name, $duration, $file->name)) {
29 $file->error = $module->GetErrorMessage();
30 }
31
32 // Set new file details
33 $file->storedas = $storedAs;
34
35 // Delete the file
36 @unlink($this->get_upload_path($file->name));
37 }
38}
0\ No newline at end of file39\ No newline at end of file
140
=== added file 'server/config/client.config.php'
--- server/config/client.config.php 1970-01-01 00:00:00 +0000
+++ server/config/client.config.php 2014-09-19 11:39:09 +0000
@@ -0,0 +1,477 @@
1<?php
2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2006-2014 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
23// Client config
24$CLIENT_CONFIG = array(
25
26 'windows' => array(
27 'synonym' => 'dotnetclient',
28 'tabs' => array(
29 array('id' => 'general', 'name' => __('General')),
30 array('id' => 'location', 'name' => __('Location')),
31 array('id' => 'trouble', 'name' => __('Troubleshooting')),
32 array('id' => 'advanced', 'name' => __('Advanced')),
33 ),
34 'settings' => array(
35 array(
36 'name' => 'CollectInterval',
37 'tabId' => 'general',
38 'title' => __('Collection Interval (seconds)'),
39 'type' => _INT,
40 'fieldType' => 'number',
41 'default' => 900,
42 'helpText' => __('The number of seconds between connections to the CMS.'),
43 'validation' => 'numeric',
44 'enabled' => true,
45 'groupClass' => NULL
46 ),
47 array(
48 'name' => 'PowerpointEnabled',
49 'tabId' => 'general',
50 'title' => __('Enable PowerPoint?'),
51 'type' => _CHECKBOX,
52 'fieldType' => 'checkbox',
53 'default' => false,
54 'helpText' => __('Should Microsoft PowerPoint be Enabled?'),
55 'enabled' => true,
56 'groupClass' => NULL
57 ),
58 array(
59 'name' => 'StatsEnabled',
60 'tabId' => 'general',
61 'title' => __('Enable stats reporting?'),
62 'type' => _CHECKBOX,
63 'fieldType' => 'checkbox',
64 'default' => true,
65 'helpText' => __('Should the application send proof of play stats to the CMS.'),
66 'enabled' => true,
67 'groupClass' => NULL
68 ),
69 array(
70 'name' => 'SizeX',
71 'tabId' => 'location',
72 'title' => __('Width'),
73 'type' => _DOUBLE,
74 'fieldType' => 'number',
75 'default' => '0',
76 'helpText' => __('The Width of the Display Window. 0 means full width.'),
77 'enabled' => true,
78 'groupClass' => NULL
79 ),
80 array(
81 'name' => 'SizeY',
82 'tabId' => 'location',
83 'title' => __('Height'),
84 'type' => _DOUBLE,
85 'fieldType' => 'number',
86 'default' => '0',
87 'helpText' => __('The Height of the Display Window. 0 means full height.'),
88 'enabled' => true,
89 'groupClass' => NULL
90 ),
91 array(
92 'name' => 'OffsetX',
93 'tabId' => 'location',
94 'title' => __('Left Coordinate'),
95 'type' => _DOUBLE,
96 'fieldType' => 'number',
97 'default' => '0',
98 'helpText' => __('The left pixel position the display window should be sized from.'),
99 'enabled' => true,
100 'groupClass' => NULL
101 ),
102 array(
103 'name' => 'OffsetY',
104 'tabId' => 'location',
105 'title' => __('Top Coordinate'),
106 'type' => _DOUBLE,
107 'fieldType' => 'number',
108 'default' => '0',
109 'helpText' => __('The top pixel position the display window should be sized from.'),
110 'enabled' => true,
111 'groupClass' => NULL
112 ),
113 array(
114 'name' => 'ShowInTaskbar',
115 'tabId' => 'advanced',
116 'title' => __('Show the icon in the task bar?'),
117 'type' => _CHECKBOX,
118 'fieldType' => 'checkbox',
119 'default' => true,
120 'helpText' => __('Should the application icon be shown in the task bar?'),
121 'enabled' => true,
122 'groupClass' => NULL
123 ),
124 array(
125 'name' => 'ClientInfomationCtrlKey',
126 'tabId' => 'trouble',
127 'title' => __('CTRL Key required to access Client Information Screen?'),
128 'type' => _CHECKBOX,
129 'fieldType' => 'checkbox',
130 'default' => false,
131 'helpText' => __('Should the client information screen require the CTRL key?'),
132 'enabled' => true,
133 'groupClass' => NULL
134 ),
135 array(
136 'name' => 'ClientInformationKeyCode',
137 'tabId' => 'trouble',
138 'title' => __('Key for Client Information Screen'),
139 'type' => _WORD,
140 'fieldType' => 'text',
141 'default' => 'I',
142 'helpText' => __('Which key should activate the client information screen? A single character.'),
143 'enabled' => true,
144 'groupClass' => NULL
145 ),
146 array(
147 'name' => 'CursorStartPosition',
148 'tabId' => 'advanced',
149 'title' => __('Cursor Start Position'),
150 'type' => _STRING,
151 'fieldType' => 'dropdown',
152 'options' => array(
153 array('id' => 'Top Left', 'value' => 'Top Left'),
154 array('id' => 'Top Right', 'value' => 'Top Right'),
155 array('id' => 'Bottom Left', 'value' => 'Bottom Left'),
156 array('id' => 'Bottom Right', 'value' => 'Bottom Right'),
157 ),
158 'default' => 'Bottom Right',
159 'helpText' => __('The position of the cursor when the client starts up.'),
160 'enabled' => true,
161 'groupClass' => NULL
162 ),
163 array(
164 'name' => 'DoubleBuffering',
165 'tabId' => 'advanced',
166 'title' => __('Enable Double Buffering'),
167 'type' => _CHECKBOX,
168 'fieldType' => 'checkbox',
169 'default' => true,
170 'helpText' => __('Double buffering helps smooth the playback but should be disabled if graphics errors occur'),
171 'enabled' => true,
172 'groupClass' => NULL
173 ),
174 array(
175 'name' => 'EmptyLayoutDuration',
176 'tabId' => 'advanced',
177 'title' => __('Duration for Empty Layouts'),
178 'type' => _INT,
179 'fieldType' => 'text',
180 'default' => 10,
181 'helpText' => __('If an empty layout is detected how long should it remain on screen. Must be greater then 1.'),
182 'validation' => 'number',
183 'enabled' => true,
184 'groupClass' => NULL
185 ),
186 array(
187 'name' => 'EnableMouse',
188 'tabId' => 'advanced',
189 'title' => __('Enable Mouse'),
190 'type' => _CHECKBOX,
191 'fieldType' => 'checkbox',
192 'default' => true,
193 'helpText' => __('Enable the mouse.'),
194 'enabled' => true,
195 'groupClass' => NULL
196 ),
197 array(
198 'name' => 'EnableShellCommands',
199 'tabId' => 'advanced',
200 'title' => __('Enable Shell Commands'),
201 'type' => _CHECKBOX,
202 'fieldType' => 'checkbox',
203 'default' => true,
204 'helpText' => __('Enable the Shell Command module.'),
205 'enabled' => true,
206 'groupClass' => NULL
207 ),
208 array(
209 'name' => 'ExpireModifiedLayouts',
210 'tabId' => 'advanced',
211 'title' => __('Expire Modified Layouts'),
212 'type' => _CHECKBOX,
213 'fieldType' => 'checkbox',
214 'default' => true,
215 'helpText' => __('Expire Modified Layouts immediately on change. This means a layout can be cut during playback if it receives an update from the CMS'),
216 'enabled' => true,
217 'groupClass' => NULL
218 ),
219 array(
220 'name' => 'LogLevel',
221 'tabId' => 'trouble',
222 'title' => __('Log Level'),
223 'type' => _WORD,
224 'fieldType' => 'dropdown',
225 'options' => array(
226 array('id' => 'audit', 'value' => 'Audit'),
227 array('id' => 'info', 'value' => 'Information'),
228 array('id' => 'error', 'value' => 'Error'),
229 array('id' => 'off', 'value' => 'Off')
230 ),
231 'default' => 'error',
232 'helpText' => __('The position of the cursor when the client starts up.'),
233 'enabled' => true,
234 'groupClass' => NULL
235 ),
236 array(
237 'name' => 'LogToDiskLocation',
238 'tabId' => 'trouble',
239 'title' => __('Log file path name.'),
240 'type' => _STRING,
241 'fieldType' => 'text',
242 'default' => '',
243 'helpText' => __('Create a log file on disk in this location. Please enter a fully qualified path.'),
244 'enabled' => true,
245 'groupClass' => NULL
246 ),
247 array(
248 'name' => 'MaxConcurrentDownloads',
249 'tabId' => 'advanced',
250 'title' => __('Maximum concurrent downloads'),
251 'type' => _INT,
252 'fieldType' => 'text',
253 'default' => '2',
254 'helpText' => __('The maximum number of concurrent downloads the client will attempt.'),
255 'enabled' => true,
256 'groupClass' => NULL
257 ),
258 array(
259 'name' => 'ShellCommandAllowList',
260 'tabId' => 'advanced',
261 'title' => __('Shell Command Allow List'),
262 'type' => _STRING,
263 'fieldType' => 'text',
264 'default' => '',
265 'helpText' => __('Which shell commands should the client execute?'),
266 'enabled' => true,
267 'groupClass' => NULL
268 ),
269 array(
270 'name' => 'UseCefWebBrowser',
271 'tabId' => 'advanced',
272 'title' => __('Use CEF as the Web Browser'),
273 'type' => _CHECKBOX,
274 'fieldType' => 'checkbox',
275 'default' => 1,
276 'helpText' => __('CEF is Chrome Embedded and offers up to date web rendering. If unselected the default Internet Explorer control will be used.'),
277 'enabled' => true,
278 'groupClass' => NULL
279 ),
280 array(
281 'name' => 'SendCurrentLayoutAsStatusUpdate',
282 'tabId' => 'advanced',
283 'title' => __('Notify current layout'),
284 'type' => _CHECKBOX,
285 'fieldType' => 'checkbox',
286 'default' => 0,
287 'helpText' => __('When enabled the client will send the current layout to the CMS each time it changes. Warning: This is bandwidth intensive and should be disabled unless on a LAN.'),
288 'enabled' => true,
289 'groupClass' => NULL
290 ),
291 array(
292 'name' => 'ScreenShotRequestInterval',
293 'tabId' => 'advanced',
294 'title' => __('Screen shot interval'),
295 'type' => _INT,
296 'fieldType' => 'number',
297 'default' => 0,
298 'helpText' => __('The duration between status screen shots in minutes. 0 to disable. Warning: This is bandwidth intensive.'),
299 'enabled' => true,
300 'groupClass' => NULL
301 )
302 )
303 ),
304
305 /*'ubuntu' => array(
306 'synonym' => 'python',
307 'settings' => array(
308
309 )
310 ),*/
311
312 'android' => array(
313 'synonym' => 'xiboforandroid',
314 'tabs' => array(
315 array('id' => 'general', 'name' => __('General')),
316 array('id' => 'location', 'name' => __('Location')),
317 array('id' => 'trouble', 'name' => __('Troubleshooting')),
318 array('id' => 'advanced', 'name' => __('Advanced')),
319 ),
320 'settings' => array(
321 array(
322 'name' => 'emailAddress',
323 'tabId' => 'general',
324 'title' => __('Email Address'),
325 'type' => _STRING,
326 'fieldType' => 'text',
327 'default' => '',
328 'helpText' => __('The email address will be used to license this client. This is the email address you provided when you purchased the licence.'),
329 'enabled' => true,
330 'groupClass' => NULL
331 ),
332 array(
333 'name' => 'settingsPassword',
334 'tabId' => 'general',
335 'title' => __('Password Protect Settings'),
336 'type' => _STRING,
337 'fieldType' => 'text',
338 'default' => '',
339 'helpText' => __('Provide a Password which will be required to access settings'),
340 'enabled' => true,
341 'groupClass' => NULL
342 ),
343 array(
344 'name' => 'collectInterval',
345 'tabId' => 'general',
346 'title' => __('Collect interval'),
347 'type' => _INT,
348 'fieldType' => 'dropdown',
349 'options' => array(
350 array('id' => 60, 'value' => __('1 minute')),
351 array('id' => 300, 'value' => __('5 minutes')),
352 array('id' => 600, 'value' => __('10 minutes')),
353 array('id' => 1800, 'value' => __('30 minutes')),
354 array('id' => 3600, 'value' => __('1 hour')),
355 array('id' => 14400, 'value' => __('4 hours')),
356 array('id' => 43200, 'value' => __('12 hours'))
357 ),
358 'default' => 900,
359 'helpText' => __('How often should the Player check for new content.'),
360 'validation' => 'numeric',
361 'enabled' => true,
362 'groupClass' => NULL
363 ),
364 array(
365 'name' => 'orientation',
366 'tabId' => 'location',
367 'title' => __('Orientation'),
368 'type' => _INT,
369 'fieldType' => 'dropdown',
370 'options' => array(
371 array('id' => 0, 'value' => __('Landscape')),
372 array('id' => 1, 'value' => __('Portrait')),
373 array('id' => 8, 'value' => __('Reverse Landscape')),
374 array('id' => 9, 'value' => __('Reverse Portrait'))
375 ),
376 'default' => 0,
377 'helpText' => __('Set the orientation of the device (portrait mode will only work if supported by the hardware) Application Restart Required.'),
378 'enabled' => true,
379 'groupClass' => NULL
380 ),
381 array(
382 'name' => 'startOnBoot',
383 'tabId' => 'advanced',
384 'title' => __('Start during device start up?'),
385 'type' => _CHECKBOX,
386 'fieldType' => 'checkbox',
387 'default' => true,
388 'helpText' => __('When the device starts and Android finishes loading, should the client start up and come to the foreground?'),
389 'enabled' => true,
390 'groupClass' => NULL
391 ),
392 array(
393 'name' => 'actionBarMode',
394 'tabId' => 'advanced',
395 'title' => __('Action Bar Mode'),
396 'type' => _INT,
397 'fieldType' => 'dropdown',
398 'options' => array(
399 array('id' => 0, 'value' => 'Hide'),
400 array('id' => 1, 'value' => 'Timed')
401 ),
402 'default' => 1,
403 'helpText' => __('How should the action bar behave?'),
404 'enabled' => true,
405 'groupClass' => NULL
406 ),
407 array(
408 'name' => 'actionBarDisplayDuration',
409 'tabId' => 'advanced',
410 'title' => __('Action Bar Display Duration'),
411 'type' => _INT,
412 'fieldType' => 'text',
413 'default' => 30,
414 'helpText' => __('How long should the Action Bar be shown for, in seconds?'),
415 'validation' => 'numeric',
416 'enabled' => true,
417 'groupClass' => NULL
418 ),
419 array(
420 'name' => 'screenDimensions',
421 'tabId' => 'location',
422 'title' => __('Screen Dimensions'),
423 'type' => _STRING,
424 'fieldType' => 'text',
425 'default' => '',
426 'helpText' => __('Override the screen dimensions (left,top,width,height). Requires restart. Care should be taken to ensure these are within the actual screen size.'),
427 'enabled' => true,
428 'groupClass' => NULL
429 ),
430 array(
431 'name' => 'autoRestart',
432 'tabId' => 'advanced',
433 'title' => __('Automatic Restart'),
434 'type' => _CHECKBOX,
435 'fieldType' => 'checkbox',
436 'default' => true,
437 'helpText' => __('Automatically Restart the application if we detect it is not visible.'),
438 'enabled' => true,
439 'groupClass' => NULL
440 ),
441 array(
442 'name' => 'startOnBootDelay',
443 'tabId' => 'advanced',
444 'title' => __('Start delay for device start up'),
445 'type' => _INT,
446 'fieldType' => 'text',
447 'default' => 60,
448 'helpText' => __('The number of seconds to wait before starting the application after the device has started. Minimum 10.'),
449 'validation' => 'numeric',
450 'enabled' => true,
451 'groupClass' => NULL
452 ),
453 array(
454 'name' => 'blacklistVideo',
455 'tabId' => 'trouble',
456 'title' => __('Blacklist Videos?'),
457 'type' => _CHECKBOX,
458 'fieldType' => 'checkbox',
459 'default' => true,
460 'helpText' => __('Should Videos we fail to play be blacklisted and no longer attempted?'),
461 'enabled' => true,
462 'groupClass' => NULL
463 ),
464 array(
465 'name' => 'storeHtmlOnInternal',
466 'tabId' => 'trouble',
467 'title' => __('Store HTML resources on the Internal Storage?'),
468 'type' => _CHECKBOX,
469 'fieldType' => 'checkbox',
470 'default' => false,
471 'helpText' => __('Store all HTML resources on the Internal Storage? Should be selected if the device cannot display text, ticker, dataset media.'),
472 'enabled' => true,
473 'groupClass' => NULL
474 )
475 )
476 )
477 );
0478
=== modified file 'server/config/config.class.php'
--- server/config/config.class.php 2014-07-17 09:35:07 +0000
+++ server/config/config.class.php 2014-09-19 11:39:09 +0000
@@ -77,6 +77,42 @@
77 return false;77 return false;
78 }78 }
79 }79 }
80
81 static function GetAll($sort_order = array('cat', 'ordering'), $filter_by = array()) {
82
83 if ($sort_order == NULL)
84 $sort_order = array('cat', 'ordering');
85
86 try {
87 $dbh = PDOConnect::init();
88
89 $SQL = 'SELECT * FROM setting WHERE 1 = 1 ';
90 $params = array();
91
92 if (Kit::GetParam('userChange', $filter_by, _INT, -1) != -1) {
93 $SQL .= ' AND userChange = :userChange ';
94 $params['userChange'] = Kit::GetParam('userChange', $filter_by, _INT);
95 }
96
97 if (Kit::GetParam('userSee', $filter_by, _INT, -1) != -1) {
98 $SQL .= ' AND userSee = :userSee ';
99 $params['userSee'] = Kit::GetParam('userSee', $filter_by, _INT);
100 }
101
102 // Sorting?
103 if (is_array($sort_order))
104 $SQL .= 'ORDER BY ' . implode(',', $sort_order);
105
106 $sth = $dbh->prepare($SQL);
107 $sth->execute($params);
108
109 return $sth->fetchAll();
110 }
111 catch (Exception $e) {
112 trigger_error($e->getMessage());
113 return false;
114 }
115 }
80 116
81 /**117 /**
82 * Defines the Version and returns it118 * Defines the Version and returns it
@@ -116,311 +152,365 @@
116 }152 }
117 153
118 /**154 /**
119 * Checks the Environment and Determines if it is suitable for Xibo155 * Checks the Environment and Determines if it is suitable
120 * @return 156 * @return
121 */157 */
122 public function CheckEnvironment()158 public function CheckEnvironment()
123 {159 {
124 $output = '';160 $cols = array(
125 $imgGood = '<img src="install/dot_green.gif"> ';161 array('name' => 'item', 'title' => __('Item')),
126 $imgBad = '<img src="install/dot_red.gif"> ';162 array('name' => 'status', 'title' => __('Status'), 'icons' => true),
127 $imgWarn = '<img src="install/dot_amber.gif"> ';163 array('name' => 'advice', 'title' => __('Advice'))
128 164 );
129 $output .= '<div class="checks">';165 Theme::Set('table_cols', $cols);
130 166
167 $rows = array();
168
131 // Check for PHP version169 // Check for PHP version
132 $message = __('PHP Version');170 $advice = sprintf(__("PHP version %s or later required."), Config::$VERSION_REQUIRED) . ' Detected ' . phpversion();
133
134 if ($this->CheckPHP()) 171 if ($this->CheckPHP())
135 {172 {
136 $output .= $imgGood.$message.'<br />';173 $status = 1;
137 }174 }
138 else175 else
139 {176 {
140 $this->envFault = true;177 $this->envFault = true;
141 178 $status = 0;
142 $output .= $imgBad.$message.'<br />';
143 $output .= '<div class="check_explain"> <p>' . sprintf(__("PHP version %s or later required."), Config::$VERSION_REQUIRED) . '. Detected ' . phpversion() . '</p></div>';
144 }179 }
180
181 $rows[] = array(
182 'item' => __('PHP Version'),
183 'status' => $status,
184 'advice' => $advice
185 );
145 186
146 // Check for file system permissions187 // Check for file system permissions
147 $message = __('Filesystem Permissions');188 $advice = __("Write access required for settings.php, install.php and upgrade.php");
148
149 if ($this->CheckFsPermissions()) 189 if ($this->CheckFsPermissions())
150 {190 {
151 $output .= $imgGood.$message.'<br />';191 $status = 1;
152 }192 }
153 else193 else
154 {194 {
155 $this->envFault = true;195 $this->envFault = true;
156 196
157 $output .= $imgBad.$message.'<br />';197 $status = 0;
158 $output .= '<div class="check_explain"><p>' . __("Write access required for the following:");
159 $output .= <<<END
160 <ul>
161 <li> settings.php
162 <li> install.php
163 <li> upgrade.php
164 </ul>
165END;
166 $output .= __('Please fix this, and retest.') . '</p></div>';
167 }198 }
199
200 $rows[] = array(
201 'item' => __('File System Permissions'),
202 'status' => $status,
203 'advice' => $advice
204 );
168 205
169 // Check for MySQL206 // Check for MySQL
170 $message = __('MySQL database (PHP MySql)');207 $advice = __('MySQL support must be enabled in PHP.');
171
172 if ($this->CheckMySQL()) 208 if ($this->CheckMySQL())
173 {209 {
174 $output .= $imgGood.$message.'<br />';210 $status = 1;
175 }211 }
176 else212 else
177 {213 {
178 $this->envFault = true;214 $this->envFault = true;
179 215
180 $output .= $imgBad.$message.'<br />';216 $status = 0;
181 $output .= <<<END
182 <div class="check_explain">
183 <p>Xibo requires the PHP MySQL Extension to function.</p>
184 </div>
185END;
186 }217 }
187218
219 $rows[] = array(
220 'item' => __('MySQL database (PHP MySql)'),
221 'status' => $status,
222 'advice' => $advice
223 );
224
188 // Check for PDO225 // Check for PDO
189 $message = __('MySQL database (PDO MySql)');226 $advice = __('PDO support with MySQL drivers must be enabled in PHP.');
190
191 if ($this->CheckPDO()) 227 if ($this->CheckPDO())
192 {228 {
193 $output .= $imgGood.$message.'<br />';229 $status = 1;
194 }230 }
195 else231 else
196 {232 {
197 $this->envFault = true;233 $this->envFault = true;
198 234
199 $output .= $imgBad.$message.'<br />';235 $status = 0;
200 $output .= <<<END
201 <div class="check_explain">
202 <p>Xibo requires the PHP PDO Extension to function.</p>
203 </div>
204END;
205 }236 }
237
238 $rows[] = array(
239 'item' => __('MySQL database (PDO MySql)'),
240 'status' => $status,
241 'advice' => $advice
242 );
206 243
207 // Check for JSON244 // Check for JSON
208 $message = __('JSON Extension');245 $advice = __('PHP JSON extension required to function.');
209
210 if ($this->CheckJson())246 if ($this->CheckJson())
211 {247 {
212 $output .= $imgGood.$message.'<br />';248 $status = 1;
213 }249 }
214 else250 else
215 {251 {
216 $this->envFault = true;252 $this->envFault = true;
217253
218 $output .= $imgBad.$message.'<br />';254 $status = 0;
219 $output .= '<div class="check_explain"><p>' . __('PHP JSON extension required to function.') . '</p></div>';
220 }255 }
221256
222 // Check for SOAP257 $rows[] = array(
223 $message = __('SOAP Extension');258 'item' => __('JSON Extension'),
259 'status' => $status,
260 'advice' => $advice
261 );
224262
263 // Check for SOAP
264 $advice = __('PHP SOAP extension required to function.');
225 if ($this->CheckSoap())265 if ($this->CheckSoap())
226 {266 {
227 $output .= $imgGood.$message.'<br />';267 $status = 1;
228 }268 }
229 else269 else
230 {270 {
231 $this->envFault = true;271 $this->envFault = true;
232272
233 $output .= $imgBad.$message.'<br />';273 $status = 0;
234 $output .= '<div class="check_explain"><p>' . __('PHP SOAP extension required to function.') . '</p></div>';
235 }274 }
275
276 $rows[] = array(
277 'item' => __('SOAP Extension'),
278 'status' => $status,
279 'advice' => $advice
280 );
236 281
237 // Check for GD (graphics)282 // Check for GD (graphics)
238 $message = __('GD Extension');283 $advice = __('PHP GD extension to function.');
239
240 if ($this->CheckGd()) 284 if ($this->CheckGd())
241 {285 {
242 $output .= $imgGood.$message.'<br />';286 $status = 1;
243 }287 }
244 else288 else
245 {289 {
246 $this->envFault = true;290 $this->envFault = true;
247 291
248 $output .= $imgBad.$message.'<br />';292 $status = 0;
249 $output .= '<div class="check_explain"><p>' . __('PHP GD extension to function.') . '</p></div>';
250 }293 }
251294
295 $rows[] = array(
296 'item' => __('GD Extension'),
297 'status' => $status,
298 'advice' => $advice
299 );
300
252 // Check for PHP Session301 // Check for PHP Session
253 $message = __('Session');302 $advice = __('PHP session support to function.');
254
255 if ($this->CheckSession()) 303 if ($this->CheckSession())
256 {304 {
257 $output .= $imgGood.$message.'<br />';305 $status = 1;
258 }306 }
259 else307 else
260 {308 {
261 $this->envFault = true;309 $this->envFault = true;
262 310
263 $output .= $imgBad.$message.'<br />';311 $status = 0;
264 $output .= '<div class="check_explain"><p>' . __('PHP session support to function.') . '</p></div>';
265 }312 }
266313
314 $rows[] = array(
315 'item' => __('Session'),
316 'status' => $status,
317 'advice' => $advice
318 );
319
267 // Check for PHP FileInfo320 // Check for PHP FileInfo
268 $message = __('FileInfo');321 $advice = __('Requires PHP FileInfo support to function. If you are on Windows you need to enable the php_fileinfo.dll in your php.ini file.');
269
270 if ($this->CheckFileInfo()) 322 if ($this->CheckFileInfo())
271 {323 {
272 $output .= $imgGood.$message.'<br />';324 $status = 1;
273 }325 }
274 else326 else
275 {327 {
276 $this->envFault = true;328 $this->envFault = true;
277 329
278 $output .= $imgBad.$message.'<br />';330 $status = 0;
279 $output .= '<div class="check_explain"><p>' . __('Requires PHP FileInfo support to function. If you are on Windows you need to enable the php_fileinfo.dll in your php.ini file.') . '</p></div>';
280 }331 }
332
333 $rows[] = array(
334 'item' => __('FileInfo'),
335 'status' => $status,
336 'advice' => $advice
337 );
281 338
282 // Check for PHP PCRE339 // Check for PHP PCRE
283 $message = __('PCRE');340 $advice = __('PHP PCRE support to function.');
284
285 if ($this->CheckPCRE()) 341 if ($this->CheckPCRE())
286 {342 {
287 $output .= $imgGood.$message.'<br />';343 $status = 1;
288 }344 }
289 else345 else
290 {346 {
291 $this->envFault = true;347 $this->envFault = true;
292 348
293 $output .= $imgBad.$message.'<br />';349 $status = 0;
294 $output .= '<div class="check_explain"><p>' . __('PHP PCRE support to function.') . '</p></div>';
295 }350 }
351
352 $rows[] = array(
353 'item' => __('PCRE'),
354 'status' => $status,
355 'advice' => $advice
356 );
296 357
297 // Check for PHP Gettext358 // Check for PHP Gettext
298 $message = __('Gettext');359 $advice = __('PHP Gettext support to function.');
299
300 /**
301 * we now use PHP-Gettext which is shipped.
302 */
303 if ($this->CheckGettext())360 if ($this->CheckGettext())
304 {361 {
305 $output .= $imgGood.$message.'<br />';362 $status = 1;
306 }363 }
307 else364 else
308 {365 {
309 $this->envFault = true;366 $this->envFault = true;
310 367
311 $output .= $imgBad.$message.'<br />';368 $status = 0;
312 $output .= '<div class="check_explain"><p>' . __('PHP Gettext support to function.') . '</p></div>';
313 }369 }
370
371 $rows[] = array(
372 'item' => __('Gettext'),
373 'status' => $status,
374 'advice' => $advice
375 );
314 376
315 // Check for Calendar377 // Check for Calendar
316 $message = __('Calendar Extension');378 $advice = __('PHP Calendar extension to function.');
317
318 if ($this->CheckCal()) 379 if ($this->CheckCal())
319 {380 {
320 $output .= $imgGood.$message.'<br />';381 $status = 1;
321 }382 }
322 else383 else
323 {384 {
324 $this->envFault = true;385 $this->envFault = true;
325 386
326 $output .= $imgBad.$message.'<br />';387 $status = 0;
327 $output .= '<div class="check_explain"><p>' . __('PHP Calendar extension to function.') . '</p></div>';
328 }388 }
389
390 $rows[] = array(
391 'item' => __('Calendar Extension'),
392 'status' => $status,
393 'advice' => $advice
394 );
329 395
330 // Check for DOM396 // Check for DOM
331 $message = __('DOM Extension');397 $advice = __('PHP DOM core functionality enabled.');
332
333 if ($this->CheckDom()) 398 if ($this->CheckDom())
334 {399 {
335 $output .= $imgGood.$message.'<br />';400 $status = 1;
336 }401 }
337 else402 else
338 {403 {
339 $this->envFault = true;404 $this->envFault = true;
340 405
341 $output .= $imgBad.$message.'<br />';406 $status = 0;
342 $output .= '<div class="check_explain"><p>' . __('PHP DOM core functionality enabled.') . '</p></div>';
343 }407 }
408
409 $rows[] = array(
410 'item' => __('DOM Extension'),
411 'status' => $status,
412 'advice' => $advice
413 );
344 414
345 // Check for DOM XML415 // Check for DOM XML
346 $message = __('DOM XML Extension');416 $advice = __('PHP DOM XML extension to function.');
347
348 if ($this->CheckDomXml()) 417 if ($this->CheckDomXml())
349 {418 {
350 $output .= $imgGood.$message.'<br />';419 $status = 1;
351 }420 }
352 else421 else
353 {422 {
354 $this->envFault = true;423 $this->envFault = true;
355 424
356 $output .= $imgBad.$message.'<br />';425 $status = 0;
357 $output .= '<div class="check_explain"><p>' . __('PHP DOM XML extension to function.') . '</p></div>';
358 }426 }
427
428 $rows[] = array(
429 'item' => __('DOM XML Extension'),
430 'status' => $status,
431 'advice' => $advice
432 );
359 433
360 // Check for Mcrypt434 // Check for Mcrypt
361 $message = __('Mcrypt Extension');435 $advice = __('PHP Mcrypt extension to function.');
362
363 if ($this->CheckMcrypt()) 436 if ($this->CheckMcrypt())
364 {437 {
365 $output .= $imgGood.$message.'<br />';438 $status = 1;
366 }439 }
367 else440 else
368 {441 {
369 $this->envFault = true;442 $this->envFault = true;
370 443
371 $output .= $imgBad.$message.'<br />';444 $status = 0;
372 $output .= '<div class="check_explain"><p>' . __('PHP Mcrypt extension to function.') . '</p></div>';
373 }445 }
446
447 $rows[] = array(
448 'item' => __('Mcrypt Extension'),
449 'status' => $status,
450 'advice' => $advice
451 );
374 452
375 // Check to see if we are allowed to open remote URLs (homecall will not work otherwise)453 // Check to see if we are allowed to open remote URLs (home call will not work otherwise)
376 $message = __('Allow PHP to open external URLs');454 $advice = __('You must have allow_url_fopen = On in your PHP.ini file for RSS Feeds / Anonymous statistics gathering to function.');
377
378 if (ini_get('allow_url_fopen')) 455 if (ini_get('allow_url_fopen'))
379 {456 {
380 $output .= $imgGood.$message.'<br />';457 $status = 1;
381 }458 }
382 else459 else
383 {460 {
384 // Not a fault as this will not block installation/upgrade. Informational.461 // Not a fault as this will not block installation / upgrade. Informational.
385 $this->envWarning = true;462 $this->envWarning = true;
386 $output .= $imgWarn.$message.'<br />';463 $status = 2;
387 $output .= '<div class="check_explain"><p>' . __('You must have allow_url_fopen = On in your PHP.ini file for anonymous statistics gathering to function.') . '<br />';
388 $output .= __('If you do not intend to enable anonymous statistics gathering you need not worry about this problem.') . '</p></div>';
389 }464 }
390465
466 $rows[] = array(
467 'item' => __('Allow PHP to open external URLs'),
468 'status' => $status,
469 'advice' => $advice
470 );
471
391 // Check to see if timezone_identifiers_list exists472 // Check to see if timezone_identifiers_list exists
392 $message = 'DateTimeZone';473 $advice = __('This enables us to get a list of time zones supported by the hosting server.');
393
394 if (function_exists('timezone_identifiers_list')) 474 if (function_exists('timezone_identifiers_list'))
395 {475 {
396 $output .= $imgGood.$message.'<br />';476 $status = 1;
397 }477 }
398 else478 else
399 {479 {
400 $this->envWarning = true;480 $this->envWarning = true;
401 481
402 $output .= $imgWarn.$message.'<br />';
403 }482 }
483
484 $rows[] = array(
485 'item' => __('DateTimeZone'),
486 'status' => $status,
487 'advice' => $advice
488 );
404 489
405 // Check to see if large file uploads enabled490 // Check to see if large file uploads enabled
406 $message = 'Large File Uploads';491 $advice = __('Support for uploading large files is recommended.');
407
408 if ($this->CheckPHPUploads()) 492 if ($this->CheckPHPUploads())
409 {493 {
410 $output .= $imgGood.$message.'<br />';494 $status = 1;
411 }495 }
412 else496 else
413 {497 {
414 $this->envWarning = true;498 $this->envWarning = true;
415 $output .= $imgWarn.$message.'<br />';499 $status = 2;
416 $output .= '<div class="check_explain"><p>' . __('You probably want to allow larger files to be uploaded than is currently available with your PHP configuration.') . '<br />';500 $advice = __('You probably want to allow larger files to be uploaded than is currently available with your PHP configuration.') . '<br />';
417 $output .= __('We suggest setting your PHP post_max_size and upload_max_size to at least 128M, and also increasing your max_execution_time to at least 120 seconds.') . '</p></div>';501 $advice .= __('We suggest setting your PHP post_max_size and upload_max_size to at least 128M, and also increasing your max_execution_time to at least 120 seconds.');
418 }502 }
419 503
420 $output .= '</div>';504 $rows[] = array(
505 'item' => __('Large File Uploads'),
506 'status' => $status,
507 'advice' => $advice
508 );
421 509
422 $this->envTested = true;510 $this->envTested = true;
423 return $output;511
512 Theme::Set('table_rows', $rows);
513 return Theme::RenderReturn('table_render');
424 }514 }
425 515
426 /**516 /**
@@ -582,6 +672,10 @@
582 {672 {
583 return extension_loaded("fileinfo");673 return extension_loaded("fileinfo");
584 }674 }
675
676 function CheckZip() {
677 return extension_loaded('zip');
678 }
585 679
586 /**680 /**
587 * Check PHP is setup for large file uploads681 * Check PHP is setup for large file uploads
588682
=== modified file 'server/install.php'
--- server/install.php 2014-09-18 17:14:29 +0000
+++ server/install.php 2014-09-19 11:39:09 +0000
@@ -1,7 +1,7 @@
1<?php1<?php
2/*2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009-2013 Alex Harrington4 * Copyright (C) 2009-2014 Alex Harrington and Daniel Garner
5 *5 *
6 * This file is part of Xibo.6 * This file is part of Xibo.
7 *7 *
@@ -19,726 +19,124 @@
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */ 20 */
21DEFINE('XIBO', true);21DEFINE('XIBO', true);
22DEFINE('MAX_EXECUTION', true);
2223
23error_reporting(0);24error_reporting(0);
24ini_set('display_errors', 0);25ini_set('display_errors', 0);
2526
26include('lib/app/kit.class.php');27require_once('lib/app/kit.class.php');
27include('install/header.inc');28require_once('config/config.class.php');
28include('config/config.class.php');29require_once('config/db_config.php');
29include('config/db_config.php');30require_once("lib/app/pdoconnect.class.php");
3031require_once("lib/app/translationengine.class.php");
31$config = new Config();32require_once("lib/app/thememanager.class.php");
3233require_once("lib/app/helpmanager.class.php");
33if (!$config->CheckPHP()) {34require_once("lib/app/datemanager.class.php");
34 die(sprintf('Xibo required PHP version %s.', Config::$VERSION_REQUIRED));35require_once("lib/app/formmanager.class.php");
35}36require_once('modules/module_user_general.php');
3637require_once('lib/pages/install.class.php');
37// Setup for the Translations using Gettext.38require_once("lib/data/data.class.php");
38// There is normally a class that will do this for us - but it requires a DB object (which we do not have at install time)39require_once('lib/app/debug.class.php');
39// Would be nice to include a method on the TranslationEngine that did this for us - but without the debugging40
40// The actual translation function __() is included later in this file.41// Create a theme
41$langs = Kit::GetParam('HTTP_ACCEPT_LANGUAGE', $_SERVER, _STRING);42new Theme(new User(new Database()), 'default');
42$lang = 'en-gb'; // Default language43Theme::SetPagename('install');
43$encoding = ''; // We do not seem to need an encoding, but I read somewhere that we might - left as a reminder of this.44
4445// Set-up the translations for get text
45if ($langs != '') 46TranslationEngine::InitLocale('en_GB');
46{47
47 $langs = explode(',', $langs);48$xibo_step = Kit::GetParam('step', _REQUEST, _INT, 1);
48 $lang = $langs[0];49
49}50$content = '';
5051$install = new Install();
51// For windows52
52putenv('LANG='.$lang.'.'.$encoding);53switch ($xibo_step) {
53putenv('LANGUAGE='.$lang.'.'.$encoding); 54
54putenv('LC_ALL='.$lang.'.'.$encoding); 55 case 1:
5556 // Welcome to the installer (this should only show once)
56// Set local57 // Checks environment
57setlocale(LC_ALL, $lang.'.'.$encoding);58 $content = $install->Step1();
5859 break;
59// Translations have been setup.60
6061 case 2:
61$fault = false;62 // Collect details about the database
6263 $content = $install->Step2();
63$xibo_step = Kit::GetParam('xibo_step',_POST,_INT,'0');64 break;
6465
65if (!isset($xibo_step) || $xibo_step == 0) {66 case 3:
66 # First step of the process.67 // Check and validate DB details
67 # Show a welcome screen and next button68 if (defined('MAX_EXECUTION') && MAX_EXECUTION)
68 ?>69 set_time_limit(0);
69 <?php echo __("Welcome to the Xibo Installer!"); ?><br /><br />70
70 <?php echo __("The installer will take you through setting up Xibo one step at a time."); ?><br /><br />71 try {
71 <?php echo __("Lets get started!"); ?><br /><br />72 $install->Step3();
72 <form action="install.php" method="POST">73
73 <input type="hidden" name="xibo_step" value="1" />74 // Redirect to step 4
74 <div class="loginbutton"><button type="submit"><?php echo __("Next"); ?> ></button></div>75 header('Location: install.php?step=4');
75 </form>76 }
76 <?php77 catch (Exception $e) {
77}78 $install->errorMessage = $e->getMessage();
78elseif ($xibo_step == 1) {79
79 # Check environment80 // Reload step 2
80 $db = new Database();81 $content = $install->Step2();
81 $cObj = new Config();82 }
82 ?>83 break;
83 <p><?php echo __("First we need to check if your server meets Xibo's requirements."); ?></p>84
84 <div class="checks">85 case 4:
85 <?php86 // DB installed and we are ready to collect some more details
86 echo $cObj->CheckEnvironment();87 // We should get the admin username and password
87 if ($cObj->EnvironmentFault()) {88 $content = $install->Step4();
88 ?>89 break;
89 <form action="install.php" method="POST">90
90 <input type="hidden" name="xibo_step" value="1" />91 case 5:
91 <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>92 // Create a user account
92 </form>93 include_once('settings.php');
93 <?php94 try {
94 }95 $install->Step5();
95 else if ($cObj->EnvironmentWarning()) {96
96 ?>97 // Redirect to step 6
97 <form action="install.php" method="POST">98 header('Location: install.php?step=6');
98 <input type="hidden" name="xibo_step" value="1" />99 }
99 <div class="loginbutton"><button type="submit"><?php echo __("Retest"); ?></button></div>100 catch (Exception $e) {
100 </form>101 $install->errorMessage = $e->getMessage();
101 <form action="install.php" method="POST">102
102 <input type="hidden" name="xibo_step" value="2" />103 // Reload step 4
103 <div class="loginbutton"><button type="submit"><?php echo __("Next"); ?> ></button></div>104 $content = $install->Step4();
104 </form>105 }
105 <?php106 break;
106 }107
107 else {108 case 6:
108 ?>109 $content = $install->Step6();
109 <form action="install.php" method="POST">110 break;
110 <input type="hidden" name="xibo_step" value="2" />111
111 <div class="loginbutton"><button type="submit"><?php echo __("Next"); ?> ></button></div>112 case 7:
112 </form>113 // Create a user account
113 <?php114 include_once('settings.php');
114 } 115 try {
115}116 $install->Step7();
116elseif ($xibo_step == 2) {117
117# Create database118 // Redirect to step 6
118## Does database exist already?119 header('Location: install.php?step=8');
119120 }
120 ?>121 catch (Exception $e) {
121 <div class="info">122 $install->errorMessage = $e->getMessage();
122 <p><?php echo __("Xibo needs to setup a new database."); ?></p>123
123 <p><?php echo __("If you have not yet created an empty database and database user for Xibo to use, and know the username/password of a MySQL administrator, click the \"Create New\" button, otherwise click \"Use Existing\"."); ?></p>124 // Reload step 4
124 <p><i><?php echo __("Note that any existing database must be empty"); ?></i></p>125 $content = $install->Step6();
125 </div>126 }
126 <form action="install.php" method="POST">127 break;
127 <input type="hidden" name="xibo_step" value="3" />128
128 <button type="submit"><?php echo __("Create New"); ?></button>129 case 8:
129 </form>130 include_once('settings.php');
130 <form action="install.php" method="POST">131 // Step 8 ends the execution
131 <input type="hidden" name="xibo_step" value="4" />132 $install->Step8();
132 <button type="submit"><?php echo __("Use Existing"); ?></button>133 break;
133 </form>134}
134 <?php135
135}136Theme::Set('step', $xibo_step);
136elseif ($xibo_step == 3) {137Theme::Set('stepContent', $content);
137## If not, gather admin password and use to create empty db and new user.138
138?>139// Include the header
139<div class="info">140Theme::Render('install_header');
140<p><?php echo __("Since no empty database has been created for Xibo to use, we need the username and password of a MySQL administrator to create a new database, and database user for Xibo."); ?></p>141Theme::Render('install_footer');
141<p><?php echo __("Additionally, please give us a new username and password to create in MySQL for Xibo to use. Xibo will create this automatically for you."); ?></p>
142<form action="install.php" method="POST">
143<input type="hidden" name="xibo_step" value="5" />
144<input type="hidden" name="db_create" value="On" />
145<div class="install_table">
146 <p><label for="host"><?php echo __("Host:"); ?>&nbsp;</label><input class="username" type="text" id="host" name="host" size="12" value="localhost" /></p>
147 <p><label for="admin_username"><?php echo __("Admin Username:"); ?>&nbsp;</label><input class="username" type="text" id="admin_username" name="admin_username" size="12" /></p>
148 <p><label for="admin_password"><?php echo __("Admin Password:"); ?>&nbsp;</label><input class="username" type="password" id="admin_password" name="admin_password" size="12" /></p>
149 <p><label for="db_name"><?php echo __("Xibo Database Name:"); ?>&nbsp;</label><input class="username" type="text" id="db_name" name="db_name" size="12" value="xibo" /></p>
150 <p><label for="db_username"><?php echo __("Xibo Database Username:"); ?>&nbsp;</label><input class="username" type="text" id="db_username" name="db_username" size="12" value="xibo" /></p>
151 <p><label for="db_password"><?php echo __("Xibo Database Password:"); ?>&nbsp;</label><input class="username" type="password" id="db_password" name="db_password" size="12" /></p>
152</div>
153</div>
154<button type="submit"><?php echo __("Create"); ?></button>
155</form>
156<?php
157}
158elseif ($xibo_step == 4) {
159## Get details of db that's been created already for us
160?>
161<div class="info">
162<p><?php echo __("Please enter the details of the database and user you have created for Xibo."); ?></p>
163<form action="install.php" method="POST">
164<input type="hidden" name="xibo_step" value="5" />
165<input type="hidden" name="db_create" value="Off" />
166<div class="install_table">
167 <p><label for="host"><?php echo __("Host:"); ?>&nbsp;</label><input class="username" type="text" id="host" name="host" size="12" value="localhost" /></p>
168 <p><label for="db_name"><?php echo __("Xibo Database Name:"); ?>&nbsp;</label><input class="username" type="text" id="db_name" name="db_name" size="12" value="xibo" /></p>
169 <p><label for="db_username"><?php echo __("Xibo Database Username:"); ?>&nbsp;</label><input class="username" type="text" id="db_username" name="db_username" size="12" value="xibo" /></p>
170 <p><label for="db_password"><?php echo __("Xibo Database Password:"); ?>&nbsp;</label><input class="username" type="password" id="db_password" name="db_password" size="12" /></p>
171</div>
172</div>
173<button type="submit"><?php echo __("Create"); ?></button>
174</form>
175<?php
176}
177elseif ($xibo_step == 5) {
178
179 $db_create = Kit::GetParam('db_create',_POST,_STRING);
180
181 if (!isset($db_create)) {
182 reportError("2",__("Something went wrong"));
183 }
184 else {
185 $db_host = Kit::GetParam('host',_POST,_STRING,'localhost');
186 $db_user = Kit::GetParam('db_username',_POST,_PASSWORD);
187 $db_pass = Kit::GetParam('db_password',_POST,_PASSWORD);
188 $db_name = Kit::GetParam('db_name',_POST,_PASSWORD);
189 ?>
190 <div class="info">
191 <?php
192 if ($db_create == 'On') {
193 $db_admin_user = Kit::GetParam('admin_username',_POST,_PASSWORD);
194 $db_admin_pass = Kit::GetParam('admin_password',_POST,_PASSWORD);
195
196 if (! ($db_host && $db_name && $db_user && $db_admin_user)) {
197 # Something was blank.
198 # Throw an error.
199 reportError("3", __("A field was blank. Please fill in all fields."));
200 }
201
202 $db = @mysql_connect($db_host,$db_admin_user,$db_admin_pass);
203
204 if (! $db) {
205 reportError("3", __("Could not connect to MySQL with the administrator details. Please check and try again.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
206 }
207
208 ?>
209 <p><?php echo __("Creating new database."); ?></p>
210 <?php
211 flush();
212
213 $SQL = sprintf("CREATE DATABASE `%s`",
214 mysql_real_escape_string($db_name));
215 if (! @mysql_query($SQL, $db)) {
216 # Create database and user
217 reportError("3", __("Could not create a new database with the administrator details. Please check and try again.") . "<br /><br />" . "MySQL Error:" . "<br />" . mysql_error());
218 }
219
220 # Choose the MySQL DB to create a user
221 @mysql_select_db("mysql", $db);
222
223 # Make $db_host lowercase so it matches "localhost" if required.
224 $db_host = strtolower($db_host);
225
226 ?>
227 <p><?php echo __("Creating new user"); ?></p>
228 <?php
229 flush();
230
231 if ($db_host == 'localhost') {
232 $SQL = sprintf("GRANT ALL PRIVILEGES ON `%s`.* to '%s'@'%s' IDENTIFIED BY '%s'",
233 mysql_real_escape_string($db_name),
234 mysql_real_escape_string($db_user),
235 mysql_real_escape_string($db_host),
236 mysql_real_escape_string($db_pass));
237 }
238 else {
239 $SQL = sprintf("GRANT ALL PRIVILEGES ON `%s`.* to '%s'@'%%' IDENTIFIED BY '%s'",
240 mysql_real_escape_string($db_name),
241 mysql_real_escape_string($db_user),
242 mysql_real_escape_string($db_pass));
243 }
244 if (! @mysql_query($SQL, $db)) {
245 reportError("3", __("Could not create a new user with the administrator details. Please check and try again.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
246 }
247
248
249 @mysql_query("FLUSH PRIVILEGES", $db);
250 @mysql_close($db);
251
252 }
253 else {
254 if (! ($db_host && $db_name && $db_user && $db_pass)) {
255 # Something was blank
256 # Throw an error.
257 reportError("4", __("A field was blank. Please fill in all fields.") . " " . $db_host . " " . $db_name . " " . $db_user . " " . $db_pass);
258 }
259 }
260 ## Populate database
261
262 $db = @mysql_connect($db_host,$db_user,$db_pass);
263
264 if (! $db) {
265 reportError("4", __("Could not connect to MySQL with the Xibo User account details. Please check and try again.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
266 }
267
268 @mysql_select_db($db_name,$db);
269
270 ?>
271 <p>Populating the database</p>
272 <?php
273 flush();
274
275 # Load from sql files to db - HOW?
276 $sql_files = array('structure.sql', 'data.sql');
277
278 $sqlStatementCount = 0;
279
280 foreach ($sql_files as $filename) {
281 ?>
282 <p>Loading from <?php print $filename; ?>
283 <?php
284 flush();
285
286 $delimiter = ';';
287 $sql_file = @file_get_contents('install/master/' . $filename);
288 $sql_file = remove_remarks($sql_file);
289 $sql_file = split_sql_file($sql_file, $delimiter);
290
291 foreach ($sql_file as $sql) {
292 print ".";
293 $sqlStatementCount++;
294 flush();
295 if (! @mysql_query($sql,$db)) {
296 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);
297 }
298 }
299 print "</p>";
300 }
301 @mysql_close($db);
302 }
303 # Write out a new settings.php
304 $fh = fopen("settings.php", 'wt');
305
306 if (! $fh) {
307 reportError("0", __("Unable to write to settings.php. We already checked this was possible earlier, so something changed."));
308 }
309
310 settings_strings();
311
312 $settings_content = '$dbhost = \'' . $db_host . '\';' . "\n";
313 $settings_content .= '$dbuser = \'' . $db_user . '\';' . "\n";
314 $settings_content .= '$dbpass = \'' . $db_pass . '\';' . "\n";
315 $settings_content .= '$dbname = \'' . $db_name . '\';' . "\n\n";
316 $settings_content .= 'define(\'SECRET_KEY\',\'' . gen_secret() . '\');' . "\n";
317
318 if (! fwrite($fh, $settings_header . $settings_content . $settings_footer)) {
319 reportError("0", __("Unable to write to settings.php. We already checked this was possible earlier, so something changed."));
320 }
321
322 fclose($fh);
323
324 ?>
325 </div>
326 <div class="install_table">
327 <form action="install.php" method="POST">
328 <input type="hidden" name="xibo_step" value="6" />
329 </div>
330 <button type="submit"><?php echo __("Next"); ?> ></button>
331 </form>
332 <?php
333}
334elseif ($xibo_step == 6) {
335 # Form to get new admin password
336 ?>
337 <div class="info">
338 <p><?php echo __("Xibo needs to set the \"xibo_admin\" user password. Please enter a password for this account below."); ?></p>
339 </div>
340 <div class="install_table">
341 <form action="install.php" method="POST">
342 <input type="hidden" name="xibo_step" value="7" />
343 <p><label for="password1"><?php echo __("Password:"); ?>&nbsp;</label><input type="password" name="password1" size="12" /></p>
344 <p><label for="password2"><?php echo __("Retype Password:"); ?>&nbsp;</label><input type="password" name="password2" size="12" /></p>
345 </div>
346 <button type="submit"><?php echo __("Next"); ?> ></button>
347 </form>
348 <?php
349}
350elseif ($xibo_step == 7) {
351 # Setup xibo_admin password
352 $password1 = Kit::GetParam('password1',_POST,_PASSWORD);
353 $password2 = Kit::GetParam('password2',_POST,_PASSWORD);
354
355 if (!(($password1 && $password2) && ($password1 == $password2))) {
356 reportError("6", __("Please input a new password. Ensure both password fields are identical."));
357 }
358
359 include('settings.php');
360
361 $password_hash = md5($password1);
362
363 $db = @mysql_connect($dbhost,$dbuser,$dbpass);
364
365 if (! $db) {
366 reportError("6", __("Could not connect to MySQL with the Xibo User account details saved in settings.php. Please check and try again.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
367 }
368
369 @mysql_select_db($dbname,$db);
370
371 $SQL = sprintf("UPDATE `user` SET UserPassword = '%s' WHERE UserID = 1 LIMIT 1",
372 mysql_real_escape_string($password_hash));
373 if (! @mysql_query($SQL, $db)) {
374 reportError("6", __("An error occured changing the xibo_admin password.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
375 }
376
377 @mysql_close($db);
378
379 ?>
380 <div class="info">
381 <?php echo __("Successfully changed the xibo_admin password. We're nearly there now. Just a couple more steps!"); ?>
382 </div>
383 <form action="install.php" method="POST">
384 <input type="hidden" name="xibo_step" value="8" />
385 <button type="submit"><?php echo __("Next"); ?> ></button>
386 </form>
387 <?php
388}
389elseif ($xibo_step == 8) {
390 # Configure paths and keys
391 ## nuSoap
392 ## libraries
393 ## server_key
394 ?>
395 <div class="info">
396 <p><b><?php echo __("Library Location"); ?></b></p>
397 <p><?php echo __("Xibo needs somewhere to store the things you upload to be shown. Ideally, this should be somewhere outside the root of your webserver - that is such that is not accessible by a web browser. Please input the full path to this folder. If the folder does not already exist, Xibo will attempt to create it for you."); ?></p>
398 <form action="install.php" method="POST">
399 <div class="install_table">
400 <p><label for="library_location"><?php echo __("Library Location:"); ?>&nbsp;</label><input type="text" name="library_location" value="" /></p>
401 </div>
402 <p><b><?php echo __("Server Key"); ?></b></p>
403 <p><?php echo __("Xibo needs you to choose a \"key\". This will be required each time you setup a new client. It should be complicated, and hard to remember. It is visible in the admin interface, so it need not be written down separately."); ?></p>
404 <div class="install_table">
405 <p><label for="server_key"><?php echo __("Server Key:"); ?> </label><input type="text" name="server_key" value="" /></p>
406 </div>
407 <p><b><?php echo __("Statistics"); ?></b></p>
408 <p><?php echo __("We'd love to know you're running Xibo. If you're happy for us to collect anonymous statistics (version number, number of displays) then please leave the box ticked. Please untick the box if your server does not have direct access to the internet."); ?></p>
409 <div class="install_table">
410 <p><label for="stats"><?php echo __("Anonymous Statistics:"); ?>&nbsp;</label><input type="checkbox" name="stats" value="true" checked /></p>
411 </div>
412 <input type="hidden" name="xibo_step" value="9" />
413 </div>
414 <button type="submit"><?php echo __("Next"); ?> ></button>
415 </form>
416 <?php
417}
418elseif ($xibo_step == 9) {
419
420 $server_key = Kit::GetParam('server_key',_POST,_STRING);
421 $library_location = Kit::GetParam('library_location',_POST,_STRING);
422 $stats = Kit::GetParam('stats',_POST,_BOOL);
423
424 // Remove trailing whitespace from the path given.
425 $library_location = trim($library_location);
426
427 // Check both fields were completed
428 if (! ($server_key && $library_location)) {
429 reportError("8", __("A field was blank. Please make sure you complete all fields"));
430 }
431
432 if ($stats) {
433 $stats="On"; // Fixme: translate ?
434 }
435 else {
436 $stats="Off"; //Fixme : translate ?
437 }
438
439 // Does library_location exist already?
440 if (! is_dir($library_location)) {
441 if (is_file($library_location)) {
442 reportError("8", __("A file exists with the name you gave for the Library Location. Please choose another location"));
443 }
444
445 // Directory does not exist. Attempt to make it
446 // Using mkdir recursively, so it will attempt to make any
447 // intermediate folders required.
448 if (! mkdir($library_location,0755,true)) {
449 reportError("8", __("Could not create the Library Location directory for you. Please ensure the webserver has permission to create a folder in this location, or create the folder manually and grant permission for the webserver to write to the folder."));
450 }
451
452 }
453
454 // Is library_location writable?
455 if (! is_writable($library_location)) {
456 // Directory is not writable.
457 reportError("8", __("The Library Location you gave is not writable by the webserver. Please fix the permissions and try again."));
458 }
459
460 // Is library_location empty?
461 if (count(ls("*",$library_location,true)) > 0) {
462 reportError("8", __("The Library Location you gave is not empty. Please give the location of an empty folder"));
463 }
464
465 // Check if the user has added a trailing slash.
466 // If not, add one.
467 if (!((substr($library_location, -1) == '/') || (substr($library_location, -1) == '\\'))) {
468 $library_location = $library_location . '/';
469 }
470
471 include('settings.php');
472
473 $db = @mysql_connect($dbhost,$dbuser,$dbpass);
474
475 if (! $db) {
476 reportError("8", __("Could not connect to MySQL with the Xibo User account details saved in settings.php. Please check and try again.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
477 }
478
479 @mysql_select_db($dbname,$db);
480
481 $SQL = sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`setting` = 'LIBRARY_LOCATION' LIMIT 1",
482 mysql_real_escape_string($library_location));
483 if (! @mysql_query($SQL, $db)) {
484 reportError("8", __("An error occured changing the library location.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
485 }
486
487 $SQL = sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`setting` = 'SERVER_KEY' LIMIT 1",
488 mysql_real_escape_string($server_key));
489 if (! @mysql_query($SQL, $db)) {
490 reportError("8", __("An error occured changing the server key.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
491 }
492
493 $SQL = sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`setting` = 'defaultTimezone' LIMIT 1",
494 mysql_real_escape_string(date_default_timezone_get()));
495 if (! @mysql_query($SQL, $db)) {
496 reportError("8", __("An error occured setting the default timezone.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
497 }
498
499 $SQL = sprintf("UPDATE `setting` SET `value` = '%s' WHERE `setting`.`setting` = 'PHONE_HOME' LIMIT 1",
500 mysql_real_escape_string($stats));
501 if (! @mysql_query($SQL, $db)) {
502 reportError("8", __("An error occured setting anonymous statistics.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
503 }
504 $SQL = "UPDATE `setting` SET `value` = '" . md5(uniqid(rand(), true)) . "' WHERE `setting`.`setting` = 'PHONE_HOME_KEY' LIMIT 1";
505 if (! @mysql_query($SQL, $db)) {
506 reportError("8", __("An error occured setting anonymous statistics.") . "<br /><br />" . __("MySQL Error:") . "<br />" . mysql_error());
507 }
508
509 @mysql_close($db);
510
511 ?>
512 <div class="info">
513 <p><?php echo __("Successfully set library location and server key."); ?></p>
514 </div>
515 <form action="install.php" method="POST">
516 <input type="hidden" name="xibo_step" value="10" />
517 <button type="submit"><?php echo __("Next"); ?> ></button>
518 </form>
519 <?php
520}
521elseif ($xibo_step == 10) {
522# Delete install.php
523# Redirect to login page.
524 if (! unlink('install.php')) {
525 reportError("10", __("Unable to delete install.php. Please ensure the webserver has permission to unlink this file and retry"), __("Retry")); // Fixme : translate "Retry" ?
526 }
527 if (! unlink('upgrade.php')) {
528 reportError("10", __("Unable to delete upgrade.php. Please ensure the webserver has permission to unlink this file and retry"), __("Retry")); // Fixme : translate "Retry" ?
529 }
530 ?>
531 <div class="info">
532 <p><b><?php echo __("Xibo was successfully installed."); ?></b></p>
533 <p><?php echo __("Please click"); ?>&nbsp;<a href="index.php"><?php echo __("here"); ?></a>&nbsp;<?php echo __("to logon to Xibo as \"xibo_admin\" with the password you chose earlier."); ?></p>
534 </div>
535 <?php
536}
537else {
538 reportError("0", __("A required parameter was missing. Please go through the installer sequentially!"), __("Start Again")); // Fixme : translate "Start Again" ?
539}
540
541include('install/footer.inc');
542
543# Functions
544function checkFsPermissions() {
545 # Check for appropriate filesystem permissions
546 return ((is_writable("install.php") && (is_writable("settings.php")) && (is_writable("upgrade.php")) || is_writable(".")));
547}
548
549function checkMySQL() {
550 # Check PHP has MySQL module installed
551 return extension_loaded("mysql");
552}
553
554function checkJson() {
555 # Check PHP has JSON module installed
556 return extension_loaded("json");
557}
558
559function checkGd() {
560 # Check PHP has JSON module installed
561 return extension_loaded("gd");
562}
563
564function checkCal() {
565 # Check PHP has JSON module installed
566 return extension_loaded("calendar");
567}
568
569function reportError($step, $message, $button_text="&lt; Back") { // fixme : translate ?
570?>
571 <div class="info">
572 <?php print $message; ?>
573 </div>
574 <form action="install.php" method="POST">
575 <input type="hidden" name="xibo_step" value="<?php print $step; ?>"/>
576 <button type="submit"><?php print $button_text; ?></button>
577 </form>
578 <?php
579 include('install/footer.inc');
580 die();
581}
582
583// Taken from http://forums.devshed.com/php-development-5/php-wont-load-sql-from-file-515902.html
584// By Crackster
585/**
586 * remove_remarks will strip the sql comment lines out of an uploaded sql file
587 */
588function remove_remarks($sql){
589 $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^[-].*$/m', "\n", $sql));
590 $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql));
591 return $sql;
592}
593
594// Taken from http://forums.devshed.com/php-development-5/php-wont-load-sql-from-file-515902.html
595// By Crackster
596/**
597 * split_sql_file will split an uploaded sql file into single sql statements.
598 * Note: expects trim() to have already been run on $sql.
599 */
600function split_sql_file($sql, $delimiter){
601 $sql = str_replace("\r" , '', $sql);
602 $data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql);
603 $data = array_map('trim', $data);
604 // The empty case
605 $end_data = end($data);
606 if (empty($end_data))
607 {
608 unset($data[key($data)]);
609 }
610 return $data;
611}
612
613/**
614 * This funtion will take a pattern and a folder as the argument and go thru it(recursivly if needed)and return the list of
615 * all files in that folder.
616 * Link : http://www.bin-co.com/php/scripts/filesystem/ls/
617 * License : BSD
618 * Arguments : $pattern - The pattern to look out for [OPTIONAL]
619 * $folder - The path of the directory of which's directory list you want [OPTIONAL]
620 * $recursivly - The funtion will traverse the folder tree recursivly if this is true. Defaults to false. [OPTIONAL]
621 * $options - An array of values 'return_files' or 'return_folders' or both
622 * Returns : A flat list with the path of all the files(no folders) that matches the condition given.
623 */
624function ls($pattern="*", $folder="", $recursivly=false, $options=array('return_files','return_folders')) {
625 if($folder) {
626 $current_folder = realpath('.');
627 if(in_array('quiet', $options)) { // If quiet is on, we will suppress the 'no such folder' error
628 if(!file_exists($folder)) return array();
629 }
630
631 if(!chdir($folder)) return array();
632 }
633
634
635 $get_files = in_array('return_files', $options);
636 $get_folders= in_array('return_folders', $options);
637 $both = array();
638 $folders = array();
639
640 // Get the all files and folders in the given directory.
641 if($get_files) $both = glob($pattern, GLOB_BRACE + GLOB_MARK);
642 if($recursivly or $get_folders) $folders = glob("*", GLOB_ONLYDIR + GLOB_MARK);
643
644 //If a pattern is specified, make sure even the folders match that pattern.
645 $matching_folders = array();
646 if($pattern !== '*') $matching_folders = glob($pattern, GLOB_ONLYDIR + GLOB_MARK);
647
648 //Get just the files by removing the folders from the list of all files.
649 $all = array_values(array_diff($both,$folders));
650
651 if($recursivly or $get_folders) {
652 foreach ($folders as $this_folder) {
653 if($get_folders) {
654 //If a pattern is specified, make sure even the folders match that pattern.
655 if($pattern !== '*') {
656 if(in_array($this_folder, $matching_folders)) array_push($all, $this_folder);
657 }
658 else array_push($all, $this_folder);
659 }
660
661 if($recursivly) {
662 // Continue calling this function for all the folders
663 $deep_items = ls($pattern, $this_folder, $recursivly, $options); # :RECURSION:
664 foreach ($deep_items as $item) {
665 array_push($all, $this_folder . $item);
666 }
667 }
668 }
669 }
670
671 if($folder) chdir($current_folder);
672 return $all;
673}
674
675function gen_secret() {
676 # Generates a random 12 character alphanumeric string to use as a salt
677 mt_srand((double)microtime()*1000000);
678 $key = "";
679 for ($i=0; $i < 12; $i++) {
680 $c = mt_rand(0,2);
681 if ($c == 0) {
682 $key .= chr(mt_rand(65,90));
683 }
684 elseif ($c == 1) {
685 $key .= chr(mt_rand(97,122));
686 }
687 else {
688 $key .= chr(mt_rand(48,57));
689 }
690 }
691
692 return $key;
693}
694
695function CheckGettext()
696{
697 return extension_loaded("gettext");
698}
699
700// Setup the translations for gettext
701function __($string)
702{
703 if (CheckGettext())
704 {
705 return _($string);
706 }
707 else
708 {
709 return $string;
710 }
711}
712
713function settings_strings() {
714global $settings_header;
715global $settings_footer;
716
717 $settings_header = <<<END
718<?php
719
720/*
721 * Xibo - Digital Signage - http://www.xibo.org.uk
722 *
723 * This file is part of Xibo - and is automatically generated by the installer
724 *
725 * You should not need to edit this file, unless your SQL connection details have changed.
726 */
727
728defined('XIBO') or die(__("Sorry, you are not allowed to directly access this page.") . "<br />" . __("Please press the back button in your browser."));
729
730global \$dbhost;
731global \$dbuser;
732global \$dbpass;
733global \$dbname;
734
735
736END;
737
738$settings_footer = <<<END
739?>
740END;
741
742 return;
743}
744?>142?>
745143
=== added file 'server/install/database/80.sql'
--- server/install/database/80.sql 1970-01-01 00:00:00 +0000
+++ server/install/database/80.sql 2014-09-19 11:39:09 +0000
@@ -0,0 +1,178 @@
1
2ALTER TABLE `module` ADD `render_as` VARCHAR( 10 ) NULL;
3ALTER TABLE `module` ADD `settings` TEXT NULL;
4
5UPDATE `resolution` SET enabled = 0;
6
7ALTER TABLE `resolution` ADD `version` TINYINT NOT NULL DEFAULT '1';
8ALTER TABLE `resolution` ADD `enabled` TINYINT NOT NULL DEFAULT '1';
9ALTER TABLE `resolution` CHANGE `resolution` `resolution` VARCHAR( 254 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
10
11INSERT INTO `resolution` (`resolutionID`, `resolution`, `width`, `height`, `intended_width`, `intended_height`, `version`, `enabled`) VALUES
12(9, '1080p HD Landscape', 800, 450, 1920, 1080, 2, 1),
13(10, '720p HD Landscape', 800, 450, 1280, 720, 2, 1),
14(11, '1080p HD Portrait', 450, 800, 1080, 1920, 2, 1),
15(12, '720p HD Portrait', 450, 800, 720, 1280, 2, 1),
16(13, '4k', 800, 450, 4096, 2304, 2, 1),
17(14, 'Common PC Monitor 4:3', 800, 600, 1024, 768, 2, 1);
18
19DELETE FROM `lktemplategroup` WHERE TemplateID IN (SELECT TemplateID FROM `template` WHERE isSystem = 1);
20DELETE FROM `template` WHERE isSystem = 1;
21
22ALTER TABLE `template` DROP `isSystem`;
23
24ALTER TABLE `display` ADD `displayprofileid` INT NULL;
25
26INSERT INTO `pages` (`name`, `pagegroupID`)
27SELECT 'displayprofile', pagegroupID FROM `pagegroup` WHERE pagegroup.pagegroup = 'Displays';
28
29INSERT INTO `menuitem` (MenuID, PageID, Args, Text, Class, Img, Sequence, External)
30SELECT 7, PageID, NULL, 'Display Settings', NULL, NULL, 4, 0
31 FROM `pages`
32 WHERE name = 'displayprofile';
33
34CREATE TABLE IF NOT EXISTS `displayprofile` (
35 `displayprofileid` int(11) NOT NULL AUTO_INCREMENT,
36 `name` varchar(50) NOT NULL,
37 `type` varchar(15) NOT NULL,
38 `config` text NOT NULL,
39 `isdefault` int(11) NOT NULL,
40 `userid` int(11) NOT NULL,
41 PRIMARY KEY (`displayprofileid`)
42) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
43
44UPDATE layout SET background = SUBSTRING_INDEX(background, '.', 1) WHERE IFNULL(background, '') <> '';
45ALTER TABLE `layout` CHANGE `background` `backgroundImageId` INT( 11 ) NULL DEFAULT NULL;
46
47INSERT INTO `lklayoutmedia` (mediaid, layoutid, regionid)
48SELECT backgroundimageid, layoutid, 'background' FROM `layout` WHERE IFNULL(backgroundImageId, 0) <> 0;
49
50ALTER TABLE `setting` CHANGE `type` `fieldType` VARCHAR( 24 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
51
52ALTER TABLE `setting` ADD `title` VARCHAR( 254 ) NOT NULL ,
53ADD `type` VARCHAR( 50 ) NOT NULL,
54ADD `validation` VARCHAR( 50 ) NOT NULL ,
55ADD `ordering` INT NOT NULL,
56ADD `default` VARCHAR( 1000 ) NOT NULL,
57ADD `userSee` TINYINT NOT NULL DEFAULT '1';
58
59UPDATE `setting` SET type = fieldType;
60
61DELETE FROM `setting` WHERE setting IN ('BASE_URL', 'adminMessage', 'ppt_width', 'ppt_height');
62
63UPDATE `setting` SET cat = 'configuration', ordering = 10, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'LIBRARY_LOCATION';
64UPDATE `setting` SET cat = 'configuration', ordering = 20, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'SERVER_KEY';
65UPDATE `setting` SET cat = 'configuration', ordering = 30, usersee = '1', userchange = '1', `default` = 'default' WHERE setting = 'GLOBAL_THEME_NAME';
66UPDATE `setting` SET cat = 'content', ordering = 10, usersee = '1', userchange = '1', `default` = '10' WHERE setting = 'ppt_length';
67UPDATE `setting` SET cat = 'content', ordering = 20, usersee = '1', userchange = '1', `default` = '10' WHERE setting = 'swf_length';
68UPDATE `setting` SET cat = 'content', ordering = 30, usersee = '1', userchange = '1', `default` = '10' WHERE setting = 'jpg_length';
69UPDATE `setting` SET cat = 'defaults', ordering = 10, usersee = '1', userchange = '1', `default` = 'Unchecked' WHERE setting = 'LIBRARY_MEDIA_UPDATEINALL_CHECKB';
70UPDATE `setting` SET cat = 'defaults', ordering = 20, usersee = '1', userchange = '1', `default` = 'Unchecked' WHERE setting = 'LAYOUT_COPY_MEDIA_CHECKB';
71UPDATE `setting` SET cat = 'defaults', ordering = 30, usersee = '0', userchange = '0', `default` = 'Unchecked' WHERE setting = 'MODULE_CONFIG_LOCKED_CHECKB';
72UPDATE `setting` SET cat = 'defaults', ordering = 40, usersee = '1', userchange = '0', `default` = 'Unchecked' WHERE setting = 'TRANSITION_CONFIG_LOCKED_CHECKB';
73UPDATE `setting` SET cat = 'displays', ordering = 10, usersee = '1', userchange = '1', `default` = '51.504' WHERE setting = 'DEFAULT_LAT';
74UPDATE `setting` SET cat = 'displays', ordering = 20, usersee = '1', userchange = '1', `default` = '-0.104' WHERE setting = 'DEFAULT_LONG';
75UPDATE `setting` SET cat = 'displays', ordering = 30, usersee = '1', userchange = '1', `default` = '0' WHERE setting = 'SHOW_DISPLAY_AS_VNCLINK';
76UPDATE `setting` SET cat = 'displays', ordering = 40, usersee = '1', userchange = '1', `default` = '_top' WHERE setting = 'SHOW_DISPLAY_AS_VNC_TGT';
77UPDATE `setting` SET cat = 'displays', ordering = 50, usersee = '0', userchange = '0', `default` = '0' WHERE setting = 'MAX_LICENSED_DISPLAYS';
78UPDATE `setting` SET cat = 'general', ordering = 10, usersee = '1', userchange = '1', `default` = 'On' WHERE setting = 'PHONE_HOME';
79UPDATE `setting` SET cat = 'general', ordering = 20, usersee = '0', userchange = '0', `default` = '' WHERE setting = 'PHONE_HOME_KEY';
80UPDATE `setting` SET cat = 'general', ordering = 30, usersee = '0', userchange = '0', `default` = '0' WHERE setting = 'PHONE_HOME_DATE';
81UPDATE `setting` SET cat = 'general', ordering = 40, usersee = '1', userchange = '0', `default` = 'On' WHERE setting = 'SCHEDULE_LOOKAHEAD';
82UPDATE `setting` SET cat = 'general', ordering = 50, usersee = '1', userchange = '1', `default` = '172800' WHERE setting = 'REQUIRED_FILES_LOOKAHEAD';
83UPDATE `setting` SET cat = 'general', ordering = 60, usersee = '1', userchange = '1', `default` = 'Off' WHERE setting = 'SENDFILE_MODE';
84UPDATE `setting` SET cat = 'general', ordering = 70, usersee = '1', userchange = '0', `default` = '' WHERE setting = 'EMBEDDED_STATUS_WIDGET';
85UPDATE `setting` SET cat = 'general', ordering = 80, usersee = '1', userchange = '1', `default` = '1' WHERE setting = 'SETTING_IMPORT_ENABLED';
86UPDATE `setting` SET cat = 'general', ordering = 90, usersee = '1', userchange = '1', `default` = '1' WHERE setting = 'SETTING_LIBRARY_TIDY_ENABLED';
87UPDATE `setting` SET cat = 'general', ordering = 10, usersee = '1', userchange = '1', `default` = 'http://www.xibo.org.uk/manual/' WHERE setting = 'HELP_BASE';
88UPDATE `setting` SET cat = 'maintenance', ordering = 10, usersee = '1', userchange = '1', `default` = 'Off' WHERE setting = 'MAINTENANCE_ENABLED';
89UPDATE `setting` SET cat = 'maintenance', ordering = 20, usersee = '1', userchange = '1', `default` = 'On' WHERE setting = 'MAINTENANCE_EMAIL_ALERTS';
90UPDATE `setting` SET cat = 'maintenance', ordering = 30, usersee = '1', userchange = '1', `default` = 'mail@yoursite.com' WHERE setting = 'mail_to';
91UPDATE `setting` SET cat = 'maintenance', ordering = 40, usersee = '1', userchange = '1', `default` = 'mail@yoursite.com' WHERE setting = 'mail_from';
92UPDATE `setting` SET cat = 'maintenance', ordering = 50, usersee = '1', userchange = '1', `default` = 'changeme' WHERE setting = 'MAINTENANCE_KEY';
93UPDATE `setting` SET cat = 'maintenance', ordering = 60, usersee = '1', userchange = '1', `default` = '30' WHERE setting = 'MAINTENANCE_LOG_MAXAGE';
94UPDATE `setting` SET cat = 'maintenance', ordering = 70, usersee = '1', userchange = '1', `default` = '30' WHERE setting = 'MAINTENANCE_STAT_MAXAGE';
95UPDATE `setting` SET cat = 'maintenance', ordering = 80, usersee = '1', userchange = '1', `default` = '12' WHERE setting = 'MAINTENANCE_ALERT_TOUT';
96UPDATE `setting` SET cat = 'maintenance', ordering = 80, usersee = '1', userchange = '1', `default` = 'Off' WHERE setting = 'MAINTENANCE_ALWAYS_ALERT';
97UPDATE `setting` SET cat = 'network', ordering = 10, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'PROXY_HOST';
98UPDATE `setting` SET cat = 'network', ordering = 20, usersee = '1', userchange = '1', `default` = '0' WHERE setting = 'PROXY_PORT';
99UPDATE `setting` SET cat = 'network', ordering = 30, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'PROXY_AUTH';
100UPDATE `setting` SET cat = 'network', ordering = 40, usersee = '1', userchange = '0', `default` = '0' WHERE setting = 'MONTHLY_XMDS_TRANSFER_LIMIT_KB';
101UPDATE `setting` SET cat = 'network', ordering = 50, usersee = '1', userchange = '0', `default` = '0' WHERE setting = 'LIBRARY_SIZE_LIMIT_KB';
102UPDATE `setting` SET cat = 'network', ordering = 60, usersee = '0', userchange = '0', `default` = 'http://www.xibo.org.uk/stats/track.php' WHERE setting = 'PHONE_HOME_URL';
103UPDATE `setting` SET cat = 'permissions', ordering = 10, usersee = '1', userchange = '1', `default` = 'private' WHERE setting = 'LAYOUT_DEFAULT';
104UPDATE `setting` SET cat = 'permissions', ordering = 20, usersee = '1', userchange = '1', `default` = 'private' WHERE setting = 'MEDIA_DEFAULT';
105UPDATE `setting` SET cat = 'permissions', ordering = 30, usersee = '1', userchange = '1', `default` = 'Media Colouring' WHERE setting = 'REGION_OPTIONS_COLOURING';
106UPDATE `setting` SET cat = 'permissions', ordering = 40, usersee = '1', userchange = '1', `default` = 'No' WHERE setting = 'SCHEDULE_WITH_VIEW_PERMISSION';
107UPDATE `setting` SET cat = 'regional', ordering = 10, usersee = '1', userchange = '1', `default` = 'en_GB' WHERE setting = 'DEFAULT_LANGUAGE';
108UPDATE `setting` SET cat = 'regional', ordering = 20, usersee = '1', userchange = '1', `default` = 'Europe/London' WHERE setting = 'defaultTimezone';
109UPDATE `setting` SET cat = 'troubleshooting', ordering = 10, usersee = '1', userchange = '1', `default` = 'Off' WHERE setting = 'debug';
110UPDATE `setting` SET cat = 'troubleshooting', ordering = 20, usersee = '1', userchange = '1', `default` = 'Off' WHERE setting = 'audit';
111UPDATE `setting` SET cat = 'troubleshooting', ordering = 30, usersee = '1', userchange = '1', `default` = 'Production' WHERE setting = 'SERVER_MODE';
112UPDATE `setting` SET cat = 'users', ordering = 0, usersee = '0', userchange = '0', `default` = 'module_user_general.php' WHERE setting = 'userModule';
113UPDATE `setting` SET cat = 'users', ordering = 10, usersee = '1', userchange = '1', `default` = 'User' WHERE setting = 'defaultUsertype';
114UPDATE `setting` SET cat = 'users', ordering = 20, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'USER_PASSWORD_POLICY';
115UPDATE `setting` SET cat = 'users', ordering = 30, usersee = '1', userchange = '1', `default` = '' WHERE setting = 'USER_PASSWORD_ERROR';
116
117ALTER TABLE `schedule` ADD `DisplayOrder` INT NOT NULL DEFAULT '0';
118
119UPDATE `schedule` SET DisplayOrder = (SELECT MAX(DisplayOrder) FROM `schedule_detail` WHERE schedule_detail.eventid = schedule.eventid);
120
121ALTER TABLE `schedule_detail` DROP FOREIGN KEY `schedule_detail_ibfk_9` ;
122ALTER TABLE `schedule_detail` DROP `CampaignID`;
123ALTER TABLE `schedule_detail` DROP `is_priority`;
124ALTER TABLE `schedule_detail` DROP `DisplayOrder`;
125
126ALTER TABLE `user` ADD `newUserWizard` TINYINT NOT NULL DEFAULT '0';
127
128CREATE TABLE IF NOT EXISTS `xmdsnonce` (
129 `nonceId` bigint(20) NOT NULL AUTO_INCREMENT,
130 `nonce` varchar(100) NOT NULL,
131 `expiry` int(11) NOT NULL,
132 `lastUsed` int(11) DEFAULT NULL,
133 `displayId` int(11) NOT NULL,
134 `fileId` int(11) DEFAULT NULL,
135 `size` bigint(20) DEFAULT NULL,
136 `storedAs` varchar(100) DEFAULT NULL,
137 `layoutId` int(11) DEFAULT NULL,
138 `regionId` varchar(100) DEFAULT NULL,
139 `mediaId` varchar(100) DEFAULT NULL,
140 PRIMARY KEY (`nonceId`)
141) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
142
143ALTER TABLE `schedule` CHANGE `recurrence_type` `recurrence_type` ENUM( 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
144
145ALTER TABLE `display` CHANGE `client_version` `client_version` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
146
147ALTER TABLE `display` ADD `currentLayoutId` INT NULL;
148
149CREATE TABLE IF NOT EXISTS `bandwidthtype` (
150 `bandwidthtypeid` int(11) NOT NULL AUTO_INCREMENT,
151 `name` varchar(25) NOT NULL,
152 PRIMARY KEY (`bandwidthtypeid`)
153) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
154
155INSERT INTO `bandwidthtype` (`bandwidthtypeid`, `name`) VALUES
156(1, 'Register'),
157(2, 'Required Files'),
158(3, 'Schedule'),
159(4, 'Get File'),
160(5, 'Get Resource'),
161(6, 'Media Inventory'),
162(7, 'Notify Status'),
163(8, 'Submit Stats'),
164(9, 'Submit Log'),
165(10, 'Blacklist'),
166(11, 'Screen Shot');
167
168ALTER TABLE `display` ADD `screenShotRequested` TINYINT NOT NULL DEFAULT '0';
169
170INSERT INTO `help` (`Topic`, `Category`, `Link`) VALUES
171('Displayprofile', 'General', 'manual/single.php?p=admin/displayprofiles'),
172('DisplayProfile', 'Edit', 'manual/single.php?p=admin/displayprofiles#edit'),
173('DisplayProfile', 'Delete', 'manual/single.php?p=admin/displayprofiles#delete');
174
175
176UPDATE `version` SET `app_ver` = '1.7.0-alpha', `XmdsVersion` = 4;
177UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
178UPDATE `version` SET `DBVersion` = '80';
0179
=== removed file 'server/install/dot_amber.gif'
1Binary files server/install/dot_amber.gif 2010-10-03 16:14:21 +0000 and server/install/dot_amber.gif 1970-01-01 00:00:00 +0000 differ180Binary files server/install/dot_amber.gif 2010-10-03 16:14:21 +0000 and server/install/dot_amber.gif 1970-01-01 00:00:00 +0000 differ
=== removed file 'server/install/dot_green.gif'
2Binary files server/install/dot_green.gif 2010-10-03 16:14:21 +0000 and server/install/dot_green.gif 1970-01-01 00:00:00 +0000 differ181Binary files server/install/dot_green.gif 2010-10-03 16:14:21 +0000 and server/install/dot_green.gif 1970-01-01 00:00:00 +0000 differ
=== removed file 'server/install/dot_red.gif'
3Binary files server/install/dot_red.gif 2010-10-03 16:14:21 +0000 and server/install/dot_red.gif 1970-01-01 00:00:00 +0000 differ182Binary files server/install/dot_red.gif 2010-10-03 16:14:21 +0000 and server/install/dot_red.gif 1970-01-01 00:00:00 +0000 differ
=== removed file 'server/install/header_upgrade.inc'
--- server/install/header_upgrade.inc 2014-01-18 09:47:41 +0000
+++ server/install/header_upgrade.inc 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
1<?php
2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2006-2013 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?><!DOCTYPE html>
23<html lang="en">
24 <head>
25 <title>Xibo Admin - Upgrade</title>
26 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
27 <meta name="viewport" content="width=device-width, initial-scale=1.0">
28 <link rel="stylesheet" type="text/css" href="install/install.css" />
29 <link rel="shortcut icon" href="theme/default/img/favicon.ico" />
30 <link href="theme/default/libraries/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
31 <link href="theme/default/libraries/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
32
33 <script type="text/javascript">
34 $(document).ready(function(){
35
36 document.getElementById('username').focus();
37
38 });
39 </script>
40 </head>
41
42 <body>
43
44 <!-- Copyright 2006-2013 Daniel Garner. Part of the Xibo Open Source Digital Signage Solution. Released under the AGPLv3 or later. -->
45 <div class="container">
46 <div class="form-signin text-center">
47 <div class="row">
48 <h1>Xibo Upgrade</h1>
49 </div>
50 <div class="row">
510
=== modified file 'server/install/master/data.sql'
--- server/install/master/data.sql 2014-07-15 15:35:22 +0000
+++ server/install/master/data.sql 2014-09-19 11:39:09 +0000
@@ -1,5 +1,5 @@
1INSERT INTO `version` (`app_ver`, `XmdsVersion`, `XlfVersion`, `DBVersion`) VALUES1INSERT INTO `version` (`app_ver`, `XmdsVersion`, `XlfVersion`, `DBVersion`) VALUES
2('1.6.2', 3, 1, 70);2('1.7.0-alpha', 4, 1, 80);
33
4INSERT INTO `group` (`groupID`, `group`, `IsUserSpecific`, `IsEveryone`) VALUES4INSERT INTO `group` (`groupID`, `group`, `IsUserSpecific`, `IsEveryone`) VALUES
5(1, 'Users', 0, 0),5(1, 'Users', 0, 0),
@@ -84,7 +84,10 @@
84(78, 'User', 'SetPassword', 'manual/single.php?p=users/users#Set_Password'),84(78, 'User', 'SetPassword', 'manual/single.php?p=users/users#Set_Password'),
85(79, 'DataSet', 'ImportCSV', 'manual/single.php?p=content/content_dataset#Import_CSV'),85(79, 'DataSet', 'ImportCSV', 'manual/single.php?p=content/content_dataset#Import_CSV'),
86(80, 'DisplayGroup', 'FileAssociations', 'manual/single.php?p=admin/fileassociations'),86(80, 'DisplayGroup', 'FileAssociations', 'manual/single.php?p=admin/fileassociations'),
87(81, 'Statusdashboard', 'General', 'manual/single.php?p=coreconcepts/dashboard#Status_Dashboard');87(81, 'Statusdashboard', 'General', 'manual/single.php?p=coreconcepts/dashboard#Status_Dashboard'),
88(82, 'Displayprofile', 'General', 'manual/single.php?p=admin/displayprofiles'),
89(83, 'DisplayProfile', 'Edit', 'manual/single.php?p=admin/displayprofiles#edit'),
90(84, 'DisplayProfile', 'Delete', 'manual/single.php?p=admin/displayprofiles#delete');
8891
89INSERT INTO `menu` (`MenuID`, `Menu`) VALUES92INSERT INTO `menu` (`MenuID`, `Menu`) VALUES
90(8, 'Administration Menu'),93(8, 'Administration Menu'),
@@ -108,8 +111,9 @@
108(10, 'Counter', 'Counter', 0, 1, 'Customer Counter connected to a Remote Control', 'forms/counter.gif', 1, NULL, 1, 1),111(10, 'Counter', 'Counter', 0, 1, 'Customer Counter connected to a Remote Control', 'forms/counter.gif', 1, NULL, 1, 1),
109(11, 'datasetview', 'Data Set', 1, 1, 'A view on a DataSet', 'forms/datasetview.gif', 1, NULL, 1, 1),112(11, 'datasetview', 'Data Set', 1, 1, 'A view on a DataSet', 'forms/datasetview.gif', 1, NULL, 1, 1),
110(12, 'shellcommand', 'Shell Command', 1, 1, 'Execute a shell command on the client', 'forms/shellcommand.gif', 1, NULL, 1, 1),113(12, 'shellcommand', 'Shell Command', 1, 1, 'Execute a shell command on the client', 'forms/shellcommand.gif', 1, NULL, 1, 1),
111(13, 'localvideo', 'Local Video', 0, 1, 'Play a video locally stored on the client', 'forms/video.gif', 1, NULL, 1, 1),114(13, 'localvideo', 'Local Video', 1, 1, 'Play a video locally stored on the client', 'forms/video.gif', 1, NULL, 1, 1),
112(14, 'genericfile', 'Generic File', 1, 0, 'A generic file to be stored in the library', 'forms/library.gif', 1, 'apk,js,html,htm', 0, 0);115(14, 'genericfile', 'Generic File', 1, 0, 'A generic file to be stored in the library', 'forms/library.gif', 1, 'apk,js,html,htm', 0, 0),
116(15, 'clock', 'Clock', 1, 1, 'Display a Clock', 'forms/library.gif', 1, '', 1, 1, 'html', '[]');
113117
114INSERT INTO `pagegroup` (`pagegroupID`, `pagegroup`) VALUES118INSERT INTO `pagegroup` (`pagegroupID`, `pagegroup`) VALUES
115(1, 'Schedule'),119(1, 'Schedule'),
@@ -157,7 +161,8 @@
157(39, 'timeline', 3),161(39, 'timeline', 3),
158(40, 'sessions', 9),162(40, 'sessions', 9),
159(41, 'preview', 3),163(41, 'preview', 3),
160(42, 'statusdashboard', 2);164(42, 'statusdashboard', 2),
165(43, 'displayprofile', 7);
161166
162INSERT INTO `menuitem` (`MenuItemID`, `MenuID`, `PageID`, `Args`, `Text`, `Class`, `Img`, `Sequence`, `External`) VALUES167INSERT INTO `menuitem` (`MenuItemID`, `MenuID`, `PageID`, `Args`, `Text`, `Class`, `Img`, `Sequence`, `External`) VALUES
163(1, 1, 2, NULL, 'Schedule', NULL, NULL, 1, 0),168(1, 1, 2, NULL, 'Schedule', NULL, NULL, 1, 0),
@@ -193,77 +198,72 @@
193(36, 8, 24, NULL, 'Modules', NULL, NULL, 5, 0),198(36, 8, 24, NULL, 'Modules', NULL, NULL, 5, 0),
194(37, 6, 37, NULL, 'Campaigns', NULL, NULL, 1, 0),199(37, 6, 37, NULL, 'Campaigns', NULL, NULL, 1, 0),
195(38, 8, 38, NULL, 'Transitions', NULL, NULL, 6, 0),200(38, 8, 38, NULL, 'Transitions', NULL, NULL, 6, 0),
196(39, 9, 30, NULL, 'Help Links', NULL, NULL, 6, 0);201(39, 9, 30, NULL, 'Help Links', NULL, NULL, 6, 0),
197202(40, 7, 43, NULL, 'Display Settings', NULL, NULL, 4, 0);
198203
199INSERT INTO `resolution` (`resolutionID`, `resolution`, `width`, `height`, `intended_width`, `intended_height`) VALUES204
200(1, '4:3 Monitor', 800, 600, 1024, 768),205INSERT INTO `resolution` (`resolutionID`, `resolution`, `width`, `height`, `intended_width`, `intended_height`, `version`, `enabled`) VALUES
201(2, '3:2 Tv', 720, 480, 1440, 960),206(9, '1080p HD Landscape', 800, 450, 1920, 1080, 2, 1),
202(3, '16:10 Widescreen Mon', 800, 500, 1680, 1050),207(10, '720p HD Landscape', 800, 450, 1280, 720, 2, 1),
203(4, '16:9 HD Widescreen', 800, 450, 1920, 1080),208(11, '1080p HD Portrait', 450, 800, 1080, 1920, 2, 1),
204(5, '3:4 Monitor', 600, 800, 768, 1024),209(12, '720p HD Portrait', 450, 800, 720, 1280, 2, 1),
205(6, '2:3 Tv', 480, 720, 960, 1440),210(13, '4k', 800, 450, 4096, 2304, 2, 1),
206(7, '10:16 Widescreen', 500, 800, 1050, 1680),211(14, 'Common PC Monitor 4:3', 800, 600, 1024, 768, 2, 1);
207(8, '9:16 HD Widescreen', 450, 800, 1080, 1920);212
208213INSERT INTO `setting` (`settingid`, `setting`, `value`, `fieldType`, `helptext`, `options`, `cat`, `userChange`, `title`, `validation`, `ordering`, `default`, `userSee`, `type`) VALUES
209INSERT INTO `setting` (`settingid`, `setting`, `value`, `type`, `helptext`, `options`, `cat`, `userChange`) VALUES214(1, 'MEDIA_DEFAULT', 'private', 'dropdown', 'Media will be created with these settings. If public everyone will be able to view and use this media.', 'private|public', 'permissions', 1, 'Media Permissions', '', 20, 'private', 1, 'word'),
210(1, 'MEDIA_DEFAULT', 'private', 'dropdown', 'Media will be created with these settings. If public everyone will be able to view and use this media.', 'private|public', 'default', 1),215(2, 'LAYOUT_DEFAULT', 'private', 'dropdown', 'New layouts will be created with these settings. If public everyone will be able to view and use this layout.', 'private|public', 'permissions', 1, 'Layout Permissions', '', 10, 'private', 1, 'word'),
211(2, 'LAYOUT_DEFAULT', 'private', 'dropdown', 'New layouts will be created with these settings. If public everyone will be able to view and use this layout.', 'private|public', 'default', 1),216(3, 'defaultUsertype', 'User', 'dropdown', 'Sets the default user type selected when creating a user.\r\n<br />\r\nWe recommend that this is set to "User"', 'User|Group Admin|Super Admin', 'users', 1, 'Default User Type', '', 10, 'User', 1, 'string'),
212(3, 'defaultUsertype', 'user', 'dropdown', 'Sets the default user type selected when creating a user.\r\n<br />\r\nWe recommend that this is set to "User"', 'User|Group Admin|Super Admin', 'default', 1),217(5, 'debug', 'Off', 'dropdown', 'Sets whether debug information is recorded when an error occurs.\r\n<br />\r\nThis should be set to "off" to ensure smaller log sizes', 'On|Off', 'troubleshooting', 1, 'Enable Debugging?', '', 10, 'Off', 1, 'word'),
213(5, 'debug', 'Off', 'dropdown', 'Sets whether debug information is recorded when an error occurs.\r\n<br />\r\nThis should be set to "off" to ensure smaller log sizes', 'On|Off', 'error', 1),218(7, 'userModule', 'module_user_general.php', 'dirselect', 'This sets which user authentication module is currently being used.', NULL, 'users', 0, 'User Module', '', 0, 'module_user_general.php', 0, 'string'),
214(7, 'userModule', 'module_user_general.php', 'dirselect', 'This sets which user authentication module is currently being used.', NULL, 'user', 0),219(11, 'defaultTimezone', 'Europe/London', 'timezone', 'Set the default timezone for the application', 'Europe/London', 'regional', 1, 'Timezone', '', 20, 'Europe/London', 1, 'string'),
215(10, 'adminMessage', '', 'text', 'Sets the admin message to be displayed on the client page at all times', NULL, 'general', 0),220(18, 'mail_to', 'mail@yoursite.com', 'email', 'Errors will be mailed here', NULL, 'maintenance', 1, 'Admin email address', '', 30, 'mail@yoursite.com', 1, 'string'),
216(11, 'defaultTimezone', 'UTC', 'timezone', 'Set the default timezone for the application', 'Europe/London', 'default', 1),221(19, 'mail_from', 'mail@yoursite.com', 'email', 'Mail will be sent from this address', NULL, 'maintenance', 1, 'Sending email address', '', 40, 'mail@yoursite.com', 1, 'string'),
217(18, 'mail_to', 'admin@yoursite.com', 'text', 'Errors will be mailed here', NULL, 'maintenance', 1),222(23, 'jpg_length', '10', 'number', 'Default length for JPG files (in seconds)', NULL, 'content', 1, 'Default Image Duration', '', 30, '10', 1, 'int'),
218(19, 'mail_from', 'mail@yoursite.com', 'text', 'Mail will be sent from this address', NULL, 'maintenance', 1),223(26, 'ppt_length', '10', 'number', 'Default length for PPT files (in seconds)', NULL, 'content', 1, 'Default PowerPoint Duration', '', 10, '10', 1, 'int'),
219(20, 'BASE_URL', 'http://localhost/xibo/', 'text', 'This is the fully qualified URI of the site. e.g http://www.xibo.co.uk/', NULL, 'general', 0),224(29, 'swf_length', '10', 'number', 'Default length for SWF files', NULL, 'content', 1, 'Default Flash Duration', '', 20, '10', 1, 'int'),
220(23, 'jpg_length', '10', 'text', 'Default length for JPG files (in seconds)', NULL, 'content', 1),225(30, 'audit', 'Off', 'dropdown', 'Turn on the auditing information. Warning this will quickly fill up the log', 'On|Off', 'troubleshooting', 1, 'Enable Auditing?', '', 20, 'Off', 1, 'word'),
221(24, 'ppt_width', '1024', 'text', 'Default length for PPT files', NULL, 'content', 0),226(33, 'LIBRARY_LOCATION', '', 'text', 'The fully qualified path to the CMS library location.', NULL, 'configuration', 1, 'Library Location', 'required', 10, '', 1, 'string'),
222(25, 'ppt_height', '768', 'text', 'Default height for PPT files', NULL, 'content', 0),227(34, 'SERVER_KEY', '', 'text', NULL, NULL, 'configuration', 1, 'CMS Secret Key', 'required', 20, '', 1, 'string'),
223(26, 'ppt_length', '120', 'text', 'Default length for PPT files (in seconds)', NULL, 'content', 1),228(35, 'HELP_BASE', 'http://www.xibo.org.uk/manual/', 'text', NULL, NULL, 'general', 1, 'Location of the Manual', 'required', 10, 'http://www.xibo.org.uk/manual/', 1, 'string'),
224(29, 'swf_length', '60', 'text', 'Default length for SWF files', NULL, 'content', 1),229(36, 'PHONE_HOME', 'On', 'dropdown', 'Should the server send anonymous statistics back to the Xibo project?', 'On|Off', 'general', 1, 'Allow usage tracking?', '', 10, 'On', 1, 'word'),
225(30, 'audit', 'Off', 'dropdown', 'Turn on the auditing information. Warning this will quickly fill up the log', 'On|Off', 'error', 1),230(37, 'PHONE_HOME_KEY', '', 'text', 'Key used to distinguish each Xibo instance. This is generated randomly based on the time you first installed Xibo, and is completely untraceable.', NULL, 'general', 0, 'Phone home key', '', 20, '', 0, 'string'),
226(33, 'LIBRARY_LOCATION', 'C:\\Users\\dan\\Documents\\Xibo\\release140/', 'text', NULL, NULL, 'path', 1),231(38, 'PHONE_HOME_URL', 'http://www.xibo.org.uk/stats/track.php', 'text', 'The URL to connect to to PHONE_HOME (if enabled)', NULL, 'network', 0, 'Phone home URL', '', 60, 'http://www.xibo.org.uk/stats/track.php', 0, 'string'),
227(34, 'SERVER_KEY', 'xsm', 'text', NULL, NULL, 'general', 1),232(39, 'PHONE_HOME_DATE', '0', 'text', 'The last time we PHONED_HOME in seconds since the epoch', NULL, 'general', 0, 'Phone home time', '', 30, '0', 0, 'int'),
228(35, 'HELP_BASE', 'http://www.xibo.org.uk/manual/', 'text', NULL, NULL, 'path', 0),233(40, 'SERVER_MODE', 'Production', 'dropdown', 'This should only be set if you want to display the maximum allowed error messaging through the user interface. <br /> Useful for capturing critical php errors and environment issues.', 'Production|Test', 'troubleshooting', 1, 'Server Mode', '', 30, 'Production', 1, 'word'),
229(36, 'PHONE_HOME', 'Off', 'dropdown', 'Should the server send anonymous statistics back to the Xibo project?', 'On|Off', 'general', 1),234(41, 'MAINTENANCE_ENABLED', 'Off', 'dropdown', 'Allow the maintenance script to run if it is called?', 'Protected|On|Off', 'maintenance', 1, 'Enable Maintenance?', '', 10, 'Off', 1, 'word'),
230(37, 'PHONE_HOME_KEY', 'b904d63cc837b2af0b033bfcd781f364', 'text', 'Key used to distinguish each Xibo instance. This is generated randomly based on the time you first installed Xibo, and is completely untraceable.', NULL, 'general', 0),235(42, 'MAINTENANCE_EMAIL_ALERTS', 'On', 'dropdown', 'Global switch for email alerts to be sent', 'On|Off', 'maintenance', 1, 'Enable Email Alerts?', '', 20, 'On', 1, 'word'),
231(38, 'PHONE_HOME_URL', 'http://www.xibo.org.uk/stats/track.php', 'text', 'The URL to connect to to PHONE_HOME (if enabled)', NULL, 'path', 0),236(43, 'MAINTENANCE_KEY', 'changeme', 'text', 'String appended to the maintenance script to prevent malicious calls to the script.', NULL, 'maintenance', 1, 'Maintenance Key', '', 50, 'changeme', 1, 'string'),
232(39, 'PHONE_HOME_DATE', '0', 'text', 'The last time we PHONED_HOME in seconds since the epoch', NULL, 'general', 0),237(44, 'MAINTENANCE_LOG_MAXAGE', '30', 'number', 'Maximum age for log entries. Set to 0 to keep logs indefinitely.', NULL, 'maintenance', 1, 'Max Log Age', '', 60, '30', 1, 'int'),
233(40, 'SERVER_MODE', 'Production', 'dropdown', 'This should only be set if you want to display the maximum allowed error messaging through the user interface. <br /> Useful for capturing critical php errors and environment issues.', 'Production|Test', 'error', 1),238(45, 'MAINTENANCE_STAT_MAXAGE', '30', 'number', 'Maximum age for statistics entries. Set to 0 to keep statistics indefinitely.', NULL, 'maintenance', 1, 'Max Statistics Age', '', 70, '30', 1, 'int'),
234(41, 'MAINTENANCE_ENABLED', 'Off', 'dropdown', 'Allow the maintenance script to run if it is called?', 'Protected|On|Off', 'maintenance', 1),239(46, 'MAINTENANCE_ALERT_TOUT', '12', 'number', 'How long in minutes after the last time a client connects should we send an alert? Can be overridden on a per client basis.', NULL, 'maintenance', 1, 'Max Display Timeout', '', 80, '12', 1, 'int'),
235(42, 'MAINTENANCE_EMAIL_ALERTS', 'On', 'dropdown', 'Global switch for email alerts to be sent', 'On|Off', 'maintenance', 1),240(47, 'SHOW_DISPLAY_AS_VNCLINK', '0', 'checkbox', 'Turn the display name in display management into a VNC link using the IP address last collected. The %s is replaced with the IP address. Leave blank to disable.', NULL, 'displays', 1, 'Display a VNC Link?', '', 30, '0', 1, 'checkbox'),
236(43, 'MAINTENANCE_KEY', 'changeme', 'text', 'String appended to the maintenance script to prevent malicious calls to the script.', NULL, 'maintenance', 1),241(48, 'SHOW_DISPLAY_AS_VNC_TGT', '_top', 'text', 'If the display name is shown as a link in display management, what target should the link have? Set _top to open the link in the same window or _blank to open in a new window.', NULL, 'displays', 1, 'Open VNC Link in new window?', '', 40, '_top', 1, 'string'),
237(44, 'MAINTENANCE_LOG_MAXAGE', '30', 'text', 'Maximum age for log entries. Set to 0 to keep logs indefinitely.', NULL, 'maintenance', 1),242(49, 'MAINTENANCE_ALWAYS_ALERT', 'Off', 'dropdown', 'Should Xibo send an email if a display is in an error state every time the maintenance script runs?', 'On|Off', 'maintenance', 1, 'Send repeat Display Timeouts', '', 80, 'Off', 1, 'word'),
238(45, 'MAINTENANCE_STAT_MAXAGE', '30', 'text', 'Maximum age for statistics entries. Set to 0 to keep statistics indefinitely.', NULL, 'maintenance', 1),243(50, 'SCHEDULE_LOOKAHEAD', 'On', 'dropdown', 'Should Xibo send future schedule information to clients?', 'On|Off', 'general', 0, 'Send Schedule in advance?', '', 40, 'On', 1, 'word'),
239(46, 'MAINTENANCE_ALERT_TOUT', '12', 'text', 'How long in minutes after the last time a client connects should we send an alert? Can be overridden on a per client basis.', NULL, 'maintenance', 1),244(51, 'REQUIRED_FILES_LOOKAHEAD', '172800', 'number', 'How many seconds in to the future should the calls to RequiredFiles look?', NULL, 'general', 1, 'Send files in advance?', '', 50, '172800', 1, 'int'),
240(47, 'SHOW_DISPLAY_AS_VNCLINK', '', 'text', 'Turn the display name in display management into a VNC link using the IP address last collected. The %s is replaced with the IP address. Leave blank to disable.', NULL, 'general', 1),245(52, 'REGION_OPTIONS_COLOURING', 'Media Colouring', 'dropdown', NULL, 'Media Colouring|Permissions Colouring', 'permissions', 1, 'How to colour Media on the Region Timeline', '', 30, 'Media Colouring', 1, 'string'),
241(48, 'SHOW_DISPLAY_AS_VNC_TGT', '_top', 'text', 'If the display name is shown as a link in display management, what target should the link have? Set _top to open the link in the same window or _blank to open in a new window.', NULL, 'general', 1),246(53, 'LAYOUT_COPY_MEDIA_CHECKB', 'Unchecked', 'dropdown', 'Default the checkbox for making duplicates of media when copying layouts', 'Checked|Unchecked', 'defaults', 1, 'Default copy media when copying a layout?', '', 20, 'Unchecked', 1, 'word'),
242(49, 'MAINTENANCE_ALWAYS_ALERT', 'Off', 'dropdown', 'Should Xibo send an email if a display is in an error state every time the maintenance script runs?', 'On|Off', 'maintenance', 1),247(54, 'MAX_LICENSED_DISPLAYS', '0', 'number', 'The maximum number of licensed clients for this server installation. 0 = unlimited', NULL, 'displays', 0, 'Number of display slots', '', 50, '0', 0, 'int'),
243(50, 'SCHEDULE_LOOKAHEAD', 'On', 'dropdown', 'Should Xibo send future schedule information to clients?', 'On|Off', 'general', 0),248(55, 'LIBRARY_MEDIA_UPDATEINALL_CHECKB', 'Unchecked', 'dropdown', 'Default the checkbox for updating media on all layouts when editing in the library', 'Checked|Unchecked', 'defaults', 1, 'Default update media in all layouts', '', 10, 'Unchecked', 1, 'word'),
244(51, 'REQUIRED_FILES_LOOKAHEAD', '172800', 'text', 'How many seconds in to the future should the calls to RequiredFiles look?', NULL, 'general', 1),249(56, 'USER_PASSWORD_POLICY', '', 'text', 'Regular Expression for password complexity, leave blank for no policy.', '', 'users', 1, 'Password Policy Regular Expression', '', 20, '', 1, 'string'),
245(52, 'REGION_OPTIONS_COLOURING', 'Media Colouring', 'dropdown', NULL, 'Media Colouring|Permissions Colouring', 'permissions', 1),250(57, 'USER_PASSWORD_ERROR', '', 'text', 'A text description of this password policy. Will be show to users when their password does not meet the required policy', '', 'users', 1, 'Description of Password Policy', '', 30, '', 1, 'string'),
246(53, 'LAYOUT_COPY_MEDIA_CHECKB', 'Unchecked', 'dropdown', 'Default the checkbox for making duplicates of media when copying layouts', 'Checked|Unchecked', 'default', 1),251(58, 'MODULE_CONFIG_LOCKED_CHECKB', 'Unchecked', 'dropdown', 'Is the module config locked? Useful for Service providers.', 'Checked|Unchecked', 'defaults', 0, 'Lock Module Config', '', 30, 'Unchecked', 0, 'word'),
247(54, 'MAX_LICENSED_DISPLAYS', '0', 'text', 'The maximum number of licensed clients for this server installation. 0 = unlimited', NULL, 'general', 0),252(59, 'LIBRARY_SIZE_LIMIT_KB', '0', 'number', 'The Limit for the Library Size in KB', NULL, 'network', 0, 'Library Size Limit', '', 50, '0', 1, 'int'),
248(55, 'LIBRARY_MEDIA_UPDATEINALL_CHECKB', 'Unchecked', 'dropdown', 'Default the checkbox for updating media on all layouts when editing in the library', 'Checked|Unchecked', 'default', 1),253(60, 'MONTHLY_XMDS_TRANSFER_LIMIT_KB', '0', 'number', 'XMDS Transfer Limit in KB/month', NULL, 'network', 0, 'Monthly bandwidth Limit', '', 40, '0', 1, 'int'),
249(56, 'USER_PASSWORD_POLICY', '', 'text', 'Regular Expression for password complexity, leave blank for no policy.', '', 'permissions', 1),254(61, 'DEFAULT_LANGUAGE', 'en_GB', 'text', 'The default language to use', NULL, 'regional', 1, 'Default Language', '', 10, 'en_GB', 1, 'string'),
250(57, 'USER_PASSWORD_ERROR', '', 'text', 'A text description of this password policy. Will be show to users when their password does not meet the required policy', '', 'permissions', 1),255(62, 'TRANSITION_CONFIG_LOCKED_CHECKB', 'Unchecked', 'dropdown', 'Is the Transition config locked?', 'Checked|Unchecked', 'defaults', 0, 'Allow modifications to the transition configuration?', '', 40, 'Unchecked', 1, 'word'),
251(58, 'MODULE_CONFIG_LOCKED_CHECKB', 'Unchecked', 'dropdown', 'Is the module config locked? Useful for Service providers.', 'Checked|Unchecked', 'general', 0),256(63, 'GLOBAL_THEME_NAME', 'default', 'text', 'The Theme to apply to all pages by default', NULL, 'configuration', 1, 'CMS Theme', '', 30, 'default', 1, 'word'),
252(59, 'LIBRARY_SIZE_LIMIT_KB', '0', 'text', 'The Limit for the Library Size in KB', NULL, 'content', 0),257(64, 'DEFAULT_LAT', '51.504', 'number', 'The Latitude to apply for any Geo aware Previews', NULL, 'displays', 1, 'Default Latitude', '', 10, '51.504', 1, 'double'),
253(60, 'MONTHLY_XMDS_TRANSFER_LIMIT_KB', '0', 'text', 'XMDS Transfer Limit in KB/month', NULL, 'general', 0),258(65, 'DEFAULT_LONG', '-0.104', 'number', 'The Longitude to apply for any Geo aware Previews', NULL, 'displays', 1, 'Default Longitude', '', 20, '-0.104', 1, 'double'),
254(61, 'DEFAULT_LANGUAGE', 'en_GB', 'text', 'The default language to use', NULL, 'general', 1),259(66, 'SCHEDULE_WITH_VIEW_PERMISSION', 'No', 'dropdown', 'Should users with View permissions on displays be allowed to schedule to them?', 'Yes|No', 'permissions', 1, 'Schedule with view permissions?', '', 40, 'No', 1, 'word'),
255(62, 'TRANSITION_CONFIG_LOCKED_CHECKB', 'Unchecked', 'dropdown', 'Is the Transition config locked?', 'Checked|Unchecked', 'general', 0),260(67, 'SETTING_IMPORT_ENABLED', '1', 'checkbox', NULL, NULL, 'general', 1, 'Allow Import?', '', 80, '1', 1, 'checkbox'),
256(63, 'GLOBAL_THEME_NAME', 'default', 'text', 'The Theme to apply to all pages by default', NULL, 'general', 1),261(68, 'SETTING_LIBRARY_TIDY_ENABLED', '1', 'checkbox', NULL, NULL, 'general', 1, 'Enable Library Tidy?', '', 90, '1', 1, 'checkbox'),
257(64, 'DEFAULT_LAT', '51.504', 'text', 'The Latitude to apply for any Geo aware Previews', NULL, 'general', 1),262(69, 'SENDFILE_MODE', 'Off', 'dropdown', 'When a user downloads a file from the library or previews a layout, should we attempt to use Apache X-Sendfile, Nginx X-Accel, or PHP (Off) to return the file from the library?', 'Off|Apache|Nginx', 'general', 1, 'File download mode', '', 60, 'Off', 1, 'word'),
258(65, 'DEFAULT_LONG', '-0.104', 'text', 'The Longitude to apply for any Geo aware Previews', NULL, 'general', 1),263(70, 'EMBEDDED_STATUS_WIDGET', '', 'text', 'HTML to embed in an iframe on the Status Dashboard', NULL, 'general', 0, 'Status Dashboard Widget', '', 70, '', 1, 'htmlstring'),
259(66, 'SCHEDULE_WITH_VIEW_PERMISSION', 'No', 'dropdown', 'Should users with View permissions on displays be allowed to schedule to them?', 'Yes|No', 'permissions', '1'),264(71, 'PROXY_HOST', '', 'text', 'The Proxy URL', NULL, 'network', 1, 'Proxy URL', '', 10, '', 1, 'string'),
260(67, 'SETTING_IMPORT_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0'), 265(72, 'PROXY_PORT', '0', 'number', 'The Proxy Port', NULL, 'network', 1, 'Proxy Port', '', 20, '0', 1, 'int'),
261(68, 'SETTING_LIBRARY_TIDY_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0'),266(73, 'PROXY_AUTH', '', 'text', 'The Authentication information for this proxy. username:password', NULL, 'network', 1, 'Proxy Credentials', '', 30, '', 1, 'string');
262(69, 'SENDFILE_MODE', 'Off', 'dropdown', 'When a user downloads a file from the library or previews a layout, should we attempt to use Apache X-Sendfile, Nginx X-Accel, or PHP (Off) to return the file from the library?', 'Off|Apache|Nginx', 'general', '1'),
263(70, 'EMBEDDED_STATUS_WIDGET', '', 'text', 'HTML to embed in an iframe on the Status Dashboard' , NULL, 'general', '0'),
264(71, 'PROXY_HOST', '', 'text', 'The Proxy URL' , NULL, 'general', '1'),
265(72, 'PROXY_PORT', '', 'text', 'The Proxy Port' , NULL, 'general', '1'),
266(73, 'PROXY_AUTH', '', 'text', 'The Authentication information for this proxy. username:password' , NULL, 'general', '1');
267267
268INSERT INTO `usertype` (`usertypeid`, `usertype`) VALUES268INSERT INTO `usertype` (`usertypeid`, `usertype`) VALUES
269(1, 'Super Admin'),269(1, 'Super Admin'),
@@ -271,19 +271,10 @@
271(3, 'User');271(3, 'User');
272272
273INSERT INTO `user` (`UserID`, `usertypeid`, `UserName`, `UserPassword`, `loggedin`, `lastaccessed`, `email`, `homepage`, `Retired`) VALUES273INSERT INTO `user` (`UserID`, `usertypeid`, `UserName`, `UserPassword`, `loggedin`, `lastaccessed`, `email`, `homepage`, `Retired`) VALUES
274(1, 1, 'xibo_admin', '21232f297a57a5a743894a0e4a801fc3', 1, '2013-02-02 15:07:29', 'info@xibo.org.uk', 'statusdashboard', 0);274(1, 1, 'xibo_admin', '21232f297a57a5a743894a0e4a801fc3', 1, NOW(), '', 'statusdashboard', 0);
275275
276INSERT INTO `template` (`templateID`, `template`, `xml`, `userID`, `createdDT`, `modifiedDT`, `description`, `tags`, `thumbnail`, `isSystem`, `retired`) VALUES276
277(1, 'Full Screen 16:9', '<?xml version="1.0"?>\n<layout schemaVersion="1" width="800" height="450" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="450" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', 'fullscreen', NULL, 1, 0),277INSERT INTO `layout` (`layoutID`, `layout`, `xml`, `userID`, `createdDT`, `modifiedDT`, `description`, `tags`, `templateID`, `retired`, `duration`, `backgroundImageId`) VALUES
278(2, 'Full Screen 16:10', '<?xml version="1.0"?>\n<layout schemaVersion="1" width="800" height="500" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="500" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', 'fullscreen', NULL, 1, 0),
279(3, 'Full Screen 4:3', '<?xml version="1.0"?>\n<layout schemaVersion="1" width="800" height="600" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="600" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', 'fullscreen', NULL, 1, 0),
280(4, 'Full Screen 3:2', '<?xml version="1.0"?>\n<layout schemaVersion="1" width="720" height="480" bgcolor="#000000"><region id="47ff29524ce1b" width="720" height="480" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', 'fullscreen', NULL, 1, 0),
281(5, 'Portrait - 10:16', '<?xml version="1.0"?>\n<layout width="500" height="800" bgcolor="#000000" background="" schemaVersion="1"><region id="47ff2f524ae1b" width="500" height="800" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', '', NULL, 1, 0),
282(6, 'Portrait - 9:16', '<?xml version="1.0"?>\n<layout width="450" height="800" bgcolor="#000000" background="" schemaVersion="1"><region id="47ff2f524be1b" width="450" height="800" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', '', NULL, 1, 0),
283(7, 'Portrait - 3:4', '<?xml version="1.0"?>\n<layout width="600" height="800" bgcolor="#000000" background="" schemaVersion="1"><region id="47ff2f524ce1b" width="600" height="800" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', '', NULL, 1, 0),
284(8, 'Portrait - 2:3', '<?xml version="1.0"?>\n<layout width="480" height="720" bgcolor="#000000" background="" schemaVersion="1"><region id="47ff2f524de1b" width="480" height="720" top="0" left="0"/></layout>\n', 1, '2008-01-01 01:00:00', '2008-01-01 01:00:00', '', '', NULL, 1, 0);
285
286INSERT INTO `layout` (`layoutID`, `layout`, `xml`, `userID`, `createdDT`, `modifiedDT`, `description`, `tags`, `templateID`, `retired`, `duration`, `background`) VALUES
287(4, 'Default Layout', '<?xml version="1.0"?><layout schemaVersion="1" width="800" height="450" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="401" top="0" left="0" userId="1"><media id="522caef6e13cb6c9fe5fac15dde59ef7" type="text" duration="15" lkid="" userId="1" schemaVersion="1">278(4, 'Default Layout', '<?xml version="1.0"?><layout schemaVersion="1" width="800" height="450" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="401" top="0" left="0" userId="1"><media id="522caef6e13cb6c9fe5fac15dde59ef7" type="text" duration="15" lkid="" userId="1" schemaVersion="1">
288 <options><xmds>1</xmds><direction>none</direction><scrollSpeed>2</scrollSpeed><fitText>0</fitText></options>279 <options><xmds>1</xmds><direction>none</direction><scrollSpeed>2</scrollSpeed><fitText>0</fitText></options>
289 <raw><text><![CDATA[<p style="text-align: center;"><strong><span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:72px;"><span style="color:#FFFFFF;">Welcome to&nbsp;<br />280 <raw><text><![CDATA[<p style="text-align: center;"><strong><span style="font-family:arial,helvetica,sans-serif;"><span style="font-size:72px;"><span style="color:#FFFFFF;">Welcome to&nbsp;<br />
@@ -331,16 +322,6 @@
331(9, 41, 1),322(9, 41, 1),
332(10, 42, 1);323(10, 42, 1);
333324
334INSERT INTO `lktemplategroup` (`LkTemplateGroupID`, `TemplateID`, `GroupID`, `View`, `Edit`, `Del`) VALUES
335(1, 1, 2, 1, 0, 0),
336(2, 2, 2, 1, 0, 0),
337(3, 3, 2, 1, 0, 0),
338(4, 4, 2, 1, 0, 0),
339(5, 5, 2, 1, 0, 0),
340(6, 6, 2, 1, 0, 0),
341(7, 7, 2, 1, 0, 0),
342(8, 8, 2, 1, 0, 0);
343
344INSERT INTO `lkusergroup` (`LkUserGroupID`, `GroupID`, `UserID`) VALUES325INSERT INTO `lkusergroup` (`LkUserGroupID`, `GroupID`, `UserID`) VALUES
345(10, 3, 1);326(10, 3, 1);
346327
@@ -357,3 +338,20 @@
357INSERT INTO `datasetcolumntype` (`DataSetColumnTypeID`, `DataSetColumnType`) VALUES338INSERT INTO `datasetcolumntype` (`DataSetColumnTypeID`, `DataSetColumnType`) VALUES
358(1, 'Value'),339(1, 'Value'),
359(2, 'Formula');340(2, 'Formula');
341
342INSERT INTO `displayprofile` (`displayprofileid`, `name`, `type`, `config`, `isdefault`, `userid`) VALUES
343(1, 'Production', 'windows', '[{"name":"collectInterval","value":"900","type":"int"},{"name":"powerpointEnabled","value":1,"type":"checkbox"},{"name":"statsEnabled","value":1,"type":"checkbox"},{"name":"sizeX","value":"1280","type":"double"},{"name":"sizeY","value":"720","type":"double"},{"name":"offsetX","value":0,"type":"double"},{"name":"offsetY","value":0,"type":"double"},{"name":"ShowInTaskbar","value":1,"type":"checkbox"},{"name":"ClientInfomationCtrlKey","value":0,"type":"checkbox"},{"name":"ClientInformationKeyCode","value":"I","type":"word"},{"name":"CursorStartPosition","value":"Bottom Right","type":"string"},{"name":"DoubleBuffering","value":1,"type":"checkbox"},{"name":"emptyLayoutDuration","value":"1","type":"int"},{"name":"EnableMouse","value":0,"type":"checkbox"},{"name":"EnableShellCommands","value":1,"type":"checkbox"},{"name":"expireModifiedLayouts","value":1,"type":"checkbox"},{"name":"LogLevel","value":"audit","type":"word"},{"name":"LogToDiskLocation","value":"","type":"string"},{"name":"MaxConcurrentDownloads","value":"2","type":"int"},{"name":"ShellCommandAllowList","value":"","type":"string"}]', 1, 1),
344(2, 'Production', 'android', '[{"name":"emailAddress","value":"dan@springsignage.com","type":"string"},{"name":"settingsPassword","value":"test2","type":"string"},{"name":"collectInterval","value":"600","type":"int"},{"name":"orientation","value":0,"type":"int"},{"name":"startOnBoot","value":0,"type":"checkbox"},{"name":"actionBarMode","value":"1","type":"int"},{"name":"actionBarDisplayDuration","value":"60","type":"int"},{"name":"screenDimensions","value":"","type":"string"},{"name":"autoRestart","value":0,"type":"checkbox"},{"name":"startOnBootDelay","value":"60","type":"int"},{"name":"blacklistVideo","value":1,"type":"checkbox"},{"name":"storeHtmlOnInternal","value":1,"type":"checkbox"}]', 1, 1);
345
346INSERT INTO `bandwidthtype` (`bandwidthtypeid`, `name`) VALUES
347(1, 'Register'),
348(2, 'Required Files'),
349(3, 'Schedule'),
350(4, 'Get File'),
351(5, 'Get Resource'),
352(6, 'Media Inventory'),
353(7, 'Notify Status'),
354(8, 'Submit Stats'),
355(9, 'Submit Log'),
356(10, 'Blacklist'),
357(11, 'Screen Shot');
360358
=== modified file 'server/install/master/structure.sql'
--- server/install/master/structure.sql 2014-07-18 22:43:48 +0000
+++ server/install/master/structure.sql 2014-09-19 11:39:09 +0000
@@ -88,11 +88,14 @@
88 `GeoLocation` POINT NULL,88 `GeoLocation` POINT NULL,
89 `version_instructions` varchar(255) NULL,89 `version_instructions` varchar(255) NULL,
90 `client_type` VARCHAR( 20 ) NULL ,90 `client_type` VARCHAR( 20 ) NULL ,
91 `client_version` VARCHAR( 5 ) NULL ,91 `client_version` VARCHAR( 15 ) NULL ,
92 `client_code` SMALLINT NULL,92 `client_code` SMALLINT NULL,
93 `displayprofileid` int(11) NULL,
94 `currentLayoutId` int(11) NULL,
95 `screenShotRequested` tinyint(4) NOT NULL DEFAULT '0',
93 PRIMARY KEY (`displayid`),96 PRIMARY KEY (`displayid`),
94 KEY `defaultplaylistid` (`defaultlayoutid`)97 KEY `defaultplaylistid` (`defaultlayoutid`)
95) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;98) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
9699
97CREATE TABLE IF NOT EXISTS `displaygroup` (100CREATE TABLE IF NOT EXISTS `displaygroup` (
98 `DisplayGroupID` int(11) NOT NULL AUTO_INCREMENT,101 `DisplayGroupID` int(11) NOT NULL AUTO_INCREMENT,
@@ -138,7 +141,7 @@
138 `templateID` int(11) DEFAULT NULL COMMENT 'The ID of the template',141 `templateID` int(11) DEFAULT NULL COMMENT 'The ID of the template',
139 `retired` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Is this layout retired',142 `retired` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Is this layout retired',
140 `duration` int(11) NOT NULL DEFAULT '0' COMMENT 'The duration in seconds',143 `duration` int(11) NOT NULL DEFAULT '0' COMMENT 'The duration in seconds',
141 `background` varchar(254) DEFAULT NULL,144 `backgroundImageId` int(11) DEFAULT NULL,
142 `status` TINYINT NOT NULL DEFAULT '0',145 `status` TINYINT NOT NULL DEFAULT '0',
143 PRIMARY KEY (`layoutID`)146 PRIMARY KEY (`layoutID`)
144) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Layouts' AUTO_INCREMENT=5 ;147) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Layouts' AUTO_INCREMENT=5 ;
@@ -355,6 +358,8 @@
355 `ValidExtensions` varchar(254) DEFAULT NULL,358 `ValidExtensions` varchar(254) DEFAULT NULL,
356 `PreviewEnabled` tinyint(4) NOT NULL DEFAULT '1',359 `PreviewEnabled` tinyint(4) NOT NULL DEFAULT '1',
357 `assignable` tinyint(4) NOT NULL DEFAULT '1',360 `assignable` tinyint(4) NOT NULL DEFAULT '1',
361 `render_as` varchar(10) DEFAULT NULL,
362 `settings` TEXT,
358 PRIMARY KEY (`ModuleID`)363 PRIMARY KEY (`ModuleID`)
359) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Functional Modules' AUTO_INCREMENT=14 ;364) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Functional Modules' AUTO_INCREMENT=14 ;
360365
@@ -448,11 +453,13 @@
448453
449CREATE TABLE IF NOT EXISTS `resolution` (454CREATE TABLE IF NOT EXISTS `resolution` (
450 `resolutionID` int(11) NOT NULL AUTO_INCREMENT,455 `resolutionID` int(11) NOT NULL AUTO_INCREMENT,
451 `resolution` varchar(20) NOT NULL,456 `resolution` varchar(254) NOT NULL,
452 `width` smallint(6) NOT NULL,457 `width` smallint(6) NOT NULL,
453 `height` smallint(6) NOT NULL,458 `height` smallint(6) NOT NULL,
454 `intended_width` smallint(6) NOT NULL,459 `intended_width` smallint(6) NOT NULL,
455 `intended_height` smallint(6) NOT NULL,460 `intended_height` smallint(6) NOT NULL,
461 `version` tinyint(4) NOT NULL DEFAULT '1',
462 `enabled` tinyint(4) NOT NULL DEFAULT '1',
456 PRIMARY KEY (`resolutionID`)463 PRIMARY KEY (`resolutionID`)
457) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Supported Resolutions' AUTO_INCREMENT=9 ;464) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Supported Resolutions' AUTO_INCREMENT=9 ;
458465
@@ -460,13 +467,14 @@
460 `eventID` int(11) NOT NULL AUTO_INCREMENT,467 `eventID` int(11) NOT NULL AUTO_INCREMENT,
461 `CampaignID` int(11) NOT NULL,468 `CampaignID` int(11) NOT NULL,
462 `DisplayGroupIDs` varchar(254) NOT NULL COMMENT 'A list of the display group ids for this event',469 `DisplayGroupIDs` varchar(254) NOT NULL COMMENT 'A list of the display group ids for this event',
463 `recurrence_type` enum('Hour','Day','Week','Month','Year') DEFAULT NULL,470 `recurrence_type` enum('Minute','Hour','Day','Week','Month','Year') DEFAULT NULL,
464 `recurrence_detail` varchar(100) DEFAULT NULL,471 `recurrence_detail` varchar(100) DEFAULT NULL,
465 `userID` int(11) NOT NULL,472 `userID` int(11) NOT NULL,
466 `is_priority` tinyint(4) NOT NULL,473 `is_priority` tinyint(4) NOT NULL,
467 `FromDT` bigint(20) NOT NULL DEFAULT '0',474 `FromDT` bigint(20) NOT NULL DEFAULT '0',
468 `ToDT` bigint(20) NOT NULL DEFAULT '0',475 `ToDT` bigint(20) NOT NULL DEFAULT '0',
469 `recurrence_range` bigint(20) DEFAULT NULL,476 `recurrence_range` bigint(20) DEFAULT NULL,
477 `DisplayOrder` int(11) NOT NULL DEFAULT '0',
470 PRIMARY KEY (`eventID`),478 PRIMARY KEY (`eventID`),
471 KEY `layoutID` (`CampaignID`)479 KEY `layoutID` (`CampaignID`)
472) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='High level schedule information' AUTO_INCREMENT=2 ;480) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='High level schedule information' AUTO_INCREMENT=2 ;
@@ -474,15 +482,11 @@
474CREATE TABLE IF NOT EXISTS `schedule_detail` (482CREATE TABLE IF NOT EXISTS `schedule_detail` (
475 `schedule_detailID` int(11) NOT NULL AUTO_INCREMENT,483 `schedule_detailID` int(11) NOT NULL AUTO_INCREMENT,
476 `DisplayGroupID` int(11) NOT NULL,484 `DisplayGroupID` int(11) NOT NULL,
477 `CampaignID` int(11) NOT NULL,
478 `userID` int(8) NOT NULL DEFAULT '1' COMMENT 'Owner of the Event',485 `userID` int(8) NOT NULL DEFAULT '1' COMMENT 'Owner of the Event',
479 `is_priority` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'This scheduled event has priority and will take precidence over any others scheduled',
480 `eventID` int(11) DEFAULT NULL,486 `eventID` int(11) DEFAULT NULL,
481 `FromDT` bigint(20) NOT NULL DEFAULT '0',487 `FromDT` bigint(20) NOT NULL DEFAULT '0',
482 `ToDT` bigint(20) NOT NULL DEFAULT '0',488 `ToDT` bigint(20) NOT NULL DEFAULT '0',
483 `DisplayOrder` int(11) NOT NULL DEFAULT '0',
484 PRIMARY KEY (`schedule_detailID`),489 PRIMARY KEY (`schedule_detailID`),
485 KEY `layoutID` (`CampaignID`),
486 KEY `scheduleID` (`eventID`),490 KEY `scheduleID` (`eventID`),
487 KEY `DisplayGroupID` (`DisplayGroupID`)491 KEY `DisplayGroupID` (`DisplayGroupID`)
488) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Replicated schedule across displays and recurrence' AUTO_INCREMENT=6 ;492) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Replicated schedule across displays and recurrence' AUTO_INCREMENT=6 ;
@@ -506,13 +510,19 @@
506 `settingid` int(11) NOT NULL AUTO_INCREMENT,510 `settingid` int(11) NOT NULL AUTO_INCREMENT,
507 `setting` varchar(50) NOT NULL,511 `setting` varchar(50) NOT NULL,
508 `value` varchar(1000) NOT NULL,512 `value` varchar(1000) NOT NULL,
509 `type` varchar(24) NOT NULL,513 `fieldType` varchar(24) NOT NULL,
510 `helptext` text ,514 `helptext` text,
511 `options` varchar(254) DEFAULT NULL,515 `options` varchar(254) DEFAULT NULL,
512 `cat` varchar(24) NOT NULL DEFAULT 'general',516 `cat` varchar(24) NOT NULL DEFAULT 'general',
513 `userChange` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Can the user change this setting',517 `userChange` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Can the user change this setting',
518 `title` varchar(254) NOT NULL,
519 `validation` varchar(50) NOT NULL,
520 `ordering` int(11) NOT NULL,
521 `default` varchar(1000) NOT NULL,
522 `userSee` tinyint(4) NOT NULL DEFAULT '1',
523 `type` varchar(50) NOT NULL,
514 PRIMARY KEY (`settingid`)524 PRIMARY KEY (`settingid`)
515) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=62 ;525) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=74 ;
516526
517CREATE TABLE IF NOT EXISTS `stat` (527CREATE TABLE IF NOT EXISTS `stat` (
518 `statID` bigint(20) NOT NULL AUTO_INCREMENT,528 `statID` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -566,6 +576,7 @@
566 `homepage` varchar(254) NOT NULL DEFAULT 'dashboard.php' COMMENT 'The users homepage',576 `homepage` varchar(254) NOT NULL DEFAULT 'dashboard.php' COMMENT 'The users homepage',
567 `Retired` tinyint(4) NOT NULL DEFAULT '0',577 `Retired` tinyint(4) NOT NULL DEFAULT '0',
568 `CSPRNG` tinyint(4) NOT NULL DEFAULT '0',578 `CSPRNG` tinyint(4) NOT NULL DEFAULT '0',
579 `newUserWizard` tinyint(4) NOT NULL DEFAULT '0',
569 PRIMARY KEY (`UserID`),580 PRIMARY KEY (`UserID`),
570 KEY `usertypeid` (`usertypeid`)581 KEY `usertypeid` (`usertypeid`)
571) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;582) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
@@ -610,7 +621,39 @@
610 `RegionID` varchar(50) NOT NULL,621 `RegionID` varchar(50) NOT NULL,
611 `MediaID` varchar(50) NOT NULL,622 `MediaID` varchar(50) NOT NULL,
612 PRIMARY KEY (`LkDataSetLayoutID`)623 PRIMARY KEY (`LkDataSetLayoutID`)
613) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;624) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
625
626CREATE TABLE IF NOT EXISTS `displayprofile` (
627 `displayprofileid` int(11) NOT NULL AUTO_INCREMENT,
628 `name` varchar(50) NOT NULL,
629 `type` varchar(15) NOT NULL,
630 `config` text NOT NULL,
631 `isdefault` int(11) NOT NULL,
632 `userid` int(11) NOT NULL,
633 PRIMARY KEY (`displayprofileid`)
634) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
635
636CREATE TABLE IF NOT EXISTS `xmdsnonce` (
637 `nonceId` bigint(20) NOT NULL AUTO_INCREMENT,
638 `nonce` varchar(100) NOT NULL,
639 `expiry` int(11) NOT NULL,
640 `lastUsed` int(11) DEFAULT NULL,
641 `displayId` int(11) NOT NULL,
642 `fileId` int(11) DEFAULT NULL,
643 `size` bigint(20) DEFAULT NULL,
644 `storedAs` varchar(100) DEFAULT NULL,
645 `layoutId` int(11) DEFAULT NULL,
646 `regionId` varchar(100) DEFAULT NULL,
647 `mediaId` varchar(100) DEFAULT NULL,
648 PRIMARY KEY (`nonceId`)
649) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
650
651CREATE TABLE IF NOT EXISTS `bandwidthtype` (
652 `bandwidthtypeid` int(11) NOT NULL AUTO_INCREMENT,
653 `name` varchar(25) NOT NULL,
654 PRIMARY KEY (`bandwidthtypeid`)
655) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
656
614657
615--658--
616-- Constraints for dumped tables659-- Constraints for dumped tables
@@ -702,7 +745,6 @@
702 ADD CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`CampaignID`) REFERENCES `campaign` (`CampaignID`);745 ADD CONSTRAINT `schedule_ibfk_1` FOREIGN KEY (`CampaignID`) REFERENCES `campaign` (`CampaignID`);
703746
704ALTER TABLE `schedule_detail`747ALTER TABLE `schedule_detail`
705 ADD CONSTRAINT `schedule_detail_ibfk_9` FOREIGN KEY (`CampaignID`) REFERENCES `campaign` (`CampaignID`),
706 ADD CONSTRAINT `schedule_detail_ibfk_7` FOREIGN KEY (`eventID`) REFERENCES `schedule` (`eventID`),748 ADD CONSTRAINT `schedule_detail_ibfk_7` FOREIGN KEY (`eventID`) REFERENCES `schedule` (`eventID`),
707 ADD CONSTRAINT `schedule_detail_ibfk_8` FOREIGN KEY (`DisplayGroupID`) REFERENCES `displaygroup` (`DisplayGroupID`);749 ADD CONSTRAINT `schedule_detail_ibfk_8` FOREIGN KEY (`DisplayGroupID`) REFERENCES `displaygroup` (`DisplayGroupID`);
708750
709751
=== added file 'server/install/upgradestep.class.php'
--- server/install/upgradestep.class.php 1970-01-01 00:00:00 +0000
+++ server/install/upgradestep.class.php 2014-09-19 11:39:09 +0000
@@ -0,0 +1,51 @@
1<?php
2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2006-2014 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 UpgradeStep
24{
25 protected $db;
26 protected $q;
27 protected $a;
28
29 public function __construct($db)
30 {
31 $this->db =& $db;
32 $this->q = array();
33 $this->a = array();
34 }
35
36 public function Boot()
37 {
38
39 }
40
41 public function Questions()
42 {
43 return array();
44 }
45
46 public function ValidateQuestion($questionNumber,$response)
47 {
48 return true;
49 }
50}
51?>
052
=== modified file 'server/lib/app/app_functions.php'
--- server/lib/app/app_functions.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/app_functions.php 2014-09-19 11:39:09 +0000
@@ -40,112 +40,6 @@
40 $_SESSION['message'] = $message;40 $_SESSION['message'] = $message;
41}41}
4242
43// Returns a drop down list based on the provided SQL - the ID should be the first field, and the name the second
44function dropdownlist($SQL, $list_name, $selected = "", $callback = "", $flat_list = false, $checkPermissions = false, $userid = "", $permissionLevel = "see", $useQueryId = false) {
45 global $db;
46 global $user;
47
48 if (!$result = $db->query($SQL))
49 {
50 trigger_error($db->error());
51 return "Query Error";
52 }
53
54 if ($db->num_rows($result)==0)
55 {
56 $list = "No selections available";
57 return $list;
58 }
59
60 if ($flat_list)
61 {
62 //we want to generate a flat list of option | value pairs
63 $list = "";
64
65 while ($results = $db->get_row($result))
66 {
67 $col0 = $results[0];
68 $col1 = $results[1];
69
70 if ($checkPermissions)
71 {
72 $permissionid = $results[2];
73 $ownerid = $results[3];
74
75 if ($useQueryId)
76 {
77 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $col0);
78 }
79 else
80 {
81 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $userid);
82 }
83
84 if (($permissionLevel == "see" && $see_permissions) || $permissionLevel == "edit" && $edit_permissions) {
85 $list .= "$col0|$col1,";
86 }
87 }
88 else
89 {
90 $list .= "$col0|$col1,";
91 }
92 }
93 //trim the commas
94 $list = rtrim($list,",");
95 }
96 else
97 {
98 $list = <<<END
99 <select name="$list_name" id="$list_name" $callback>
100END;
101 while ($results = $db->get_row($result))
102 {
103 $col0 = $results[0];
104 $col1 = $results[1];
105
106 if ($checkPermissions)
107 {
108 $permissionid = $results[2];
109 $ownerid = $results[3];
110
111 if ($useQueryId)
112 {
113 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $col0);
114 }
115 else
116 {
117 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $userid);
118 }
119
120 if (($permissionLevel == "see" && $see_permissions) || $permissionLevel == "edit" && $edit_permissions)
121 {
122 if ($col0 == $selected)
123 {
124 $list .= "<option value='" . $col0 . "' selected>" . $col1 . "</option>\n";
125 }
126 else
127 {
128 $list .= "<option value='" . $col0 . "'>" . $col1 . "</option>\n";
129 }
130 }
131 }
132 else
133 {
134 if ($col0 == $selected)
135 {
136 $list .= "<option value='" . $col0 . "' selected>" . $col1 . "</option>\n";
137 }
138 else
139 {
140 $list .= "<option value='" . $col0 . "'>" . $col1 . "</option>\n";
141 }
142 }
143 }
144 $list .= "</select>\n";
145 }
146 return $list;
147}
148
149function listcontent($list_string, $list_name, $selected = "", $callback = "") 43function listcontent($list_string, $list_name, $selected = "", $callback = "")
150{44{
151 //generates a list based on a list option | value, list45 //generates a list based on a list option | value, list
@@ -181,47 +75,6 @@
181}75}
18276
18377
184//generates a list of all the users - assuming that the SQL given contains userid's
185function userlist($SQL)
186{
187 global $db;
188 global $user;
189
190 if (!$result = $db->query($SQL))
191 {
192 trigger_error($db->error());
193 return "Query Error";
194 }
195
196 if ($db->num_rows($result)==0)
197 {
198 $list = "No selections available";
199 return $list;
200 }
201
202 while ($row = $db->get_row($result))
203 {
204
205 $userid = $row[0];
206 $username = $user->getNameFromID($userid);
207
208 $user_ids[] = array('id'=>$userid);
209 $user_names[] = array('name'=>$username);
210 }
211
212 array_multisort($user_names, SORT_DESC, $user_ids, SORT_ASC); //sorts the two arrays, so that the usernames are Alpha sorted, and the ID's tag along
213
214 $list = "";
215 foreach ($user_names as $key => $row)
216 {
217
218 if($list != "") $list .= ","; //if we arnt equal to the first, append a seperator
219
220 $list .= $user_ids[$key]['id']."|".$row['name'];
221 }
222 return $list;
223}
224
225/**78/**
226 * Sets a session variable from a javascript call (so when we XMLHTTPRequest we can set a sesson var)79 * Sets a session variable from a javascript call (so when we XMLHTTPRequest we can set a sesson var)
227 * @return 80 * @return
@@ -270,30 +123,6 @@
270}123}
271124
272/**125/**
273 * Gets web safe colors
274 * @return
275 */
276function gwsc()
277{
278 $colors = array();
279 $cs = array('00', '33', '66', '99', 'CC', 'FF');
280
281 for($i=0; $i<6; $i++)
282 {
283 for($j=0; $j<6; $j++)
284 {
285 for($k=0; $k<6; $k++)
286 {
287 $c = $cs[$i] .$cs[$j] .$cs[$k];
288 $colors[] = array('colorid' => $c, 'color' => '#' . $c, 'style' => 'background-color:#' . $c . ';color:#' . $c);
289 }
290 }
291 }
292
293 return $colors;
294}
295
296/**
297 * Resizes the image126 * Resizes the image
298 * Based on code from the Web - cannot find source.127 * Based on code from the Web - cannot find source.
299 * If this is your code please send a mail to info@xibo.org.uk128 * If this is your code please send a mail to info@xibo.org.uk
300129
=== modified file 'server/lib/app/datemanager.class.php'
--- server/lib/app/datemanager.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/datemanager.class.php 2014-09-19 11:39:09 +0000
@@ -21,14 +21,7 @@
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
2222
23class DateManager23class DateManager
24{24{
25 private $db;
26
27 public function __construct(database $db)
28 {
29 $this->db =& $db;
30 }
31
32 public static function GetClock()25 public static function GetClock()
33 {26 {
34 return date("H:i T");27 return date("H:i T");
3528
=== modified file 'server/lib/app/formmanager.class.php'
--- server/lib/app/formmanager.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/formmanager.class.php 2014-09-19 11:39:09 +0000
@@ -1,7 +1,7 @@
1<?php1<?php
2/*2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2006,2007,2008 Daniel Garner4 * Copyright (C) 2006-2014 Daniel Garner
5 *5 *
6 * This file is part of Xibo.6 * This file is part of Xibo.
7 *7 *
@@ -19,135 +19,225 @@
19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.19 * along with Xibo. If not, see <http://www.gnu.org/licenses/>.
20 */ 20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
22 22
23class FormManager23class FormManager {
24{24
25 private $db;25 public static function AddMessage($message, $groupClass = '') {
26 private $user;26 return array(
27 27 'name' => NULL,
28 public function __construct(database $db, user $user)28 'title' => NULL,
29 {29 'value' => NULL,
30 $this->db =& $db;30 'helpText' => $message,
31 $this->user =& $user;31 'fieldType' => 'message',
32 }32 'options' => NULL,
33 33 'validation' => NULL,
34 /**34 'accesskey' => NULL,
35 * Returns a drop down list based on the provided SQL - the ID should be the first field, and the name the second35 'groupClass' => $groupClass,
36 * @return 36 'enabled' => true
37 * @param $SQL Object37 );
38 * @param $list_name Object38 }
39 * @param $selected Object[optional]39
40 * @param $callback Object[optional]40 public static function AddRaw($raw) {
41 * @param $flat_list Object[optional]41 return array(
42 * @param $checkPermissions Object[optional]42 'name' => NULL,
43 * @param $userid Object[optional]43 'title' => NULL,
44 * @param $permissionLevel Object[optional]44 'value' => NULL,
45 * @param $useQueryId Object[optional]45 'helpText' => $raw,
46 */46 'fieldType' => 'raw',
47 public function DropDown($SQL, $list_name, $selected = "", $callback = "", $flat_list = false, $checkPermissions = false, $userid = "", $permissionLevel = "see", $useQueryId = false) 47 'options' => NULL,
48 {48 'validation' => NULL,
49 $db =& $this->db;49 'accesskey' => NULL,
50 $user =& $this->user;50 'groupClass' => '',
51 51 'enabled' => true
52 if (!$result = $db->query($SQL)) 52 );
53 {53 }
54 trigger_error($db->error());54
55 return __("Query Error");55 public static function AddHidden($name, $value) {
56 }56 return array(
57 57 'name' => $name,
58 if ($db->num_rows($result)==0) 58 'value' => $value,
59 {59 'fieldType' => 'hidden',
60 $list = __("No selections available");60 'enabled' => true
61 return $list;61 );
62 }62 }
63 63
64 if ($flat_list) 64 public static function AddButton($title, $type = 'submit', $link = '', $groupClass = '') {
65 {65 return array(
66 //we want to generate a flat list of option | value pairs66 'title' => $title,
67 $list = "";67 'type' => $type,
68 68 'link' => $link,
69 while ($results = $db->get_row($result)) 69 'groupClass' => $groupClass,
70 {70 'fieldType' => 'button',
71 $col0 = $results[0];71 'enabled' => true
72 $col1 = $results[1];72 );
73 73 }
74 if ($checkPermissions) 74
75 {75 public static function AddText($name, $title, $value, $helpText, $accessKey, $validation = '', $groupClass = '', $enabled = true) {
76 $permissionid = $results[2];76 return array(
77 $ownerid = $results[3];77 'name' => $name,
78 78 'title' => $title,
79 if ($useQueryId)79 'value' => $value,
80 {80 'helpText' => $helpText,
81 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $col0); 81 'fieldType' => 'text',
82 }82 'options' => NULL,
83 else83 'validation' => $validation,
84 {84 'accesskey' => $accessKey,
85 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $userid);85 'groupClass' => $groupClass,
86 }86 'enabled' => $enabled
87 87 );
88 if (($permissionLevel == "see" && $see_permissions) || $permissionLevel == "edit" && $edit_permissions) {88 }
89 $list .= "$col0|$col1,";89
90 }90 public static function AddMultiText($name, $title, $value, $helpText, $accessKey, $rows, $validation = '', $groupClass = '', $enabled = true) {
91 }91 return array(
92 else 92 'name' => $name,
93 {93 'title' => $title,
94 $list .= "$col0|$col1,";94 'value' => $value,
95 }95 'helpText' => $helpText,
96 }96 'fieldType' => 'textarea',
97 //trim the commas97 'options' => NULL,
98 $list = rtrim($list,",");98 'validation' => $validation,
99 }99 'accesskey' => $accessKey,
100 else 100 'groupClass' => $groupClass,
101 {101 'enabled' => $enabled,
102 $list = <<<END102 'rows' => $rows
103 <select name="$list_name" id="$list_name" $callback>103 );
104END;104 }
105 while ($results = $db->get_row($result)) 105
106 {106 public static function AddNumber($name, $title, $value, $helpText, $accessKey, $validation = '', $groupClass = '', $enabled = true) {
107 $col0 = $results[0];107 return array(
108 $col1 = $results[1];108 'name' => $name,
109 109 'title' => $title,
110 if ($checkPermissions) 110 'value' => $value,
111 {111 'helpText' => $helpText,
112 $permissionid = $results[2];112 'fieldType' => 'number',
113 $ownerid = $results[3];113 'options' => NULL,
114 114 'validation' => $validation,
115 if ($useQueryId)115 'accesskey' => $accessKey,
116 {116 'groupClass' => $groupClass,
117 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $col0); 117 'enabled' => $enabled
118 }118 );
119 else119 }
120 {120
121 list($see_permissions , $edit_permissions) = $user->eval_permission($ownerid, $permissionid, $userid);121 public static function AddEmail($name, $title, $value, $helpText, $accessKey, $validation = '', $groupClass = '', $enabled = true) {
122 }122 return array(
123 123 'name' => $name,
124 if (($permissionLevel == "see" && $see_permissions) || $permissionLevel == "edit" && $edit_permissions) 124 'title' => $title,
125 {125 'value' => $value,
126 if ($col0 == $selected) 126 'helpText' => $helpText,
127 {127 'fieldType' => 'email',
128 $list .= "<option value='" . $col0 . "' selected>" . $col1 . "</option>\n";128 'options' => NULL,
129 }129 'validation' => $validation,
130 else 130 'accesskey' => $accessKey,
131 {131 'groupClass' => $groupClass,
132 $list .= "<option value='" . $col0 . "'>" . $col1 . "</option>\n";132 'enabled' => $enabled
133 }133 );
134 }134 }
135 }135
136 else 136 public static function AddCheckbox($name, $title, $value, $helpText, $accessKey, $groupClass = '', $enabled = true) {
137 {137 return array(
138 if ($col0 == $selected) 138 'name' => $name,
139 {139 'title' => $title,
140 $list .= "<option value='" . $col0 . "' selected>" . $col1 . "</option>\n";140 'value' => $value,
141 }141 'helpText' => $helpText,
142 else 142 'fieldType' => 'checkbox',
143 {143 'options' => NULL,
144 $list .= "<option value='" . $col0 . "'>" . $col1 . "</option>\n";144 'validation' => NULL,
145 }145 'accesskey' => $accessKey,
146 }146 'groupClass' => $groupClass,
147 }147 'enabled' => $enabled
148 $list .= "</select>\n";148 );
149 }149 }
150 return $list;150
151 }151 public static function AddRadio($name, $id, $title, $value, $setValue, $helpText, $accessKey, $groupClass = '', $enabled = true) {
152 return array(
153 'id' => $id,
154 'name' => $name,
155 'title' => $title,
156 'value' => $value,
157 'setValue' => $setValue,
158 'helpText' => $helpText,
159 'fieldType' => 'radio',
160 'options' => NULL,
161 'validation' => NULL,
162 'accesskey' => $accessKey,
163 'groupClass' => $groupClass,
164 'enabled' => $enabled
165 );
166 }
167
168 public static function AddPassword($name, $title, $value, $helpText, $accessKey, $groupClass = '', $enabled = true) {
169 return array(
170 'name' => $name,
171 'title' => $title,
172 'value' => $value,
173 'helpText' => $helpText,
174 'fieldType' => 'password',
175 'options' => NULL,
176 'validation' => NULL,
177 'accesskey' => $accessKey,
178 'groupClass' => $groupClass,
179 'enabled' => $enabled
180 );
181 }
182
183 public static function AddCombo($name, $title, $value, $options, $optionId, $optionValue, $helpText, $accessKey, $groupClass = '', $enabled = true, $callBack = '', $classColumn = '', $styleColumn = '', $optionGroups = '', $attributes = array()) {
184 return array(
185 'name' => $name,
186 'title' => $title,
187 'value' => $value,
188 'helpText' => $helpText,
189 'fieldType' => 'dropdown',
190 'options' => $options,
191 'optionId' => $optionId,
192 'optionValue' => $optionValue,
193 'validation' => NULL,
194 'accesskey' => $accessKey,
195 'groupClass' => $groupClass,
196 'enabled' => $enabled,
197 'callBack' => $callBack,
198 'classColumn' => $classColumn,
199 'styleColumn' => $styleColumn,
200 'optionGroups' => $optionGroups,
201 'dataAttributes' => $attributes
202 );
203 }
204
205 public static function AddMultiCombo($name, $title, $value, $options, $optionId, $optionValue, $helpText, $accessKey, $groupClass = '', $enabled = true, $callBack = '', $classColumn = '', $styleColumn = '', $optionGroups = '', $attributes = array()) {
206 return array(
207 'name' => $name,
208 'title' => $title,
209 'value' => $value,
210 'helpText' => $helpText,
211 'fieldType' => 'dropdownmulti',
212 'options' => $options,
213 'optionId' => $optionId,
214 'optionValue' => $optionValue,
215 'validation' => NULL,
216 'accesskey' => $accessKey,
217 'groupClass' => $groupClass,
218 'enabled' => $enabled,
219 'callBack' => $callBack,
220 'classColumn' => $classColumn,
221 'styleColumn' => $styleColumn,
222 'optionGroups' => $optionGroups,
223 'dataAttributes' => $attributes
224 );
225 }
226
227 public static function AddPermissions($name, $options) {
228 return array(
229 'name' => $name,
230 'fieldType' => 'permissions',
231 'options' => $options,
232 'groupClass' => NULL,
233 'enabled' => true
234 );
235 }
236
237 public static function AddTab($id, $name) {
238 return array(
239 'id' => $id, 'name' => $name
240 );
241 }
152}242}
153?>
154\ No newline at end of file243\ No newline at end of file
244?>
155245
=== modified file 'server/lib/app/helpmanager.class.php'
--- server/lib/app/helpmanager.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/helpmanager.class.php 2014-09-19 11:39:09 +0000
@@ -20,23 +20,7 @@
20 */ 20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
2222
23class HelpManager23class HelpManager {
24{
25 private $db;
26 private $user;
27
28 /**
29 * Constructs the Module Manager.
30 * @return
31 * @param $db Object
32 * @param $user Object
33 */
34 public function __construct(database $db, User $user)
35 {
36 $this->db =& $db;
37 $this->user =& $user;
38 }
39
40 /**24 /**
41 * Help Button25 * Help Button
42 * @return 26 * @return
4327
=== modified file 'server/lib/app/kit.class.php'
--- server/lib/app/kit.class.php 2014-05-26 09:09:06 +0000
+++ server/lib/app/kit.class.php 2014-09-19 11:39:09 +0000
@@ -46,7 +46,7 @@
46class Kit 46class Kit
47{47{
48 // Ends the current execution and issues a redirect - should only be called before headers have been sent (i.e. no output)48 // Ends the current execution and issues a redirect - should only be called before headers have been sent (i.e. no output)
49 static function Redirect($page, $message = '', $pageIsUrl = false)49 static function Redirect($page, $message = '')
50 {50 {
51 $url = $page;51 $url = $page;
52 $ajax = Kit::GetParam('ajax', _REQUEST, _BOOL, false);52 $ajax = Kit::GetParam('ajax', _REQUEST, _BOOL, false);
@@ -64,6 +64,7 @@
64 } 64 }
65 else 65 else
66 {66 {
67 header( 'HTTP/1.1 302 Moved Temporarily' );
67 header( 'Location: ' . $url );68 header( 'Location: ' . $url );
68 }69 }
69 70
@@ -351,8 +352,14 @@
351 break;352 break;
352 353
353 case _CHECKBOX:354 case _CHECKBOX:
354 if ($return == 'on') $return = 1;355 if ($return == 'on') {
355 if ($return == 'off' || $return == '') $return = 0;356 $return = 1;
357 }
358 if ($return == 'off' || $return == '') {
359 $return = 0;
360 }
361
362 break;
356363
357 default :364 default :
358 // No casting necessary365 // No casting necessary
@@ -372,7 +379,7 @@
372 */379 */
373 public static function GetURL($page = "")380 public static function GetURL($page = "")
374 {381 {
375 $page = $this->ValidateParam($page, _WORD);382 $page = Kit::ValidateParam($page, _WORD);
376 $fullUrl = 'http';383 $fullUrl = 'http';
377 384
378 if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')385 if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
@@ -535,7 +542,7 @@
535 */542 */
536 public static function SelectList($listName, $listValues, $idColumn, $nameColumn, $selectedId = '', $callBack = '', $classColumn = '')543 public static function SelectList($listName, $listValues, $idColumn, $nameColumn, $selectedId = '', $callBack = '', $classColumn = '')
537 {544 {
538 $list = '<select name="' . $listName . '" id="' . $listName . '"' . $callBack . '>';545 $list = '<select class="form-control" name="' . $listName . '" id="' . $listName . '"' . $callBack . '>';
539546
540 foreach ($listValues as $listItem)547 foreach ($listValues as $listItem)
541 {548 {
@@ -586,7 +593,7 @@
586 public static function Token($tokenName = "token")593 public static function Token($tokenName = "token")
587 {594 {
588 //Store in the users session595 //Store in the users session
589 $token = md5(uniqid()."xsmsalt".time());596 $token = md5(uniqid() . SECRET_KEY . time());
590 597
591 $_SESSION[$tokenName] = $token;598 $_SESSION[$tokenName] = $token;
592 $_SESSION[$tokenName.'_timeout'] = time();599 $_SESSION[$tokenName.'_timeout'] = time();
593600
=== modified file 'server/lib/app/menumanager.class.php'
--- server/lib/app/menumanager.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/menumanager.class.php 2014-09-19 11:39:09 +0000
@@ -22,27 +22,17 @@
2222
23class MenuManager23class MenuManager
24{24{
25 private $db;
26 private $user;25 private $user;
27 private $p;26
28 private $q;
29
30 private $ajax;
31 private $userid;
32 public $message;27 public $message;
33 28
34 private $theMenu;29 private $theMenu;
35 private $current;30 private $current;
36 private $numberItems;31 private $numberItems;
37 32
38 public function __construct(database $db, User $user, $menu)33 public function __construct(User $user, $menu)
39 {34 {
40 $this->db =& $db;
41 $this->user =& $user;35 $this->user =& $user;
42 $this->ajax = Kit::GetParam('ajax', _REQUEST, _BOOL, false);
43 $this->q = Kit::GetParam('q', _REQUEST, _WORD);
44 $this->userid = Kit::GetParam('userid', _SESSION, _INT);
45 $usertypeid = Kit::GetParam('usertype', _SESSION, _INT);
46 36
47 if ($menu == '')37 if ($menu == '')
48 {38 {
4939
=== modified file 'server/lib/app/pagemanager.class.php'
--- server/lib/app/pagemanager.class.php 2014-03-08 11:39:48 +0000
+++ server/lib/app/pagemanager.class.php 2014-09-19 11:39:09 +0000
@@ -26,8 +26,8 @@
26 private $db;26 private $db;
27 private $user;27 private $user;
2828
29 private $p;29 public $p;
30 private $q;30 public $q;
3131
32 private $page;32 private $page;
33 private $path;33 private $path;
@@ -36,9 +36,13 @@
36 private $authed;36 private $authed;
37 private $thePage;37 private $thePage;
38 38
39 // Maintain a list of pages/functions we are allowed to get to without going through the authentication system39 // Maintain a list of pages / functions we are allowed to get to without going through the authentication system
40 private $nonAuthedPages = array('index', 'clock');40 private $nonAuthedPages = array('index', 'clock', 'error');
41 private $nonAuthedPagesWithoutFunctionCall = array('error');
41 private $nonAuthedFunctions = array('login', 'logout', 'GetClock', 'About');42 private $nonAuthedFunctions = array('login', 'logout', 'GetClock', 'About');
43
44 // Maintain a list of pages we can get to that are not checked in the database but require a valid login
45 private $nonPageAuthedPages = array('upgrade');
42 46
43 function __construct(database $db, user $user, $page)47 function __construct(database $db, user $user, $page)
44 {48 {
@@ -56,7 +60,7 @@
56 $this->authed = false;60 $this->authed = false;
5761
58 // Create a theme62 // Create a theme
59 new Theme($db, $user);63 new Theme($user);
60 Theme::SetPagename($this->p);64 Theme::SetPagename($this->p);
61 }65 }
62 66
@@ -69,10 +73,11 @@
69 $user =& $this->user;73 $user =& $this->user;
70 74
71 // The user MUST be logged in unless they are trying to assess some of the public facing pages75 // The user MUST be logged in unless they are trying to assess some of the public facing pages
72 if (in_array($this->p, $this->nonAuthedPages) && in_array($this->q, $this->nonAuthedFunctions))76 if ((in_array($this->p, $this->nonAuthedPages) && in_array($this->q, $this->nonAuthedFunctions))
77 || (in_array($this->p, $this->nonAuthedPagesWithoutFunctionCall) && $this->q == ''))
73 {78 {
74 // Automatically authed79 // Automatically authed
75 $this->authed = true;80 $this->authed = true;
76 }81 }
77 else82 else
78 {83 {
@@ -80,7 +85,10 @@
80 if (!$user->attempt_login($this->ajax))85 if (!$user->attempt_login($this->ajax))
81 return false;86 return false;
8287
83 $this->authed = $user->PageAuth($this->p);88 if (in_array($this->p, $this->nonPageAuthedPages))
89 $this->authed = true;
90 else
91 $this->authed = $user->PageAuth($this->p);
84 }92 }
85 }93 }
86 94
@@ -130,6 +138,9 @@
130 }138 }
131 else 139 else
132 {140 {
141 Theme::Set('sidebar_html', $this->thePage->sideBarContent());
142 Theme::Set('action_menu', $this->thePage->actionMenu());
143
133 // Display a page instead144 // Display a page instead
134 Theme::Render('header');145 Theme::Render('header');
135 146
@@ -142,4 +153,4 @@
142 $_SESSION['message'] = '';153 $_SESSION['message'] = '';
143 }154 }
144}155}
145?>
146\ No newline at end of file156\ No newline at end of file
157?>
147158
=== modified file 'server/lib/app/pdoconnect.class.php'
--- server/lib/app/pdoconnect.class.php 2014-07-17 10:37:47 +0000
+++ server/lib/app/pdoconnect.class.php 2014-09-19 11:39:09 +0000
@@ -44,13 +44,49 @@
44 $dsn = 'mysql:host=' . $dbhost . ';dbname=' . $dbname . ';';44 $dsn = 'mysql:host=' . $dbhost . ';dbname=' . $dbname . ';';
45 }45 }
4646
47 // Open the connection and set the error mode47 //echo 'init ' . $dsn , ' user ' . $dbuser . ' pass ' . $dbpass;
48 self::$conn = new PDO($dsn, $dbuser, $dbpass);48
49 self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);49 // Open the connection and set the error mode
5050 self::$conn = new PDO($dsn, $dbuser, $dbpass);
51 self::$conn->query("SET NAMES 'utf8'");51 self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
52 }52
5353 self::$conn->query("SET NAMES 'utf8'");
54 return self::$conn;54 }
55
56 return self::$conn;
57 }
58
59 public static function connect($dbhost, $dbuser, $dbpass, $dbname = '') {
60 if (!self::$conn) {
61
62 $dbport = '';
63
64 if (strstr($dbhost, ':')) {
65 $hostParts = explode(':', $dbhost);
66 $dsn = 'mysql:host=' . $hostParts[0] . ';port=' . $hostParts[1] . ';';
67 }
68 else {
69 $dsn = 'mysql:host=' . $dbhost . ';';
70 }
71
72 if ($dbname != '')
73 $dsn .= 'dbname=' . $dbname . ';';
74
75 //echo 'connect ' . $dsn , ' user ' . $dbuser . ' pass ' . $dbpass;
76
77 // Open the connection and set the error mode
78 self::$conn = new PDO($dsn, $dbuser, $dbpass);
79 self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
80
81 self::$conn->query("SET NAMES 'utf8'");
82 }
83
84 return self::$conn;
85 }
86
87 public static function close() {
88 if (self::$conn) {
89 self::$conn = null;
90 }
55 }91 }
56}92}
57\ No newline at end of file93\ No newline at end of file
5894
=== modified file 'server/lib/app/responsemanager.class.php'
--- server/lib/app/responsemanager.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/responsemanager.class.php 2014-09-19 11:39:09 +0000
@@ -29,6 +29,7 @@
29 public $html;29 public $html;
30 public $callBack;30 public $callBack;
31 public $buttons;31 public $buttons;
32 public $fieldActions;
32 33
33 public $sortable;34 public $sortable;
34 public $sortingDiv;35 public $sortingDiv;
@@ -73,6 +74,7 @@
73 $this->appendHiddenSubmit = true;74 $this->appendHiddenSubmit = true;
74 $this->uniqueReference = '';75 $this->uniqueReference = '';
75 $this->buttons = '';76 $this->buttons = '';
77 $this->fieldActions = '';
76 $this->pageSize = 10;78 $this->pageSize = 10;
77 $this->pageNumber = 0;79 $this->pageNumber = 0;
78 $this->initialSortColumn = 1;80 $this->initialSortColumn = 1;
@@ -150,6 +152,9 @@
150 */152 */
151 public function SetFormRequestResponse($form, $title, $width = '', $height = '', $callBack = '')153 public function SetFormRequestResponse($form, $title, $width = '', $height = '', $callBack = '')
152 {154 {
155 if ($form == NULL)
156 $form = Theme::RenderReturn('form_render');
157
153 $this->html = $form;158 $this->html = $form;
154 $this->dialogTitle = $title;159 $this->dialogTitle = $title;
155 $this->callBack = $callBack;160 $this->callBack = $callBack;
@@ -211,6 +216,26 @@
211 return true;216 return true;
212 }217 }
213218
219 /**
220 * Add a Field Action to a Field
221 * @param string $field The field name
222 * @param string $action The action name
223 * @param string $value The value to trigger on
224 * @param string $actions The actions (field => action)
225 * @param string $operation The Operation (optional)
226 */
227 public function AddFieldAction($field, $action, $value, $actions, $operation = "equals") {
228 $this->fieldActions[] = array(
229 'field' => $field,
230 'trigger' => $action,
231 'value' => $value,
232 'operation' => $operation,
233 'actions' => $actions
234 );
235
236 return true;
237 }
238
214 /**239 /**
215 * Responds with an Error240 * Responds with an Error
216 * @param <string> $message241 * @param <string> $message
@@ -255,6 +280,7 @@
255 // General280 // General
256 $response['html'] = $this->html;281 $response['html'] = $this->html;
257 $response['buttons'] = $this->buttons;282 $response['buttons'] = $this->buttons;
283 $response['fieldActions'] = $this->fieldActions;
258 $response['uniqueReference'] = $this->uniqueReference;284 $response['uniqueReference'] = $this->uniqueReference;
259 285
260 $response['success'] = $this->success;286 $response['success'] = $this->success;
@@ -307,42 +333,31 @@
307 // End the execution333 // End the execution
308 die();334 die();
309 }335 }
310 else336 else {
311 {
312 // If the response does not equal success then output an error337 // If the response does not equal success then output an error
313 if (!$this->success)338 if (!$this->success) {
314 {
315 // Store the message339 // Store the message
316 $_SESSION['ErrorMessage'] = $this->message;340 $_SESSION['ErrorMessage'] = $this->message;
317 341
318 // Redirect to the following342 // Redirect to the following
319 $url = 'index.php?p=error';343 $url = 'index.php?p=error';
320 344 }
321 // Header or JS redirect345 else {
322 if (headers_sent()) 346 // Have we been asked to refresh?
323 {347 $url = ($this->refresh) ? $this->refreshLocation : 'index.php?p=' . Kit::GetParam('p', _GET, _WORD, 'index');
324 echo "<script>document.location.href='$url';</script>\n";348 }
325 } 349
326 else 350 // Redirect and end execution
327 {351 Kit::Redirect($url);
328 header( 'HTTP/1.1 301 Moved Permanently' );
329 header( 'Location: ' . $url );
330 }
331
332 // End the execution
333 die();
334 }
335 }352 }
336 353
337 return;354 return;
338 }355 }
339 356
340 public static function Pager($id)357 public static function Pager($id, $type = 'grid_pager') {
341 {
342 Theme::Set('pager_id', 'XiboPager_' . $id);358 Theme::Set('pager_id', 'XiboPager_' . $id);
343 359
344 return Theme::RenderReturn('grid_pager');360 return Theme::RenderReturn($type);
345 }361 }
346}362}
347
348?>
349\ No newline at end of file363\ No newline at end of file
364?>
350365
=== modified file 'server/lib/app/thememanager.class.php'
--- server/lib/app/thememanager.class.php 2014-03-06 22:37:29 +0000
+++ server/lib/app/thememanager.class.php 2014-09-19 11:39:09 +0000
@@ -23,7 +23,6 @@
23class Theme {23class Theme {
24 private static $instance = null;24 private static $instance = null;
25 25
26 private $db;
27 private $user;26 private $user;
28 private $helpManager;27 private $helpManager;
29 private $dateManager;28 private $dateManager;
@@ -33,18 +32,15 @@
33 private $vars = null;32 private $vars = null;
34 private $config = null;33 private $config = null;
35 34
36 public function __construct(database $db, user $user) {35 public function __construct(user $user, $theme = NULL) {
3736
38 // Store some things for the Theme engine to use37 // Store some things for the Theme engine to use
39 $this->db =& $db;
40 $this->user =& $user;38 $this->user =& $user;
41 $this->help = new HelpManager($db, $user);39 $this->help = new HelpManager();
42 $this->dateManager = new DateManager($db);40 $this->dateManager = new DateManager();
43
44 // TODO: Perhaps we also allow the user to configure their own theme for their session?
4541
46 // What is the currently selected theme?42 // What is the currently selected theme?
47 $globalTheme = Config::GetSetting('GLOBAL_THEME_NAME');43 $globalTheme = ($theme == NULL) ? Config::GetSetting('GLOBAL_THEME_NAME') : $theme;
4844
49 // Is this theme valid?45 // Is this theme valid?
50 if (!is_dir('theme/' . $globalTheme))46 if (!is_dir('theme/' . $globalTheme))
@@ -85,8 +81,12 @@
85 if (file_exists('theme/' . $theme->name . '/html/' . $item . '.php')) {81 if (file_exists('theme/' . $theme->name . '/html/' . $item . '.php')) {
86 include('theme/' . $theme->name . '/html/' . $item . '.php');82 include('theme/' . $theme->name . '/html/' . $item . '.php');
87 }83 }
84 // Check the module theme folder
85 else if (file_exists('modules/theme/' . $item . '.php')) {
86 include('modules/theme/' . $item . '.php');
87 }
88 // If not, then use the default folder88 // If not, then use the default folder
89 elseif (file_exists('theme/default/html/' . $item . '.php')) {89 else if (file_exists('theme/default/html/' . $item . '.php')) {
90 include('theme/default/html/' . $item . '.php');90 include('theme/default/html/' . $item . '.php');
91 }91 }
92 else92 else
@@ -156,8 +156,8 @@
156 * @param string $string The String to Translate156 * @param string $string The String to Translate
157 * @param array $args Variables to insert (will replace %d %s in order)157 * @param array $args Variables to insert (will replace %d %s in order)
158 */158 */
159 public static function Translate($string, $args = null) {159 public static function Translate($string) {
160 return __($string, $args);160 return call_user_func_array('__', func_get_args());
161 }161 }
162162
163 public static function Set($key, $value) {163 public static function Set($key, $value) {
@@ -217,6 +217,10 @@
217 return Theme::GetInstance()->config['theme_name'];217 return Theme::GetInstance()->config['theme_name'];
218 }218 }
219219
220 public static function SourceLink() {
221 return (isset(Theme::GetInstance()->config['cms_source_url']) ? Theme::GetInstance()->config['cms_source_url'] : 'https://launchpad.net/xibo/1.7');
222 }
223
220 public static function ThemeFolder() {224 public static function ThemeFolder() {
221 return Theme::GetInstance()->name;225 return Theme::GetInstance()->name;
222 }226 }
@@ -240,7 +244,7 @@
240 $theme = Theme::GetInstance();244 $theme = Theme::GetInstance();
241 $array = array();245 $array = array();
242246
243 if (!$menu = new MenuManager($theme->db, $theme->user, $menu))247 if (!$menu = new MenuManager($theme->user, $menu))
244 trigger_error($menu->message, E_USER_ERROR);248 trigger_error($menu->message, E_USER_ERROR);
245 249
246 while ($menuItem = $menu->GetNextMenuItem()) {250 while ($menuItem = $menu->GetNextMenuItem()) {
@@ -282,7 +286,7 @@
282 */286 */
283 public static function SelectList($listName, $listValues, $idColumn, $nameColumn, $selectedId = null, $callBack = '', $classColumn = '', $styleColumn = '')287 public static function SelectList($listName, $listValues, $idColumn, $nameColumn, $selectedId = null, $callBack = '', $classColumn = '', $styleColumn = '')
284 {288 {
285 $list = '<select name="' . $listName . '" id="' . $listName . '"' . $callBack . '>';289 $list = '<select class="form-control" name="' . $listName . '" id="' . $listName . '"' . $callBack . '>';
286290
287 foreach ($listValues as $listItem)291 foreach ($listValues as $listItem)
288 {292 {
@@ -296,4 +300,4 @@
296 return $list;300 return $list;
297 }301 }
298}302}
299?>
300\ No newline at end of file303\ No newline at end of file
304?>
301305
=== modified file 'server/lib/app/translationengine.class.php'
--- server/lib/app/translationengine.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/app/translationengine.class.php 2014-09-19 11:39:09 +0000
@@ -1,7 +1,7 @@
1<?php1<?php
2/*2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009 Daniel Garner4 * Copyright (C) 2009-14 Daniel Garner
5 *5 *
6 * This file is part of Xibo.6 * This file is part of Xibo.
7 *7 *
@@ -31,10 +31,10 @@
31 * Gets and Sets the Local 31 * Gets and Sets the Local
32 * @return 32 * @return
33 */33 */
34 public static function InitLocale()34 public static function InitLocale($language = NULL)
35 {35 {
36 $localeDir = 'locale';36 $localeDir = 'locale';
37 $default = Config::GetSetting('DEFAULT_LANGUAGE');37 $default = ($language == NULL) ? Config::GetSetting('DEFAULT_LANGUAGE') : $language;
38 38
39 global $transEngine;39 global $transEngine;
40 global $stream;40 global $stream;
@@ -50,7 +50,7 @@
50 if ($lang != '')50 if ($lang != '')
51 {51 {
52 // Set the language52 // Set the language
53 Debug::LogEntry('audit', 'Set the Language from REQUEST [' . $lang . ']', 'TranslationEngine', 'InitLocal');53 //Debug::LogEntry('audit', 'Set the Language from REQUEST [' . $lang . ']', 'TranslationEngine', 'InitLocal');
5454
55 // Is this language supported?55 // Is this language supported?
56 // if not just use the default (eb_GB).56 // if not just use the default (eb_GB).
@@ -113,16 +113,19 @@
113 * @return 113 * @return
114 * @param $string Object114 * @param $string Object
115 */ 115 */
116function __($string, $args = null)116function __($string)
117{117{
118 global $transEngine;118 global $transEngine;
119 119
120 if ($transEngine != '')120 if ($transEngine != '')
121 $string = $transEngine->translate($string);121 $string = $transEngine->translate($string);
122122
123 $args = func_get_args();
124 array_shift($args);
125
123 if (count($args) > 0)126 if (count($args) > 0)
124 $string = vsprintf($string, $args);127 $string = vsprintf($string, $args);
125128
126 return $string;129 return $string;
127}130}
128?>
129\ No newline at end of file131\ No newline at end of file
132?>
130133
=== added file 'server/lib/data/bandwidth.data.class.php'
--- server/lib/data/bandwidth.data.class.php 1970-01-01 00:00:00 +0000
+++ server/lib/data/bandwidth.data.class.php 2014-09-19 11:39:09 +0000
@@ -0,0 +1,62 @@
1<?php
2/*
3 * Xibo - Digital Signage - http://www.xibo.org.uk
4 * Copyright (C) 2009-2012 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 Bandwidth extends Data {
24
25 public static $REGISTER = 1;
26 public static $RF = 2;
27 public static $SCHEDULE = 3;
28 public static $GETFILE = 4;
29 public static $GETRESOURCE = 5;
30 public static $MEDIAINVENTORY = 6;
31 public static $NOTIFYSTATUS = 7;
32 public static $SUBMITSTATS = 8;
33 public static $SUBMITLOG = 9;
34 public static $BLACKLIST = 10;
35 public static $SCREENSHOT = 11;
36
37 public function Log($displayId, $type, $sizeInBytes) {
38 try {
39 $dbh = PDOConnect::init();
40
41 $sth = $dbh->prepare('
42 INSERT INTO `bandwidth` (Month, Type, DisplayID, Size) VALUES (:month, :type, :displayid, :size)
43 ON DUPLICATE KEY UPDATE Size = Size + :size2
44 ');
45
46 $sth->execute(array(
47 'month' => strtotime(date('m').'/02/'.date('Y').' 00:00:00'),
48 'type' => $type,
49 'displayid' => $displayId,
50 'size' => $sizeInBytes,
51 'size2' => $sizeInBytes
52 ));
53
54 return true;
55 }
56 catch (Exception $e) {
57 Debug::LogEntry('error', $e->getMessage());
58 return false;
59 }
60 }
61}
62?>
063
=== modified file 'server/lib/data/data.class.php'
--- server/lib/data/data.class.php 2014-01-18 09:47:41 +0000
+++ server/lib/data/data.class.php 2014-09-19 11:39:09 +0000
@@ -31,9 +31,10 @@
31 * Data Class31 * Data Class
32 * @param database $db32 * @param database $db
33 */33 */
34 public function __construct(database $db)34 public function __construct(database $db = null)
35 {35 {
36 $this->db =& $db;36 if ($db != null)
37 $this->db =& $db;
37 38
38 $this->error = false;39 $this->error = false;
39 $this->errorNo = 0;40 $this->errorNo = 0;
4041
=== modified file 'server/lib/data/dataset.data.class.php'
--- server/lib/data/dataset.data.class.php 2014-07-08 14:45:16 +0000
+++ server/lib/data/dataset.data.class.php 2014-09-19 11:39:09 +0000
@@ -250,7 +250,7 @@
250 try {250 try {
251 $dbh = PDOConnect::init();251 $dbh = PDOConnect::init();
252 252
253 $sth = $dbh->prepare('SELECT `lkcampaignlayout`.CampaignID FROM `lkdatasetlayout` INNER JOIN `lkcampaignlayout` ON `lkcampaignlayout`.LayoutID = `lkdatasetlayout`.LayoutID WHERE DataSetID = :datasetid');253 $sth = $dbh->prepare('SELECT DISTINCT `lkcampaignlayout`.CampaignID FROM `lkdatasetlayout` INNER JOIN `lkcampaignlayout` ON `lkcampaignlayout`.LayoutID = `lkdatasetlayout`.LayoutID WHERE DataSetID = :datasetid');
254 $sth->execute(array(254 $sth->execute(array(
255 'datasetid' => $dataSetId255 'datasetid' => $dataSetId
256 ));256 ));
@@ -441,8 +441,7 @@
441441
442 Debug::LogEntry('audit', $SQL);442 Debug::LogEntry('audit', $SQL);
443443
444 if (!$rows = $db->GetArray($SQL, $associative))444 $rows = $db->GetArray($SQL, $associative);
445 trigger_error($db->error());
446445
447 if (!is_array($rows))446 if (!is_array($rows))
448 $rows = array();447 $rows = array();
449448
=== modified file 'server/lib/data/datasetdata.data.class.php'
--- server/lib/data/datasetdata.data.class.php 2014-07-12 13:54:51 +0000
+++ server/lib/data/datasetdata.data.class.php 2014-09-19 11:39:09 +0000
@@ -377,4 +377,4 @@
377 }377 }
378 }378 }
379}379}
380?>
381\ No newline at end of file380\ No newline at end of file
381?>
382382
=== modified file 'server/lib/data/display.data.class.php'
--- server/lib/data/display.data.class.php 2014-03-09 14:41:56 +0000
+++ server/lib/data/display.data.class.php 2014-09-19 11:39:09 +0000
@@ -20,28 +20,134 @@
20 */20 */
21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");21defined('XIBO') or die("Sorry, you are not allowed to directly access this page.<br /> Please press the back button in your browser.");
2222
23class Display extends Data23// Companion classes
24{24Kit::ClassLoader('displaygroup');
25 public function __construct(database $db)25
26 {26class Display extends Data {
27 include_once('lib/data/displaygroup.data.class.php');27
28 28 public $loaded;
29 parent::__construct($db);29
30 }30 public $displayId;
31 31 public $isAuditing;
32 /**32 public $display;
33 * Adds a Display33 public $description;
34 * @return 34 public $defaultLayoutId;
35 * @param $display Object35 public $license;
36 * @param $isAuditing Object36 public $licensed;
37 * @param $defaultLayoutID Object37 public $currentLicensed;
38 * @param $license Object38 public $loggedIn;
39 * @param $licensed Object39 public $lastAccessed;
40 * @param $incSchedule Object40 public $incSchedule;
41 */41 public $emailAlert;
42 public function Add($display, $isAuditing, $defaultLayoutID, $license, $licensed, $incSchedule)42 public $alertTimeout;
43 {43 public $clientAddress;
44 Debug::LogEntry('audit', 'IN', 'Display', 'Add');44 public $mediaInventoryStatus;
45 public $mediaInventoryXml;
46 public $macAddress;
47 public $lastChanged;
48 public $numberOfMacAddressChanges;
49 public $lastWakeOnLanCommandSent;
50 public $wakeOnLanEnabled;
51 public $wakeOnLanTime;
52 public $broadCastAddress;
53 public $secureOn;
54 public $cidr;
55 public $latitude;
56 public $longitude;
57 public $versionInstructions;
58 public $clientType;
59 public $clientVersion;
60 public $clientCode;
61 public $displayProfileId;
62 public $currentLayoutId;
63 public $screenShotRequested;
64
65 public $displayGroupId;
66
67 public function Load() {
68 try {
69 $dbh = PDOConnect::init();
70
71 $sth = $dbh->prepare('
72 SELECT display.*, displaygroup.displaygroupid, displaygroup.description, X(display.GeoLocation) AS Latitude, Y(display.GeoLocation) AS Longitude
73 FROM `display`
74 INNER JOIN `lkdisplaydg`
75 ON lkdisplaydg.displayid = display.displayId
76 INNER JOIN `displaygroup`
77 ON displaygroup.displaygroupid = lkdisplaydg.displaygroupid
78 AND isdisplayspecific = 1
79 WHERE display.displayid = :display_id');
80
81 $sth->execute(array('display_id' => $this->displayId));
82
83 if (!$row = $sth->fetch())
84 $this->ThrowError(25004, __('Cannot find display record'));
85
86 $this->isAuditing = Kit::ValidateParam($row['isAuditing'], _INT);
87 $this->display = Kit::ValidateParam($row['display'], _STRING);
88 $this->description = Kit::ValidateParam($row['description'], _STRING);
89 $this->defaultLayoutId = Kit::ValidateParam($row['defaultlayoutid'], _INT);
90 $this->license = Kit::ValidateParam($row['license'], _STRING);
91 $this->licensed = Kit::ValidateParam($row['licensed'], _INT);
92 $this->loggedIn = Kit::ValidateParam($row['loggedin'], _INT);
93 $this->lastAccessed = Kit::ValidateParam($row['lastaccessed'], _INT);
94 $this->incSchedule = Kit::ValidateParam($row['inc_schedule'], _INT);
95 $this->emailAlert = Kit::ValidateParam($row['email_alert'], _INT);
96 $this->alertTimeout = Kit::ValidateParam($row['alert_timeout'], _INT);
97 $this->clientAddress = Kit::ValidateParam($row['ClientAddress'], _STRING);
98 $this->mediaInventoryStatus = Kit::ValidateParam($row['MediaInventoryStatus'], _INT);
99 $this->mediaInventoryXml = Kit::ValidateParam($row['MediaInventoryXml'], _HTMLSTRING);
100 $this->macAddress = Kit::ValidateParam($row['MacAddress'], _STRING);
101 $this->lastChanged = Kit::ValidateParam($row['LastChanged'], _INT);
102 $this->numberOfMacAddressChanges = Kit::ValidateParam($row['NumberOfMacAddressChanges'], _INT);
103 $this->lastWakeOnLanCommandSent = Kit::ValidateParam($row['LastWakeOnLanCommandSent'], _INT);
104 $this->wakeOnLanEnabled = Kit::ValidateParam($row['WakeOnLan'], _INT);
105 $this->wakeOnLanTime = Kit::ValidateParam($row['WakeOnLanTime'], _STRING);
106 $this->broadCastAddress = Kit::ValidateParam($row['BroadCastAddress'], _STRING);
107 $this->secureOn = Kit::ValidateParam($row['SecureOn'], _STRING);
108 $this->cidr = Kit::ValidateParam($row['Cidr'], _INT);
109 $this->latitude = Kit::ValidateParam($row['Latitude'], _DOUBLE);
110 $this->longitude = Kit::ValidateParam($row['Longitude'], _DOUBLE);
111 $this->versionInstructions = Kit::ValidateParam($row['version_instructions'], _STRING);
112 $this->clientType = Kit::ValidateParam($row['client_type'], _STRING);
113 $this->clientVersion = Kit::ValidateParam($row['client_version'], _STRING);
114 $this->clientCode = Kit::ValidateParam($row['client_code'], _INT);
115 $this->displayProfileId = Kit::ValidateParam($row['displayprofileid'], _INT);
116 $this->currentLayoutId = Kit::ValidateParam($row['currentLayoutId'], _INT);
117 $this->screenShotRequested = Kit::ValidateParam($row['screenShotRequested'], _INT);
118
119 $this->displayGroupId = Kit::ValidateParam($row['displaygroupid'], _INT);
120
121 // Store the current licensed flag, in case we are changing it and need to check it.
122 $this->currentLicensed = $this->licensed;
123
124 $this->loaded = true;
125
126 return true;
127 }
128 catch (Exception $e) {
129
130 Debug::LogEntry('error', $e->getMessage());
131
132 if (!$this->IsError())
133 $this->SetError(1, __('Unknown Error'));
134
135 return false;
136 }
137 }
138
139 /**
140 * Adds a Display
141 * @return
142 * @param $display Object
143 * @param $isAuditing Object
144 * @param $defaultLayoutID Object
145 * @param $license Object
146 * @param $licensed Object
147 * @param $incSchedule Object
148 */
149 public function Add($display, $isAuditing, $defaultLayoutID, $license, $licensed, $incSchedule) {
150 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
45 151
46 try {152 try {
47 $dbh = PDOConnect::init();153 $dbh = PDOConnect::init();
@@ -62,7 +168,7 @@
62 'email_alert' => 0,168 'email_alert' => 0,
63 'alert_timeout' => 0169 'alert_timeout' => 0
64 ));170 ));
65 171
66 // Get the ID of the inserted record172 // Get the ID of the inserted record
67 $displayId = $dbh->lastInsertId();173 $displayId = $dbh->lastInsertId();
68174
@@ -89,20 +195,26 @@
89195
90 return false;196 return false;
91 }197 }
92 }198 }
93 199
94 /**200 /**
95 * Edits a Display 201 * Edits a Display
96 * @return 202 * @return
97 * @param $displayID Object203 * @param $displayID Object
98 * @param $isAuditing Object204 * @param $isAuditing Object
99 * @param $defaultLayoutID Object205 * @param $defaultLayoutID Object
100 * @param $licensed Object206 * @param $licensed Object
101 * @param $incSchedule Object207 * @param $incSchedule Object
102 */208 */
103 public function Edit($displayID, $display, $isAuditing, $defaultLayoutID, $licensed, $incSchedule, $email_alert, $alert_timeout, $wakeOnLanEnabled, $wakeOnLanTime, $broadCastAddress, $secureOn, $cidr, $latitude, $longitude)209 public function Edit() {
104 {210 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
105 Debug::LogEntry('audit', 'IN', 'Display', 'Edit');211
212 // Validation
213 if ($this->display == '')
214 return $this->SetError(__("Can not have a display without a name"));
215
216 if ($this->wakeOnLanEnabled == 1 && $this->wakeOnLanTime == '')
217 return $this->SetError(__('Wake on Lan is enabled, but you have not specified a time to wake the display'));
106 218
107 try {219 try {
108 $dbh = PDOConnect::init();220 $dbh = PDOConnect::init();
@@ -110,19 +222,10 @@
110 // Check the number of licensed displays222 // Check the number of licensed displays
111 $maxDisplays = Config::GetSetting('MAX_LICENSED_DISPLAYS');223 $maxDisplays = Config::GetSetting('MAX_LICENSED_DISPLAYS');
112224
113 if ($maxDisplays > 0)225 if ($maxDisplays > 0) {
114 {
115 // See if this is a license switch226 // See if this is a license switch
116 $sth = $dbh->prepare('SELECT licensed FROM display WHERE DisplayID = :displayid');
117 $sth->execute(array(
118 'displayid' => $displayID
119 ));
120
121 if (!$row = $sth->fetch())
122 $this->ThrowError(25004, __('Cannot find display record'));
123
124 // Has the licence flag toggled?227 // Has the licence flag toggled?
125 if (Kit::ValidateParam($row['licensed'], _INT) != $licensed && $licensed == 1)228 if ($this->currentLicensed != $this->licensed && $this->licensed == 1)
126 {229 {
127 // License change - test number of licensed displays.230 // License change - test number of licensed displays.
128 $sth = $dbh->prepare('SELECT COUNT(DisplayID) AS CountLicensed FROM display WHERE licensed = 1');231 $sth = $dbh->prepare('SELECT COUNT(DisplayID) AS CountLicensed FROM display WHERE licensed = 1');
@@ -143,101 +246,106 @@
143 // Validate some parameters246 // Validate some parameters
144247
145 // Fill $addr with client's IP address, if $addr is empty248 // Fill $addr with client's IP address, if $addr is empty
146 if ($broadCastAddress != '')249 if ($this->broadCastAddress != '')
147 {250 {
148 // Resolve broadcast address251 // Resolve broadcast address
149 // same as (but easier than): preg_match("/\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b/",$addr)252 // same as (but easier than): preg_match("/\b(([01]?\d?\d|2[0-4]\d|25[0-5])\.){3}([01]?\d?\d|2[0-4]\d|25[0-5])\b/",$addr)
150 if (!filter_var($broadCastAddress, FILTER_VALIDATE_IP))253 if (!filter_var($this->broadCastAddress, FILTER_VALIDATE_IP))
151 $this->ThrowError(25015, __('BroadCast Address is not a valid IP Address'));254 $this->ThrowError(25015, __('BroadCast Address is not a valid IP Address'));
152 }255 }
153256
154 // Check whether $cidr is valid257 // Check whether $cidr is valid
155 if ($cidr != '')258 if ($this->cidr != '')
156 {259 {
157 if ((!is_numeric($cidr)) || ($cidr < 0) || ($cidr > 32))260 if ((!is_numeric($this->cidr)) || ($this->cidr < 0) || ($this->cidr > 32))
158 $this->ThrowError(25015, __('CIDR subnet mask is not a number within the range of 0 to 32.'));261 $this->ThrowError(25015, __('CIDR subnet mask is not a number within the range of 0 to 32.'));
159 }262 }
160263
161 // Check whether $secureOn is valid264 // Check whether $secureOn is valid
162 if ($secureOn != '')265 if ($this->secureOn != '')
163 {266 {
164 $secureOn = strtoupper($secureOn);267 $this->secureOn = strtoupper($this->secureOn);
165 $secureOn = str_replace(":", "-", $secureOn);268 $this->secureOn = str_replace(":", "-", $this->secureOn);
166269
167 if ((!preg_match("/([A-F0-9]{2}[-]){5}([0-9A-F]){2}/", $secureOn)) || (strlen($secureOn) != 17))270 if ((!preg_match("/([A-F0-9]{2}[-]){5}([0-9A-F]){2}/", $this->secureOn)) || (strlen($this->secureOn) != 17))
168 $this->ThrowError(25015, __('Pattern of secureOn-password is not "xx-xx-xx-xx-xx-xx" (x = digit or CAPITAL letter)'));271 $this->ThrowError(25015, __('Pattern of secureOn-password is not "xx-xx-xx-xx-xx-xx" (x = digit or CAPITAL letter)'));
169 }272 }
170273
171 Debug::LogEntry('audit', 'Validation Complete and Passed', 'Display', 'Edit');274 Debug::LogEntry('audit', 'Validation Complete and Passed', 'Display', 'Edit');
172275
173 // Update the display record276 // Update the display record
174 $SQL = "UPDATE display SET display = :display, ";277 $SQL = '
175 $SQL .= " defaultlayoutid = :defaultlayoutid, ";278 UPDATE display
176 $SQL .= " inc_schedule = :incschedule, ";279 SET display = :display,
177 $SQL .= " licensed = :licensed, ";280 defaultlayoutid = :defaultlayoutid,
178 $SQL .= " isAuditing = :isauditing, ";281 inc_schedule = :incschedule,
179 $SQL .= " email_alert = :emailalert, ";282 licensed = :licensed,
180 $SQL .= " alert_timeout = :alerttimeout, ";283 isAuditing = :isauditing,
181 $SQL .= " WakeOnLan = :wakeonlan, ";284 email_alert = :emailalert,
182 $SQL .= " WakeOnLanTime = :wakeonlantime, ";285 alert_timeout = :alerttimeout,
183 $SQL .= " BroadCastAddress = :broadcastaddress, ";286 WakeOnLan = :wakeonlan,
184 $SQL .= " SecureOn = :secureon, ";287 WakeOnLanTime = :wakeonlantime,
185 $SQL .= " Cidr = :cidr, ";288 BroadCastAddress = :broadcastaddress,
186 $SQL .= " GeoLocation = POINT(:latitude, :longitude) ";289 SecureOn = :secureon,
187 $SQL .= " WHERE displayid = :displayid ";290 Cidr = :cidr,
291 GeoLocation = POINT(:latitude, :longitude),
292 displayprofileid = :displayprofileid
293 WHERE displayid = :displayid';
188294
189 $sth = $dbh->prepare($SQL);295 $sth = $dbh->prepare($SQL);
190 $sth->execute(array(296 $sth->execute(array(
191 'display' => $display,297 'display' => $this->display,
192 'defaultlayoutid' => $defaultLayoutID,298 'defaultlayoutid' => $this->defaultLayoutId,
193 'incschedule' => $incSchedule,299 'incschedule' => $this->incSchedule,
194 'licensed' => $licensed,300 'licensed' => $this->licensed,
195 'isauditing' => $isAuditing,301 'isauditing' => $this->isAuditing,
196 'emailalert' => $email_alert,302 'emailalert' => $this->emailAlert,
197 'alerttimeout' => $alert_timeout,303 'alerttimeout' => $this->alertTimeout,
198 'wakeonlan' => $wakeOnLanEnabled,304 'wakeonlan' => $this->wakeOnLanEnabled,
199 'wakeonlantime' => $wakeOnLanTime,305 'wakeonlantime' => $this->wakeOnLanTime,
200 'broadcastaddress' => $broadCastAddress,306 'broadcastaddress' => $this->broadCastAddress,
201 'secureon' => $secureOn,307 'secureon' => $this->secureOn,
202 'cidr' => $cidr,308 'cidr' => $this->cidr,
203 'latitude' => $latitude,309 'latitude' => $this->latitude,
204 'longitude' => $longitude,310 'longitude' => $this->longitude,
205 'displayid' => $displayID311 'displayprofileid' => $this->displayProfileId,
312 'displayid' => $this->displayId
206 ));313 ));
207314
208 Debug::LogEntry('audit', 'Display Edited', 'Display', 'Edit');315 Debug::LogEntry('audit', 'Display Edited', 'Display', 'Edit');
209 316
210 // Use a DisplayGroup to handle the default layout and displaygroup name for this display317 // Use a DisplayGroup to handle the default layout and displaygroup name for this display
211 $displayGroupObject = new DisplayGroup($this->db);318 Kit::ClassLoader('displaygroup');
212 319 $displayGroupObject = new DisplayGroup();
213 // Do we also want to update the linked Display Groups name (seeing as that is what we will be presenting to everyone)320
214 if (!$displayGroupObject->EditDisplayGroup($displayID, $display)) {321 // Do we also want to update the linked Display Groups name (seeing as that is what we will be presenting to everyone)
322 if (!$displayGroupObject->Edit($this->displayGroupId, $this->display, $this->description)) {
215 $this->ThrowError(25002, __('Could not update this display with a new name.'));323 $this->ThrowError(25002, __('Could not update this display with a new name.'));
216 }324 }
217325
218 Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'Edit');326 Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'Edit');
219 327
220 return true;328 return true;
221 }329 }
222 catch (Exception $e) {330 catch (Exception $e) {
223 331
224 Debug::LogEntry('error', $e->getMessage());332 Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__);
225333
226 if (!$this->IsError())334 if (!$this->IsError())
227 $this->SetError(25000, __('Could not update display'));335 $this->SetError(25000, __('Could not update display'));
228336
229 return false;337 return false;
230 }338 }
231 }339 }
232 340
233 /**341 /**
234 * Deletes a Display342 * Deletes a Display
235 * @return 343 * @return
236 * @param $displayID Object344 * @param $displayID Object
237 */345 */
238 public function Delete($displayID)346 public function Delete($displayID)
239 {347 {
240 Debug::LogEntry('audit', 'IN', 'Display', 'Delete');348 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
241 349
242 try {350 try {
243 $dbh = PDOConnect::init();351 $dbh = PDOConnect::init();
@@ -276,17 +384,17 @@
276384
277 return false;385 return false;
278 }386 }
279 }387 }
280 388
281 /**389 /**
282 * Edits a Displays Name390 * Edits a Displays Name
283 * @return 391 * @return
284 * @param $license Object392 * @param $license Object
285 * @param $display Object393 * @param $display Object
286 */394 */
287 public function EditDisplayName($license, $display) 395 public function EditDisplayName($license, $display)
288 {396 {
289 Debug::LogEntry('audit', 'IN', 'DisplayGroup', 'EditDisplayName');397 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
290398
291 try {399 try {
292 $dbh = PDOConnect::init();400 $dbh = PDOConnect::init();
@@ -297,17 +405,17 @@
297 'display' => $display,405 'display' => $display,
298 'license' => $license406 'license' => $license
299 ));407 ));
300 408
301 // Also need to update the display group name here.409 // Also need to update the display group name here.
302 $displayGroupObject = new DisplayGroup($this->db);410 $displayGroupObject = new DisplayGroup($this->db);
303 411
304 // Do we also want to update the linked Display Groups name (seeing as that is what we will be presenting to everyone)412 // Do we also want to update the linked Display Groups name (seeing as that is what we will be presenting to everyone)
305 if (!$displayGroupObject->EditDisplayGroup($displayID, $display))413 if (!$displayGroupObject->EditDisplayGroup($displayID, $display))
306 $this->ThrowError(25015, __('Could not update this display with a new name.'));414 $this->ThrowError(25015, __('Could not update this display with a new name.'));
307 415
308 Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'EditDisplayName');416 Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'EditDisplayName');
309 417
310 return true;418 return true;
311 }419 }
312 catch (Exception $e) {420 catch (Exception $e) {
313 421
@@ -318,106 +426,95 @@
318426
319 return false;427 return false;
320 }428 }
321 }429 }
322 430
323 /**431 /**
324 * Sets the information required on the display to indicate that it is still logged in432 * Sets the information required on the display to indicate that it is still logged in
325 * @param string $license The display licence key433 * @param int $displayId The Display ID
326 * @param string $clientAddress The client IP address434 * @param array $status The Display Status
327 * @param integer $mediaInventoryComplete The Media Inventory Status
328 * @param string $mediaInventoryXml The Media Inventory XML
329 * @param string $macAddress The Client Mac Address
330 * @param string $clientType The Client Type
331 * @param string $clientVersion The Client Version
332 * @param integer $clientCode The Client Version Code
333 */435 */
334 public function Touch($license, $clientAddress = '', $mediaInventoryComplete = 0, $mediaInventoryXml = '', $macAddress = '', $clientType = '', $clientVersion = '', $clientCode = 0)436 public function Touch($displayId, $status = array())
335 {437 {
336 Debug::LogEntry('audit', 'IN', 'DisplayGroup', 'Touch');438 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
337 439
338 try {440 try {
339 $dbh = PDOConnect::init();441 $dbh = PDOConnect::init();
340442
341 // Set the last accessed flag on the display443 $this->displayId = $displayId;
342 $SQL = "";444 $this->Load();
343 $SQL .= "UPDATE display SET lastaccessed = :lastaccessed, loggedin = :loggedin ";445
344446 // Update last accessed and set to be logged in
345 $params = array();447 $this->lastAccessed = time();
346 $params['lastaccessed'] = time();448 $this->loggedIn = 1;
347 $params['loggedin'] = 1;449
348 $params['license'] = $license;450 // Pull in any of the optional parameters from the status array
349451 $this->clientAddress = (Kit::GetParam('clientAddress', $status, _STRING) == '') ? $this->clientAddress : Kit::GetParam('clientAddress', $status, _STRING);
350 // We will want to update the client Address if it is given452 $this->mediaInventoryStatus = (Kit::GetParam('mediaInventoryStatus', $status, _INT) == 0) ? $this->mediaInventoryStatus : Kit::GetParam('mediaInventoryStatus', $status, _INT);
351 if ($clientAddress != '') {453 $this->mediaInventoryXml = (Kit::GetParam('mediaInventoryXml', $status, _HTMLSTRING) == '') ? $this->mediaInventoryXml : Kit::GetParam('mediaInventoryXml', $status, _HTMLSTRING);
352 $SQL .= " , ClientAddress = :clientaddress ";454 $this->clientType = (Kit::GetParam('clientType', $status, _STRING) == '') ? $this->clientType : Kit::GetParam('clientType', $status, _STRING);
353 $params['clientaddress'] = $clientAddress;455 $this->clientVersion = (Kit::GetParam('clientVersion', $status, _STRING) == '') ? $this->clientVersion : Kit::GetParam('clientVersion', $status, _STRING);
354 }456 $this->clientCode = (Kit::GetParam('clientCode', $status, _INT) == 0) ? $this->clientCode : Kit::GetParam('clientCode', $status, _INT);
355457 $this->currentLayoutId = (Kit::GetParam('currentLayoutId', $status, _INT) == 0) ? $this->currentLayoutId : Kit::GetParam('currentLayoutId', $status, _INT);
356 // Media Inventory Settings (if appropriate)458 $this->screenShotRequested = (Kit::GetParam('screenShotRequested', $status, _INT, -1) == -1) ? $this->screenShotRequested : Kit::GetParam('screenShotRequested', $status, _INT);
357 if ($mediaInventoryComplete != 0) {459
358 $SQL .= " , MediaInventoryStatus = :mediainventorystatus ";460 // Has the mac address changed
359 $params['mediainventorystatus'] = $mediaInventoryComplete;461 if (Kit::GetParam('macAddress', $status, _STRING) != '') {
360 }462 if ($this->macAddress != Kit::GetParam('macAddress', $status, _STRING)) {
361463 // Mac address change detected
362 if ($mediaInventoryXml != '') {464 $this->macAddress = Kit::GetParam('macAddress', $status, _STRING);
363 $SQL .= " , MediaInventoryXml = :mediainventoryxml ";465 $this->numberOfMacAddressChanges++;
364 $params['mediainventoryxml'] = $mediaInventoryXml;466 $this->lastChanged = time();
365 }
366
367 // Client information if present
368 if ($clientType != '') {
369 $SQL .= " , client_type = :client_type ";
370 $params['client_type'] = $clientType;
371 }
372
373 if ($clientVersion != '') {
374 $SQL .= " , client_version = :client_version ";
375 $params['client_version'] = $clientVersion;
376 }
377
378 if ($clientCode != '') {
379 $SQL .= " , client_code = :client_code ";
380 $params['client_code'] = $clientCode;
381 }
382
383 // Mac address storage
384 if ($macAddress != '')
385 {
386 // Address changed.
387 $sth = $dbh->prepare('SELECT MacAddress FROM display WHERE license = :license');
388 $sth->execute(array(
389 'license' => $license
390 ));
391
392 if (!$row = $sth->fetch())
393 $currentAddress = '';
394 else
395 $currentAddress = $row['MacAddress'];
396
397 if ($macAddress != $currentAddress)
398 {
399 $SQL .= " , MacAddress = :macaddress, LastChanged = :lastchanged, NumberOfMacAddressChanges = NumberOfMacAddressChanges + 1 ";
400 $params['macaddress'] = $macAddress;
401 $params['lastchanged'] = time();
402 }467 }
403 }468 }
404469
405 // Restrict to the display license470 // Save
406 $SQL .= " WHERE license = :license";471 $SQL = '
472 UPDATE display SET lastaccessed = :lastAccessed,
473 loggedin = :loggedIn,
474 ClientAddress = :clientAddress,
475 MediaInventoryStatus = :mediaInventoryStatus,
476 MediaInventoryXml = :mediaInventoryXml,
477 client_type = :clientType,
478 client_version = :clientVersion,
479 client_code = :clientCode,
480 MacAddress = :macAddress,
481 LastChanged = :lastChanged,
482 NumberOfMacAddressChanges = :numberOfMacAddressChanges,
483 currentLayoutId = :currentLayoutId,
484 screenShotRequested = :screenShotRequested
485 WHERE displayId = :displayId
486 ';
407487
408 // Update the display with its new name (using the license as the key)488 // Update the display
409 $sth = $dbh->prepare($SQL);489 $sth = $dbh->prepare($SQL);
410 $sth->execute($params);490 $sth->execute(array(
411 491 'displayId' => $this->displayId,
412 Debug::LogEntry('audit', 'OUT', 'DisplayGroup', 'Touch');492 'lastAccessed' => $this->lastAccessed,
413 493 'loggedIn' => $this->loggedIn,
414 return true;494 'clientAddress' => $this->clientAddress,
495 'mediaInventoryStatus' => $this->mediaInventoryStatus,
496 'mediaInventoryXml' => $this->mediaInventoryXml,
497 'clientType' => $this->clientType,
498 'clientVersion' => $this->clientVersion,
499 'clientCode' => $this->clientCode,
500 'macAddress' => $this->macAddress,
501 'lastChanged' => $this->lastChanged,
502 'numberOfMacAddressChanges' => $this->numberOfMacAddressChanges,
503 'currentLayoutId' => $this->currentLayoutId,
504 'screenShotRequested' => $this->screenShotRequested
505 ));
506
507 return true;
415 }508 }
416 catch (Exception $e) {509 catch (Exception $e) {
417 Debug::LogEntry('error', $e->getMessage());510 Debug::LogEntry('error', $e->getMessage());
418 return $this->SetError(25002, __("Error updating this displays last accessed information."));511 return $this->SetError(25002, __("Error updating this displays last accessed information."));
419 }512 }
420 }513 }
514
515 public function RequestScreenShot($displayId) {
516 return $this->Touch($displayId, array('screenShotRequested' => 1));
517 }
421518
422 /**519 /**
423 * Flags a display as being incomplete520 * Flags a display as being incomplete
@@ -460,12 +557,14 @@
460557
461 // Which displays does a change to this layout effect?558 // Which displays does a change to this layout effect?
462 $SQL = " SELECT DISTINCT display.DisplayID ";559 $SQL = " SELECT DISTINCT display.DisplayID ";
463 $SQL .= " FROM schedule_detail ";560 $SQL .= " FROM schedule ";
464 $SQL .= " INNER JOIN lkdisplaydg ";561 $SQL .= " INNER JOIN schedule_detail ";
465 $SQL .= " ON lkdisplaydg.DisplayGroupID = schedule_detail.DisplayGroupID ";562 $SQL .= " ON schedule_detail.eventid = schedule.eventid ";
466 $SQL .= " INNER JOIN display ";563 $SQL .= " INNER JOIN lkdisplaydg ";
467 $SQL .= " ON lkdisplaydg.DisplayID = display.displayID ";564 $SQL .= " ON lkdisplaydg.DisplayGroupID = schedule_detail.DisplayGroupID ";
468 $SQL .= " WHERE schedule_detail.CampaignID = :campaignid ";565 $SQL .= " INNER JOIN display ";
566 $SQL .= " ON lkdisplaydg.DisplayID = display.displayID ";
567 $SQL .= " WHERE schedule.CampaignID = :campaignid ";
469 $SQL .= " AND schedule_detail.FromDT < :fromdt AND schedule_detail.ToDT > :todt ";568 $SQL .= " AND schedule_detail.FromDT < :fromdt AND schedule_detail.ToDT > :todt ";
470 $SQL .= " UNION ";569 $SQL .= " UNION ";
471 $SQL .= " SELECT DISTINCT display.DisplayID ";570 $SQL .= " SELECT DISTINCT display.DisplayID ";
@@ -505,7 +604,7 @@
505 */604 */
506 public function EditDefaultLayout($displayId, $defaultLayoutId)605 public function EditDefaultLayout($displayId, $defaultLayoutId)
507 {606 {
508 Debug::LogEntry('audit', 'IN', 'Display', 'EditDefaultLayout');607 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
509608
510 try {609 try {
511 $dbh = PDOConnect::init();610 $dbh = PDOConnect::init();
@@ -567,7 +666,7 @@
567 */666 */
568 public function WakeOnLan($displayId)667 public function WakeOnLan($displayId)
569 {668 {
570 Debug::LogEntry('audit', 'IN', 'Display', 'WakeOnLan');669 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
571670
572 try {671 try {
573 $dbh = PDOConnect::init();672 $dbh = PDOConnect::init();
@@ -613,15 +712,16 @@
613 * Wake On Lan Script712 * Wake On Lan Script
614 * // Version: 2713 * // Version: 2
615 * // Author of this application:714 * // Author of this application:
616 * // DS508_customer (http://www.synology.com/enu/forum/memberlist.php?mode=viewprofile&u=12636)715 * // DS508_customer (http://www.synology.com/enu/forum/memberlist.php?mode=viewprofile&u=12636)
617 * // Please inform the author of any suggestions on (the functionality, graphical design, ... of) this application.716 * // Please inform the author of any suggestions on (the functionality, graphical design, ... of) this application.
618 * // More info: http://wolviaphp.sourceforge.net717 * // More info: http://wolviaphp.sourceforge.net
619 * // License: GPLv2.0718 * // License: GPLv2.0
620 *719 *
621 * Modified for use with the Xibo project by Dan Garner.720 * Modified for use with the Xibo project by Dan Garner.
622 */721 */
623 function TransmitWakeOnLan($mac_address, $secureon, $addr, $cidr, $port)722 function TransmitWakeOnLan($mac_address, $secureon, $addr, $cidr, $port) {
624 {723 Debug::LogEntry('audit', 'IN', get_class(), __FUNCTION__);
724
625 // Prepare magic packet: part 1/3 (defined constant)725 // Prepare magic packet: part 1/3 (defined constant)
626 $buf = "";726 $buf = "";
627 727
628728
=== modified file 'server/lib/data/displaygroup.data.class.php'
--- server/lib/data/displaygroup.data.class.php 2014-04-19 09:11:34 +0000
+++ server/lib/data/displaygroup.data.class.php 2014-09-19 11:39:09 +0000
@@ -22,12 +22,12 @@
2222
23class DisplayGroup extends Data23class DisplayGroup extends Data
24{24{
25 public function __construct(database $db)25 public function __construct()
26 {26 {
27 include_once('lib/data/schedule.data.class.php');27 include_once('lib/data/schedule.data.class.php');
28 include_once('lib/data/displaygroupsecurity.data.class.php');28 include_once('lib/data/displaygroupsecurity.data.class.php');
29 29
30 parent::__construct($db);30 parent::__construct();
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches