[open-ils-commits] [GIT] Evergreen ILS branch master updated. cb56b66329964ecf0fdd27ae721b93d321b30c62
Evergreen Git
git at git.evergreen-ils.org
Tue Oct 4 14:30:08 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via cb56b66329964ecf0fdd27ae721b93d321b30c62 (commit)
via c5b58fa98b415173786de6aa35db68d4aece2f35 (commit)
via 8d748bd69eb6d75ad4c6fc7360bcae5e9a52a41a (commit)
via 3cbc8a303e969243105a6e80104aec6b889aaf05 (commit)
from b235f1e01d959ae673d8b89bd062508b7b16fdeb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cb56b66329964ecf0fdd27ae721b93d321b30c62
Author: Jason Etheridge <jason at esilibrary.com>
Date: Tue Oct 4 14:22:15 2011 -0400
pin version for upgrade script
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 368668a..12c0843 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0633', :eg_version); -- tsbere/phasefx
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0634', :eg_version); -- tsbere/phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql b/Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
new file mode 100644
index 0000000..c6b9a8c
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
@@ -0,0 +1,10 @@
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('0634', :eg_version);
+
+INSERT INTO permission.perm_list ( id, code, description ) VALUES
+ ( 513, 'DEBUG_CLIENT', oils_i18n_gettext( 513,
+ 'Allows a user to use debug functions in the staff client', 'ppl', 'description' ));
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
deleted file mode 100644
index b17e70a..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-INSERT INTO permission.perm_list ( id, code, description ) VALUES
- ( 513, 'DEBUG_CLIENT', oils_i18n_gettext( 513,
- 'Allows a user to use debug functions in the staff client', 'ppl', 'description' ));
commit c5b58fa98b415173786de6aa35db68d4aece2f35
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Mon Aug 15 09:04:13 2011 -0400
Unwrapped upgrade script for security lockdown
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
new file mode 100644
index 0000000..b17e70a
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
@@ -0,0 +1,3 @@
+INSERT INTO permission.perm_list ( id, code, description ) VALUES
+ ( 513, 'DEBUG_CLIENT', oils_i18n_gettext( 513,
+ 'Allows a user to use debug functions in the staff client', 'ppl', 'description' ));
commit 8d748bd69eb6d75ad4c6fc7360bcae5e9a52a41a
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Mon Aug 15 08:59:31 2011 -0400
Require permission or pref to debug in client
Disables all debug functions I know of unless:
1 - You have new DEBUG_CLIENT permission (after login)
This should work even on operator change.
Once a given debug interface is open you can change operator back.
2 - You have a client with the debug preference enabled
This causes the client in all places I touched to think you have DEBUG_CLIENT
This also allows debugging *before* login, including in the Standalone interface.
Debug functions I know of:
Debug box on login page (already protected by pref)
Debug items in Admin menu
Venkman
Javascript Shells
Inspector
Chrome List
CTRL+SHIFT+F7 debug box in overlays
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 1c84e97..441b2b9 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1440,7 +1440,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
( 511, 'PERSISTENT_LOGIN', oils_i18n_gettext( 511,
'Allows a user to authenticate and get a long-lived session (length configured in opensrf.xml)', 'ppl', 'description' )),
( 512, 'ACQ_INVOICE_REOPEN', oils_i18n_gettext( 512,
- 'Allows a user to reopen an Acquisitions invoice', 'ppl', 'description' ));
+ 'Allows a user to reopen an Acquisitions invoice', 'ppl', 'description' )),
+ ( 513, 'DEBUG_CLIENT', oils_i18n_gettext( 513,
+ 'Allows a user to use debug functions in the staff client', 'ppl', 'description' ));
SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
index fdfb446..c4b023b 100644
--- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_chrome.xul
@@ -71,7 +71,7 @@
<button label="Inspect" oncommand="try { var dtb = document.getElementById('debug_tb'); var dx = eval( dtb.value ); var ds = ''; for (var di in dx) { ds += di + '=' + dx[di] + '\r\n'; }; window.open('data:text/plain;charset=UTF-8,'+window.escape(ds),'debug_win','chrome,resizable,modal'); } catch(E) { alert(E); }; dtb.focus();"/>
<button label="js2JSON" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( js2JSON( eval( dtb.value ) ) ); } catch(E) { alert(E); }; dtb.focus();"/>
</hbox>
- <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); dx.hidden = !dx.hidden; if (!dx.hidden) dtb.focus();"/></keyset>
+ <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); if(data.enable_debug || !dx.hidden) { dx.hidden = !dx.hidden; if(!dx.hidden) dtb.focus();}"/></keyset>
<script>dump('finished openils_util_overlay\n');</script>
</scripts>
diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul
index 207469c..5b50799 100644
--- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/util_overlay_offline.xul
@@ -66,7 +66,7 @@
<button label="Inspect" oncommand="try { var dtb = document.getElementById('debug_tb'); var dx = eval( dtb.value ); var ds = ''; for (var di in dx) { ds += di + '=' + dx[di] + '\r\n'; }; window.open('data:text/plain;charset=UTF-8,'+window.escape(ds),'debug_win','chrome,resizable,modal'); } catch(E) { alert(E); }; dtb.focus();"/>
<button label="js2JSON" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( js2JSON( eval( dtb.value ) ) ); } catch(E) { alert(E); }; dtb.focus();"/>
</hbox>
- <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); dx.hidden = !dx.hidden; if (!dx.hidden) dtb.focus();"/></keyset>
+ <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); if(data.debug_build || data.enable_debug || !dx.hidden) { dx.hidden = !dx.hidden; if(!dx.hidden) dtb.focus();}"/></keyset>
</scripts>
<script>dump('Loaded OpenILS/util_overlay_offline.xul\n');</script>
diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
index f0f8f8f..dd6de40 100644
--- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
+++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
@@ -553,8 +553,10 @@ auth.controller.prototype = {
this.session.close();
this.data.menu_perms = false;
this.data.current_hotkeyset = undefined;
+ this.data.enable_debug = this.data.debug_client;
this.data.stash('menu_perms');
this.data.stash('current_hotkeyset');
+ this.data.stash('enable_debug');
/* FIXME - need some locking or object destruction for the async tests */
/* this.test_server( this.controller.view.server_prompt.value ); */
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js
index 123e3de..9598484 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/main.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js
@@ -212,6 +212,15 @@ function get_menu_perms(indocument) {
var r = network.simple_request('BATCH_PERM_RETRIEVE_WORK_OU', [ G.data.session.key, get_menu_perms.perm_list ]);
for(p in r)
r[p] = (typeof(r[p][0]) == 'number');
+ // Developer-enabled clients override permissions and always allow debugging
+ if(G.data.debug_build) {
+ r['DEBUG_CLIENT'] = true;
+ }
+ // If we have DEBUG_CLIENT (by force or otherwise) we can use debugging interfaces
+ // Doing this here because this function gets called at least once per login
+ // Including operator change
+ G.data.enable_debug = (r['DEBUG_CLIENT'] == true);
+ G.data.stash('enable_debug');
G.data.menu_perms = r;
G.data.stash('menu_perms');
}
@@ -524,6 +533,12 @@ function main_init() {
} catch(E) {
}
+ // If we are showing the debugging frame then we consider this a debug build
+ // This could be a versionless build, a developer-pref enabled build, or otherwise
+ // If set this will enable all debugging commands, even if you normally don't have permission to use them
+ G.data.debug_build = !document.getElementById('debug_gb').hidden;
+ G.data.stash('debug_build');
+
var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
index a68b9bf..61d239c 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -1585,6 +1585,46 @@ main.menu.prototype = {
xulG.pref.clearUserPref('open-ils.menu.toolbar.labelbelow');
}
],
+ 'cmd_debug_venkman' : [
+ ['oncommand'],
+ function() {
+ try{
+ xulG.window.win.start_debugger();
+ } catch(E) {
+ alert(E);
+ }
+ }
+ ],
+ 'cmd_debug_inspector' : [
+ ['oncommand'],
+ function() {
+ try{
+ xulG.window.win.start_inspector();
+ } catch(E) {
+ alert(E);
+ }
+ }
+ ],
+ 'cmd_debug_chrome_list' : [
+ ['oncommand'],
+ function() {
+ try{
+ xulG.window.win.start_chrome_list();
+ } catch(E) {
+ alert(E);
+ }
+ }
+ ],
+ 'cmd_debug_chrome_shell' : [
+ ['oncommand'],
+ function() {
+ try{
+ xulG.window.win.start_js_shell();
+ } catch(E) {
+ alert(E)
+ }
+ }
+ ],
};
JSAN.use('util.controller');
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
index 014ffab..4ec89a3 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul
@@ -66,14 +66,25 @@
<command id="cmd_local_admin" />
<command id="cmd_toggle_meters" />
- <command id="cmd_extension_manager" />
- <command id="cmd_theme_manager" />
- <command id="cmd_about_config" />
+ <command id="cmd_extension_manager"
+ perm="DEBUG_CLIENT"
+ />
+ <command id="cmd_theme_manager"
+ perm="DEBUG_CLIENT"
+ />
+ <command id="cmd_about_config"
+ perm="DEBUG_CLIENT"
+ />
<command id="cmd_adv_user_edit" />
- <command id="cmd_console" />
- <command id="cmd_shell" />
- <command id="cmd_xuleditor" />
+ <command id="cmd_console"
+ perm="DEBUG_CLIENT" />
+ <command id="cmd_shell"
+ perm="DEBUG_CIENT"
+ />
+ <command id="cmd_xuleditor"
+ perm="DEBUG_CLIENT"
+ />
<command id="cmd_fieldmapper" />
<command id="cmd_test_html" />
<command id="cmd_test_xul" />
@@ -237,6 +248,18 @@
<command id="cmd_toolbar_mode_set" />
<command id="cmd_toolbar_size_set" />
<command id="cmd_toolbar_label_position_set" />
+ <command id="cmd_debug_venkman"
+ perm="DEBUG_CLIENT"
+ />
+ <command id="cmd_debug_inspector"
+ perm="DEBUG_CLIENT"
+ />
+ <command id="cmd_debug_chrome_list"
+ perm="DEBUG_CLIENT"
+ />
+ <command id="cmd_debug_chrome_shell"
+ perm="DEBUG_CLIENT"
+ />
</commandset>
<!-- The File menu on the main menu -->
@@ -570,8 +593,7 @@
<menuitem label="&staff.main.menu.admin.fieldmapper.label;" accesskey="&staff.main.menu.admin.fieldmapper.accesskey;" command="cmd_fieldmapper"/>
<menuitem label="&staff.main.menu.admin.cmd_console.label;" accesskey="&staff.main.menu.admin.cmd_console.accesskey;" command="cmd_console"/>
<menuitem label="&staff.main.menu.admin.cmd_shell.label;" accesskey="&staff.main.menu.admin.cmd_shell.accesskey;" command="cmd_shell"/>
- <menuitem label="&staff.main.menu.admin.cmd_chrome_shell.label;" accesskey="&staff.main.menu.admin.cmd_chrome_shell.accesskey;"
- oncommand="try{xulG.window.win.start_js_shell();}catch(E){alert(E);}"/>
+ <menuitem label="&staff.main.menu.admin.cmd_chrome_shell.label;" accesskey="&staff.main.menu.admin.cmd_chrome_shell.accesskey;" command="cmd_debug_chrome_shell"/>
<menuitem label="server/main/test.html" accesskey="1" command="cmd_test_html"/>
<menuitem label="server/main/test.xul" accesskey="2" command="cmd_test_xul"/>
<menuitem label="&staff.main.menu.admin.clear_cache.label;" accesskey="&staff.main.menu.admin.clear_cache.accesskey;" command="cmd_clear_cache"/>
@@ -579,9 +601,9 @@
<menuitem label="&staff.main.menu.admin.extension_manager.label;" command="cmd_extension_manager"/>
<menuitem label="&staff.main.menu.admin.theme_manager.label;" command="cmd_theme_manager"/>
<menuitem label="&staff.main.menu.admin.about_config.label;" command="cmd_about_config"/>
- <menuitem label="&staff.main.menu.admin.venkman.label;" oncommand="try{xulG.window.win.start_debugger();}catch(E){alert(E);}"/>
- <menuitem label="&staff.main.auth.debug.inspector;" oncommand="try{xulG.window.win.start_inspector();}catch(E){alert(E);}"/>
- <menuitem label="&staff.main.auth.debug.chrome_list;" oncommand="try{xulG.window.win.start_chrome_list();}catch(E){alert(E);}"/>
+ <menuitem label="&staff.main.menu.admin.venkman.label;" command="cmd_debug_venkman"/>
+ <menuitem label="&staff.main.auth.debug.inspector;" command="cmd_debug_inspector"/>
+ <menuitem label="&staff.main.auth.debug.chrome_list;" command="cmd_debug_chrome_list"/>
<menuitem label="&staff.main.menu.admin.ping;" oncommand="try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');JSAN.use('util.network'); var n = new util.network(); alert(n.ping());}catch(E){alert(E);}"/>
</menupopup>
</menu>
diff --git a/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul b/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
index 242acdc..f185b79 100644
--- a/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
+++ b/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
@@ -88,7 +88,7 @@
<button label="Inspect" oncommand="try { var dtb = document.getElementById('debug_tb'); var dx = eval( dtb.value ); var ds = ''; for (var di in dx) { ds += di + '=' + dx[di] + '\r\n'; }; window.open('data:text/plain;charset=UTF-8,'+window.escape(ds),'debug_win','chrome,resizable,modal'); } catch(E) { alert(E); }; dtb.focus();"/>
<button label="js2JSON" oncommand="try { var dtb = document.getElementById('debug_tb'); alert( js2JSON( eval( dtb.value ) ) ); } catch(E) { alert(E); }; dtb.focus();"/>
</hbox>
- <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); dx.hidden = !dx.hidden; if (!dx.hidden) dtb.focus();"/></keyset>
+ <keyset><key id="debug_box_key" keycode="VK_F7" modifiers="control,shift" oncommand="JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); var dtb = document.getElementById('debug_tb'); var dx = document.getElementById('debug_box'); if(data.enable_debug || !dx.hidden) { dx.hidden = !dx.hidden; if(!dx.hidden) dtb.focus();}"/></keyset>
<script type="text/javascript" src="/xul/server/skin/custom.js" />
<script>dump('finished openils_util_overlay\n');</script>
</scripts>
commit 3cbc8a303e969243105a6e80104aec6b889aaf05
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Fri Aug 12 09:17:46 2011 -0400
Clear password from password_prompt post-login
Otherwise it remains as the plain text value.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
diff --git a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
index 35d885c..f0f8f8f 100644
--- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
+++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
@@ -456,6 +456,8 @@ auth.controller.prototype = {
this.on_login_error(E);
}
}
+ // Once we are done with it, clear the password
+ this.controller.view.password_prompt.value = '';
},
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 4 +-
.../src/sql/Pg/upgrade/0634.security_lockdown.sql | 10 ++++
.../chrome/content/OpenILS/util_overlay_chrome.xul | 2 +-
.../content/OpenILS/util_overlay_offline.xul | 2 +-
.../staff_client/chrome/content/auth/controller.js | 4 ++
.../xul/staff_client/chrome/content/main/main.js | 15 +++++++
.../xul/staff_client/chrome/content/main/menu.js | 40 ++++++++++++++++++
.../chrome/content/main/menu_frame_menus.xul | 44 +++++++++++++++-----
.../staff_client/server/OpenILS/util_overlay.xul | 2 +-
10 files changed, 109 insertions(+), 16 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list