From 15f044881632d1ba38bb7ab0cbc32eefd94e3a45 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 26 Jan 2017 18:06:37 +0100 Subject: [PATCH] =?UTF-8?q?mise=20=C3=A0=20jour=20des=20excercices=20tronc?= =?UTF-8?q?-commun-2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../documents/exercice1/30_ircd.xml | 26 - .../documents/exercice2/30_phpldapadmin.xml | 33 -- .../documents/exercice2/apache.conf | 6 - .../documents/exercice2/phpldapadmin.php | 17 - .../documents/exercice3/30_phpldapadmin.xml | 37 -- .../documents/exercice3/phpldapadmin.php | 17 - .../documents/exercice4/sample.zephir | 36 -- .../bareosfichiers.d/test.conf | 10 + .../tronc-commun-2-avancee/diagnose/90-ircd | 10 + .../tronc-commun-2-avancee/dicos/50_ircd.xml | 73 +++ .../dicos/50_rennes.xml | 28 + .../ead/actions_ls.cfg | 0 .../ead/cmd_ls.py | 0 .../ead/ls.cmd | 0 .../ead/perm_ls.ini | 0 .../extra/schedule/50_ircd.xml | 30 + .../funcs/mafonction.py | 4 + .../posttemplate/00-creation | 0 .../schedule/scripts/ircd_start} | 3 - .../schedule/scripts/ircd_stop} | 3 - .../documents/tronc-commun-2/ircd-irc2.tex | 0 .../documents/tronc-commun-2/ircd/00_ircd.xml | 23 - .../tronc-commun-2/ircd/00_root_ircd.fw | 1 - .../documents/tronc-commun-2/ircd/160-ircd | 14 - .../tronc-commun-2/patch/clamd.conf.patch | 20 - .../phpldapmyadmin/00_phpldapadmin.xml | 39 -- .../phpldapmyadmin/phpldapadmin-apache.conf | 53 -- .../phpldapmyadmin/phpldapadmin-config.php | 549 ------------------ .../tronc-commun-2/supprimer_fichier.tex | 163 ++++++ .../supprimer_fichier.zephir | 0 .../supprimer_fichier_sudo.zephir | 0 31 files changed, 318 insertions(+), 877 deletions(-) delete mode 100644 modules_EOLE_envole/documents/exercice1/30_ircd.xml delete mode 100644 modules_EOLE_envole/documents/exercice2/30_phpldapadmin.xml delete mode 100644 modules_EOLE_envole/documents/exercice2/apache.conf delete mode 100644 modules_EOLE_envole/documents/exercice2/phpldapadmin.php delete mode 100644 modules_EOLE_envole/documents/exercice3/30_phpldapadmin.xml delete mode 100644 modules_EOLE_envole/documents/exercice3/phpldapadmin.php delete mode 100644 modules_EOLE_envole/documents/exercice4/sample.zephir create mode 100644 modules_EOLE_envole/documents/tronc-commun-2-avancee/bareosfichiers.d/test.conf create mode 100755 modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd create mode 100644 modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_ircd.xml create mode 100644 modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_rennes.xml rename modules_EOLE_envole/documents/{tronc-commun-2 => tronc-commun-2-avancee}/ead/actions_ls.cfg (100%) rename modules_EOLE_envole/documents/{tronc-commun-2 => tronc-commun-2-avancee}/ead/cmd_ls.py (100%) rename modules_EOLE_envole/documents/{tronc-commun-2 => tronc-commun-2-avancee}/ead/ls.cmd (100%) rename modules_EOLE_envole/documents/{tronc-commun-2 => tronc-commun-2-avancee}/ead/perm_ls.ini (100%) create mode 100644 modules_EOLE_envole/documents/tronc-commun-2-avancee/extra/schedule/50_ircd.xml create mode 100644 modules_EOLE_envole/documents/tronc-commun-2-avancee/funcs/mafonction.py rename modules_EOLE_envole/documents/{tronc-commun-2 => tronc-commun-2-avancee}/posttemplate/00-creation (100%) rename modules_EOLE_envole/documents/{tronc-commun-2/schedule/post/ircd => tronc-commun-2-avancee/schedule/scripts/ircd_start} (58%) mode change 100644 => 100755 rename modules_EOLE_envole/documents/{tronc-commun-2/schedule/pre/ircd => tronc-commun-2-avancee/schedule/scripts/ircd_stop} (61%) mode change 100644 => 100755 rename exercice_exemple.tex => modules_EOLE_envole/documents/tronc-commun-2/ircd-irc2.tex (100%) delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/ircd/00_ircd.xml delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/ircd/00_root_ircd.fw delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/ircd/160-ircd delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/patch/clamd.conf.patch delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/00_phpldapadmin.xml delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-apache.conf delete mode 100644 modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-config.php create mode 100644 modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.tex rename modules_EOLE_envole/documents/{exercice4 => tronc-commun-2}/supprimer_fichier.zephir (100%) rename modules_EOLE_envole/documents/{exercice4 => tronc-commun-2}/supprimer_fichier_sudo.zephir (100%) diff --git a/modules_EOLE_envole/documents/exercice1/30_ircd.xml b/modules_EOLE_envole/documents/exercice1/30_ircd.xml deleted file mode 100644 index 71bce56..0000000 --- a/modules_EOLE_envole/documents/exercice1/30_ircd.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - ircd - - - - - non - - - - - - ['oui','non'] - - - non - ircd - - - - - - diff --git a/modules_EOLE_envole/documents/exercice2/30_phpldapadmin.xml b/modules_EOLE_envole/documents/exercice2/30_phpldapadmin.xml deleted file mode 100644 index 3f64ace..0000000 --- a/modules_EOLE_envole/documents/exercice2/30_phpldapadmin.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - phpldapadmin - - - - - - - non - - - - - localhost - - - - - - - non - phpldapadmin - phpldapadmin - - - - - - diff --git a/modules_EOLE_envole/documents/exercice2/apache.conf b/modules_EOLE_envole/documents/exercice2/apache.conf deleted file mode 100644 index 67f5f9c..0000000 --- a/modules_EOLE_envole/documents/exercice2/apache.conf +++ /dev/null @@ -1,6 +0,0 @@ -%if %%activate_phpldapadmin == 'oui' - -... - -%end if - diff --git a/modules_EOLE_envole/documents/exercice2/phpldapadmin.php b/modules_EOLE_envole/documents/exercice2/phpldapadmin.php deleted file mode 100644 index 063a3ee..0000000 --- a/modules_EOLE_envole/documents/exercice2/phpldapadmin.php +++ /dev/null @@ -1,17 +0,0 @@ -... - -/*********************************************/ -/* Define your LDAP servers in this section */ -/*********************************************/ - -%if %%getVar("phpldapadmin_name", "") == "" -$ldapservers->SetValue(0,'server','name','Serveur LDAP'); -%else -$ldapservers->SetValue(0,'server','name','%%phpldapadmin_name'); -%end if - -$ldapservers->SetValue(0,'server','host','ldap://%%phpldapadmin_host'); - -$ldapservers->SetValue(0,'server','tls',false); - -... diff --git a/modules_EOLE_envole/documents/exercice3/30_phpldapadmin.xml b/modules_EOLE_envole/documents/exercice3/30_phpldapadmin.xml deleted file mode 100644 index 98b3607..0000000 --- a/modules_EOLE_envole/documents/exercice3/30_phpldapadmin.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - phpldapadmin - - - - - - - non - - - - - localhost - - - - - - - non - phpldapadmin - phpldapadmin - - - phpldapadmin_name - - - - - - diff --git a/modules_EOLE_envole/documents/exercice3/phpldapadmin.php b/modules_EOLE_envole/documents/exercice3/phpldapadmin.php deleted file mode 100644 index f384189..0000000 --- a/modules_EOLE_envole/documents/exercice3/phpldapadmin.php +++ /dev/null @@ -1,17 +0,0 @@ -/*********************************************/ -/* Define your LDAP servers in this section */ -/*********************************************/ - -%for %%phpldapadmin in %%phpldapadmin_host -%if %%phpldapadmin.phpldapadmin_name == "" -$ldapservers->SetValue(0,'server','name','Serveur LDAP'); -%else -$ldapservers->SetValue(0,'server','name','%%phpldapadmin.phpldapadmin_name'); -%end if - -$ldapservers->SetValue(0,'server','host','ldap://%%phpldapadmin'); - -$ldapservers->SetValue(0,'server','tls',false); -%end for - -... diff --git a/modules_EOLE_envole/documents/exercice4/sample.zephir b/modules_EOLE_envole/documents/exercice4/sample.zephir deleted file mode 100644 index 94e6ab8..0000000 --- a/modules_EOLE_envole/documents/exercice4/sample.zephir +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -########################################################################### -# Eole NG - 2007 -# Copyright Pole de Competence Eole (Ministere Education - Academie Dijon) -# Licence CeCill cf /root/LicenceEole.txt -# eole@ac-dijon.fr -# -# test_perso.zephir -# -# exemple de script personnalisé pour le client zephir -# -########################################################################### - -import os, sys -from zephir.lib_zephir import * -from creole import fonctionseole - -if fonctionseole.init_proc('PERSO') == False: - fonctionseole.zephir("MSG" , "procédure sample bloquée par zephir", "PERSO") - sys.exit(1) - -fonctionseole.zephir("INIT" , "script test_perso en cours d'execution", "PERSO") - -try: - message = sys.argv[1] - fonctionseole.zephir("MSG" , "sample lancé avec l'argument %s" % message, "PERSO") -except: - fonctionseole.zephir("ERR" , "sample lancé sans argument", "PERSO") - exit(1) -if is_locked(['reconfigure']): - fonctionseole.zephir("ERR" , "sample stoppé : reconfigure en cours", "PERSO") - exit(1) -else: - fonctionseole.zephir("FIN" , "sample : OK", "PERSO") - diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/bareosfichiers.d/test.conf b/modules_EOLE_envole/documents/tronc-commun-2-avancee/bareosfichiers.d/test.conf new file mode 100644 index 0000000..5567908 --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/bareosfichiers.d/test.conf @@ -0,0 +1,10 @@ +Include { + Options { + aclsupport = no + @/etc/bareos/include-options.conf + } + File = /tmp/repertoire +} +Exclude { + File = /tmp/repertoire/toto.txt +} diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd b/modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd new file mode 100755 index 0000000..bc81e25 --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/diagnose/90-ircd @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ $(CreoleGet activer_ircd) = "oui" ];then + . /usr/lib/eole/diagnose.sh + EchoGras "*** Serveur IRCD" + TestService IRCD 127.0.0.1:$(CreoleGet ircd_port) + echo +fi + +exit 0 diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_ircd.xml b/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_ircd.xml new file mode 100644 index 0000000..85eb99d --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_ircd.xml @@ -0,0 +1,73 @@ + + + + + + ircd-irc2 + ircd-irc2 + + ircd_port + + + + + + + + + oui + + + + + + + 6667 + + + + Vous êtes banni, contacter votre administrateur + + + + + + + + + ['message 1', 'message 2', 'personnalisé'] + + + web_url + + + + + Serveur IRC pour + libelle_etab + + + ircd_banned_comment + + + non + ircd + ircd + ircd + + + personnalisé + ircd_motd_personnalise + + + ircd_motd_personnalise + + + + + Cette variable permet d'activer un serveur IRC + + + + diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_rennes.xml b/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_rennes.xml new file mode 100644 index 0000000..c846f7d --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/dicos/50_rennes.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ead/actions_ls.cfg b/modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/actions_ls.cfg similarity index 100% rename from modules_EOLE_envole/documents/tronc-commun-2/ead/actions_ls.cfg rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/actions_ls.cfg diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ead/cmd_ls.py b/modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/cmd_ls.py similarity index 100% rename from modules_EOLE_envole/documents/tronc-commun-2/ead/cmd_ls.py rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/cmd_ls.py diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ead/ls.cmd b/modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/ls.cmd similarity index 100% rename from modules_EOLE_envole/documents/tronc-commun-2/ead/ls.cmd rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/ls.cmd diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ead/perm_ls.ini b/modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/perm_ls.ini similarity index 100% rename from modules_EOLE_envole/documents/tronc-commun-2/ead/perm_ls.ini rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/ead/perm_ls.ini diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/extra/schedule/50_ircd.xml b/modules_EOLE_envole/documents/tronc-commun-2-avancee/extra/schedule/50_ircd.xml new file mode 100644 index 0000000..68c93f9 --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/extra/schedule/50_ircd.xml @@ -0,0 +1,30 @@ + + + + + + Démarrage du service IRCD + + post + + + Arrêt du service IRCD + + pre + + + + + non + activer_ircd + none + daily + + + non + activer_ircd + none + daily + + + diff --git a/modules_EOLE_envole/documents/tronc-commun-2-avancee/funcs/mafonction.py b/modules_EOLE_envole/documents/tronc-commun-2-avancee/funcs/mafonction.py new file mode 100644 index 0000000..ba301b8 --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/funcs/mafonction.py @@ -0,0 +1,4 @@ +#!/usr/bin/python + +def ma_fonction(): + return u'Ma phrase de ma fonction' diff --git a/modules_EOLE_envole/documents/tronc-commun-2/posttemplate/00-creation b/modules_EOLE_envole/documents/tronc-commun-2-avancee/posttemplate/00-creation similarity index 100% rename from modules_EOLE_envole/documents/tronc-commun-2/posttemplate/00-creation rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/posttemplate/00-creation diff --git a/modules_EOLE_envole/documents/tronc-commun-2/schedule/post/ircd b/modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_start old mode 100644 new mode 100755 similarity index 58% rename from modules_EOLE_envole/documents/tronc-commun-2/schedule/post/ircd rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_start index 3654eb9..62e1d10 --- a/modules_EOLE_envole/documents/tronc-commun-2/schedule/post/ircd +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_start @@ -1,7 +1,4 @@ #!/bin/bash -DESC="Démarrage du serveur IRC" - CreoleService ircd-irc2 start - exit 0 diff --git a/modules_EOLE_envole/documents/tronc-commun-2/schedule/pre/ircd b/modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_stop old mode 100644 new mode 100755 similarity index 61% rename from modules_EOLE_envole/documents/tronc-commun-2/schedule/pre/ircd rename to modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_stop index fa5312a..b54bc09 --- a/modules_EOLE_envole/documents/tronc-commun-2/schedule/pre/ircd +++ b/modules_EOLE_envole/documents/tronc-commun-2-avancee/schedule/scripts/ircd_stop @@ -1,7 +1,4 @@ #!/bin/bash -DESC="Arrêt du serveur IRC" - CreoleService ircd-irc2 stop - exit 0 diff --git a/exercice_exemple.tex b/modules_EOLE_envole/documents/tronc-commun-2/ircd-irc2.tex similarity index 100% rename from exercice_exemple.tex rename to modules_EOLE_envole/documents/tronc-commun-2/ircd-irc2.tex diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_ircd.xml b/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_ircd.xml deleted file mode 100644 index fe3b1c9..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_ircd.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - ircd-irc2 - - - - - non - - - - - - non - ircd-irc2 - ircd-irc2 - - - diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_root_ircd.fw b/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_root_ircd.fw deleted file mode 100644 index 2a7095e..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/ircd/00_root_ircd.fw +++ /dev/null @@ -1 +0,0 @@ -allow_src(ip='0/0', port="6667") diff --git a/modules_EOLE_envole/documents/tronc-commun-2/ircd/160-ircd b/modules_EOLE_envole/documents/tronc-commun-2/ircd/160-ircd deleted file mode 100644 index 383ab67..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/ircd/160-ircd +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -. /usr/share/eole/FonctionsEoleNg -. ParseDico - -EchoGras "*** Serveur IRC" - -if [ "$activate_ircd" = "oui" ]; then - TestService IRCD 127.0.0.1:6667 -else - Inactif "IRCD" -fi -echo -exit 0 diff --git a/modules_EOLE_envole/documents/tronc-commun-2/patch/clamd.conf.patch b/modules_EOLE_envole/documents/tronc-commun-2/patch/clamd.conf.patch deleted file mode 100644 index 527f7da..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/patch/clamd.conf.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- distrib/clamd.conf 2012-12-03 14:58:06.000000000 +0100 -+++ modif/clamd.conf 2013-02-13 16:44:18.370654335 +0100 -@@ -23,7 +23,7 @@ - # and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size - # in bytes just don't use modifiers. - # Default: 1M --LogFileMaxSize 2M -+LogFileMaxSize 10M - - # Log time with each message. - # Default: no -@@ -228,7 +228,7 @@ - - - # Scan urls found in mails for phishing attempts. --# (available in experimental builds only) -+# (available in experimental builds only) - # Default: yes - #PhishingScanURLs yes - diff --git a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/00_phpldapadmin.xml b/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/00_phpldapadmin.xml deleted file mode 100644 index 6ec2ca4..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/00_phpldapadmin.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - phpldapadmin - phpldapadmin - - - - - - - - non - - - - - - - - - - phpldapadmin_ip - - - non - phpldapadmin - phpldapadmin - phpldapadmin - - - adresse_ip_ldap - - - - - diff --git a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-apache.conf b/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-apache.conf deleted file mode 100644 index 177f70b..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-apache.conf +++ /dev/null @@ -1,53 +0,0 @@ -%if %%activer_phpldapadmin == "oui" -# Define /phpldapadmin alias, this is the default - - Alias /phpldapadmin /usr/share/phpldapadmin/htdocs - - -# You can also use phpLDAPadmin as a VirtualHost -# -# ServerName ldap.example.com -# ServerAdmin root@example.com -# DocumentRoot /usr/share/phpldapadmin -# ErrorLog logs/ldap.example.com-error.log -# CustomLog logs/ldap.example.com-access.log common -# - - - - DirectoryIndex index.php - Options +FollowSymLinks - AllowOverride None - - Order allow,deny - Allow from all - - - - - AddType application/x-httpd-php .php - - php_flag magic_quotes_gpc Off - php_flag track_vars On - php_flag register_globals On - php_value include_path . - php_value memory_limit 32M - - - - - - AddType application/x-httpd-php .php - Action application/x-httpd-php /cgi-bin/php5 - - - AddType application/x-httpd-php .php - Action application/x-httpd-php /cgi-bin/php5 - - - - - - - -%end if diff --git a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-config.php b/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-config.php deleted file mode 100644 index 93cc1e0..0000000 --- a/modules_EOLE_envole/documents/tronc-commun-2/phpldapmyadmin/phpldapadmin-config.php +++ /dev/null @@ -1,549 +0,0 @@ -custom variable to do so. - * For example, the default for defining the language in config_default.php - * - * $this->default->appearance['language'] = array( - * 'desc'=>'Language', - * 'default'=>'auto'); - * - * to override this, use $config->custom->appearance['language'] = 'en_EN'; - * - * This file is also used to configure your LDAP server connections. - * - * You must specify at least one LDAP server there. You may add - * as many as you like. You can also specify your language, and - * many other options. - * - * NOTE: Commented out values in this file prefixed by //, represent the - * defaults that have been defined in config_default.php. - * Commented out values prefixed by #, dont reflect their default value, you can - * check config_default.php if you want to see what the default is. - * - * DONT change config_default.php, you changes will be lost by the next release - * of PLA. Instead change this file - as it will NOT be replaced by a new - * version of phpLDAPadmin. - */ - -/*********************************************/ -/* Useful important configuration overrides */ -/*********************************************/ - -/* If you are asked to put PLA in debug mode, this is how you do it: */ -# $config->custom->debug['level'] = 255; -# $config->custom->debug['syslog'] = true; -# $config->custom->debug['file'] = '/tmp/pla_debug.log'; - -/* phpLDAPadmin can encrypt the content of sensitive cookies if you set this - to a big random string. */ -// $config->custom->session['blowfish'] = null; - -/* The language setting. If you set this to 'auto', phpLDAPadmin will attempt - to determine your language automatically. Otherwise, available lanaguages - are: 'ct', 'de', 'en', 'es', 'fr', 'it', 'nl', and 'ru' - Localization is not complete yet, but most strings have been translated. - Please help by writing language files. See lang/en.php for an example. */ -// $config->custom->appearance['language'] = 'auto'; - -/* The temporary storage directory where we will put jpegPhoto data - This directory must be readable and writable by your web server. */ -// $config->custom->jpeg['tmpdir'] = '/tmp'; // Example for Unix systems -# $config->custom->jpeg['tmpdir'] = 'c:\\temp'; // Example for Windows systems - -/* Set this to (bool)true if you do NOT want a random salt used when - calling crypt(). Instead, use the first two letters of the user's - password. This is insecure but unfortunately needed for some older - environments. */ -# $config->custom->password['no_random_crypt_salt'] = true; - -/* PHP script timeout control. If php runs longer than this many seconds then - PHP will stop with an Maximum Execution time error. Increase this value from - the default if queries to your LDAP server are slow. The default is either - 30 seconds or the setting of max_exection_time if this is null. */ -// $config->custom->session['timelimit'] = 30; - -/* Our local timezone - This is to make sure that when we ask the system for the current time, we - get the right local time. If this is not set, all time() calculations will - assume UTC if you have not set PHP date.timezone. */ -// $config->custom->appearance['timezone'] = null; -# $config->custom->appearance['timezone'] = 'Australia/Melbourne'; - -/*********************************************/ -/* Commands */ -/*********************************************/ - -/* Command availability ; if you don't authorize a command the command - links will not be shown and the command action will not be permitted. - For better security, set also ACL in your ldap directory. */ -/* -$config->custom->commands['cmd'] = array( - 'entry_internal_attributes_show' => true, - 'entry_refresh' => true, - 'oslinks' => true, - 'switch_template' => true -); - -$config->custom->commands['script'] = array( - 'add_attr_form' => true, - 'add_oclass_form' => true, - 'add_value_form' => true, - 'collapse' => true, - 'compare' => true, - 'compare_form' => true, - 'copy' => true, - 'copy_form' => true, - 'create' => true, - 'create_confirm' => true, - 'delete' => true, - 'delete_attr' => true, - 'delete_form' => true, - 'draw_tree_node' => true, - 'expand' => true, - 'export' => true, - 'export_form' => true, - 'import' => true, - 'import_form' => true, - 'login' => true, - 'logout' => true, - 'login_form' => true, - 'mass_delete' => true, - 'mass_edit' => true, - 'mass_update' => true, - 'modify_member_form' => true, - 'monitor' => true, - 'purge_cache' => true, - 'query_engine' => true, - 'rename' => true, - 'rename_form' => true, - 'rdelete' => true, - 'refresh' => true, - 'schema' => true, - 'server_info' => true, - 'show_cache' => true, - 'template_engine' => true, - 'update_confirm' => true, - 'update' => true -); -*/ - -/*********************************************/ -/* Appearance */ -/*********************************************/ - -/* If you want to choose the appearance of the tree, specify a class name which - inherits from the Tree class. */ -// $config->custom->appearance['tree'] = 'AJAXTree'; -# $config->custom->appearance['tree'] = 'HTMLTree'; - -/* Just show your custom templates. */ -// $config->custom->appearance['custom_templates_only'] = false; - -/* Disable the default template. */ -// $config->custom->appearance['disable_default_template'] = false; - -/* Hide the warnings for invalid objectClasses/attributes in templates. */ -// $config->custom->appearance['hide_template_warning'] = false; - -/* Configure what objects are shown in left hand tree */ -// $config->custom->appearance['tree_filter'] = '(objectclass=*)'; - -/* The height and width of the tree. If these values are not set, then - no tree scroll bars are provided. */ -// $config->custom->appearance['tree_height'] = null; -# $config->custom->appearance['tree_height'] = 600; -// $config->custom->appearance['tree_width'] = null; -# $config->custom->appearance['tree_width'] = 250; - -/*********************************************/ -/* User-friendly attribute translation */ -/*********************************************/ - -/* Use this array to map attribute names to user friendly names. For example, if - you don't want to see "facsimileTelephoneNumber" but rather "Fax". */ -// $config->custom->appearance['friendly_attrs'] = array(); -$config->custom->appearance['friendly_attrs'] = array( - 'facsimileTelephoneNumber' => 'Fax', - 'gid' => 'Group', - 'mail' => 'Email', - 'telephoneNumber' => 'Telephone', - 'uid' => 'User Name', - 'userPassword' => 'Password' -); - -/*********************************************/ -/* Hidden attributes */ -/*********************************************/ - -/* You may want to hide certain attributes from being edited. If you want to - hide attributes from the user, you should use your LDAP servers ACLs. - NOTE: The user must be able to read the hide_attrs_exempt entry to be - excluded. */ -// $config->custom->appearance['hide_attrs'] = array(); -# $config->custom->appearance['hide_attrs'] = array('objectClass'); - -/* Members of this list will be exempt from the hidden attributes.*/ -// $config->custom->appearance['hide_attrs_exempt'] = null; -# $config->custom->appearance['hide_attrs_exempt'] = 'cn=PLA UnHide,ou=Groups,c=AU'; - -/*********************************************/ -/* Read-only attributes */ -/*********************************************/ - -/* You may want to phpLDAPadmin to display certain attributes as read only, - meaning that users will not be presented a form for modifying those - attributes, and they will not be allowed to be modified on the "back-end" - either. You may configure this list here: - NOTE: The user must be able to read the readonly_attrs_exempt entry to be - excluded. */ -// $config->custom->appearance['readonly_attrs'] = array(); - -/* Members of this list will be exempt from the readonly attributes.*/ -// $config->custom->appearance['readonly_attrs_exempt'] = null; -# $config->custom->appearance['readonly_attrs_exempt'] = 'cn=PLA ReadWrite,ou=Groups,c=AU'; - -/*********************************************/ -/* Group attributes */ -/*********************************************/ - -/* Add "modify group members" link to the attribute. */ -// $config->custom->modify_member['groupattr'] = array('member','uniqueMember','memberUid'); - -/* Configure filter for member search. This only applies to "modify group members" feature */ -// $config->custom->modify_member['filter'] = '(objectclass=Person)'; - -/* Attribute that is added to the group member attribute. */ -// $config->custom->modify_member['attr'] = 'dn'; - -/* For Posix attributes */ -// $config->custom->modify_member['posixattr'] = 'uid'; -// $config->custom->modify_member['posixfilter'] = '(uid=*)'; -// $config->custom->modify_member['posixgroupattr'] = 'memberUid'; - -/*********************************************/ -/* Support for attrs display order */ -/*********************************************/ - -/* Use this array if you want to have your attributes displayed in a specific - order. You can use default attribute names or their fridenly names. - For example, "sn" will be displayed right after "givenName". All the other - attributes that are not specified in this array will be displayed after in - alphabetical order. */ -// $config->custom->appearance['attr_display_order'] = array(); -# $config->custom->appearance['attr_display_order'] = array( -# 'givenName', -# 'sn', -# 'cn', -# 'displayName', -# 'uid', -# 'uidNumber', -# 'gidNumber', -# 'homeDirectory', -# 'mail', -# 'userPassword' -# ); - -/*********************************************/ -/* Define your LDAP servers in this section */ -/*********************************************/ - -$servers = new Datastore(); - -/* $servers->NewServer('ldap_pla') must be called before each new LDAP server - declaration. */ -$servers->newServer('ldap_pla'); - -/* A convenient name that will appear in the tree viewer and throughout - phpLDAPadmin to identify this LDAP server to users. */ -%for %%phpldapadmin_master in %%phpldapadmin_name -$servers->setValue('server','name','%%phpldapadmin_master'); - -/* Examples: - 'ldap.example.com', - 'ldaps://ldap.example.com/', - 'ldapi://%2fusr%local%2fvar%2frun%2fldapi' - (Unix socket at /usr/local/var/run/ldap) */ -$servers->setValue('server','host','%%phpldapadmin_master.phpldapadmin_ip'); -%end for -/* The port your LDAP server listens on (no quotes). 389 is standard. */ -// $servers->setValue('server','port',389); - -/* Array of base DNs of your LDAP server. Leave this blank to have phpLDAPadmin - auto-detect it for you. */ -$servers->setValue('server','base',array('dc=example,dc=com')); - -/* Four options for auth_type: - 1. 'cookie': you will login via a web form, and a client-side cookie will - store your login dn and password. - 2. 'session': same as cookie but your login dn and password are stored on the - web server in a persistent session variable. - 3. 'http': same as session but your login dn and password are retrieved via - HTTP authentication. - 4. 'config': specify your login dn and password here in this config file. No - login will be required to use phpLDAPadmin for this server. - - Choose wisely to protect your authentication information appropriately for - your situation. If you choose 'cookie', your cookie contents will be - encrypted using blowfish and the secret your specify above as - session['blowfish']. */ -$servers->setValue('login','auth_type','session'); - -/* The DN of the user for phpLDAPadmin to bind with. For anonymous binds or - 'cookie' or 'session' auth_types, LEAVE THE LOGIN_DN AND LOGIN_PASS BLANK. If - you specify a login_attr in conjunction with a cookie or session auth_type, - then you can also specify the bind_id/bind_pass here for searching the - directory for users (ie, if your LDAP server does not allow anonymous binds. */ -$servers->setValue('login','bind_id','cn=admin,dc=example,dc=com'); -# $servers->setValue('login','bind_id','cn=Manager,dc=example,dc=com'); - -/* Your LDAP password. If you specified an empty bind_id above, this MUST also - be blank. */ -// $servers->setValue('login','bind_pass',''); -# $servers->setValue('login','bind_pass','secret'); - -/* Use TLS (Transport Layer Security) to connect to the LDAP server. */ -// $servers->setValue('server','tls',false); - -/************************************ - * SASL Authentication * - ************************************/ - -/* Enable SASL authentication LDAP SASL authentication requires PHP 5.x - configured with --with-ldap-sasl=DIR. If this option is disabled (ie, set to - false), then all other sasl options are ignored. */ -// $servers->setValue('server','sasl_auth',false); - -/* SASL auth mechanism */ -// $servers->setValue('server','sasl_mech','PLAIN'); - -/* SASL authentication realm name */ -// $servers->setValue('server','sasl_realm',''); -# $servers->setValue('server','sasl_realm','example.com'); - -/* SASL authorization ID name - If this option is undefined, authorization id will be computed from bind DN, - using sasl_authz_id_regex and sasl_authz_id_replacement. */ -// $servers->setValue('server','sasl_authz_id', null); - -/* SASL authorization id regex and replacement - When sasl_authz_id property is not set (default), phpLDAPAdmin will try to - figure out authorization id by itself from bind distinguished name (DN). - - This procedure is done by calling preg_replace() php function in the - following way: - - $authz_id = preg_replace($sasl_authz_id_regex,$sasl_authz_id_replacement, - $bind_dn); - - For info about pcre regexes, see: - - pcre(3), perlre(3) - - http://www.php.net/preg_replace */ -// $servers->setValue('server','sasl_authz_id_regex',null); -// $servers->setValue('server','sasl_authz_id_replacement',null); -# $servers->setValue('server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i'); -# $servers->setValue('server','sasl_authz_id_replacement','$1'); - -/* SASL auth security props. - See http://beepcore-tcl.sourceforge.net/tclsasl.html#anchor5 for explanation. */ -// $servers->setValue('server','sasl_props',null); - -/* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5, - blowfish, crypt or leave blank for now default algorithm. */ -// $servers->setValue('appearance','password_hash','md5'); - -/* If you specified 'cookie' or 'session' as the auth_type above, you can - optionally specify here an attribute to use when logging in. If you enter - 'uid' and login as 'dsmith', phpLDAPadmin will search for (uid=dsmith) - and log in as that user. - Leave blank or specify 'dn' to use full DN for logging in. Note also that if - your LDAP server requires you to login to perform searches, you can enter the - DN to use when searching in 'bind_id' and 'bind_pass' above. -// $servers->setValue('login','attr','dn'); - -/* Base DNs to used for logins. If this value is not set, then the LDAP server - Base DNs are used. */ -// $servers->setValue('login','base',array()); - -/* If 'login,attr' is used above such that phpLDAPadmin will search for your DN - at login, you may restrict the search to a specific objectClasses. EG, set this - to array('posixAccount') or array('inetOrgPerson',..), depending upon your - setup. */ -// $servers->setValue('login','class',array()); - -/* If you specified something different from 'dn', for example 'uid', as the - login_attr above, you can optionally specify here to fall back to - authentication with dn. - This is useful, when users should be able to log in with their uid, but - the ldap administrator wants to log in with his root-dn, that does not - necessarily have the uid attribute. - When using this feature, login_class is ignored. */ -// $servers->setValue('login','fallback_dn',false); - -/* Specify true If you want phpLDAPadmin to not display or permit any - modification to the LDAP server. */ -// $servers->setValue('server','read_only',false); - -/* Specify false if you do not want phpLDAPadmin to draw the 'Create new' links - in the tree viewer. */ -// $servers->setValue('appearance','show_create',true); - -/* This feature allows phpLDAPadmin to automatically determine the next - available uidNumber for a new entry. */ -// $servers->setValue('auto_number','enable',true); - -/* The mechanism to use when finding the next available uidNumber. Two possible - values: 'uidpool' or 'search'. - The 'uidpool' mechanism uses an existing uidPool entry in your LDAP server to - blindly lookup the next available uidNumber. The 'search' mechanism searches - for entries with a uidNumber value and finds the first available uidNumber - (slower). */ -// $servers->setValue('auto_number','mechanism','search'); - -/* The DN of the search base when the 'search' mechanism is used above. */ -# $servers->setValue('auto_number','search_base','ou=People,dc=example,dc=com'); - -/* The minimum number to use when searching for the next available number - (only when 'search' is used for auto_number */ -// $servers->setValue('auto_number','min',array('uidNumber'=>1000,'gidNumber'=>500)); - -/* If you set this, then phpldapadmin will bind to LDAP with this user ID when - searching for the uidnumber. The idea is, this user id would have full - (readonly) access to uidnumber in your ldap directory (the logged in user - may not), so that you can be guaranteed to get a unique uidnumber for your - directory. */ -// $servers->setValue('auto_number','dn',null); - -/* The password for the dn above. */ -// $servers->setValue('auto_number','pass',null); - -/* Enable anonymous bind login. */ -// $servers->setValue('login','anon_bind',true); - -/* Use customized page with prefix when available. */ -# $servers->setValue('custom','pages_prefix','custom_'); - -/* If you set this, then only these DNs are allowed to log in. This array can - contain individual users, groups or ldap search filter(s). Keep in mind that - the user has not authenticated yet, so this will be an anonymous search to - the LDAP server, so make your ACLs allow these searches to return results! */ -# $servers->setValue('login','allowed_dns',array( -# 'uid=stran,ou=People,dc=example,dc=com', -# '(&(gidNumber=811)(objectClass=groupOfNames))', -# '(|(uidNumber=200)(uidNumber=201))', -# 'cn=callcenter,ou=Group,dc=example,dc=com')); - -/* Set this if you dont want this LDAP server to show in the tree */ -// $servers->setValue('server','visible',true); - -/* This is the time out value in minutes for the server. After as many minutes - of inactivity you will be automatically logged out. If not set, the default - value will be ( session_cache_expire()-1 ) */ -# $servers->setValue('login','timeout',30); - -/* Set this if you want phpldapadmin to perform rename operation on entry which - has children. Certain servers are known to allow it, certain are not */ -// $servers->setValue('server','branch_rename',false); - -/* If you set this, then phpldapadmin will show these attributes as - internal attributes, even if they are not defined in your schema. */ -// $servers->setValue('server','custom_sys_attrs',array('')); -# $servers->setValue('server','custom_sys_attrs',array('passwordExpirationTime','passwordAllowChangeTime')); - -/* If you set this, then phpldapadmin will show these attributes on - objects, even if they are not defined in your schema. */ -// $servers->setValue('server','custom_attrs',array('')); -# $servers->setValue('server','custom_attrs',array('nsRoleDN','nsRole','nsAccountLock')); - -/* These attributes will be forced to MAY attributes and become option in the - templates. If they are not defined in the templates, then they wont appear - as per normal template processing. You may want to do this becuase your LDAP - server may automatically calculate a default value. - In Fedora Directory Server using the DNA Plugin one could ignore uidNumber, - gidNumber and sambaSID. */ -// $servers->setValue('force_may','attrs',array('')); -# $servers->setValue('force_may','attrs',array('uidNumber','gidNumber','sambaSID')); - -/*********************************************/ -/* Unique attributes */ -/*********************************************/ - -/* You may want phpLDAPadmin to enforce some attributes to have unique values - (ie: not belong to other entries in your tree. This (together with - 'unique','dn' and 'unique','pass' option will not let updates to - occur with other attributes have the same value. */ -# $servers->setValue('unique','attrs',array('mail','uid','uidNumber')); - -/* If you set this, then phpldapadmin will bind to LDAP with this user ID when - searching for attribute uniqueness. The idea is, this user id would have full - (readonly) access to your ldap directory (the logged in user may not), so - that you can be guaranteed to get a unique uidnumber for your directory. */ -// $servers->setValue('unique','dn',null); - -/* The password for the dn above. */ -// $servers->setValue('unique','pass',null); - -/************************************************************************** - * If you want to configure additional LDAP servers, do so below. * - * Remove the commented lines and use this section as a template for all * - * your other LDAP servers. * - **************************************************************************/ - -/* -$servers->newServer('ldap_pla'); -$servers->setValue('server','name','LDAP Server'); -$servers->setValue('server','host','127.0.0.1'); -$servers->setValue('server','port',389); -$servers->setValue('server','base',array('')); -$servers->setValue('login','auth_type','cookie'); -$servers->setValue('login','bind_id',''); -$servers->setValue('login','bind_pass',''); -$servers->setValue('server','tls',false); - -# SASL auth -$servers->setValue('server','sasl_auth',true); -$servers->setValue('server','sasl_mech','PLAIN'); -$servers->setValue('server','sasl_realm','EXAMPLE.COM'); -$servers->setValue('server','sasl_authz_id',null); -$servers->setValue('server','sasl_authz_id_regex','/^uid=([^,]+)(.+)/i'); -$servers->setValue('server','sasl_authz_id_replacement','$1'); -$servers->setValue('server','sasl_props',null); - -$servers->setValue('appearance','password_hash','md5'); -$servers->setValue('login','attr','dn'); -$servers->setValue('login','fallback_dn',false); -$servers->setValue('login','class',null); -$servers->setValue('server','read_only',false); -$servers->setValue('appearance','show_create',true); - -$servers->setValue('auto_number','enable',true); -$servers->setValue('auto_number','mechanism','search'); -$servers->setValue('auto_number','search_base',null); -$servers->setValue('auto_number','min',array('uidNumber'=>1000,'gidNumber'=>500)); -$servers->setValue('auto_number','dn',null); -$servers->setValue('auto_number','pass',null); - -$servers->setValue('login','anon_bind',true); -$servers->setValue('custom','pages_prefix','custom_'); -$servers->setValue('unique','attrs',array('mail','uid','uidNumber')); -$servers->setValue('unique','dn',null); -$servers->setValue('unique','pass',null); - -$servers->setValue('server','visible',true); -$servers->setValue('login','timeout',30); -$servers->setValue('server','branch_rename',false); -$servers->setValue('server','custom_sys_attrs',array('passwordExpirationTime','passwordAllowChangeTime')); -$servers->setValue('server','custom_attrs',array('nsRoleDN','nsRole','nsAccountLock')); -$servers->setValue('force_may','attrs',array('uidNumber','gidNumber','sambaSID')); -*/ -?> diff --git a/modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.tex b/modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.tex new file mode 100644 index 0000000..6a78755 --- /dev/null +++ b/modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.tex @@ -0,0 +1,163 @@ +\documentclass[a4paper,11pt]{report} +\usepackage{ifxetex} +\ifxetex + %\usepackage{fontspec} + %\usepackage{xunicode} + \usepackage{xltxtra} + \defaultfontfeatures{Mapping=tex-text} % To support LaTeX quoting style + \setmainfont{Caviar Dreams} +\else + \usepackage[utf8]{inputenc} + \usepackage[T1]{fontenc} + \usepackage{amsfonts} +\fi +\usepackage{pifont} +\usepackage{geometry} +\usepackage{fancybox} +\usepackage{verbatim} +\usepackage{eurosym} +\usepackage[english, francais]{babel} +\usepackage{listings} +\usepackage{color} +\usepackage{graphicx} +\usepackage{hyperref} +\usepackage{titlesec} +\usepackage{fancyhdr} +\usepackage{lastpage} +\usepackage{minted} + +\setlength{\hoffset}{-18pt} +\setlength{\oddsidemargin}{0pt} % Marge gauche sur pages impaires +\setlength{\evensidemargin}{9pt} % Marge gauche sur pages paires +\setlength{\marginparwidth}{54pt} % Largeur de note dans la marge +\setlength{\textwidth}{481pt} % Largeur de la zone de texte (17cm) +\setlength{\voffset}{-18pt} % Bon pour DOS +\setlength{\marginparsep}{7pt} % Séparation de la marge +\setlength{\topmargin}{0pt} % Pas de marge en haut +\setlength{\headheight}{13pt} % Haut de page +\setlength{\headsep}{10pt} % Entre le haut de page et le texte +\setlength{\footskip}{27pt} % Bas de page + séparation +\setlength{\textheight}{708pt} % Hauteur de la zone de texte (25cm) +\definecolor{bg}{rgb}{0.9,0.9,0.9} + +% TITRE DU DOCUMENT ! +\title{Corrigé des exercices : créer un script Zéphir} + +%\date{} + +\begin{document} +\maketitle +\normalsize +\vspace{2cm} +\textbf{Rédacteurs :} +\begin{itemize} + \item Emmanuel Garette (egarette@cadoles.com) + \item Vincent Febvre (vfebvre@cadoles.com) \newline +\end{itemize} +\vspace{2cm} +\textbf{Version} : 1.0 \newline + +\chapter{Création d'un script Zéphir : un script python} + +Un script Zéphir est un script python. Des fonctions de base se proposer pour faciliter l'écriture de ce script. + +\begin{minted}{xml} +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from zephir.lib_zephir import * +from creole import fonctionseole +\end{minted} + +\chapter{Création d'un script Zéphir : vérification} + +Avant il faut vérifier qu'aucun blocage ne soit mis en place pour éviter l'exécuter de l'action. + +\begin{minted}{xml} +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from zephir.lib_zephir import * +from creole import fonctionseole + +\end{minted} +\begin{minted}[bgcolor=bg]{xml} +if fonctionseole.init_proc('PERSO') == False: + fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO") + sys.exit(1) +\end{minted} + +\chapter{Création d'un script Zéphir : début} + +Avant d'exécuter le script, emettre un message sur le Zéphir. + +\begin{minted}{xml} +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from zephir.lib_zephir import * +from creole import fonctionseole + +if fonctionseole.init_proc('PERSO') == False: + fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO") + sys.exit(1) + +\end{minted} +\begin{minted}[bgcolor=bg]{xml} +fonctionseole.zephir("INIT" , "script supprimer_fichier en cours d'execution", "PERSO") +\end{minted} + +\chapter{Création d'un script Zéphir : lancement du script en root} + +Le script principal est exécuter avec l'utilisateur "uucp". Il faut utiliser la fonction sudo\_script pour avoir les droits "root". + +Si tout se passe bien, deux messages seront remontés : + +\begin{itemize} + \item un message d'information avec le nom du fichier ; + \item un message annonçant que le fichier est correctement supprimer. +\end{itemize} + +En cas d'erreur, un message d'erreur est remonté sur le Zéphir. + +\begin{minted}{xml} +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import sys +from zephir.lib_zephir import * +from creole import fonctionseole + +if fonctionseole.init_proc('PERSO') == False: + fonctionseole.zephir("ERR" , "procédure supprimer_fichier bloquée par zephir", "PERSO") + sys.exit(1) + +fonctionseole.zephir("INIT" , "script supprimer_fichier en cours d'execution", "PERSO") + +\end{minted} +\begin{minted}[bgcolor=bg]{xml} +try: + filename = sys.argv[1] + fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument {}".format(filename), "PERSO") + sudo_script('supprimer_fichier_sudo.zephir %s' % filename) +except Exception, err: + fonctionseole.zephir("ERR" , "supprimer_fichier a généré une erreur {}".format(err), "PERSO") + sys.exit(1) + +fonctionseole.zephir("FIN" , "supprimer_fichier {}: OK".format(filename), "PERSO") +\end{minted} + +\chapter{Création du script de suppression des fichiers} + +Un second script bash est nécessaire. Ce script est utilisé pour supprimer effectivement le fichier sur le serveur. + +\begin{minted}{bash} +#!/bin/bash + +[ -f "$1" ] && rm -f "$1" +\end{minted} + +\end{document} diff --git a/modules_EOLE_envole/documents/exercice4/supprimer_fichier.zephir b/modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.zephir similarity index 100% rename from modules_EOLE_envole/documents/exercice4/supprimer_fichier.zephir rename to modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier.zephir diff --git a/modules_EOLE_envole/documents/exercice4/supprimer_fichier_sudo.zephir b/modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier_sudo.zephir similarity index 100% rename from modules_EOLE_envole/documents/exercice4/supprimer_fichier_sudo.zephir rename to modules_EOLE_envole/documents/tronc-commun-2/supprimer_fichier_sudo.zephir