X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finstall%2Fetape_ldap4.php;fp=www%2Fecrire%2Finstall%2Fetape_ldap4.php;h=835412d9be0d20a5622bc7dc69331ca89b77dab1;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c diff --git a/www/ecrire/install/etape_ldap4.php b/www/ecrire/install/etape_ldap4.php new file mode 100644 index 0000000..835412d --- /dev/null +++ b/www/ecrire/install/etape_ldap4.php @@ -0,0 +1,101 @@ +"._T('avis_operation_echec')."

"._T('avis_chemin_invalide_1'), + " (".htmlspecialchars($base_ldap).") "._T('avis_chemin_invalide_2')."

"; + } + else { + info_etape(_T('info_reglage_ldap')); + echo info_progression_etape(4,'etape_ldap','install/'); + + $statuts = liste_statuts_ldap(); + $statut_ldap = defined('_INSTALL_STATUT_LDAP') + ? _INSTALL_STATUT_LDAP + : $GLOBALS['liste_des_statuts']['info_redacteurs']; + + + $res = install_propager(array('adresse_ldap','port_ldap','login_ldap','pass_ldap','protocole_ldap','tls_ldap')) + . "" + . "" + . fieldset(_T('info_statut_utilisateurs_1'), + array( + 'statut_ldap' => array( + 'label' => _T('info_statut_utilisateurs_2').'
', + 'valeur' => $statut_ldap, + 'alternatives' => $statuts + ) + ) + ) + . install_ldap_correspondances() + . bouton_suivant(); + + echo generer_form_ecrire('install', $res); + } + + echo install_fin_html(); +} + +// http://doc.spip.org/@liste_statuts_ldap +function liste_statuts_ldap() { + $recom = array("info_administrateurs" => ("" ._T('info_administrateur_1')." "._T('info_administrateur_2')."
"), + "info_redacteurs" => (""._T('info_redacteur_1')." "._T('info_redacteur_2')."
"), + "info_visiteurs" => (""._T('info_visiteur_1')." "._T('info_visiteur_2')."
")); + + $res = array(); + foreach($GLOBALS['liste_des_statuts'] as $k => $v) { + if (isset($recom[$k])) $res[$v] = $recom[$k]; + } + return $res; +} + +function install_ldap_correspondances() +{ + $champs = array(); + foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : array() as $champ => $v ) { + $nom = 'ldap_' . $champ; + $val = is_array($v) ? join(',', $v) : strval($v); + $champs[$nom]= array( + 'label' => _T('ldap_correspondance', array('champ' => "$champ")).'
', + 'valeur' => $val + ); + } + + return !$champs ? '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '

'); +} +?>