mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-11-21 10:31:36 +01:00
Fix account created by remote user header
This commit is contained in:
parent
57740d8b4c
commit
bee1ad0a93
3
scripts/fix_user_db_for_local_users.sql
Normal file
3
scripts/fix_user_db_for_local_users.sql
Normal file
@ -0,0 +1,3 @@
|
||||
UPDATE `__APP__`.`user`
|
||||
SET `login_type` = 2, `login_source` = 1, `login_name` = `name`
|
||||
WHERE `user`.`name` in __USER_LIST__ ;
|
@ -87,6 +87,15 @@ if [[ -z "${jwt_secret:-}" ]]; then
|
||||
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
|
||||
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
|
||||
#=================================================
|
||||
|
Loading…
Reference in New Issue
Block a user