Bugzilla – Attachment 132295 Details for
Bug 29957
Cookies not removed after logout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29957: Add --keep-cookie option to koha-create
Bug-29957-Add---keep-cookie-option-to-koha-create.patch (text/plain), 5.20 KB, created by
Martin Renvoize (ashimema)
on 2022-03-28 07:54:16 UTC
(
hide
)
Description:
Bug 29957: Add --keep-cookie option to koha-create
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-03-28 07:54:16 UTC
Size:
5.20 KB
patch
obsolete
>From 726e2aafd59a9f99888c02155ad0c581e0764fc6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 25 Mar 2022 08:20:46 +0000 >Subject: [PATCH] Bug 29957: Add --keep-cookie option to koha-create > >As requested on comment99. Personally I do not feel that it >should be a requirement for adding a koha-conf entry though. >Note that koha-create does/did not even support adding multiple >line entries to koha-conf like we do here now. >But it might be a start for adding them? > >Test plan: >The following tweak might help you to test without running the >complete koha-create, while still convincing you: > >[1] cp debian/templates/koha-conf-site.xml.in /etc/koha/test.conf >[2] Add the following line in debian/scripts/koha-create. Append > if after the BCRYPT_SETTINGS= line on L652: > generate_config_file test.conf test.xml; exit >[3] Run debian/scripts/koha-create --keep-cookie A >[4] Check if you see <do_not_remove_cookie>A<..> in test.xml. >[5] Run debian/scripts/koha-create --keep-cookie A --keep-cookie B >[6] Check for two lines in test.xml >[7] Run debian/scripts/koha-create clone_name >[8] Check that the __KEEP_COOKIE__ line is gone in test.xml. >[9] Undo the tweak by removing test.xml and /etc/koha/test.conf, > and removing the added line from koha-create. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > debian/scripts/koha-create | 16 +++++++++++++++- > debian/templates/koha-conf-site.xml.in | 1 + > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create >index 1f761e95ea..c833b451ad 100755 >--- a/debian/scripts/koha-create >+++ b/debian/scripts/koha-create >@@ -90,6 +90,8 @@ Options: > --mb-pass pass RabbitMQ password (default: guest) > --mb-vhost vhost RabbitMQ vhost (default: koha_<instance>) > >+ --keep-cookie NAME Do not clear this cookie at logout (can be repeated) >+ > --help,-h Show this help. > > Note: the instance name cannot be longer that 11 chars. >@@ -105,6 +107,13 @@ generate_config_file() { > # Bug 28364: the z3950 responder needs other permissions > [ "$1" = "log4perl-site.conf.in" ] && chown "$username:$username" "$2" > >+ # Handle repeated command line options (KEEP_COOKIE) >+ keep_cookie_lines="" >+ for cookie in "${KEEP_COOKIE[@]}" >+ do >+ keep_cookie_lines="${keep_cookie_lines} <do_not_remove_cookie>${cookie}<\/do_not_remove_cookie>\\n" >+ done >+ > chmod 0640 "$2" > sed -e "s/__KOHA_CONF_DIR__/\/etc\/koha\/sites\/$name/g" \ > -e "s/__KOHASITE__/$name/g" \ >@@ -147,6 +156,7 @@ generate_config_file() { > -e "s/__MESSAGE_BROKER_USER__/$MESSAGE_BROKER_USER/g" \ > -e "s/__MESSAGE_BROKER_PASS__/$MESSAGE_BROKER_PASS/g" \ > -e "s/__MESSAGE_BROKER_VHOST__/$MESSAGE_BROKER_VHOST/g" \ >+ -e "s/ <do_not_remove_cookie>__KEEP_COOKIE__<\/do_not_remove_cookie>/$keep_cookie_lines/" \ > "/etc/koha/$1" > "$2" > > } >@@ -475,6 +485,8 @@ END_SRU_PUBLICSERVER="-->" > > APACHE_CONFIGFILE="" > >+declare -a KEEP_COOKIE >+ > if [ -e /etc/koha/koha-sites.conf ] > then > . /etc/koha/koha-sites.conf >@@ -482,7 +494,7 @@ fi > > [ $# -ge 1 ] && [ $# -le 16 ] || ( usage ; die "Error: wrong parameters" ) > >-TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,elasticsearch-server:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,smtp-host:,smtp-port:,smtp-timeout:,smtp-ssl-mode:,smtp-user-name:,smtp-password:,smtp-debug,mb-host:,mb-port:,mb-user:,mb-pass:,mb-vhost:,letsencrypt, \ >+TEMP=`getopt -o chrpm:l:d:f:b:a: -l create-db,request-db,populate-db,use-db,enable-sru,sru-port:,help,marcflavor:,auth-idx:,biblio-idx:,zebralang:,defaultsql:,configfile:,passwdfile:,dbhost:,database:,elasticsearch-server:,adminuser:,memcached-servers:,memcached-prefix:,template-cache-dir:,timezone:,upload-path:,tmp-path:,smtp-host:,smtp-port:,smtp-timeout:,smtp-ssl-mode:,smtp-user-name:,smtp-password:,smtp-debug,mb-host:,mb-port:,mb-user:,mb-pass:,mb-vhost:,letsencrypt,keep-cookie:, \ > -n "$0" -- "$@"` > > # Note the quotes around `$TEMP': they are essential! >@@ -549,6 +561,8 @@ while true ; do > CLO_ADMINUSER="$2" ; shift 2 ;; > --enable-sru) > ENABLE_SRU="yes" ; shift ;; >+ --keep-cookie) >+ KEEP_COOKIE+=("$2"); shift 2;; > --mb-host) > CLO_MESSAGE_BROKER_HOST="$2" ; shift 2 ;; > --mb-port) >diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in >index 5147ab0d93..20d217222d 100644 >--- a/debian/templates/koha-conf-site.xml.in >+++ b/debian/templates/koha-conf-site.xml.in >@@ -449,6 +449,7 @@ __END_SRU_PUBLICSERVER__ > <vhost>__MESSAGE_BROKER_VHOST__</vhost> > </message_broker> > >+ <do_not_remove_cookie>__KEEP_COOKIE__</do_not_remove_cookie> > <!-- Uncomment lines like hereunder to not clear cookies at logout: > The cookie name is case sensitive. > <do_not_remove_cookie>KohaOpacLanguage</do_not_remove_cookie> >-- >2.20.1
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 29957
:
129871
|
129872
|
130005
|
130006
|
131428
|
131750
|
131751
|
131752
|
131807
|
131808
|
131809
|
131810
|
131824
|
131825
|
131826
|
131827
|
131828
|
131840
|
131841
|
131842
|
131843
|
131856
|
132045
|
132046
|
132047
|
132105
|
132106
|
132107
|
132108
|
132109
|
132110
|
132111
|
132115
|
132210
|
132211
|
132231
|
132232
|
132233
|
132234
|
132235
|
132236
|
132237
|
132238
|
132239
|
132288
|
132289
|
132290
|
132291
|
132292
|
132293
|
132294
| 132295 |
132296