modif exercices

This commit is contained in:
vfebvre 2015-03-09 09:35:21 +01:00 committed by Benjamin Bohard
parent 99de52f66b
commit d1e541032b
6 changed files with 40 additions and 61 deletions

View File

@ -1,28 +1,26 @@
<creole> <creole>
<containers> <containers>
<container name="web"> <container name="web">
<file name='/etc/phpldapadmin/apache.conf'/> <file name='/etc/phpldapadmin/apache.conf'/>
<file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/> <file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/>
<package>phpldapadmin</package> <package>phpldapadmin</package>
</container> </container>
</containers> </containers>
<variables> <variables>
<family name='services'> <family name='applications web'>
<variable name='activate_phpldapadmin' type='string' description="Activer phpldapadmin"> <variable name='activate_phpldapadmin' type='oui/non' description="Activer phpldapadmin">
<value>non</value> <value>non</value>
</variable> </variable>
</family> </family>
<family name='phpldapadmin' hidden='True'> <family name='phpldapadmin'>
<variable name="phpldapadmin_host" type="string" description="Adresse IP ou DNS du serveur ldap"/> <variable name="phpldapadmin_host" type="string" description="Adresse IP ou DNS du serveur ldap" mandatory="True">
<value>localhost</value>
</variable>
<variable name="phpldapadmin_name" type="string" description="Nom du serveur ldap"/> <variable name="phpldapadmin_name" type="string" description="Nom du serveur ldap"/>
</family> </family>
</variables> </variables>
<constraints> <constraints>
<check name='valid_enum' target='activate_phpldapadmin'>
<param>['oui','non']</param>
</check>
<check name='obligatoire' target='phpldapadmin_host'/>
<condition name='hidden_if_in' source='activate_phpldapadmin'> <condition name='hidden_if_in' source='activate_phpldapadmin'>
<param>non</param> <param>non</param>
<target type='family'>phpldapadmin</target> <target type='family'>phpldapadmin</target>

View File

@ -5,13 +5,13 @@
/*********************************************/ /*********************************************/
%if %%phpldapadmin_name == "" %if %%phpldapadmin_name == ""
$ldapservers->SetValue($i,'server','name','Serveur LDAP'); $ldapservers->SetValue(0,'server','name','Serveur LDAP');
%else %else
$ldapservers->SetValue($i,'server','name','%%phpldapadmin_name'); $ldapservers->SetValue(0,'server','name','%%phpldapadmin_name');
%end if %end if
$ldapservers->SetValue($i,'server','host','ldap://%%phpldapadmin_host'); $ldapservers->SetValue(0,'server','host','ldap://%%phpldapadmin_host');
$ldapservers->SetValue($i,'server','tls',false); $ldapservers->SetValue(0,'server','tls',false);
... ...

View File

@ -1,37 +1,27 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<creole> <creole>
<containers> <containers>
<container name="web"> <container name="web">
<file name='/etc/phpldapadmin/apache.conf'/> <file name='/etc/phpldapadmin/apache.conf'/>
<file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/> <file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/>
<package>phpldapadmin</package> <package>phpldapadmin</package>
</container> </container>
</containers> </containers>
<variables> <variables>
<family name='services'> <family name='applications web'>
<variable name='activate_phpldapadmin' type='string' description="Activer phpldapadmin"> <variable name='activate_phpldapadmin' type='oui/non' description="Activer phpldapadmin">
<value>non</value> <value>non</value>
</variable>
</family>
<family name='phpldapadmin' hidden='True'>
<variable name="phpldapadmin_host" type="string" description="Adresse IP ou DNS du serveur ldap" multi='True'/>
<variable name="phpldapadmin_name" type="string" description="Nom du serveur ldap"/>
<variable name="phpldapadmin_tls" type="string" description="Connexion TLS">
<value>non</value>
</variable> </variable>
</family> </family>
<family name='phpldapadmin'>
<variable name="phpldapadmin_host" type="string" description="Adresse IP ou DNS du serveur ldap" multi='True' mandatory="True">
<value>localhost</value>
</variable>
<variable name="phpldapadmin_name" type="string" description="Nom du serveur ldap" mandatory="True"/>
</family>
</variables> </variables>
<constraints> <constraints>
<check name='valid_enum' target='activate_phpldapadmin'>
<param>['oui','non']</param>
</check>
<check name='valid_enum' target='phpldapadmin_tls'>
<param>['oui','non']</param>
</check>
<check name='obligatoire' target='phpldapadmin_host'/>
<check name='obligatoire' target='phpldapadmin_name'/>
<check name='obligatoire' target='phpldapadmin_tls'/>
<condition name='hidden_if_in' source='activate_phpldapadmin'> <condition name='hidden_if_in' source='activate_phpldapadmin'>
<param>non</param> <param>non</param>
<target type='family'>phpldapadmin</target> <target type='family'>phpldapadmin</target>
@ -39,7 +29,6 @@
</condition> </condition>
<group master='phpldapadmin_host'> <group master='phpldapadmin_host'>
<slave>phpldapadmin_name</slave> <slave>phpldapadmin_name</slave>
<slave>phpldapadmin_tls</slave>
</group> </group>
</constraints> </constraints>
<help> <help>

