diff --git a/composer.lock b/composer.lock index baba3aff5..effe384ae 100644 --- a/composer.lock +++ b/composer.lock @@ -1061,12 +1061,12 @@ "source": { "type": "git", "url": "https://github.com/phpList/phplist-plugin-saml2.git", - "reference": "ad8aaa2f5a22f42b3cc50f720de039ddeb6d56f1" + "reference": "8f1ca9ff9ed0812103126bc0c0b9fe064bb6575d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpList/phplist-plugin-saml2/zipball/ad8aaa2f5a22f42b3cc50f720de039ddeb6d56f1", - "reference": "ad8aaa2f5a22f42b3cc50f720de039ddeb6d56f1", + "url": "https://api.github.com/repos/phpList/phplist-plugin-saml2/zipball/8f1ca9ff9ed0812103126bc0c0b9fe064bb6575d", + "reference": "8f1ca9ff9ed0812103126bc0c0b9fe064bb6575d", "shasum": "" }, "require": { @@ -1092,7 +1092,7 @@ "wiki": "http://resources.phplist.com/", "source": "https://github.com/phpList/phpList3" }, - "time": "2025-06-28T09:36:08+00:00" + "time": "2026-05-06T08:58:48+00:00" }, { "name": "phplist/phplist-plugin-subjectlineplaceholders", diff --git a/scripts/install-plugins.sh b/scripts/install-plugins.sh index 4277ae043..fb3fa365f 100755 --- a/scripts/install-plugins.sh +++ b/scripts/install-plugins.sh @@ -11,9 +11,29 @@ echo $from $to apt install -y rsync } -for plugin in $(find $from -type d -name phplist-plugin-*); do - [[ ! -z "$(ls -A $plugin/plugins/)" ]] && { - echo installing plugin $plugin - rsync -a $plugin/plugins/* $to - } -done +while IFS= read -r -d '' plugin; do + plugin_name="$(basename "$plugin")" + + [[ -d "$plugin/plugins" ]] || continue + [[ -n "$(find "$plugin/plugins" -mindepth 1 -maxdepth 1 -print -quit)" ]] || continue + + echo "Installing plugin: $plugin_name" + + rsync_args=(-a) + + case "$plugin_name" in + phplist-plugin-saml2) + settings_file="$to/simplesaml/settings.php" + + if [[ -f "$settings_file" ]]; then + echo "Preserving existing SAML2 settings.php" + rsync_args+=(--exclude='simplesaml/settings.php') + else + echo "SAML2 settings.php does not exist, it will be created" + fi + ;; + esac + + rsync "${rsync_args[@]}" "$plugin/plugins/" "$to/" + +done < <(find "$from" -type d -name 'phplist-plugin-*' -print0)