diff --git a/seed/README.md b/seed/README.md index 8f7c5d85..2cac2c83 100644 --- a/seed/README.md +++ b/seed/README.md @@ -13,16 +13,13 @@ - dns: - [dns-external](dns-external/README.md): DNS client with resolution on all zones (especially outside) - [dns-local](dns-local/README.md): DNS client with access to local zones -- [dotclear](dotclear/README.md): Dotclear an open-source web publishing software - [dovecot](dovecot/README.md): Postfix and Dovecot as mail servers (Submission and IMAP) - [forgejo](forgejo/README.md): Forgejo, a community managed lightweight code hosting solution -- [galette](galette/README.md): Galette, a membership management web application towards non profit organizations - [gitea](gitea/README.md): Transitional package for Gitea to Forgejo - [host-systemd-machined](host-systemd-machined/README.md): Host with machine started in Systemd Machined environment - [imap-client](imap-client/README.md): Application service needs interact with an IMAP server - [ldap-client](ldap-client/README.md): Application service needs interact with a LDAP server - [lemonldap](lemonldap/README.md): LemonLDAP, a Web Single Sign On and Access Management -- [letsencrypt](letsencrypt/README.md): Let's encrypt, a nonprofit Certificate Authority providing TLS certificates - [mailman](mailman/README.md): GNU Mailman, managing electronic mail discussion and e-newsletter lists - mariadb: - [mariadb](mariadb/README.md): MariaDB, a relational database @@ -42,6 +39,7 @@ - [php](php/README.md): PHP, a popular general-purpose scripting language - [php-fpm](php-fpm/README.md): PHP FPM - [piwigo](piwigo/README.md): Piwigo, a photo management software +- [pki-tls](pki-tls/README.md): Autosign PKI or Let's encrypt support for TLS certificates - postfix: - [postfix-lmtp-relay](postfix-lmtp-relay/README.md): Postfix, the mail server, as LMTP relay - [postfix-relay](postfix-relay/README.md): Postfix, the mail server, as relay @@ -57,7 +55,6 @@ - [relay-mail-client](relay-mail-client/README.md): Client SMTP - [reverse-proxy-client](reverse-proxy-client/README.md): Application service needs interact with a a reverse proxy server - [roundcube](roundcube/README.md): Roundcube, a webmail -- [sensmotdire](sensmotdire/README.md): Sens Mot Dire, a french conjugaison service - [speedtest-rs](speedtest-rs/README.md): Speedtest-rs, a very lightweight Speedtest - [systemd](systemd/README.md): Systemd, a system and service manager - [unbound](unbound/README.md): Unbound, a validating, recursive, caching DNS resolver diff --git a/seed/apache/README.md b/seed/apache/README.md index 0a0093d5..f69d0a0b 100644 --- a/seed/apache/README.md +++ b/seed/apache/README.md @@ -27,8 +27,8 @@ Paramètrage avancé du serveur web Apache | Description | Help | Type | Values | |-----------------------------------------------------------------------------------------------------------------------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------|----------| -| **Temps d'attente des entrées/sorties avant de considérer qu'une requête a échoué** (*[apache_timeout](dictionaries/20_web.xml)*) | Temps en secondes | [number](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | 300 | -| **Autoriser les connexions persistantes** (*[apache_keepalive](dictionaries/20_web.xml)*) | | [boolean](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | True | +| **Temps d'attente des entrées/sorties avant de considérer qu'une requête a échoué** (*[apache_timeout](dictionaries/20_web.xml)*) | Temps en secondes | [number](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | 300 | +| **Autoriser les connexions persistantes** (*[apache_keepalive](dictionaries/20_web.xml)*) | | [boolean](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | True | - [+]: variable is multiple diff --git a/seed/apache/dictionaries/20_web.xml b/seed/apache/dictionaries/20_web.xml index 1cdf9127..afd56df9 100644 --- a/seed/apache/dictionaries/20_web.xml +++ b/seed/apache/dictionaries/20_web.xml @@ -5,9 +5,6 @@ /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/risotto.conf /etc/httpd/conf.d/ssl.conf - /etc/httpd/ssl/server.ca - /etc/httpd/ssl/server.crt - /etc/httpd/ssl/server.key /sysusers.d/httpd.conf /tmpfiles.d/0httpd.conf diff --git a/seed/apache/manual/image/preinstall/apache.sh b/seed/apache/manual/image/preinstall/apache.sh index c8ac0407..9c9e8c36 100644 --- a/seed/apache/manual/image/preinstall/apache.sh +++ b/seed/apache/manual/image/preinstall/apache.sh @@ -1 +1 @@ -PKG="$PKG mod_ssl" +PKG="$PKG httpd mod_ssl" diff --git a/seed/apache/templates/server.ca b/seed/apache/templates/server.ca deleted file mode 100644 index 91ed66dd..00000000 --- a/seed/apache/templates/server.ca +++ /dev/null @@ -1 +0,0 @@ -%%get_chain(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy", hide=%%hide_secret) diff --git a/seed/apache/templates/server.crt b/seed/apache/templates/server.crt deleted file mode 100644 index da844246..00000000 --- a/seed/apache/templates/server.crt +++ /dev/null @@ -1 +0,0 @@ -%%get_certificate(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy", hide=%%hide_secret) diff --git a/seed/apache/templates/server.key b/seed/apache/templates/server.key deleted file mode 100644 index e8593618..00000000 --- a/seed/apache/templates/server.key +++ /dev/null @@ -1 +0,0 @@ -%%get_private_key(%%domain_name_eth0, authority_cn=%%revprox_client_server_domainname, authority_name="InternalReverseProxy", hide=%%hide_secret) diff --git a/seed/apache/templates/ssl.conf b/seed/apache/templates/ssl.conf index 0067b4a1..d2ee87c5 100644 --- a/seed/apache/templates/ssl.conf +++ b/seed/apache/templates/ssl.conf @@ -100,7 +100,7 @@ SSLProxyCipherSuite PROFILE=SYSTEM # require an ECC certificate which can also be configured in # parallel. # GNUNUX SSLCertificateFile /etc/pki/tls/certs/localhost.crt -SSLCertificateFile /etc/httpd/ssl/server.crt +SSLCertificateFile %%tls_cert_directory/revprox.crt # Server Private Key: # If the key is not combined with the certificate, use this @@ -109,7 +109,7 @@ SSLCertificateFile /etc/httpd/ssl/server.crt # both in parallel (to also allow the use of DSA ciphers, etc.) # ECC keys, when in use, can also be configured in parallel # GNUNUX SSLCertificateKeyFile /etc/pki/tls/private/localhost.key -SSLCertificateKeyFile /etc/httpd/ssl/server.key +SSLCertificateKeyFile %%tls_key_directory/revprox.key # Server Certificate Chain: # Point SSLCertificateChainFile at a file containing the @@ -126,7 +126,7 @@ SSLCertificateKeyFile /etc/httpd/ssl/server.key # huge file containing all of them (file must be PEM encoded) #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt #>GNUNUX -SSLCACertificateFile /etc/httpd/ssl/server.ca +SSLCACertificateFile %%tls_ca_directory/InternalReverseProxy.crt # - domain_name_eth0 + server_name machine.name diff --git a/seed/base-machine/funcs/funcs.py b/seed/base-machine/funcs/funcs.py index 1784d5a3..54fe475c 100644 --- a/seed/base-machine/funcs/funcs.py +++ b/seed/base-machine/funcs/funcs.py @@ -10,11 +10,11 @@ _HERE = _environ['PWD'] _PASSWORD_DIR = _join(_HERE, 'password') -def get_password(server_name: str, - username: str, +def get_password(username: str, description: str, type: str, hide: bool, + server_name: str='none', length: int=20, temporary: bool=True, ) -> str: diff --git a/seed/base/dictionaries/00-base.xml b/seed/base/dictionaries/00_base.xml similarity index 100% rename from seed/base/dictionaries/00-base.xml rename to seed/base/dictionaries/00_base.xml diff --git a/seed/base/funcs/base.py b/seed/base/funcs/base.py index c4fe7125..3017cd1c 100644 --- a/seed/base/funcs/base.py +++ b/seed/base/funcs/base.py @@ -21,12 +21,15 @@ def get_ip(zones: dict, break else: raise ValueError(f'cannot find IP in domain name "{domain_name}" (for "{s_name}")') + if not host_name in zone['hosts']: + continue ret = zone['hosts'][host_name] if not return_list: return ret if ret not in lst: lst.append(ret) - return lst + if return_list: + return lst @_multi_function diff --git a/seed/dns-external/README.md b/seed/dns-external/README.md index 2db1e1b2..7a82a85e 100644 --- a/seed/dns-external/README.md +++ b/seed/dns-external/README.md @@ -19,8 +19,8 @@ DNS client with resolution on all zones (especially outside). | Description | Values | Supplier | |-------------------------------------------------------------|----------|-------------| -| *[**dns_is_only_local**](dictionaries/14-dns-external.xml)* | False | | -| *[dns_client_address](dictionaries/14-dns-external.xml)* | | ExternalDNS | +| *[**dns_is_only_local**](dictionaries/14_dns-external.xml)* | False | | +| *[dns_client_address](dictionaries/14_dns-external.xml)* | | ExternalDNS | - [+]: variable is multiple diff --git a/seed/dns-external/dictionaries/14-dns-external.xml b/seed/dns-external/dictionaries/14_dns-external.xml similarity index 100% rename from seed/dns-external/dictionaries/14-dns-external.xml rename to seed/dns-external/dictionaries/14_dns-external.xml diff --git a/seed/dns-local/dictionaries/13-dns-local.xml b/seed/dns-local/dictionaries/13_dns-local.xml similarity index 100% rename from seed/dns-local/dictionaries/13-dns-local.xml rename to seed/dns-local/dictionaries/13_dns-local.xml diff --git a/seed/dotclear/README.md b/seed/dotclear/README.md deleted file mode 100644 index dccce365..00000000 --- a/seed/dotclear/README.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -gitea: none -include_toc: true ---- - -# dotclear - -[All applications services for this dataset.](../README.md) - -## Description - -Dotclear an open-source web publishing software. - -[For more informations](https://dotclear.org) - -## Dependances - -- [base-fedora-36](../base-fedora-36/README.md) - - [base-fedora](../base-fedora/README.md) - - [systemd](../systemd/README.md) - - [base-machine](../base-machine/README.md) - - [base](../base/README.md) - - [dns-local](../dns-local/README.md) -- [postgresql-client](../postgresql-client/README.md) -- [nginx-https](../nginx-https/README.md) - - [nginx-common](../nginx-common/README.md) - - [reverse-proxy-client](../reverse-proxy-client/README.md) -- [php-fpm](../php-fpm/README.md) - - [php](../php/README.md) - -## Variables - -### Général (*general*) - -#### Dotclear (*general.dotclear*) - -| Description | Type | -|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------| -| **Adresse courriel de l'administrateur** (*[admin_mail_from](dictionaries/40_dotclear.xml)*) | [mail](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | - - -- [+]: variable is multiple -- **bold**: variable is mandatory diff --git a/seed/dotclear/applicationservice.yml b/seed/dotclear/applicationservice.yml deleted file mode 100644 index 33dd1403..00000000 --- a/seed/dotclear/applicationservice.yml +++ /dev/null @@ -1,8 +0,0 @@ -format: '0.1' -description: Dotclear an open-source web publishing software -website: https://dotclear.org -depends: - - base-fedora-36 - - postgresql-client - - nginx-https - - php-fpm diff --git a/seed/dotclear/dictionaries/40_dotclear.xml b/seed/dotclear/dictionaries/40_dotclear.xml deleted file mode 100644 index 924fc9b4..00000000 --- a/seed/dotclear/dictionaries/40_dotclear.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - /etc/dotclear/config.php - /etc/nginx/default.d/dotclear.conf - /tmpfiles.d/0dotclear.conf - - - - - - - - - - - domain_name_eth0 - secret_key - dotclear - cleartext - hide_secret - dotclear_secret_key - - - diff --git a/seed/dotclear/manual/image/postinstall/dotclear.sh b/seed/dotclear/manual/image/postinstall/dotclear.sh deleted file mode 100644 index 3beb06fd..00000000 --- a/seed/dotclear/manual/image/postinstall/dotclear.sh +++ /dev/null @@ -1,16 +0,0 @@ -set -e - -ORIPWD=$PWD -mkdir -p "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share" -cd "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share" -wget -q "https://download.dotclear.net/latest.tar.gz" -tar xf *tar.gz -rm -f *tar.gz -chown -R root: dotclear -cd dotclear -rmdir public -ln -s /srv/dotclear/public public -cd inc -ln -s /etc/dotclear/config.php config.php - -cd $ORIPWD diff --git a/seed/dotclear/manual/image/preinstall/dotclear.sh b/seed/dotclear/manual/image/preinstall/dotclear.sh deleted file mode 100644 index c29a6cdc..00000000 --- a/seed/dotclear/manual/image/preinstall/dotclear.sh +++ /dev/null @@ -1 +0,0 @@ -PKG="$PKG php-pgsql php-mbstring php-xml" diff --git a/seed/dotclear/templates/config.php b/seed/dotclear/templates/config.php deleted file mode 100644 index 1380766a..00000000 --- a/seed/dotclear/templates/config.php +++ /dev/null @@ -1,108 +0,0 @@ -GNUNUX -//define('DC_TPL_CACHE', path::real(__DIR__ . '/..') . '/cache'); -define('DC_TPL_CACHE', '/srv/dotclear/cache'); -//GNUNUX -define('DC_NOT_UPDATE', false); -//GNUNUX -define('DC_REVERSE_PROXY',true); -//.+?\.php)(?/.*)?$ { - fastcgi_pass php-fpm; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $request_filename; - include fastcgi_params; - } -} -%end for diff --git a/seed/dotclear/templates/dotclear.service b/seed/dotclear/templates/dotclear.service deleted file mode 100644 index 5d167884..00000000 --- a/seed/dotclear/templates/dotclear.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Dotclear management -After=risotto.target -Before=nginx.service php-fpm.service - -[Service] -Type=oneshot -ExecStart=/usr/bin/cp -f /usr/local/share/dotclear/var/.htaccess /srv/dotclear/var/ -ExecStart=/usr/bin/cp -f /usr/local/share/dotclear/cache/.htaccess /srv/dotclear/cache/ -ExecStart=/usr/bin/cp -f /usr/local/share/dotclear/plugins/.htaccess /srv/dotclear/plugins/ -ExecStart=/usr/bin/rm -rf /srv/dotclear/plugins/* -ExecStart=/bin/bash -c '/usr/bin/cp -fr /usr/local/share/dotclear/plugins/* /srv/dotclear/plugins/' - -User=nginx -Group=nginx - -[Install] -WantedBy=multi-user.target diff --git a/seed/dotclear/templates/tmpfile-dotclear.conf b/seed/dotclear/templates/tmpfile-dotclear.conf deleted file mode 100644 index e0b65c7e..00000000 --- a/seed/dotclear/templates/tmpfile-dotclear.conf +++ /dev/null @@ -1,4 +0,0 @@ -d /srv/dotclear/cache 770 root nginx - - -d /srv/dotclear/public 770 root nginx - - -d /srv/dotclear/var 770 root nginx - - -d /srv/dotclear/plugins 770 root nginx - - diff --git a/seed/dovecot/FIXME b/seed/dovecot/FIXME index 73bc7aa9..ec4570af 100644 --- a/seed/dovecot/FIXME +++ b/seed/dovecot/FIXME @@ -1,2 +1,6 @@ SPF : https://www.djaodjin.com/blog/postfix-dovecot-openldap.blog.html Postcreen : modoboa_installer/scripts/files/postfix/main.cf.tpl + +https://github.com/progmaticltd/homebox + +/srv/postfix/mail devrait etre vide ! diff --git a/seed/dovecot/README.md b/seed/dovecot/README.md index 4a9ce66d..e8b35f2c 100644 --- a/seed/dovecot/README.md +++ b/seed/dovecot/README.md @@ -21,6 +21,7 @@ Postfix and Dovecot as mail servers (Submission and IMAP). - [base-machine](../base-machine/README.md) - [base](../base/README.md) - [dns-local](../dns-local/README.md) + - [pki-tls](../pki-tls/README.md) - [relay-lmtp-client](../relay-lmtp-client/README.md) - [relay-mail-client](../relay-mail-client/README.md) - [ldap-client](../ldap-client/README.md) @@ -47,23 +48,28 @@ Postfix and Dovecot as mail servers (Submission and IMAP). |----------------------------------------------------------|----------| | *[**ldapclient_family**](dictionaries/26_dovecot.xml)* | all | | *[**ldap_key_file_owner**](dictionaries/26_dovecot.xml)* | dovecot | -| *[**ldap_key_file_group**](dictionaries/26_dovecot.xml)* | postfix | -#### Mail domain (*general.mail*) +#### Mail configuration (*general.mail*) + +| Description | Type | Values | Choices | +|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-----------|----------------------------| +| **Autorité de certification signant les certificats des domaines extérieurs** (*[mail_crt_provider](dictionaries/26_dovecot.xml)*) | [choice](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | autosigne | autosigneletsencrypt | + +##### Mail domain (*general.mail.domain*) This a family is a leadership. | Description | Type | Supplier | |---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|---------------| -| **Domaine de courriel géré localement** (*[mail_domains](dictionaries/26_dovecot.xml)*) [+] | [domainname](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | LMTP:criteria | -| *[**imap_domainname**](dictionaries/26_dovecot.xml)* | [domainname](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | -| *[**submission_domainname**](dictionaries/26_dovecot.xml)* | [domainname](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | +| **Domaine de courriel géré localement** (*[mail_domains](dictionaries/26_dovecot.xml)*) [+] | [domainname](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | LMTP:criteria | +| *[**imap_domainname**](dictionaries/26_dovecot.xml)* | [domainname](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | +| *[**submission_domainname**](dictionaries/26_dovecot.xml)* | [domainname](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | #### IMAP mail server (*general.dovecot*) | Description | Type | Values | Provider | |----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|--------------|------------| -| **Adresse interne du serveur IMAP** (*[imap_internal_address](dictionaries/26_dovecot.xml)*) | [domainname](https://cloud.silique.fr/gitea/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | IMAP | +| **Adresse interne du serveur IMAP** (*[imap_internal_address](dictionaries/26_dovecot.xml)*) | [domainname](https://forge.cloud.silique.fr/risotto/rougail/src/branch/main/doc/variable/README.md#le-type-de-la-variable) | | IMAP | #### revprox (*general.revprox*) diff --git a/seed/dovecot/dictionaries/26_dovecot.xml b/seed/dovecot/dictionaries/26_dovecot.xml index 7aff3628..c0d78741 100644 --- a/seed/dovecot/dictionaries/26_dovecot.xml +++ b/seed/dovecot/dictionaries/26_dovecot.xml @@ -3,18 +3,17 @@ + submission_domainname + postfixlocal + postfix + postfix_ldap_client /sysusers.d/1postfix.conf /tmpfiles.d/0postfix.conf /etc/postfix/main.cf /etc/postfix/master.cf /etc/postfix/relay_passwd /etc/postfix/ldapsource.cf - /etc/pki/ca-trust/source/anchors/ca_MailServer.crt - /etc/pki/tls/certs/postfix.crt - /etc/pki/tls/private/postfix.key /etc/postfix/sni - postfix_pem_files - /etc/postfix/certs/postfix.pem @@ -24,6 +23,8 @@ well_known_filenames + imap_domainname + dovecot /sysusers.d/1dovecot.conf /tmpfiles.d/0dovecot.conf /etc/dovecot/conf.d/10-logging.conf @@ -42,11 +43,6 @@ /etc/dovecot/conf.d/auth-oauth2.conf.ext /etc/dovecot/dovecot-oauth2.conf.ext - /etc/pki/ca-trust/source/anchors/ca_IMAPServer.crt - /etc/pki/tls/certs/dovecot.crt - /etc/pki/tls/private/dovecot.key - external_imap_crt - external_imap_key /tests/imap.yml @@ -65,25 +61,24 @@ dovecot - - postfix - - - - - - - - - + + + + + + + + + autosigne + autosigne + letsencrypt + - - @@ -98,30 +93,6 @@ - - /etc/pki/tls/certs/imap_ - imap_domainname - .crt - - True - external_imap_crt - - - /etc/pki/tls/private/imap_ - imap_domainname - .key - - True - external_imap_key - - - /etc/postfix/certs/ - submission_domainname - .pem - - True - postfix_pem_files - domain_name_eth0 imap_internal_address diff --git a/seed/dovecot/templates/10-ssl.conf b/seed/dovecot/templates/10-ssl.conf index 6adcf9f7..bcc06696 100644 --- a/seed/dovecot/templates/10-ssl.conf +++ b/seed/dovecot/templates/10-ssl.conf @@ -18,13 +18,13 @@ ssl_cert = GNUNUX -tls_cert_file = %%ldap_cert_file -tls_key_file = %%ldap_key_file -tls_ca_cert_file = %%ldap_ca_file +tls_cert_file = %%tls_cert_directory/ldap_client.crt +tls_key_file = %%tls_key_directory/ldap_client.key +tls_ca_cert_file = %%tls_ca_directory/LDAP.crt tls_require_cert = hard #>GNUNUX diff --git a/seed/dovecot/templates/dovecot.crt b/seed/dovecot/templates/dovecot.crt deleted file mode 100644 index 60f06838..00000000 --- a/seed/dovecot/templates/dovecot.crt +++ /dev/null @@ -1,8 +0,0 @@ -%set %%extra_domainnames = [] -%for %%idx in %%range(%%len(%%zones_list)) - %if not idx - %continue - %end if - %%extra_domainnames.append(%%getVar('domain_name_eth' + %%str(%%idx))) -%end for -%%get_certificate(%%domain_name_eth0, 'IMAPServer', extra_domainnames=%%extra_domainnames, hide=%%hide_secret) diff --git a/seed/dovecot/templates/dovecot.key b/seed/dovecot/templates/dovecot.key deleted file mode 100644 index 3cbe873c..00000000 --- a/seed/dovecot/templates/dovecot.key +++ /dev/null @@ -1 +0,0 @@ -%%get_private_key(cn=%%domain_name_eth0, authority_name='IMAPServer', hide=%%hide_secret) diff --git a/seed/dovecot/templates/ldapsource.cf b/seed/dovecot/templates/ldapsource.cf index 38555927..76283fd6 100644 --- a/seed/dovecot/templates/ldapsource.cf +++ b/seed/dovecot/templates/ldapsource.cf @@ -1,8 +1,8 @@ server_host = ldaps://%%ldap_server_address server_port = %%ldap_port -tls_cert = %%ldap_cert_file -tls_key = %%ldap_key_file -tls_ca_cert_file = %%ldap_ca_file +tls_cert = %%tls_cert_directory/postfix_ldap_client.crt +tls_key = %%tls_key_directory/postfix_ldap_client.key +tls_ca_cert_file = %%tls_ca_directory/LDAP.crt tls_require_cert = yes version = 3 bind = yes diff --git a/seed/dovecot/templates/main.cf b/seed/dovecot/templates/main.cf index 3b4b980b..7619d055 100644 --- a/seed/dovecot/templates/main.cf +++ b/seed/dovecot/templates/main.cf @@ -306,7 +306,7 @@ smtpd_recipient_restrictions = #mynetworks = 168.100.3.0/28, 127.0.0.0/8 #mynetworks = $config_directory/mynetworks #mynetworks = hash:/etc/postfix/network_table -mynetworks = 172.0.0.0/8 +mynetworks = 127.0.0.0/8 # The relay_domains parameter restricts what destinations this system will # relay mail to. See the smtpd_recipient_restrictions description in @@ -476,6 +476,9 @@ recipient_delimiter = + # #mail_spool_directory = /var/mail #mail_spool_directory = /var/spool/mail +#>GNUNUX +mail_spool_directory = /srv/postfix/mail +#GNUNUX tls_server_sni_maps = hash:/etc/postfix/sni # | +#### postgresql (*general.postgresql*) + +| Description | Values | +|----------------------------------------------------------|----------| +| *[**pg_client_key_owner**](dictionaries/31_forgejo.xml)* | forgejo | + - [+]: variable is multiple - **bold**: variable is mandatory diff --git a/seed/forgejo/dictionaries/31_forgejo.xml b/seed/forgejo/dictionaries/31_forgejo.xml index 2b239ea6..0526f167 100644 --- a/seed/forgejo/dictionaries/31_forgejo.xml +++ b/seed/forgejo/dictionaries/31_forgejo.xml @@ -40,9 +40,6 @@ forgejo - - forgejo - diff --git a/seed/forgejo/templates/app.ini b/seed/forgejo/templates/app.ini index 06dfcfd4..a0e654f3 100644 --- a/seed/forgejo/templates/app.ini +++ b/seed/forgejo/templates/app.ini @@ -319,8 +319,8 @@ OFFLINE_MODE = true ;CERT_FILE = https/cert.pem ;KEY_FILE = https/key.pem ;>GNUNUX -CERT_FILE = %%revprox_client_cert_file -KEY_FILE = %%revprox_client_key_file +CERT_FILE = %%tls_cert_directory/revprox.crt +KEY_FILE = %%tls_key_directory/revprox.key ; - - - - /etc/galette/config.inc.php - /etc/nginx/default.d/galette.conf - - - diff --git a/seed/galette/manual/image/postinstall/galette.sh b/seed/galette/manual/image/postinstall/galette.sh deleted file mode 100644 index 8dc7e164..00000000 --- a/seed/galette/manual/image/postinstall/galette.sh +++ /dev/null @@ -1,8 +0,0 @@ -set -e - -mkdir -p "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share" -cp -a $IMAGE_DIR_RECIPIENT_IMAGE/postinstall/galette "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share" -chown -R root: "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/galette" -ln -s /etc/galette/config.inc.php "$IMAGE_NAME_RISOTTO_IMAGE_DIR_TMP/usr/local/share/galette/includes/config.inc.php" - -cd $ORIPWD diff --git a/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php b/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php deleted file mode 100644 index 9628b29d..00000000 --- a/seed/galette/manual/image/postinstall/galette/ajouter_adherent.php +++ /dev/null @@ -1,810 +0,0 @@ - modif ou création - $values = Array(); - $id_adh = ""; - $values['date_crea_adh'] = ""; - if (isset($_GET["id_adh"])) - if (is_numeric($_GET["id_adh"])) - $id_adh = $_GET["id_adh"]; - if (isset($_POST["id_adh"])) - if (is_numeric($_POST["id_adh"])) - $id_adh = $_POST["id_adh"]; - - // Si c'est un user qui est loggé, on va à sa fiche - if ($_SESSION["admin_status"]!=1) - $id_adh = $_SESSION["logged_id_adh"]; - $values['id_adh'] = $id_adh; - // variables d'erreur (pour affichage) - $error_detected = ""; - $warning_detected = ""; - $confirm_detected = ""; - - // - // DEBUT parametrage des champs - // On recupere de la base la longueur et les flags des champs - // et on initialise des valeurs par defaut - - // recuperation de la liste de champs de la table - $fields = $DB->MetaColumns(PREFIX_DB."adherents"); - foreach ($fields as $champ => $proprietes) - { - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - $fieldname = $proprietes_arr["name"]; - - // on ne met jamais a jour id_adh - if ($fieldname!="id_adh" && $fieldname!="date_echeance") - $$fieldname= ""; - - $fieldlen = $fieldname."_len"; - $fieldreq = $fieldname."_req"; - - // definissons aussi la longueur des input text - $max_tmp = $proprietes_arr["max_length"]; - if ($max_tmp == "-1") - $max_tmp = 10; - $fieldlen = $fieldname."_len"; - $$fieldlen=$max_tmp; - - // et s'ils sont obligatoires (à partir de la base) - if ($proprietes_arr["not_null"]==1) - $$fieldreq = "style=\"color: #FF0000;\""; - else - $$fieldreq = ""; - } - reset($fields); - - // et les valeurs par defaut - $id_statut = "4"; - $values['titre_adh'] = "1"; - - // - // FIN parametrage des champs - // - - // - // Validation du formulaire - // - - if (isset($_POST["valid"])) - { - // verification de champs - $update_string = ""; - $insert_string_fields = ""; - $insert_string_values = ""; - - // recuperation de la liste de champs de la table - foreach ($fields as $champ => $proprietes) - { - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - $fieldname = $proprietes_arr["name"]; - - // on précise les champs non modifiables - if ( - ($_SESSION["admin_status"]==1 && $fieldname!="id_adh" - && $fieldname!="date_echeance") || - ($_SESSION["admin_status"]==0 && $fieldname!="date_crea_adh" - && $fieldname!="panier_adh" - && $fieldname!="pain_adh" - && $fieldname!="volaille_adh" - && $fieldname!="chevre_adh" - && $fieldname!="boeuf_adh" - && $fieldname!="veau_adh" - && $fieldname!="cochon_adh" - && $fieldname!="farine_adh" - && $fieldname!="id_adh" - && $fieldname!="titre_adh" - && $fieldname!="id_statut" - && $fieldname!="nom_adh" - && $fieldname!="prenom_adh" - && $fieldname!="activite_adh" - && $fieldname!="bool_exempt_adh" - && $fieldname!="bool_admin_adh" - && $fieldname!="date_echeance" - && $fieldname!="info_adh") - ) - { - if (isset($_POST[$fieldname])) - $post_value=trim($_POST[$fieldname]); - else - $post_value=""; - // on declare les variables pour la présaisie en cas d'erreur - $values[$fieldname] = htmlentities(stripslashes($post_value),ENT_QUOTES); - $fieldreq = $fieldname."_req"; - - // vérification de la présence des champs obligatoires - if ($$fieldreq!="" && $post_value=="") - $error_detected .= ""._T("- Champ obligatoire non renseigné.").""; - else - { - // validation des dates - if($proprietes_arr["type"]=="date" && $post_value!="") - { - if (preg_match("/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/", $post_value, $array_jours) || $post_value=="") - { - if (checkdate($array_jours[2],$array_jours[1],$array_jours[3]) || $post_value=="") -// $value=$DB->DBDate(mktime(0,0,0,$array_jours[2],$array_jours[1],$array_jours[3])); - $value = $DB->DBDate($array_jours[3].'/'.$array_jours[2].'/'.$array_jours[1]); - else - $error_detected .= ""._T("- Date non valide !").""; - } - else - $error_detected .= ""._T("- Mauvais format de date (jj/mm/aaaa) !").""; - } - elseif ($fieldname=="email_adh") - { - $post_value=strtolower($post_value); - if (!is_valid_email($post_value) && $post_value!="") - $error_detected .= ""._T("- Adresse E-mail non valide !").""; - else - $value = $DB->qstr($post_value, true); - - if ($post_value=="" && isset($_POST["mail_confirm"])) - $error_detected .= ""._T("- Vous ne pouvez pas envoyer de confirmation par mail si l'adhérent n'a pas d'adresse !").""; - } - elseif ($fieldname=="url_adh") - { - if (!is_valid_web_url($post_value) && $post_value!="" && $post_value!="http://") - $error_detected .= ""._T("- Adresse web non valide ! Oubli du http:// ?").""; - else - { - if ($post_value=="http://") - $post_value=""; - $value = $DB->qstr($post_value, true); - } - } - elseif ($fieldname=="login_adh") - { - if (strlen($post_value)<4) - $error_detected .= ""._T("- L'identifiant doit être composé d'au moins 4 caractères !").""; - else - { - // on vérifie que le login n'est pas déjà utilisé - $requete = "SELECT id_adh - FROM ".PREFIX_DB."adherents - WHERE login_adh=". $DB->qstr($post_value, true); - if ($id_adh!="") - $requete .= " AND id_adh!=" . $DB->qstr($id_adh, true); -echo $requete; - $result = $DB->Execute($requete); - if (!$result->EOF || $post_value==PREF_ADMIN_LOGIN) - $error_detected .= ""._T("- Cet identifiant est déjà utilisé par un autre adhérent !").""; - else - $value = $DB->qstr($post_value, true); - } - } - elseif ($fieldname=="mdp_adh") - { - if (strlen($post_value)<4) - $error_detected .= ""._T("- Le mot de passe doit être composé d'au moins 4 caractères !").""; - else - $value = $DB->qstr($post_value, true); - } - else - { - // on se contente d'escaper le html et les caracteres speciaux - $value = $DB->qstr($post_value, true); - } - - // mise à jour des chaines d'insertion/update - if ($value=="''") - $value="NULL"; - $update_string .= ",".$fieldname."=".$value; - $insert_string_fields .= ",".$fieldname; - $insert_string_values .= ",".$value; - } - } - } - reset($fields); - - // modif ou ajout - if ($error_detected=="") - { - if ($id_adh!="") - { - // modif - - $requete = "UPDATE ".PREFIX_DB."adherents - SET " . substr($update_string,1) . " - WHERE id_adh=" . $id_adh; - $DB->Execute("SET NAMES utf8"); - $DB->Execute($requete); - $DB->Execute("SET NAMES latin1"); - $result = $DB->Execute("SET NAMES latin1"); - dblog(_T("Mise à jour de la fiche adhérent :")." ".strtoupper($_POST["nom_adh"])." ".$_POST["prenom_adh"], $requete); - - $date_fin = get_echeance($DB, $id_adh); - if ($date_fin!="") -// $date_fin_update = $DB->DBDate(mktime(0,0,0,$date_fin[1],$date_fin[0],$date_fin[2])); - $date_fin_update = $DB->DBDate($date_fin[2].'/'.$date_fin[1].'/'.$date_fin[0]); - else - $date_fin_update = "NULL"; - $requete = "UPDATE ".PREFIX_DB."adherents - SET date_echeance=".$date_fin_update." - WHERE id_adh=" . $id_adh; - } - else - { - // ajout - $insert_string_fields = substr($insert_string_fields,1); - $insert_string_values = substr($insert_string_values,1); - $requete = "INSERT INTO ".PREFIX_DB."adherents - (" . $insert_string_fields . ") - VALUES (" . $insert_string_values . ")"; - dblog(_T("Ajout de la fiche adhérent :")." ".strtoupper($_POST["nom_adh"])." ".$_POST["prenom_adh"], $requete); - - } - if ($DB->Execute($requete) === false) { - print 'error inserting: '. $DB->ErrorMsg().''; - return; - }; - // il est temps d'envoyer un mail - if (isset($_POST["mail_confirm"])) - if ($_POST["mail_confirm"]=="1") - if ($email_adh!="") - { - $mail_subject = _T("Vos identifiants Galette"); - $mail_text = _T("Bonjour,")."\n"; - $mail_text .= "\n"; - $mail_text .= _T("Vous venez d'être inscrit sur le système de gestion d'adhérents de l'association.")."\n"; - $mail_text .= _T("Il vous est désormais possible de suivre en temps réel l'état de votre adhésion")."\n"; - $mail_text .= _T("et de mettre à jour vos coordonnées par l'interface web prévue à cet effet.")."\n"; - $mail_text .= "\n"; - $mail_text .= _T("Veuillez vous identifier à cette adresse :")."\n"; - $mail_text .= "http://".$_SERVER["SERVER_NAME"].dirname($_SERVER["REQUEST_URI"])."\n"; - $mail_text .= "\n"; - $mail_text .= _T("Identifiant :")." ".custom_html_entity_decode($values['login_adh'])."\n"; - $mail_text .= _T("Mot de passe :")." ".custom_html_entity_decode($values['mdp_adh'])."\n"; - $mail_text .= "\n"; - $mail_text .= _T("A très bientôt !")."\n"; - $mail_text .= "\n"; - $mail_text .= _T("(ce mail est un envoi automatique)")."\n"; - $mail_headers = "From: ".PREF_EMAIL_NOM." <".PREF_EMAIL.">\n"; - mail ($email_adh,$mail_subject,$mail_text, $mail_headers); - } - - // récupération du max pour insertion photo - // ou passage en mode modif apres insertion - if ($id_adh=="") - { - $requete = "SELECT max(id_adh) - AS max - FROM ".PREFIX_DB."adherents"; - $max = $DB->Execute($requete); - $id_adh_new = $max->fields["max"]; - } - else - $id_adh_new = $id_adh; - - if (isset($_FILES["photo"]["tmp_name"])) - if ($_FILES["photo"]["tmp_name"]!="none" && - $_FILES["photo"]["tmp_name"]!="") - { - - if ($_FILES['photo']['type']=="image/jpeg" || - (function_exists("ImageCreateFromGif") && $_FILES['photo']['type']=="image/gif") || - $_FILES['photo']['type']=="image/png" || - $_FILES['photo']['type']=="image/x-png") - { - $tmp_name = $HTTP_POST_FILES["photo"]["tmp_name"]; - - // extension du fichier (en fonction du type mime) - if ($_FILES['photo']['type']=="image/jpeg") - $ext_image = ".jpg"; - if ($_FILES['photo']['type']=="image/png" || $_FILES['photo']['type']=="image/x-png") - $ext_image = ".png"; - if ($_FILES['photo']['type']=="image/gif") - $ext_image = ".gif"; - - // suppression ancienne photo - // NB : une verification sur le type de $id_adh permet d'eviter une faille - // du style $id_adh = "../../../image" - @unlink(WEB_ROOT . "photos/".$id_adh_new.".jpg"); - @unlink(WEB_ROOT . "photos/".$id_adh_new.".gif"); - @unlink(WEB_ROOT . "photos/".$id_adh_new.".jpg"); - @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".jpg"); - @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".gif"); - @unlink(WEB_ROOT . "photos/tn_".$id_adh_new.".jpg"); - - // copie fichier temporaire - if (!@move_uploaded_file($tmp_name,WEB_ROOT . "photos/".$id_adh_new.$ext_image)) - $warning_detected .= ""._T("- La photo semble ne pas avoir été transmise correstement. L'enregistrement a cependant été effectué.").""; - else - resizeimage(WEB_ROOT . "photos/".$id_adh_new.$ext_image,WEB_ROOT . "photos/tn_".$id_adh_new.$ext_image,130,130); - } - else - { - if (function_exists("imagegif")) - $warning_detected .= ""._T("- Le fichier transmis n'est pas une image valide (GIF, PNG ou JPEG). L'enregistrement a cependant été effectué.").""; - else - $warning_detected .= ""._T("- Le fichier transmis n'est pas une image valide (PNG ou JPEG). L'enregistrement a cependant été effectué.").""; - } - } - - // retour à la liste ou passage à la contribution - if ($warning_detected=="" && $id_adh=="") - { - header("location: ajouter_contribution.php?id_adh=".$id_adh_new); - die(); - } - elseif ($warning_detected=="" && !isset($_FILES["photo"])) - { - header("location: gestion_adherents.php"); - die(); - } - elseif ($warning_detected=="" && ($_FILES["photo"]["tmp_name"]=="none" || $_FILES["photo"]["tmp_name"]=="")) - { - header("location: gestion_adherents.php"); - die(); - } - $id_adh=$id_adh_new; - } - } - - // suppression photo - if (isset($_POST["del_photo"])) - { - @unlink(WEB_ROOT . "photos/" . $id_adh . ".jpg"); - @unlink(WEB_ROOT . "photos/" . $id_adh . ".png"); - @unlink(WEB_ROOT . "photos/" . $id_adh . ".gif"); - @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".jpg"); - @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".png"); - @unlink(WEB_ROOT . "photos/tn_" . $id_adh . ".gif"); - } - - // - // Pré-remplissage des champs - // avec des valeurs issues de la base - // -> donc uniquement si l'enregistrement existe et que le formulaire - // n'a pas déja été posté avec des erreurs (pour pouvoir corriger) - - if (!isset($_POST["valid"]) || (isset($_POST["valid"]) && $error_detected=="")) - if ($id_adh != "") - - - { - // recup des données - $requete = "SELECT * - FROM ".PREFIX_DB."adherents - WHERE id_adh=$id_adh"; - $result = $DB->Execute($requete); - if ($result->EOF) - { - header("location: index.php"); - die(); - } - - - - // recuperation de la liste de champs de la table - //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations"); - foreach ($fields as $champ => $proprietes) - { - //echo $proprietes_arr["name"]." -- (".$result->fields[$proprietes_arr["name"]].")"; - - - $val=""; - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - // déclaration des variables correspondant aux champs - // et reformatage des dates. - - // on doit faire cette verif pour une enventuelle valeur "NULL" - // non renvoyée -> ex: pas de societe membre - // sinon on obtient un warning - if (isset($result->fields[$proprietes_arr["name"]])) - $val = $result->fields[$proprietes_arr["name"]]; - - if($proprietes_arr["type"]=="date" && $val!="") - { - list($a,$m,$j)=explode("-",$val); - $val="$j/$m/$a"; - } - $values[$proprietes_arr["name"]]=htmlentities(stripslashes(addslashes($val)), ENT_QUOTES); - } - reset($fields); - } - else - { - // initialisation des champs - - } - - // la date de creation de fiche, ici vide si nouvelle fiche - if ($values['date_crea_adh']=="") - $values['date_crea_adh'] = date("d/m/Y"); - if ($url_adh=="") - $url_adh = "http://"; - if ($mdp_adh=="") - $mdp_adh = makeRandomPassword(); - - // variable pour la desactivation de champs - if ($_SESSION["admin_status"]==0) - $disabled_field = "disabled"; - else - $disabled_field = ""; - - - include("header.php"); - -?> - - () - - - - - - - - - - - - - - - - - - - - - - id="libelle"> - - > - > - > - - - - id="libelle"> - > - - - " border="1" alt="" width="" height=""> - - - - - id="libelle"> - > - - - id="libelle"> - - - - id="libelle"> - - - - id="libelle"> - - - - - > - - - - "> - - - - - - - id="libelle"> - - > - > - > - > - - - id="libelle"> - - > - > - > - > - > - > - - - - - id="libelle"> - - > - > - > - - - id="libelle"> - - > - > - > - - - - - id="libelle"> - - > - > - > - - - id="libelle"> - - > - > - > - - - - - id="libelle"> - - > - > - > - - - - - - - - - - - - - - id="libelle"> - - > - > - > - - - - - - - - - - - id="libelle"> - - - > - > - - - - - - id="libelle"> - - - Execute($requete); - while (!$result->EOF) - { - ?> - "fields["id_statut"]) ?>>fields["libelle_statut"]); ?> - MoveNext(); - } - $result->Close(); - ?> - - - - - - - > - - - - - > - - - - - - - - > - - - - - - - > - - > - - - - > - - > - - - - > - - > - - - - > - - > - - - - > - - > - - - - - - - > - - > - - - - - - - - - - - - - > - - - - - > - - - - - - - - - "> - - - - - . - - - - diff --git a/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php b/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php deleted file mode 100644 index 73d413ba..00000000 --- a/seed/galette/manual/image/postinstall/galette/ajouter_contribution.php +++ /dev/null @@ -1,392 +0,0 @@ - modif ou création - $id_cotis = ""; - if (isset($_GET["id_cotis"])) - if (is_numeric($_GET["id_cotis"])) - $id_cotis = $_GET["id_cotis"]; - if (isset($_POST["id_cotis"])) - if (is_numeric($_POST["id_cotis"])) - $id_cotis = $_POST["id_cotis"]; - - // variables d'erreur (pour affichage) - $error_detected = ""; - - // - // DEBUT parametrage des champs - // On recupere de la base la longueur et les flags des champs - // et on initialise des valeurs par defaut - - // recuperation de la liste de champs de la table - $fields = $DB->MetaColumns(PREFIX_DB."cotisations"); - foreach ($fields as $champ => $proprietes) - { - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - $fieldname = $proprietes_arr["name"]; - $fieldreq = $fieldname."_req"; - $fieldlen = $fieldname."_len"; - - // on ne met jamais a jour id_cotis -> on le saute - if ($fieldname!="id_cotis") - $$fieldname = ""; - - // definissons aussi la longueur des input text - $max_tmp = $proprietes_arr["max_length"]; - if ($max_tmp == "-1") - $max_tmp = 10; - $$fieldlen = $max_tmp; - - // et s'ils sont obligatoires (à partir de la base) - if ($proprietes_arr["not_null"]==1) - $$fieldreq = " style=\"color: #FF0000;\""; - else - $$fieldreq = ""; - } - reset($fields); - - // et les valeurs par defaut - $id_type_cotis = "1"; - $duree_mois_cotis = "12"; - - // - // FIN parametrage des champs - // - - $values = Array(); - $values['id_adh'] = ""; - if (isset($_GET["id_adh"])) - $values['id_adh'] = $_GET["id_adh"]; - elseif (isset($_POST["id_adh"])) - $values['id_adh'] = $_POST["id_adh"]; - if ($values['id_adh']!="") - { - $requete = "SELECT nom_adh, prenom_adh FROM ".PREFIX_DB."adherents WHERE id_adh=".$DB->qstr($values['id_adh']); - $resultat = $DB->Execute($requete); - if (!$resultat->EOF) - { - $nom_adh = $resultat->fields[0]; - $prenom_adh = $resultat->fields[1]; - $resultat->Close(); - } - } - - // - // Validation du formulaire - // - - if (isset($_POST["valid"])) - { - // verification de champs - $update_string = ""; - $insert_string_fields = ""; - $insert_string_values = ""; - - // recuperation de la liste de champs de la table - //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations"); - foreach ($fields as $champ => $proprietes) - { - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - $fieldname = $proprietes_arr["name"]; - $fieldreq = $fieldname."_req"; - - // on ne met jamais a jour id_cotis -> on le saute - if ($fieldname!="id_cotis") - { - if (isset($_POST[$fieldname])) - $post_value=trim($_POST[$fieldname]); - else - $post_value=""; - - // on declare les variables pour la présaisie en cas d'erreur - $$fieldname = htmlentities(stripslashes($post_value),ENT_QUOTES); - - // vérification de la présence des champs obligatoires - if ($$fieldreq!="" && $post_value=="") - $error_detected = ""._T("- Vérifiez que tous les champs obligatoires sont renseignés.").""; - else - { - $value = ""; - // validation des dates - if($proprietes_arr["type"]=="date") - { - if (preg_match("/^([0-9]{2})\/([0-9]{2})\/([0-9]{4})$/", $post_value, $array_jours)) - { - if (checkdate($array_jours[2],$array_jours[1],$array_jours[3])) - $value=$DB->DBDate(mktime(0,0,0,$array_jours[2],$array_jours[1],$array_jours[3])); - else - $error_detected .= ""._T("- Date non valide !").""; - } - else - $error_detected .= ""._T("- Mauvais format de date (jj/mm/aaaa) !").""; - } - elseif(strstr($proprietes_arr["type"],"int")) - { - if (is_numeric($post_value) || $post_value=="") - $value=$DB->qstr($post_value,ENT_QUOTES); - else - $error_detected .= ""._T("- La durée doit être un entier !").""; - } - elseif(strstr($proprietes_arr["type"],"float")) - { - $us_value = strtr($post_value, ",", "."); - if (is_numeric($us_value) || $us_value=="") - $value=$DB->qstr($us_value,ENT_QUOTES); - else - $error_detected .= ""._T("- Le montant doit être un chiffre !").""; - } - else - { - // on se contente d'escaper le html et les caracteres speciaux - $value = $DB->qstr($post_value,ENT_QUOTES); - } - - // mise à jour des chaines d'insertion/update - $update_string .= ",".$fieldname."=".$value; - $insert_string_fields .= ",".$fieldname; - $insert_string_values .= ",".$value; - } - } - } - reset($fields); - - // modif ou ajout - if ($error_detected=="") - { - if ($id_cotis!="") - { - // modif - - $requete = "UPDATE ".PREFIX_DB."cotisations - SET " . substr($update_string,1) . " - WHERE id_cotis=" . $DB->qstr($id_cotis); - dblog(_T("Mise à jour d'une contribution :")." ".strtoupper($nom_adh)." ".$prenom_adh, $requete); - } - else - { - // ajout - - $requete = "INSERT INTO ".PREFIX_DB."cotisations - (" . substr($insert_string_fields,1) . ") - VALUES (" . substr($insert_string_values,1) . ")"; - - dblog(_T("Ajout d'une contribution :")." ".strtoupper($nom_adh)." ".$prenom_adh, $requete); - } - $DB->Execute("SET NAMES utf8"); - $DB->Execute($requete); - $DB->Execute("SET NAMES latin1"); - - // mise a jour de l'échéance - $date_fin = get_echeance($DB, $values['id_adh']); - if ($date_fin!="") - $date_fin_update = $DB->DBDate(mktime(0,0,0,$date_fin[1],$date_fin[0],$date_fin[2])); - else - $date_fin_update = "'NULL'"; - - $requete = "UPDATE ".PREFIX_DB."adherents - SET date_echeance=".$date_fin_update." - WHERE id_adh='".$values['id_adh']."'"; - $DB->Execute($requete); - - // retour à la liste - header("location: gestion_contributions.php?id_adh=".$values['id_adh']); - - // récupération du max pour passage en mode modif apres insertion - if ($id_cotis=="") - { - $requete = "SELECT max(id_cotis) - AS max - FROM ".PREFIX_DB."cotisations"; - $max = $DB->Execute($requete); - $id_cotis = $max->fields["max"]; - } - } - } - - // - // Pré-remplissage des champs - // avec des valeurs issues de la base - // -> donc uniquement si l'enregistrement existe et que le formulaire - // n'a pas déja été posté avec des erreurs (pour pouvoir corriger) - - if (!isset($_POST["valid"]) || (isset($_POST["valid"]) && $error_detected=="")) - if ($id_cotis != "") - { - // recup des données - $requete = "SELECT * - FROM ".PREFIX_DB."cotisations - WHERE id_cotis=$id_cotis"; - $result = $DB->Execute($requete); - if ($result->EOF) - header("location: index.php"); - - - - // recuperation de la liste de champs de la table - //$fields = &$DB->MetaColumns(PREFIX_DB."cotisations"); - foreach ($fields as $champ => $proprietes) - { - $proprietes_arr = get_object_vars($proprietes); - // on obtient name, max_length, type, not_null, has_default, primary_key, - // auto_increment et binary - - // déclaration des variables correspondant aux champs - // et reformatage des dates. - - $val = $result->fields[$proprietes_arr["name"]]; - - if($proprietes_arr["type"]=="date" && $val!="") - { - list($a,$m,$j)=explode("-",$val); - $val="$j/$m/$a"; - } - $values[$proprietes_arr["name"]] = htmlentities(stripslashes(addslashes($val)), ENT_QUOTES); - } - } - else - { - // initialisation des champs - - } - - // la date de creation de fiche, ici vide si nouvelle fiche - if ($date_cotis=="") - $date_cotis = date("d/m/Y"); - - include("header.php"); - -?> - - () - - - - - - - - - - - - - - - > - - - > - Execute($requete); - while (!$result->EOF) - { - ?> - fields[0]) ?>>fields[1]), ENT_QUOTES)." ".htmlentities($result->fields[2], ENT_QUOTES); ?> - MoveNext(); - } - $result->Close(); - ?> - - - > - - - Execute($requete); - while (!$result->EOF) - { - ?> - "fields["id_type_cotis"]) ?>>fields["libelle_type_cotis"]) ?> - MoveNext(); - } - $result->Close(); - ?> - - - - - > - - > - - - - > - - - - > - - - - "> - - - - - . - - - - diff --git a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php deleted file mode 100644 index 6f96771a..00000000 --- a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents.php +++ /dev/null @@ -1,208 +0,0 @@ -qstr($value); - } - $requete .= $where_clause." ORDER by nom_adh, prenom_adh;"; - $resultat = &$DB->Execute($requete); - - $pdf = new pdffile; - $pdf->set_default('margin', 0); - $firstpage = $pdf->new_page("a4-landscape"); - $param["height"] = PREF_ETIQ_CORPS; - $param["fillcolor"] = $pdf->get_color('#000000'); - $param["align"] = "center"; - $param["width"] = 1; - $param["strokecolor"] = $pdf->get_color('#000000'); - if ($resultat->EOF) - die(); - $yorigin=545; - $xorigin=round(PREF_ETIQ_MARGES*2.835); - $row=1; - $nb_etiq=0; - $concatname = ""; - $i=0; - $j=0; - while (date("Ym",strtotime("$j saturday", strtotime($datenow))) <= $annee.$mois) - { - $j++; - if (date("m",strtotime("$j saturday", strtotime($datenow))) == $mois) { - $panier[$i][0]=0; - $panier[$i][1]=0; - $date[$i]=date("d/m/Y",strtotime($j . " saturday", strtotime($datenow))); - $date2[$i]=date("Y-m-d",strtotime($j . " saturday", strtotime($datenow))); - $i++; - } - if ($j > 10) { - print "Problème dans le calcul des mois !"; - die(); - } - } - $col = $i; - $ligne = 18; - $x1 = 70; - $x2 = 300; - $ecart = 480/$col; - $hecart = 490/$ligne; - - - while (!$resultat->EOF) - { - $y1 = $yorigin-(($row-1)*($hecart)); - $y2 = $y1 - $hecart; - if ($row==1) - { - $param["font"] = "Helvetica-Bold"; - $pdf->draw_rectangle($yorigin+20, $x1, $yorigin, $x2, $firstpage, $param); - $pdf->draw_paragraph($yorigin+20, $x1, $yorigin, $x2, "Nom", $firstpage, $param); - $pdf->draw_rectangle($yorigin+20, $x2, $yorigin, $x2+40, $firstpage, $param); - $pdf->draw_paragraph($yorigin+20, $x2, $yorigin, $x2+40, "Prix", $firstpage, $param); - $i=0; - while($i<$col) - { - $xdr1=$x2+40+$i*$ecart; - $xdr2=$x2+40+($i+1)*$ecart; - $pdf->draw_paragraph($yorigin+20, $xdr1, $yorigin, $xdr2, $date[$i], $firstpage, $param); - $pdf->draw_rectangle($yorigin+20, $xdr1, $yorigin, $xdr2, $firstpage, $param); - $i++; - } - } - if ( ($_POST['panier'] == "legume" && $resultat->fields[9] != "-1") || ($_POST['panier'] == "pain" && $resultat->fields[10] != "0") ) { - $nom_adh_ext=""; - switch($resultat->fields[4]) - { - case "1" : - $nom_adh_ext .= _T("M."); - break; - case "2" : - $nom_adh_ext .= _T("Mme."); - break; - default : - $nom_adh_ext .= _T("Mlle."); - } - - $nom_adh_ext .= " ".strtoupper($resultat->fields[1])." ".ucfirst(strtolower($resultat->fields[2])); - $concatname = $concatname . " - " . $nom_adh_ext; - $param["font"] = "Helvetica"; - $pdf->draw_paragraph($y1-5, $x1, $y2, $x2, $nom_adh_ext, $firstpage, $param); - $pdf->draw_rectangle ($y1, $x1, $y2, $x2, $firstpage, $param); - $pdf->draw_rectangle($y1, $x2, $y2, $x2+40, $firstpage, $param); -// $pdf->draw_rectangle($y1, $x2+20, $y2, $x2+40, $firstpage, $param); - if ($_POST['panier'] == "legume") - { - $qpanier=$resultat->fields[9]; - if ($qpanier == "0" ) - $qpanier_result="pp"; - else - $qpanier_result="GP"; - } else if ($_POST['panier'] == "pain") { - $qpanier=$resultat->fields[10]; - if ($qpanier == "1" ) - $qpanier_result="3"; - if ($qpanier == "2" ) - $qpanier_result="5"; - if ($qpanier == "3" ) - $qpanier_result="7"; - if ($qpanier == "4" ) - $qpanier_result="9,50"; - } - $pdf->draw_paragraph($y1, $x2, $y2, $x2+40, $qpanier_result, $firstpage, $param); - $i=0; - while($i<$col) - { - $absence = &$DB->Execute("SELECT * FROM `galette_absences` WHERE `id_adh` = " . $resultat->fields[0] . " AND `date_abs` = '$date2[$i]'"); - if (!$absence->EOF) - $pdf->draw_paragraph($y1, $x2+$i*$ecart+40, $y2, $x2+($i+1)*$ecart+40, "Absent", $firstpage, $param); - else - $panier[$i+1][$qpanier]=$panier[$i+1][$qpanier]+1; - $pdf->draw_rectangle($y1, $x2+$i*$ecart+40, $y2, $x2+($i+1)*$ecart+40, $firstpage, $param); - $i++; - } - - $row++; - if ($row>$ligne) - { - $row=1; - $firstpage = $pdf->new_page("a4-landscape"); - } - $nb_etiq++; - } - $resultat->MoveNext(); - } - $i=0; - while($i<$col) - { - $pdf->draw_rectangle($y2, $x2+$i*$ecart+40, $y2-20, $x2+($i+1)*$ecart+40, $firstpage, $param); - if ($_POST['panier'] == "legume") - $display="pp : " . $panier[$i+1][0] . " | GP : " . $panier[$i+1][1]; - if ($_POST['panier'] == "pain") - $display="3E : " . $panier[$i+1][1] . " | 5E : " . $panier[$i+1][2] . " | 7E : " . $panier[$i+1][3] . " | 9E50 : " . $panier[$i+1][4]; - - $pdf->draw_paragraph($y2, $x2+$i*$ecart+40, $y2-20, $x2+($i+1)*$ecart+40, $display, $firstpage, $param); - $i++; - } - - $resultat->Close(); - dblog(_T("Génération de ")." ".$nb_etiq." "._T("feuille emargement"),$concatname); - header("Content-Disposition: filename=feuille_emargement.pdf"); - header("Content-Type: application/pdf"); - $temp = $pdf->generate(); - header('Content-Length: ' . strlen($temp)); - echo $temp; -?> diff --git a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php b/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php deleted file mode 100644 index 30b9ef77..00000000 --- a/seed/galette/manual/image/postinstall/galette/etiquettes_adherents_2.php +++ /dev/null @@ -1,127 +0,0 @@ -qstr($value); - } - $requete .= $where_clause." ORDER by nom_adh, prenom_adh;"; - // echo $requete; - $resultat = &$DB->Execute($requete); - - $pdf = new pdffile; - $pdf->set_default('margin', 0); - $firstpage = $pdf->new_page("a4"); - $param["height"] = PREF_ETIQ_CORPS; - $param["fillcolor"] = $pdf->get_color('#000000'); - $param["align"] = "center"; - $param["width"] = 1; - $param["strokecolor"] = $pdf->get_color('#DDDDDD'); - - if ($resultat->EOF) - die(); - - $yorigin=842-round(PREF_ETIQ_MARGES*2.835); - $xorigin=round(PREF_ETIQ_MARGES*2.835); - $col=1; - $row=1; - $nb_etiq=0; - $concatname = ""; - while (!$resultat->EOF) - { - $nom_adh_ext=""; - switch($resultat->fields[4]) - { - case "1" : - $nom_adh_ext .= _T("M."); - break; - case "2" : - $nom_adh_ext .= _T("Mme."); - break; - default : - $nom_adh_ext .= _T("Mlle."); - } - - $x1 = $xorigin + ($col-1)*(round(PREF_ETIQ_HSIZE*2.835)+round(PREF_ETIQ_HSPACE*2.835)); - $x2 = $x1 + round(PREF_ETIQ_HSIZE*2.835); - $y1 = $yorigin-($row-1)*(round(PREF_ETIQ_VSIZE*2.835)+round(PREF_ETIQ_VSPACE*2.835)); - $y2 = $y1 - round(PREF_ETIQ_VSIZE*2.835); - - $nom_adh_ext .= " ".strtoupper($resultat->fields[1])." ".ucfirst(strtolower($resultat->fields[2])); - $concatname = $concatname . " - " . $nom_adh_ext; - $param["font"] = "Helvetica-Bold"; - $pdf->draw_paragraph($y1-10, $x1, $y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5)+5, $x2, $nom_adh_ext, $firstpage, $param); - $param["font"] = "Helvetica"; - $pdf->draw_paragraph ($y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5), $x1, $y1-10-(round(PREF_ETIQ_VSIZE*2.835)/5)-(round(PREF_ETIQ_VSIZE*2.835)*4/5), $x2, $resultat->fields[3]."\n".$resultat->fields[8]."\n".$resultat->fields[5]." - ".$resultat->fields[6]."\n".$resultat->fields[7], $firstpage, $param); - $pdf->draw_rectangle ($y1, $x1, $y2, $x2, $firstpage, $param); - $resultat->MoveNext(); - - $col++; - if ($col>PREF_ETIQ_COLS) - { - $col=1; - $row++; - } - if ($row>PREF_ETIQ_ROWS) - { - $col=1; - $row=1; - $firstpage = $pdf->new_page("a4"); - } - $nb_etiq++; - } - $resultat->Close(); - dblog(_T("Génération de ")." ".$nb_etiq." "._T("étiquette(s)"),$concatname); - - header("Content-Disposition: filename=example.pdf"); - header("Content-Type: application/pdf"); - $temp = $pdf->generate(); - header('Content-Length: ' . strlen($temp)); - echo $temp; -?> diff --git a/seed/galette/manual/image/postinstall/galette/footer.php b/seed/galette/manual/image/postinstall/galette/footer.php deleted file mode 100644 index 7a5de706..00000000 --- a/seed/galette/manual/image/postinstall/galette/footer.php +++ /dev/null @@ -1,168 +0,0 @@ - - - Galette - Deelight - Gimp - Bluefish - - - - - - - Galette - - - - - - - - - - - - - - - - - - - - - - - - - - - " align="middle" width="10" height="12"> - - - - " align="middle" width="9" height="12"> - - - - - " align="middle" border="0" width="14" height="10"> - - - - - " align="middle" width="12" height="13"> - - - - " border="0" width="12" height="13"> - - - - " border="0" width="13" height="13"> - - - - " border="0" width="11" height="13"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " border="0" width="12" height="13"> - - - - " border="0" width="11" height="13"> - - - - - - - - - - - - - - - -
- - - - id="libelle"> - - > - > - > - - - - id="libelle"> - > - - - " border="1" alt="" width="" height=""> - - - - - id="libelle"> - > - - - id="libelle"> - - - - id="libelle"> - - - - id="libelle"> - - - - - > - - - - "> - - - - - - - id="libelle"> - - > - > - > - > - - - id="libelle"> - - > - > - > - > - > - > - - - - - id="libelle"> - - > - > - > - - - id="libelle"> - - > - > - > - - - - - id="libelle"> - - > - > - > - - - id="libelle"> - - > - > - > - - - - - id="libelle"> - - > - > - > - - - - - - - - - - - - - - id="libelle"> - - > - > - > - - - - - - - - - - - id="libelle"> - - - > - > - - - - - - id="libelle"> - - - Execute($requete); - while (!$result->EOF) - { - ?> - "fields["id_statut"]) ?>>fields["libelle_statut"]); ?> - MoveNext(); - } - $result->Close(); - ?> - - - - - - - > - - - - - > - - - - - - - - > - - - - - - - > - - > - - - - > - - > - - - - > - - > - - - - > - - > - - - - > - - > - - - - - - - > - - > - - - - - - - - - - - - - > - - - - - > - - - - - - - - - "> - - - - - . -
- - - - > - - - > - Execute($requete); - while (!$result->EOF) - { - ?> - fields[0]) ?>>fields[1]), ENT_QUOTES)." ".htmlentities($result->fields[2], ENT_QUOTES); ?> - MoveNext(); - } - $result->Close(); - ?> - - - > - - - Execute($requete); - while (!$result->EOF) - { - ?> - "fields["id_type_cotis"]) ?>>fields["libelle_type_cotis"]) ?> - MoveNext(); - } - $result->Close(); - ?> - - - - - > - - > - - - - > - - - - > - - - - "> - - - - - . -