1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dolibarr_ynh.git synced 2024-09-03 18:35:53 +02:00

Reenable ldap

try with collate

slower
This commit is contained in:
Salamandar 2024-01-24 16:37:13 +01:00
parent 50bddd844d
commit 57eeead757
3 changed files with 26 additions and 8 deletions

View file

@ -19,7 +19,7 @@ location __PATH__/ {
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_read_timeout 600;
fastcgi_read_timeout 1600;
}
# Include SSOWAT user panel.

View file

@ -1,15 +1,18 @@
#!/bin/bash
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"
src_path=$(yunohost app setting $app install_dir)
# 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-)"
install_dir=$(yunohost app setting "$app" install_dir)
phpversion=$(yunohost app setting "$app" phpversion)
# member=__MEMBER__
# Sync users
if sudo php "$src_path/scripts/user/sync_users_ldap2dolibarr.php" commitiferror --server=localhost -y; then
echo ldap user update ok
if sudo "php$phpversion" "$install_dir/scripts/user/sync_users_ldap2dolibarr.php" commitiferror --server=localhost -y; then
echo "LDAP user update ok"
else
echo ldap user update ended with error
echo "LDAP user update ended with error"
fi
# If YNH users should also be members, sync members
# if [ $member -eq 1 ];
# then

View file

@ -30,6 +30,7 @@ ynh_app_setting_set --app="$app" --key="fpm_usage" --value="$fpm_usage"
ynh_script_progression --message="Configuring $app's MySQL database..." --weight=1
ynh_mysql_execute_as_root --sql="ALTER DATABASE $db_name charset=utf8"
ynh_mysql_execute_as_root --database="$db_name" --sql="SET NAMES 'utf8' COLLATE 'utf8_general_ci'"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -67,6 +68,20 @@ ynh_add_nginx_config
# Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile="$install_dir/documents/dolibarr.log"
ynh_script_progression --message="Configuring LDAP" --weight=1
# Populate the LDAP parameters
ynh_mysql_execute_file_as_root --database="$db_name" --file="../conf/sql/ldap.sql"
# Populate the database with YNH users.
ynh_mysql_execute_file_as_root --database="$db_name" --file="../conf/sql/ldap_user.sql"
if "php$phpversion" "$install_dir/scripts/user/sync_users_ldap2dolibarr.php" commitiferror --server=localhost -y; then
ynh_print_info --message="LDAP user update ok"
else
ynh_print_info --message="LDAP user update ended with error"
fi
#=================================================
# END OF SCRIPT
#=================================================