View File

@ -1,24 +1,17 @@
... /*********************************************/
/* Define your LDAP servers in this section */
/*********************************************/
$ldapservers = new LDAPServers;
%set %%i = 0
%for %%phpldapadmin in %%phpldapadmin_host %for %%phpldapadmin in %%phpldapadmin_host
$i=%%i; %if %%phpldapadmin.phpldapadmin_name == ""
$ldapservers->SetValue($i,'server','name','%%phpldapadmin_name'); $ldapservers->SetValue(0,'server','name','Serveur LDAP');
%if %%phpldapadmin.phpldapadmin_tls == 'oui':
$ldapservers->SetValue($i,'server','host','ldaps://%%phpldapadmin');
%else %else
$ldapservers->SetValue($i,'server','host','ldap://%%phpldapadmin'); $ldapservers->SetValue(0,'server','name','%%phpldapadmin.phpldapadmin_name');
%end if %end if
%if %%phpldapadmin.phpldapadmin_tls == 'oui': $ldapservers->SetValue(0,'server','host','ldap://%%phpldapadmin');
$ldapservers->SetValue($i,'server','tls',true);
%else
$ldapservers->SetValue($i,'server','tls',false);
%end if
%set %%i = %%i + 1 $ldapservers->SetValue(0,'server','tls',false);
%end for %end for
... ...

View File

@ -11,6 +11,10 @@ if fonctionseole.init_proc('PERSO') == False:
fonctionseole.zephir("INIT" , "script test_perso en cours d'execution", "PERSO") fonctionseole.zephir("INIT" , "script test_perso en cours d'execution", "PERSO")
if is_locked(['reconfigure']):
fonctionseole.zephir("ERR" , "supprimer_fichier stoppé : reconfigure en cours", "PERSO")
sys.exit(1)
try: try:
filename = sys.argv[1] filename = sys.argv[1]
fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument %s" % filename, "PERSO") fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument %s" % filename, "PERSO")
@ -18,9 +22,5 @@ try:
except: except:
fonctionseole.zephir("ERR" , "supprimer_fichier lancé sans argument", "PERSO") fonctionseole.zephir("ERR" , "supprimer_fichier lancé sans argument", "PERSO")
sys.exit(1) sys.exit(1)
if is_locked(['reconfigure']):
fonctionseole.zephir("ERR" , "supprimer_fichier stoppé : reconfigure en cours", "PERSO")
sys.exit(1)
else:
fonctionseole.zephir("FIN" , "supprimer_fichier : OK", "PERSO")
fonctionseole.zephir("FIN" , "supprimer_fichier : OK", "PERSO")

View File

@ -145,7 +145,6 @@
\item copier les templates /etc/phpldapadmin/config.php et /etc/phpldapadmin/apache.conf dans /usr/share/eole/creole/distrib/ ; \item copier les templates /etc/phpldapadmin/config.php et /etc/phpldapadmin/apache.conf dans /usr/share/eole/creole/distrib/ ;
\item le template config.php sera renommé en phpldapadmin.php ; \item le template config.php sera renommé en phpldapadmin.php ;
\item si le nom n'est pas spécifié, le serveur : "Serveur LDAP" ; \item si le nom n'est pas spécifié, le serveur : "Serveur LDAP" ;
\item supprimer la configuration du TLS dans phpldapadmin ;
\item tester sans reconfigurer : CreoleCat -o config.php /usr/share/eole/creole/distrib/phpldapadmin.php \item tester sans reconfigurer : CreoleCat -o config.php /usr/share/eole/creole/distrib/phpldapadmin.php
\end{itemize} \end{itemize}
\end{frame} \end{frame}