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>
<containers>
<container name="web">
<container name="web">
<file name='/etc/phpldapadmin/apache.conf'/>
<file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/>
<package>phpldapadmin</package>
</container>
</container>
</containers>
<variables>
<family name='services'>
<variable name='activate_phpldapadmin' type='string' description="Activer phpldapadmin">
<value>non</value>
</variable>
<family name='applications web'>
<variable name='activate_phpldapadmin' type='oui/non' description="Activer phpldapadmin">
<value>non</value>
</variable>
</family>
<family name='phpldapadmin' hidden='True'>
<variable name="phpldapadmin_host" type="string" description="Adresse IP ou DNS du serveur ldap"/>
<family name='phpldapadmin'>
<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"/>
</family>
</variables>
<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'>
<param>non</param>
<target type='family'>phpldapadmin</target>

View File

@ -5,13 +5,13 @@
/*********************************************/
%if %%phpldapadmin_name == ""
$ldapservers->SetValue($i,'server','name','Serveur LDAP');
$ldapservers->SetValue(0,'server','name','Serveur LDAP');
%else
$ldapservers->SetValue($i,'server','name','%%phpldapadmin_name');
$ldapservers->SetValue(0,'server','name','%%phpldapadmin_name');
%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"?>
<creole>
<containers>
<container name="web">
<file name='/etc/phpldapadmin/apache.conf'/>
<file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/>
<container name="web">
<file name='/etc/phpldapadmin/apache.conf'/>
<file name='/etc/phpldapadmin/config.php' source='phpldapadmin.php' filelist='phpldapadmin'/>
<package>phpldapadmin</package>
</container>
</container>
</containers>
<variables>
<family name='services'>
<variable name='activate_phpldapadmin' type='string' description="Activer phpldapadmin">
<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>
<family name='applications web'>
<variable name='activate_phpldapadmin' type='oui/non' description="Activer phpldapadmin">
<value>non</value>
</variable>
</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>
<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'>
<param>non</param>
<target type='family'>phpldapadmin</target>
@ -39,7 +29,6 @@
</condition>
<group master='phpldapadmin_host'>
<slave>phpldapadmin_name</slave>
<slave>phpldapadmin_tls</slave>
</group>
</constraints>
<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
$i=%%i;
$ldapservers->SetValue($i,'server','name','%%phpldapadmin_name');
%if %%phpldapadmin.phpldapadmin_tls == 'oui':
$ldapservers->SetValue($i,'server','host','ldaps://%%phpldapadmin');
%if %%phpldapadmin.phpldapadmin_name == ""
$ldapservers->SetValue(0,'server','name','Serveur LDAP');
%else
$ldapservers->SetValue($i,'server','host','ldap://%%phpldapadmin');
$ldapservers->SetValue(0,'server','name','%%phpldapadmin.phpldapadmin_name');
%end if
%if %%phpldapadmin.phpldapadmin_tls == 'oui':
$ldapservers->SetValue($i,'server','tls',true);
%else
$ldapservers->SetValue($i,'server','tls',false);
%end if
$ldapservers->SetValue(0,'server','host','ldap://%%phpldapadmin');
%set %%i = %%i + 1
$ldapservers->SetValue(0,'server','tls',false);
%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")
if is_locked(['reconfigure']):
fonctionseole.zephir("ERR" , "supprimer_fichier stoppé : reconfigure en cours", "PERSO")
sys.exit(1)
try:
filename = sys.argv[1]
fonctionseole.zephir("MSG" , "supprimer_fichier lancé avec l'argument %s" % filename, "PERSO")
@ -18,9 +22,5 @@ try:
except:
fonctionseole.zephir("ERR" , "supprimer_fichier lancé sans argument", "PERSO")
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 le template config.php sera renommé en phpldapadmin.php ;
\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
\end{itemize}
\end{frame}