Merge lp:~dangarner/xibo/1270899 into lp:xibo/1.6

Proposed by Dan Garner
Status: Merged
Approved by: Dan Garner
Approved revision: 298
Merged at revision: 298
Proposed branch: lp:~dangarner/xibo/1270899
Merge into: lp:xibo/1.6
Diff against target: 115 lines (+38/-4)
4 files modified
server/install/database/66.sql (+16/-0)
server/install/master/data.sql (+3/-1)
server/lib/pages/admin.class.php (+17/-3)
server/locale/dbtranslate.php (+2/-0)
To merge this branch: bzr merge lp:~dangarner/xibo/1270899
Reviewer Review Type Date Requested Status
Xibo Maintainters Pending
Review via email: mp+202356@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/install/database/66.sql'
2--- server/install/database/66.sql 2014-01-19 11:52:23 +0000
3+++ server/install/database/66.sql 2014-01-20 17:53:04 +0000
4@@ -78,6 +78,22 @@
5 (78, 'User', 'SetPassword', 'manual/single.php?p=users/users#Set_Password'),
6 (79, 'DataSet', 'ImportCSV', 'manual/single.php?p=content/content_dataset#Import_CSV');
7
8+INSERT INTO `setting` (
9+`settingid` ,
10+`setting` ,
11+`value` ,
12+`type` ,
13+`helptext` ,
14+`options` ,
15+`cat` ,
16+`userChange`
17+)
18+VALUES (
19+NULL , 'SETTING_IMPORT_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0'
20+), (
21+NULL , 'SETTING_LIBRARY_TIDY_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0'
22+);
23+
24 UPDATE `version` SET `app_ver` = '1.6.0-rc1', `XmdsVersion` = 3;
25 UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
26 UPDATE `version` SET `DBVersion` = '66';
27\ No newline at end of file
28
29=== modified file 'server/install/master/data.sql'
30--- server/install/master/data.sql 2014-01-19 14:06:56 +0000
31+++ server/install/master/data.sql 2014-01-20 17:53:04 +0000
32@@ -251,7 +251,9 @@
33 (63, 'GLOBAL_THEME_NAME', 'default', 'text', 'The Theme to apply to all pages by default', NULL, 'general', 1),
34 (64, 'DEFAULT_LAT', '51.504', 'text', 'The Latitude to apply for any Geo aware Previews', NULL, 'general', 1),
35 (65, 'DEFAULT_LONG', '-0.104', 'text', 'The Longitude to apply for any Geo aware Previews', NULL, 'general', 1),
36-(66, 'SCHEDULE_WITH_VIEW_PERMISSION', 'No', 'dropdown', 'Should users with View permissions on displays be allowed to schedule to them?', 'Yes|No', 'permissions', '1');
37+(66, 'SCHEDULE_WITH_VIEW_PERMISSION', 'No', 'dropdown', 'Should users with View permissions on displays be allowed to schedule to them?', 'Yes|No', 'permissions', '1'),
38+(67, 'SETTING_IMPORT_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0'),
39+(68, 'SETTING_LIBRARY_TIDY_ENABLED', 'Off', 'dropdown', NULL , 'On|Off', 'general', '0');
40
41 INSERT INTO `usertype` (`usertypeid`, `usertype`) VALUES
42 (1, 'Super Admin'),
43
44=== modified file 'server/lib/pages/admin.class.php'
45--- server/lib/pages/admin.class.php 2014-01-18 09:47:41 +0000
46+++ server/lib/pages/admin.class.php 2014-01-20 17:53:04 +0000
47@@ -276,9 +276,14 @@
48 if ($cat == 'general')
49 {
50 $output .= '<p>' . __('Import / Export Database') . '</p>';
51- $output .= '<button class="XiboFormButton" href="index.php?p=admin&q=RestoreForm">' . __('Import') . '</button>';
52+
53+ if (Config::GetSetting('SETTING_IMPORT_ENABLED') == 'On')
54+ $output .= '<button class="XiboFormButton" href="index.php?p=admin&q=RestoreForm">' . __('Import') . '</button>';
55+
56 $output .= '<button class="XiboFormButton" href="index.php?p=admin&q=BackupForm">' . __('Export') . '</button>';
57- $output .= '<button class="XiboFormButton" href="index.php?p=admin&q=TidyLibrary">' . __('Tidy Library') . '</button>';
58+
59+ if (Config::GetSetting('SETTING_LIBRARY_TIDY_ENABLED') == 'On')
60+ $output .= '<button class="XiboFormButton" href="index.php?p=admin&q=TidyLibrary">' . __('Tidy Library') . '</button>';
61 }
62
63 // Need to now get all the Misc settings
64@@ -636,6 +641,9 @@
65 {
66 $response = new ResponseManager();
67
68+ if (Config::GetSetting('SETTING_IMPORT_ENABLED') != 'On')
69+ trigger_error(__('Sorry this function is disabled.'), E_USER_ERROR);
70+
71 // Check we have permission to do this
72 if ($this->user->usertypeid != 1)
73 trigger_error(__('Only an adminitrator can import a database'));
74@@ -673,6 +681,9 @@
75 {
76 $db =& $this->db;
77
78+ if (Config::GetSetting('SETTING_IMPORT_ENABLED') != 'On')
79+ trigger_error(__('Sorry this function is disabled.'), E_USER_ERROR);
80+
81 include('install/header.inc');
82 echo '<div class="info">';
83
84@@ -710,7 +721,7 @@
85 }
86
87 echo '</div>';
88- echo '<a href="index.php?p=admin">Database Restored. Click here to continue.</a>';
89+ echo '<a href="index.php?p=admin">' . __('Database Restored. Click here to continue.') . '</a>';
90
91 include('install/footer.inc');
92
93@@ -743,6 +754,9 @@
94 $db =& $this->db;
95 $response = new ResponseManager();
96
97+ if (Config::GetSetting('SETTING_LIBRARY_TIDY_ENABLED') != 'On')
98+ trigger_error(__('Sorry this function is disabled.'), E_USER_ERROR);
99+
100 // Also run a script to tidy up orphaned media in the library
101 $library = Config::GetSetting('LIBRARY_LOCATION');
102 $library = rtrim($library, '/') . '/';
103
104=== modified file 'server/locale/dbtranslate.php'
105--- server/locale/dbtranslate.php 2014-01-18 09:47:41 +0000
106+++ server/locale/dbtranslate.php 2014-01-20 17:53:04 +0000
107@@ -94,6 +94,8 @@
108 echo __('DEFAULT_LAT');
109 echo __('DEFAULT_LONG');
110 echo __('SCHEDULE_WITH_VIEW_PERMISSION');
111+echo __('SETTING_IMPORT_ENABLED');
112+echo __('SETTING_LIBRARY_TIDY_ENABLED');
113
114 // Transitions
115 echo __('Fade In');

Subscribers

People subscribed via source and target branches

to all changes: