2024-03-25 22:28:52 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Extract the app name from the script name, which is supposed to be something like "50-app_id"
|
|
|
|
app="$(basename "$0" | cut -d- -f 2-)"
|
|
|
|
|
|
|
|
src_path=$(yunohost app setting "$app" install_dir)
|
2022-12-07 17:59:08 +01:00
|
|
|
# member=__MEMBER__
|
2024-03-25 22:28:52 +01:00
|
|
|
|
2017-05-05 17:34:15 +02:00
|
|
|
# Sync users
|
2022-12-08 18:44:04 +01:00
|
|
|
if sudo php "$src_path/scripts/user/sync_users_ldap2dolibarr.php" commitiferror --server=localhost -y; then
|
2024-03-25 22:28:52 +01:00
|
|
|
echo "LDAP user update succeeded"
|
2019-06-16 00:06:51 +02:00
|
|
|
else
|
2024-03-25 22:28:52 +01:00
|
|
|
echo "LDAP user update ended with error"
|
2019-06-16 00:06:51 +02:00
|
|
|
fi
|
2024-03-25 22:28:52 +01:00
|
|
|
|
2017-05-05 17:34:15 +02:00
|
|
|
# If YNH users should also be members, sync members
|
2024-03-25 22:28:52 +01:00
|
|
|
# if [ $member -eq 1 ]; then
|
|
|
|
# if sudo php "$src_path/scripts/members/sync_members_ldap2dolibarr.php" commitiferror 1 --server=localhost -y; then
|
|
|
|
# echo ldap member update ok
|
|
|
|
# else
|
|
|
|
# echo ldap member update ended with error
|
|
|
|
# fi
|
2022-12-07 17:59:08 +01:00
|
|
|
# fi
|