1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

Merge pull request #578 from YunoHost-Apps/hook-post-user-delete

Add a post_user_delete hook
This commit is contained in:
eric_G 2023-11-10 17:30:14 +01:00 committed by GitHub
commit 9a6e857784
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View file

@ -20,8 +20,7 @@ Nextcloud Hub is a fully open-source on-premises content collaboration platform.
### YunoHost-specific features
In addition to Nextcloud core features, the following are made available with
this package:
In addition to Nextcloud core features, the following are made available with this package:
* Integrate with YunoHost users and SSO - i.e. logout button
* Allow one user to be the administrator (set at the installation)

16
hooks/post_user_delete Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
source /usr/share/yunohost/helpers
user="$1"
app="$(basename $0 | cut -d- -f 2-)" # Extract the app name from the script name, which is supposed to be something like "50-app_id"
install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
# Define a function to execute commands with `occ`
exec_occ() {
(cd "$install_dir" && ynh_exec_as "$app" \
php${phpversion} --define apc.enable_cli=1 occ --no-interaction --no-ansi "$@")
}
exec_occ user:delete $user