Bug 14004: Add ability to temporarily disable JS/CSS sysprefs
authorFridolin Somers <fridolin.somers@biblibre.com>
Tue, 12 Jan 2021 10:15:25 +0000 (11:15 +0100)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Fri, 5 Feb 2021 12:29:46 +0000 (12:29 +0000)
commitee9ac246697756def229033a19c69be4044e27e1
treefbb3ddd0bfb19ea5124bd17d3b79c43fb05f1447
parent77b10e87b251f0cb3350a4a62cf55a4a716bc91c
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs

It would be *super* handy if intranetuserjs and/or opacuserjs could be
temporarily disabled via a check-box or syspref.
Right now, debugging issues in intranetuserjs usuaally starts with
copying the contents into a text file, blanking the syspref and re-testing.

This patch adds this feature by setting syspref via ENV
OVERRIDE_SYSPREF like override via Apache config.

Implemented only for preferences :
OPACUserCSS OPACUserJS IntranetUserCSS IntranetUserJS
=> replaced with ' '
intranetcolorstylesheet intranetstylesheet
=> replaced with 0

Test plan :
1) Set some CSS in IntranetUserCSS like : #breadcrumbs{color:red}
2) Go to staff interface home page like : /cgi-bin/koha/mainpage.pl
3) See CSS impact is visible
4) Edit URL : /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserCSS=1
5) See CSS impact is not visible
6) Check with the other preferences

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 180db2f63b83dc4052b42e3073be9893e7495a1f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7a622302aae6ec8b4f4a4accaad8e37f5a8f9c0b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
C4/Auth.pm