#!/bin/bash

if [ "$(CreoleGet activer_apache)" = 'oui' ];then
    # gestion des modes apache
    ENMOD="ssl rewrite authnz_ldap"
    DISMOD=""
    # gestion des cas particuliers (rpaf: #2570, jappix: #3151)
    if [ "$(CreoleGet activer_web_behind_revproxy)" = 'oui' ];then
        ENMOD="$ENMOD rpaf"
    else
        DISMOD="$DISMOD rpaf"
    fi
    if [ "$(CreoleGet activer_jappix non)" = 'oui' ];then
        ENMOD="$ENMOD proxy headers proxy_http"
    fi
    if [ "$(CreoleGet activer_eop non)" = 'oui' ];then
        ENMOD="$ENMOD proxy proxy_http"
    fi
    CreoleRun "/usr/sbin/a2enmod $ENMOD >/dev/null" web
    [ ! -z $DISMOD ] && CreoleRun "/usr/sbin/a2dismod $DISMOD >/dev/null" web
fi

exit 0
