[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 021970b0300986961d4d72d34279dbe92d110e2a
Evergreen Git
git at git.evergreen-ils.org
Tue Oct 4 14:30:09 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, rel_2_1 has been updated
via 021970b0300986961d4d72d34279dbe92d110e2a (commit)
via 60722675c66fe28ce540e640722969da2d5b76ce (commit)
via 23fc0a16286766b76605822391feae6484511580 (commit)
via 7fdf6b597138ab83ea61bb24fa3d88551d7deef3 (commit)
from c82f2c3da68c05f2ab83db4ab3d78e7be00afb8d (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 021970b0300986961d4d72d34279dbe92d110e2a
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 74d3fcaf7..db5457a 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0633'); -- tsbere/phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0634'); -- tsbere/phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql b/Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
similarity index 72%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
rename to Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
index b17e70a..62466d9 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.security_lockdown.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0634.security_lockdown.sql
@@ -1,3 +1,9 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0634');
+
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;
commit 60722675c66fe28ce540e640722969da2d5b76ce
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 23fc0a16286766b76605822391feae6484511580
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 3751ba4..43c3892 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1431,7 +1431,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
( 510, 'UPDATE_PATRON_COLLECTIONS_EXEMPT', oils_i18n_gettext(510,
'Allows a user to indicate that a patron is exempt from collections processing', '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 c635ab3..b0085d0 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
@@ -68,7 +68,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 6990dae..2a55b30 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
@@ -63,7 +63,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 d8fb9e3..b0d4963 100644
--- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
+++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
@@ -552,8 +552,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 f13cbfe..6dd9d17 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 bc8c11d..38bf9f7 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js
@@ -1514,6 +1514,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 2dc7cb5..52713ca 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
@@ -64,14 +64,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" />
@@ -220,6 +231,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 -->
@@ -534,8 +557,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"/>
@@ -543,9 +565,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 fbd1dd6..9626cea 100644
--- a/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
+++ b/Open-ILS/xul/staff_client/server/OpenILS/util_overlay.xul
@@ -82,7 +82,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 7fdf6b597138ab83ea61bb24fa3d88551d7deef3
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 2b3a14a..d8fb9e3 100644
--- a/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
+++ b/Open-ILS/xul/staff_client/chrome/content/auth/controller.js
@@ -455,6 +455,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 | 9 ++++
.../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, 108 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