Bugzilla – Attachment 149538 Details for
Bug 33408
Fetch sysprefs from svc/config/systempreferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33408: Prevent access to erm module by URL if sys pref is disabled
Bug-33408-Prevent-access-to-erm-module-by-URL-if-s.patch (text/plain), 6.80 KB, created by
Martin Renvoize (ashimema)
on 2023-04-12 12:44:22 UTC
(
hide
)
Description:
Bug 33408: Prevent access to erm module by URL if sys pref is disabled
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-04-12 12:44:22 UTC
Size:
6.80 KB
patch
obsolete
>From f423984acc2328189eb510b70424c68e41af68e5 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Wed, 5 Apr 2023 11:45:45 +0000 >Subject: [PATCH] Bug 33408: Prevent access to erm module by URL if sys pref is > disabled > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/js/vue/components/ERM/Main.vue | 13 ++++++------- > t/cypress/integration/ERM/Agreements_spec.ts | 7 ++----- > t/cypress/integration/ERM/Dialog_spec.ts | 7 ++----- > t/cypress/integration/ERM/Licenses_spec.ts | 7 ++----- > t/cypress/integration/ERM/Packages_spec.ts | 7 ++----- > t/cypress/integration/ERM/Titles_spec.ts | 7 ++----- > 6 files changed, 16 insertions(+), 32 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >index b9d48342f9..9fe08ade2f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/Main.vue >@@ -214,15 +214,18 @@ export default { > error => {} > ) > ) >- return Promise.all(promises) >+ return Promise.all(promises).then(values => { >+ this.loaded() >+ this.initialized = true >+ }) > } > > const sysprefs_client = APIClient.sysprefs > sysprefs_client.sysprefs > .get("ERMModule") > .then(value => { >- this.ERMModule = value >- if (!this.ERMModule) { >+ this.ERMModule = value.value >+ if (this.ERMModule == 0) { > this.loaded() > return this.setError( > this.$__( >@@ -233,10 +236,6 @@ export default { > } > return fetch_config() > }) >- .then(() => { >- this.loaded() >- this.initialized = true >- }) > }, > components: { > Breadcrumb, >diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts >index b931927858..cd7689c31e 100644 >--- a/t/cypress/integration/ERM/Agreements_spec.ts >+++ b/t/cypress/integration/ERM/Agreements_spec.ts >@@ -117,14 +117,11 @@ function get_licenses_to_relate() { > } > > describe("Agreement CRUD operations", () => { >- before(() => { >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); >- }); >- > beforeEach(() => { > cy.login(); > cy.title().should("eq", "Koha staff interface"); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); > }); > > it("List agreements", () => { >diff --git a/t/cypress/integration/ERM/Dialog_spec.ts b/t/cypress/integration/ERM/Dialog_spec.ts >index dc85f035d2..79665cb7a9 100644 >--- a/t/cypress/integration/ERM/Dialog_spec.ts >+++ b/t/cypress/integration/ERM/Dialog_spec.ts >@@ -22,14 +22,11 @@ function get_package() { > } > > describe("Dialog operations", () => { >- before(() => { >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); >- }); >- > beforeEach(() => { > cy.login(); > cy.title().should("eq", "Koha staff interface"); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); > }); > > it("There are no ... defined", () => { >diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts >index 78d1390c02..5ba6dfd231 100644 >--- a/t/cypress/integration/ERM/Licenses_spec.ts >+++ b/t/cypress/integration/ERM/Licenses_spec.ts >@@ -33,14 +33,11 @@ function get_license() { > } > > describe("License CRUD operations", () => { >- before(() => { >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); >- }); >- > beforeEach(() => { > cy.login(); > cy.title().should("eq", "Koha staff interface"); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); > }); > > it("List license", () => { >diff --git a/t/cypress/integration/ERM/Packages_spec.ts b/t/cypress/integration/ERM/Packages_spec.ts >index 5a52fc231c..58ea00323c 100644 >--- a/t/cypress/integration/ERM/Packages_spec.ts >+++ b/t/cypress/integration/ERM/Packages_spec.ts >@@ -24,14 +24,11 @@ function get_package() { > } > > describe("Package CRUD operations", () => { >- before(() => { >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); >- }); >- > beforeEach(() => { > cy.login(); > cy.title().should("eq", "Koha staff interface"); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); > }); > > it("List package", () => { >diff --git a/t/cypress/integration/ERM/Titles_spec.ts b/t/cypress/integration/ERM/Titles_spec.ts >index 06724aa4d8..56aa71dcf3 100644 >--- a/t/cypress/integration/ERM/Titles_spec.ts >+++ b/t/cypress/integration/ERM/Titles_spec.ts >@@ -18,14 +18,11 @@ function get_packages_to_relate() { > } > > describe("Title CRUD operations", () => { >- before(() => { >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >- cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); >- }); >- > beforeEach(() => { > cy.login(); > cy.title().should("eq", "Koha staff interface"); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}'); >+ cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}'); > }); > > it("Import titles", () => { >-- >2.40.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33408
:
149131
|
149132
|
149133
|
149134
|
149184
|
149185
|
149186
|
149196
|
149197
|
149198
|
149200
|
149204
|
149205
|
149206
|
149207
|
149208
|
149209
|
149254
|
149438
|
149516
|
149517
|
149518
|
149535
|
149536
|
149537
| 149538 |
149539
|
149540
|
149541
|
149542
|
149543
|
149570