Bugzilla – Attachment 149197 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.70 KB, created by
Pedro Amorim
on 2023-04-05 12:13:11 UTC
(
hide
)
Description:
Bug 33408: Prevent access to erm module by URL if sys pref is disabled
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-04-05 12:13:11 UTC
Size:
6.70 KB
patch
obsolete
>From 52ea338c2d6aec1a1be758679d75a4daacf14767 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 > >--- > .../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 7267659e0d1..5c97cda1272 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 b9319278583..cd7689c31e2 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 dc85f035d24..79665cb7a94 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 78d1390c029..5ba6dfd231c 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 647c30d19eb..4e0308d6a25 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 06724aa4d8c..56aa71dcf3d 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.30.2
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