Fix account created by remote user header

This commit is contained in:
Josué Tille 2024-02-05 19:12:58 +01:00
parent 57740d8b4c
commit bee1ad0a93
No known key found for this signature in database
GPG Key ID: 5F259226AD51F2F5
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,3 @@
UPDATE `__APP__`.`user`
SET `login_type` = 2, `login_source` = 1, `login_name` = `name`
WHERE `user`.`name` in __USER_LIST__ ;

View File

@ -87,6 +87,15 @@ if [[ -z "${jwt_secret:-}" ]]; then
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret" ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
fi fi
#=================================================
# MIGRATION STEP Fix regression linked to 77c3678 and #76
#=================================================
list_param_sql=$(yunohost user list --output-as json | jq -c '.users | keys' | sed 's|\[|\(|' | sed 's|\]|\)|')
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./fix_user_db_for_local_users.sql
ynh_replace_string --match_string=__USER_LIST__ --replace_string="$list_param_sql" --target_file=./fix_user_db_for_local_users.sql
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./fix_user_db_for_local_users.sql
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================