From ea1049da0fd296c7c0563be8aaf3c94b3df8cd31 Mon Sep 17 00:00:00 2001 From: cat-bro Date: Mon, 30 Jun 2025 18:47:38 +1000 Subject: [PATCH] Fix dump-users The emails are blanked out if apikey is not there. --- parts/22-query.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/parts/22-query.sh b/parts/22-query.sh index ba12e78..06c92d5 100644 --- a/parts/22-query.sh +++ b/parts/22-query.sh @@ -4620,26 +4620,28 @@ query_dump-users() { ##? [--apikey] [--email] : Dump the list of users and their EOF if [[ -n "$arg_email" ]]; then - email=",$(gdpr_safe email email)" + email=",$(gdpr_safe email u.email)" else email="" fi if [[ -n "$arg_apikey" ]]; then - apikey="apikey" - apikeyjoin="left join api_keys " + apikey=",ak.key" + apikeyjoin="left join api_keys ak on ak.user_id = u.id" else - email="" + apikey="" + apikeyjoin="" fi read -r -d '' QUERY <<-EOF SELECT - username + u.username $email + $apikey FROM - galaxy_user + galaxy_user u $apikeyjoin ORDER BY - id desc + u.id desc EOF }