ensure no user have obsolete login source
This commit is contained in:
parent
4862bb6e82
commit
634b85bf36
4 changed files with 9 additions and 4 deletions
|
@ -34,7 +34,7 @@ Brought to you by an inclusive community under the umbrella of Codeberg e.V., a
|
|||
- Customize HTML templates, static files and many others.
|
||||
|
||||
|
||||
**Shipped version:** 1.19.3-0~ynh3
|
||||
**Shipped version:** 1.19.3-0~ynh4
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ Brought to you by an inclusive community under the umbrella of Codeberg e.V., a
|
|||
- Customize HTML templates, static files and many others.
|
||||
|
||||
|
||||
**Version incluse :** 1.19.3-0~ynh3
|
||||
**Version incluse :** 1.19.3-0~ynh4
|
||||
|
||||
## Captures d’écran
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ name = "Forgejo"
|
|||
description.en = "Lightweight software forge"
|
||||
description.fr = "Forge logiciel légère"
|
||||
|
||||
version = "1.19.3-0~ynh3"
|
||||
version = "1.19.3-0~ynh4"
|
||||
|
||||
maintainers = ["Emmanuel Averty"]
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
|||
pushd "$install_dir"
|
||||
old_login_source_id=$(ynh_exec_as $app ./forgejo admin auth list | grep "YunoHost LDAP" | grep "via BindDN" | cut -f 1)
|
||||
if [ ! -z $old_login_source_id ]; then
|
||||
ynh_print_info --message="Delete obsolete forgejo login source (LDAP via BindDN)"
|
||||
|
||||
# Ensure no user have this obsolete login source
|
||||
ynh_psql_execute_as_root --database $db_name --sql "update public.user set login_source = 0, login_type = 0 where login_source = ${old_login_source_id}"
|
||||
|
||||
# Delete old login source
|
||||
ynh_exec_as $app ./forgejo admin auth delete --id $old_login_source_id
|
||||
|
||||
|
|
Loading…
Reference in a new issue