<?xml version="1.0" encoding="utf-8"?>

<creole>
    <files>
        <file name="/usr/share/eole/db/glpi/updates/glpi-update.sql" filelist="glpi_files" mkdir="True"/>
        <file name="/etc/eole/eole-db.d/glpi.yml" filelist="glpi_files" rm="True"/>
    </files>

    <containers>
        <container name='web' id='15'>
            <package>glpi</package>
            <package>glpi-plugin-ocsinventoryng</package>
            <service method="apache" servicelist='glpi'>glpi</service>
            <file name='/etc/apache2/sites-available/glpi' source="apache-glpi.conf"/>
            <file name="/var/www/html/glpi/config/config_db.php" rm="True" filelist="glpi_files" mode="0540" owner="www-data" group="www-data" source='glpi_config_db.php'/>
        </container>
    </containers>

    <variables>
        <family name="applications web">
            <variable name="activer_glpi" type="oui/non" description="Activer GLPI">
                <value>non</value>
            </variable>
        </family>
        <family name="glpi" icon='laptop'>
            <variable name="glpi_config_email" type="string"
                description="Configurer les envois d'emails">
                <value>ne rien faire</value>
            </variable>
            <variable name="glpi_admin_email" type="string"
                description="Adresse email de l'admin">
            </variable>
            <variable name="glpi_ldap_auth" type="string"
                description="Activer l'authentification LDAP non chiffrée">
                <value>ne rien faire</value>
            </variable>
            <variable name="glpi_domainadmins_dn" type="string" mandatory="True"
                description='DN du groupe DomainAdmins pour ajout "super-admin" GLPI'>
            </variable>
            <variable name="glpi_cas_auth" type="string"
                description="Activer l'authentification CAS">
                <value>ne rien faire</value>
            </variable>
            <variable name='glpi_db_mode' type='string' description="Mode de fonctionnement de la base de données"  mode='expert' mandatory='True'>
                <value>default</value>
            </variable>
            <variable name='glpi_db_host' type='string' description="Adresse de la base de données" mode='expert' mandatory='True'/>
            <variable name='glpi_db_port' type='number' description="Port de la base de données" mode='expert' mandatory='True'/>
            <variable name='glpi_db_root' type='string' description="Compte d'adminstration de la base de données" mode='expert' mandatory='True'/>
            <variable name='glpi_db_root_passwd_path' type='filename' description="Chemin du fichier de mot de passe pour l'administration de la base de données" mode='expert' mandatory='True'/>
            <variable name='glpi_db_extra_allowed_hosts' type='string' description="Hôtes supplémentaires autorisés à se connecter à la base de données" mode='expert' multi='True' mandatory='True'/>
            <variable name='glpi_helpdesk_doc_source' type='string' description="Type d'URL de l'aide helpdesk" mode='expert'>
                <value>personnalisée</value>
            </variable>
            <variable name='glpi_helpdesk_doc_url' type='string' description="URL de l'aide helpdesk" mode='expert'/>
            <variable name='glpi_central_doc_source' type='string' description="Type d'URL de l'aide centrale" mode='expert'>
                <value>personnalisée</value>
            </variable>
            <variable name='glpi_central_doc_url' type='string' description="URL de l'aide centrale" mode='expert'/>

        </family>
    </variables>

    <constraints>
        <check name="valid_enum" target="glpi_config_email">
            <param>['ne rien faire','oui','non']</param>
        </check>
        <check name="valid_enum" target="glpi_ldap_auth">
            <param>['ne rien faire','oui','non']</param>
        </check>
        <check name="valid_enum" target="glpi_cas_auth">
            <param>['ne rien faire','oui','non']</param>
        </check>
        <check name='valid_enum' target='glpi_db_mode'>
            <param>['default', 'local', 'externe']</param>
        </check>
        <check name='valid_enum' target='glpi_helpdesk_doc_source'>
            <param>['personnalisée', 'officielle']</param>
        </check>
        <check name='valid_enum' target='glpi_central_doc_source'>
            <param>['personnalisée', 'officielle']</param>
        </check>
        <fill name='calc_multi_condition' target='glpi_helpdesk_doc_url'>
            <param>personnalisée</param>
            <param type='eole' name='condition_1'>glpi_helpdesk_doc_source</param>
            <param name='match'>http://pne.metier.e2.rie.gouv.fr/glpi-r677.html</param>
            <param name='default_mismatch'>http://www.glpi-project.org/spip.php?rubrique3</param>
        </fill>
        <fill name='calc_multi_condition' target='glpi_central_doc_url'>
            <param>personnalisée</param>
            <param type='eole' name='condition_1'>glpi_central_doc_source</param>
            <param name='match'>http://pne.metier.e2.rie.gouv.fr/glpi-r677.html</param>
            <param name='default_mismatch'>http://www.glpi-project.org/spip.php?rubrique3</param>
        </fill>
        <condition name='disabled_if_in' source='glpi_helpdesk_doc_source'>
            <param>officielle</param>
            <target type='variable'>glpi_helpdesk_doc_url</target>
        </condition>
        <condition name='disabled_if_in' source='glpi_central_doc_source'>
            <param>officielle</param>
            <target type='variable'>glpi_central_doc_url</target>
        </condition>


        <condition name="disabled_if_in" source='activer_glpi'>
            <param>non</param>
            <target type='filelist'>glpi_files</target>
            <target type='family'>glpi</target>
            <target type='servicelist'>glpi</target>
        </condition>
        <condition name='disabled_if_in' source='activer_client_ldap' fallback='True'>
            <param>non</param>
            <target type='variable'>glpi_ldap_auth</target>
        </condition>
        <condition name='disabled_if_in' source='glpi_db_mode'>
            <param>default</param>
            <target type='variable'>glpi_db_host</target>
            <target type='variable'>glpi_db_port</target>
            <target type='variable'>glpi_db_root</target>
            <target type='variable'>glpi_db_root_passwd_path</target>
            <target type='variable'>glpi_db_extra_allowed_hosts</target>
        </condition>
        <condition name='disabled_if_in' source='glpi_db_mode'>
            <param>local</param>
            <target type='variable'>glpi_db_port</target>
            <target type='variable'>glpi_db_root</target>
            <target type='variable'>glpi_db_root_passwd_path</target>
            <target type='variable'>glpi_db_extra_allowed_hosts</target>
        </condition>
        
        <condition name="disabled_if_not_in" source='glpi_config_email'>
            <param>oui</param>
            <target>glpi_admin_email</target>
        </condition>
        <condition name="disabled_if_not_in" source='glpi_ldap_auth'>
            <param>oui</param>
            <target>glpi_domainadmins_dn</target>
        </condition>
         <fill name='concat' target='glpi_admin_email'>
            <param type='eole'>system_mail_to</param>
        </fill>
        <fill name='concat' target='glpi_domainadmins_dn'>
            <param>cn=DomainAdmins,ou=local,ou=groupes,ou=</param>
            <param type='eole'>numero_etab</param>
            <param>,ou=</param>
            <param type='eole'>nom_academie</param>
            <param>,ou=education,</param>
            <param type='eole'>ldap_base_dn</param>
        </fill>

    </constraints>

    <help>
        <family name='glpi'>Paramétrage avancé de l'application GLPI</family>
        <variable name='activer_glpi'>GLPI est une application web permettant la gestion de parc informatique et de gestion des services d'assistance</variable>
        <variable name='glpi_helpdesk_doc_source'>Source de la documentation helpdesk accessible depuis le site de l'application glpi (documentation officielle ou personnalisée).</variable>
        <variable name='glpi_central_doc_source'>Source de la documentation centrale accessible depuis le site de l'application glpi (documentation officielle ou personnalisée).</variable>
        <variable name='glpi_helpdesk_doc_url'>URL personnalisée de la documentation helpdesk accessible depuis l'application glpi.</variable>
        <variable name='glpi_central_doc_url'>URL personnalisée de la documentation centrale accessible depuis l'application glpi.</variable>
    </help>

</creole>
<!-- vim: ts=4 sw=4 expandtab
-->
