@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 19 | - return; |
|
| 19 | + return; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -25,20 +25,20 @@ discard block |
||
| 25 | 25 | * @uses info_copyright() |
| 26 | 26 | **/ |
| 27 | 27 | function install_etape__dist() { |
| 28 | - utiliser_langue_visiteur(); |
|
| 29 | - $menu_langues = menu_langues('var_lang_ecrire'); |
|
| 30 | - if (!$menu_langues) { |
|
| 31 | - redirige_url_ecrire('install', 'etape=chmod'); |
|
| 32 | - } else { |
|
| 33 | - include_spip('inc/presentation'); // pour info_copyright |
|
| 28 | + utiliser_langue_visiteur(); |
|
| 29 | + $menu_langues = menu_langues('var_lang_ecrire'); |
|
| 30 | + if (!$menu_langues) { |
|
| 31 | + redirige_url_ecrire('install', 'etape=chmod'); |
|
| 32 | + } else { |
|
| 33 | + include_spip('inc/presentation'); // pour info_copyright |
|
| 34 | 34 | |
| 35 | - $res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" . |
|
| 36 | - "<p class='small'>" . info_copyright() . "</p></div>\n" . |
|
| 37 | - '<p>' . _T('install_select_langue') . '</p>' . |
|
| 38 | - '<div>' . $menu_langues . "</div>\n" . |
|
| 39 | - generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant()); |
|
| 35 | + $res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" . |
|
| 36 | + "<p class='small'>" . info_copyright() . "</p></div>\n" . |
|
| 37 | + '<p>' . _T('install_select_langue') . '</p>' . |
|
| 38 | + '<div>' . $menu_langues . "</div>\n" . |
|
| 39 | + generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant()); |
|
| 40 | 40 | |
| 41 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 42 | - echo $minipage->page($res); |
|
| 43 | - } |
|
| 41 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 42 | + echo $minipage->page($res); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -32,11 +32,11 @@ |
||
| 32 | 32 | } else { |
| 33 | 33 | include_spip('inc/presentation'); // pour info_copyright |
| 34 | 34 | |
| 35 | - $res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='" . chemin_image('logo-spip.png') . "' />\n" . |
|
| 36 | - "<p class='small'>" . info_copyright() . "</p></div>\n" . |
|
| 37 | - '<p>' . _T('install_select_langue') . '</p>' . |
|
| 38 | - '<div>' . $menu_langues . "</div>\n" . |
|
| 39 | - generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />" . bouton_suivant()); |
|
| 35 | + $res = "<div class='petit-centre'><img alt='SPIP' class='logo' src='".chemin_image('logo-spip.png')."' />\n". |
|
| 36 | + "<p class='small'>".info_copyright()."</p></div>\n". |
|
| 37 | + '<p>'._T('install_select_langue').'</p>'. |
|
| 38 | + '<div>'.$menu_langues."</div>\n". |
|
| 39 | + generer_form_ecrire('install', "<input type='hidden' name='etape' value='chmod' />".bouton_suivant()); |
|
| 40 | 40 | |
| 41 | 41 | $minipage = new Spip\Afficher\Minipage\Installation(); |
| 42 | 42 | echo $minipage->page($res); |
@@ -10,77 +10,77 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function install_etape_ldap3_dist() { |
| 17 | - $info = []; |
|
| 18 | - $adresse_ldap = _request('adresse_ldap'); |
|
| 19 | - $login_ldap = _request('login_ldap'); |
|
| 20 | - $pass_ldap = _request('pass_ldap'); |
|
| 21 | - $port_ldap = _request('port_ldap'); |
|
| 17 | + $info = []; |
|
| 18 | + $adresse_ldap = _request('adresse_ldap'); |
|
| 19 | + $login_ldap = _request('login_ldap'); |
|
| 20 | + $pass_ldap = _request('pass_ldap'); |
|
| 21 | + $port_ldap = _request('port_ldap'); |
|
| 22 | 22 | |
| 23 | - $base_ldap_text = defined('_INSTALL_BASE_LDAP') |
|
| 24 | - ? _INSTALL_BASE_LDAP |
|
| 25 | - : 'ou=users, dc=mon-domaine, dc=com'; |
|
| 23 | + $base_ldap_text = defined('_INSTALL_BASE_LDAP') |
|
| 24 | + ? _INSTALL_BASE_LDAP |
|
| 25 | + : 'ou=users, dc=mon-domaine, dc=com'; |
|
| 26 | 26 | |
| 27 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 28 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 27 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 28 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 29 | 29 | |
| 30 | - echo info_etape( |
|
| 31 | - _T('info_chemin_acces_1'), |
|
| 32 | - info_progression_etape(3, 'etape_ldap', 'install/') |
|
| 33 | - ), |
|
| 34 | - _T('info_chemin_acces_2'); |
|
| 30 | + echo info_etape( |
|
| 31 | + _T('info_chemin_acces_1'), |
|
| 32 | + info_progression_etape(3, 'etape_ldap', 'install/') |
|
| 33 | + ), |
|
| 34 | + _T('info_chemin_acces_2'); |
|
| 35 | 35 | |
| 36 | - $ldap_link = @ldap_connect("$adresse_ldap", "$port_ldap"); |
|
| 37 | - if ($ldap_link) { |
|
| 38 | - @ldap_bind($ldap_link, "$login_ldap", "$pass_ldap"); |
|
| 39 | - $result = @ldap_read($ldap_link, '', 'objectclass=*', ['namingContexts']); |
|
| 40 | - $info = @ldap_get_entries($ldap_link, $result); |
|
| 41 | - @ldap_close($ldap_link); |
|
| 42 | - } |
|
| 36 | + $ldap_link = @ldap_connect("$adresse_ldap", "$port_ldap"); |
|
| 37 | + if ($ldap_link) { |
|
| 38 | + @ldap_bind($ldap_link, "$login_ldap", "$pass_ldap"); |
|
| 39 | + $result = @ldap_read($ldap_link, '', 'objectclass=*', ['namingContexts']); |
|
| 40 | + $info = @ldap_get_entries($ldap_link, $result); |
|
| 41 | + @ldap_close($ldap_link); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - $checked = false; |
|
| 45 | - $res = ''; |
|
| 46 | - if (is_array($info) and $info['count'] > 0) { |
|
| 47 | - $res .= '<p>' . _T('info_selection_chemin_acces') . '</p>'; |
|
| 48 | - $res .= '<ul>'; |
|
| 49 | - $n = 0; |
|
| 50 | - for ($i = 0; $i < $info['count']; $i++) { |
|
| 51 | - $names = $info[$i]['namingcontexts']; |
|
| 52 | - if (is_array($names)) { |
|
| 53 | - for ($j = 0; $j < $names['count']; $j++) { |
|
| 54 | - $n++; |
|
| 55 | - $res .= '<li><input name="base_ldap" value="' . spip_htmlspecialchars($names[$j]) . "\" type='radio' id='tab$n'"; |
|
| 56 | - if (!$checked) { |
|
| 57 | - $res .= ' checked="checked"'; |
|
| 58 | - $checked = true; |
|
| 59 | - } |
|
| 60 | - $res .= ' />'; |
|
| 61 | - $res .= "<label for='tab$n'>" . spip_htmlspecialchars($names[$j]) . "</label></li>\n"; |
|
| 62 | - } |
|
| 63 | - } |
|
| 64 | - } |
|
| 65 | - $res .= '</ul>'; |
|
| 66 | - $res .= _T('info_ou') . ' '; |
|
| 67 | - } |
|
| 68 | - $res .= "<br />\n<input name=\"base_ldap\" value=\"\" type='radio' id='manuel'"; |
|
| 69 | - if (!$checked) { |
|
| 70 | - $res .= ' checked="checked"'; |
|
| 71 | - $checked = true; |
|
| 72 | - } |
|
| 44 | + $checked = false; |
|
| 45 | + $res = ''; |
|
| 46 | + if (is_array($info) and $info['count'] > 0) { |
|
| 47 | + $res .= '<p>' . _T('info_selection_chemin_acces') . '</p>'; |
|
| 48 | + $res .= '<ul>'; |
|
| 49 | + $n = 0; |
|
| 50 | + for ($i = 0; $i < $info['count']; $i++) { |
|
| 51 | + $names = $info[$i]['namingcontexts']; |
|
| 52 | + if (is_array($names)) { |
|
| 53 | + for ($j = 0; $j < $names['count']; $j++) { |
|
| 54 | + $n++; |
|
| 55 | + $res .= '<li><input name="base_ldap" value="' . spip_htmlspecialchars($names[$j]) . "\" type='radio' id='tab$n'"; |
|
| 56 | + if (!$checked) { |
|
| 57 | + $res .= ' checked="checked"'; |
|
| 58 | + $checked = true; |
|
| 59 | + } |
|
| 60 | + $res .= ' />'; |
|
| 61 | + $res .= "<label for='tab$n'>" . spip_htmlspecialchars($names[$j]) . "</label></li>\n"; |
|
| 62 | + } |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | + $res .= '</ul>'; |
|
| 66 | + $res .= _T('info_ou') . ' '; |
|
| 67 | + } |
|
| 68 | + $res .= "<br />\n<input name=\"base_ldap\" value=\"\" type='radio' id='manuel'"; |
|
| 69 | + if (!$checked) { |
|
| 70 | + $res .= ' checked="checked"'; |
|
| 71 | + $checked = true; |
|
| 72 | + } |
|
| 73 | 73 | |
| 74 | - $res .= ' />' |
|
| 75 | - . "\n<label for='manuel'>" . _T('entree_chemin_acces') . '</label> ' |
|
| 76 | - . "\n<fieldset>" |
|
| 77 | - . "<input type='text' name='base_ldap_text' class='text' value=\"$base_ldap_text\" size='40' />" |
|
| 78 | - . "\n</fieldset>" |
|
| 79 | - . "\n<input type='hidden' name='etape' value='ldap4' />" |
|
| 80 | - . install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
|
| 81 | - . bouton_suivant(); |
|
| 74 | + $res .= ' />' |
|
| 75 | + . "\n<label for='manuel'>" . _T('entree_chemin_acces') . '</label> ' |
|
| 76 | + . "\n<fieldset>" |
|
| 77 | + . "<input type='text' name='base_ldap_text' class='text' value=\"$base_ldap_text\" size='40' />" |
|
| 78 | + . "\n</fieldset>" |
|
| 79 | + . "\n<input type='hidden' name='etape' value='ldap4' />" |
|
| 80 | + . install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
|
| 81 | + . bouton_suivant(); |
|
| 82 | 82 | |
| 83 | - echo generer_form_ecrire('install', $res); |
|
| 83 | + echo generer_form_ecrire('install', $res); |
|
| 84 | 84 | |
| 85 | - echo $minipage->installFinPage(); |
|
| 85 | + echo $minipage->installFinPage(); |
|
| 86 | 86 | } |
@@ -10,70 +10,70 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | include_spip('inc/headers'); |
| 17 | 17 | |
| 18 | 18 | function install_etape_4_dist() { |
| 19 | 19 | |
| 20 | - // creer le repertoire cache, qui sert partout ! |
|
| 21 | - if (!@file_exists(_DIR_CACHE)) { |
|
| 22 | - $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE); |
|
| 23 | - $rep = sous_repertoire(_DIR_TMP, $rep, true, true); |
|
| 24 | - } |
|
| 20 | + // creer le repertoire cache, qui sert partout ! |
|
| 21 | + if (!@file_exists(_DIR_CACHE)) { |
|
| 22 | + $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE); |
|
| 23 | + $rep = sous_repertoire(_DIR_TMP, $rep, true, true); |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 27 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 26 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 27 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 28 | 28 | |
| 29 | - echo info_progression_etape(4, 'etape_', 'install/'); |
|
| 29 | + echo info_progression_etape(4, 'etape_', 'install/'); |
|
| 30 | 30 | |
| 31 | - echo "<div class='success'><b>" |
|
| 32 | - . _T('info_derniere_etape') |
|
| 33 | - . '</b><p>' |
|
| 34 | - . _T('info_utilisation_spip') |
|
| 35 | - . '</p></div>'; |
|
| 31 | + echo "<div class='success'><b>" |
|
| 32 | + . _T('info_derniere_etape') |
|
| 33 | + . '</b><p>' |
|
| 34 | + . _T('info_utilisation_spip') |
|
| 35 | + . '</p></div>'; |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | - echo '<p>' |
|
| 39 | - . _T( |
|
| 40 | - 'plugin_info_plugins_dist_1', |
|
| 41 | - ['plugins_dist' => '<tt>' . joli_repertoire(_DIR_PLUGINS_DIST) . '</tt>'] |
|
| 42 | - ) |
|
| 43 | - . '</p>'; |
|
| 38 | + echo '<p>' |
|
| 39 | + . _T( |
|
| 40 | + 'plugin_info_plugins_dist_1', |
|
| 41 | + ['plugins_dist' => '<tt>' . joli_repertoire(_DIR_PLUGINS_DIST) . '</tt>'] |
|
| 42 | + ) |
|
| 43 | + . '</p>'; |
|
| 44 | 44 | |
| 45 | - // installer les extensions |
|
| 46 | - include_spip('inc/plugin'); |
|
| 47 | - $afficher = charger_fonction('afficher_liste', 'plugins'); |
|
| 48 | - echo $afficher( |
|
| 49 | - self(), |
|
| 50 | - liste_plugin_files(_DIR_PLUGINS_DIST), |
|
| 51 | - [], |
|
| 52 | - [], |
|
| 53 | - _DIR_PLUGINS_DIST, |
|
| 54 | - 'afficher_nom_plugin' |
|
| 55 | - ); |
|
| 45 | + // installer les extensions |
|
| 46 | + include_spip('inc/plugin'); |
|
| 47 | + $afficher = charger_fonction('afficher_liste', 'plugins'); |
|
| 48 | + echo $afficher( |
|
| 49 | + self(), |
|
| 50 | + liste_plugin_files(_DIR_PLUGINS_DIST), |
|
| 51 | + [], |
|
| 52 | + [], |
|
| 53 | + _DIR_PLUGINS_DIST, |
|
| 54 | + 'afficher_nom_plugin' |
|
| 55 | + ); |
|
| 56 | 56 | |
| 57 | - // si la base de SPIP est up, on peut installer les plugins, sinon on passe cette etape |
|
| 58 | - // car les plugins supposent que la base de SPIP est dans son etat normal (mise a jour) |
|
| 59 | - // au premier passage dans l'espace prive on aura une demande d'upgrade qui se poursuit sur la page plugin |
|
| 60 | - // et procede alors a l'installation |
|
| 61 | - if ( |
|
| 62 | - !isset($GLOBALS['meta']['version_installee']) |
|
| 63 | - or ($GLOBALS['spip_version_base'] == (str_replace(',', '.', $GLOBALS['meta']['version_installee']))) |
|
| 64 | - ) { |
|
| 65 | - plugin_installes_meta(); |
|
| 66 | - } |
|
| 57 | + // si la base de SPIP est up, on peut installer les plugins, sinon on passe cette etape |
|
| 58 | + // car les plugins supposent que la base de SPIP est dans son etat normal (mise a jour) |
|
| 59 | + // au premier passage dans l'espace prive on aura une demande d'upgrade qui se poursuit sur la page plugin |
|
| 60 | + // et procede alors a l'installation |
|
| 61 | + if ( |
|
| 62 | + !isset($GLOBALS['meta']['version_installee']) |
|
| 63 | + or ($GLOBALS['spip_version_base'] == (str_replace(',', '.', $GLOBALS['meta']['version_installee']))) |
|
| 64 | + ) { |
|
| 65 | + plugin_installes_meta(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - // mettre a jour si necessaire l'adresse du site |
|
| 69 | - // securite si on arrive plus a se loger |
|
| 70 | - include_spip('inc/config'); |
|
| 71 | - appliquer_adresse_site(''); |
|
| 68 | + // mettre a jour si necessaire l'adresse du site |
|
| 69 | + // securite si on arrive plus a se loger |
|
| 70 | + include_spip('inc/config'); |
|
| 71 | + appliquer_adresse_site(''); |
|
| 72 | 72 | |
| 73 | - // aller a la derniere etape qui clos l'install et redirige |
|
| 74 | - $suite = "\n<input type='hidden' name='etape' value='fin' />" |
|
| 75 | - . bouton_suivant(_T('login_espace_prive')); |
|
| 73 | + // aller a la derniere etape qui clos l'install et redirige |
|
| 74 | + $suite = "\n<input type='hidden' name='etape' value='fin' />" |
|
| 75 | + . bouton_suivant(_T('login_espace_prive')); |
|
| 76 | 76 | |
| 77 | - echo generer_form_ecrire('install', $suite); |
|
| 78 | - echo $minipage->installFinPage(); |
|
| 77 | + echo generer_form_ecrire('install', $suite); |
|
| 78 | + echo $minipage->installFinPage(); |
|
| 79 | 79 | } |
@@ -10,97 +10,97 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | include_spip('auth/ldap'); |
| 17 | 17 | |
| 18 | 18 | function install_etape_ldap4_dist() { |
| 19 | - $adresse_ldap = _request('adresse_ldap'); |
|
| 20 | - $login_ldap = _request('login_ldap'); |
|
| 21 | - $pass_ldap = _request('pass_ldap'); |
|
| 22 | - $port_ldap = _request('port_ldap'); |
|
| 23 | - $base_ldap = _request('base_ldap'); |
|
| 24 | - $base_ldap_text = _request('base_ldap_text'); |
|
| 25 | - if (!$base_ldap) { |
|
| 26 | - $base_ldap = $base_ldap_text; |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 30 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 31 | - |
|
| 32 | - $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
|
| 33 | - @ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
|
| 34 | - |
|
| 35 | - // Essayer de verifier le chemin fourni |
|
| 36 | - $r = @ldap_compare($ldap_link, $base_ldap, 'objectClass', ''); |
|
| 37 | - $fail = (ldap_errno($ldap_link) == 32); |
|
| 38 | - |
|
| 39 | - if ($fail) { |
|
| 40 | - echo info_etape(_T('info_chemin_acces_annuaire')), |
|
| 41 | - info_progression_etape(3, 'etape_ldap', 'install/', true), |
|
| 42 | - "<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'), |
|
| 43 | - ' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>'; |
|
| 44 | - } else { |
|
| 45 | - info_etape(_T('info_reglage_ldap')); |
|
| 46 | - echo info_progression_etape(4, 'etape_ldap', 'install/'); |
|
| 47 | - |
|
| 48 | - $statuts = liste_statuts_ldap(); |
|
| 49 | - $statut_ldap = defined('_INSTALL_STATUT_LDAP') |
|
| 50 | - ? _INSTALL_STATUT_LDAP |
|
| 51 | - : $GLOBALS['liste_des_statuts']['info_redacteurs']; |
|
| 52 | - |
|
| 53 | - |
|
| 54 | - $res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
|
| 55 | - . "<input type='hidden' name='etape' value='ldap5' />" |
|
| 56 | - . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" |
|
| 57 | - . fieldset( |
|
| 58 | - _T('info_statut_utilisateurs_1'), |
|
| 59 | - [ |
|
| 60 | - 'statut_ldap' => [ |
|
| 61 | - 'label' => _T('info_statut_utilisateurs_2') . '<br />', |
|
| 62 | - 'valeur' => $statut_ldap, |
|
| 63 | - 'alternatives' => $statuts |
|
| 64 | - ] |
|
| 65 | - ] |
|
| 66 | - ) |
|
| 67 | - . install_ldap_correspondances() |
|
| 68 | - . bouton_suivant(); |
|
| 69 | - |
|
| 70 | - echo generer_form_ecrire('install', $res); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - echo $minipage->installFinPage(); |
|
| 19 | + $adresse_ldap = _request('adresse_ldap'); |
|
| 20 | + $login_ldap = _request('login_ldap'); |
|
| 21 | + $pass_ldap = _request('pass_ldap'); |
|
| 22 | + $port_ldap = _request('port_ldap'); |
|
| 23 | + $base_ldap = _request('base_ldap'); |
|
| 24 | + $base_ldap_text = _request('base_ldap_text'); |
|
| 25 | + if (!$base_ldap) { |
|
| 26 | + $base_ldap = $base_ldap_text; |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 30 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 31 | + |
|
| 32 | + $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
|
| 33 | + @ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
|
| 34 | + |
|
| 35 | + // Essayer de verifier le chemin fourni |
|
| 36 | + $r = @ldap_compare($ldap_link, $base_ldap, 'objectClass', ''); |
|
| 37 | + $fail = (ldap_errno($ldap_link) == 32); |
|
| 38 | + |
|
| 39 | + if ($fail) { |
|
| 40 | + echo info_etape(_T('info_chemin_acces_annuaire')), |
|
| 41 | + info_progression_etape(3, 'etape_ldap', 'install/', true), |
|
| 42 | + "<div class='error'><p><b>" . _T('avis_operation_echec') . '</b></p><p>' . _T('avis_chemin_invalide_1'), |
|
| 43 | + ' (<tt>' . spip_htmlspecialchars($base_ldap) . '</tt>) ' . _T('avis_chemin_invalide_2') . '</p></div>'; |
|
| 44 | + } else { |
|
| 45 | + info_etape(_T('info_reglage_ldap')); |
|
| 46 | + echo info_progression_etape(4, 'etape_ldap', 'install/'); |
|
| 47 | + |
|
| 48 | + $statuts = liste_statuts_ldap(); |
|
| 49 | + $statut_ldap = defined('_INSTALL_STATUT_LDAP') |
|
| 50 | + ? _INSTALL_STATUT_LDAP |
|
| 51 | + : $GLOBALS['liste_des_statuts']['info_redacteurs']; |
|
| 52 | + |
|
| 53 | + |
|
| 54 | + $res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
|
| 55 | + . "<input type='hidden' name='etape' value='ldap5' />" |
|
| 56 | + . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" |
|
| 57 | + . fieldset( |
|
| 58 | + _T('info_statut_utilisateurs_1'), |
|
| 59 | + [ |
|
| 60 | + 'statut_ldap' => [ |
|
| 61 | + 'label' => _T('info_statut_utilisateurs_2') . '<br />', |
|
| 62 | + 'valeur' => $statut_ldap, |
|
| 63 | + 'alternatives' => $statuts |
|
| 64 | + ] |
|
| 65 | + ] |
|
| 66 | + ) |
|
| 67 | + . install_ldap_correspondances() |
|
| 68 | + . bouton_suivant(); |
|
| 69 | + |
|
| 70 | + echo generer_form_ecrire('install', $res); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + echo $minipage->installFinPage(); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | function liste_statuts_ldap() { |
| 77 | - $recom = [ |
|
| 78 | - 'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'), |
|
| 79 | - 'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'), |
|
| 80 | - 'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />') |
|
| 81 | - ]; |
|
| 82 | - |
|
| 83 | - $res = []; |
|
| 84 | - foreach ($GLOBALS['liste_des_statuts'] as $k => $v) { |
|
| 85 | - if (isset($recom[$k])) { |
|
| 86 | - $res[$v] = $recom[$k]; |
|
| 87 | - } |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - return $res; |
|
| 77 | + $recom = [ |
|
| 78 | + 'info_administrateurs' => ('<b>' . _T('info_administrateur_1') . '</b> ' . _T('info_administrateur_2') . '<br />'), |
|
| 79 | + 'info_redacteurs' => ('<b>' . _T('info_redacteur_1') . '</b> ' . _T('info_redacteur_2') . '<br />'), |
|
| 80 | + 'info_visiteurs' => ('<b>' . _T('info_visiteur_1') . '</b> ' . _T('info_visiteur_2') . '<br />') |
|
| 81 | + ]; |
|
| 82 | + |
|
| 83 | + $res = []; |
|
| 84 | + foreach ($GLOBALS['liste_des_statuts'] as $k => $v) { |
|
| 85 | + if (isset($recom[$k])) { |
|
| 86 | + $res[$v] = $recom[$k]; |
|
| 87 | + } |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + return $res; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | function install_ldap_correspondances() { |
| 94 | - $champs = []; |
|
| 95 | - foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) { |
|
| 96 | - $nom = 'ldap_' . $champ; |
|
| 97 | - $val = is_array($v) ? join(',', $v) : strval($v); |
|
| 98 | - $champs[$nom] = [ |
|
| 99 | - 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 100 | - 'valeur' => $val |
|
| 101 | - ]; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return !$champs ? |
|
| 105 | - '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />'); |
|
| 94 | + $champs = []; |
|
| 95 | + foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) { |
|
| 96 | + $nom = 'ldap_' . $champ; |
|
| 97 | + $val = is_array($v) ? join(',', $v) : strval($v); |
|
| 98 | + $champs[$nom] = [ |
|
| 99 | + 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 100 | + 'valeur' => $val |
|
| 101 | + ]; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return !$champs ? |
|
| 105 | + '' : fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />'); |
|
| 106 | 106 | } |
@@ -10,168 +10,168 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | include_spip('base/abstract_sql'); |
| 17 | 17 | |
| 18 | 18 | function install_etape_2_dist() { |
| 19 | - $adresse_db = defined('_INSTALL_HOST_DB') |
|
| 20 | - ? _INSTALL_HOST_DB |
|
| 21 | - : _request('adresse_db'); |
|
| 19 | + $adresse_db = defined('_INSTALL_HOST_DB') |
|
| 20 | + ? _INSTALL_HOST_DB |
|
| 21 | + : _request('adresse_db'); |
|
| 22 | 22 | |
| 23 | - if (preg_match(',(.*):(.*),', $adresse_db, $r)) { |
|
| 24 | - [, $adresse_db, $port] = $r; |
|
| 25 | - } else { |
|
| 26 | - $port = ''; |
|
| 27 | - } |
|
| 23 | + if (preg_match(',(.*):(.*),', $adresse_db, $r)) { |
|
| 24 | + [, $adresse_db, $port] = $r; |
|
| 25 | + } else { |
|
| 26 | + $port = ''; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - $login_db = defined('_INSTALL_USER_DB') |
|
| 30 | - ? _INSTALL_USER_DB |
|
| 31 | - : _request('login_db'); |
|
| 29 | + $login_db = defined('_INSTALL_USER_DB') |
|
| 30 | + ? _INSTALL_USER_DB |
|
| 31 | + : _request('login_db'); |
|
| 32 | 32 | |
| 33 | - $pass_db = defined('_INSTALL_PASS_DB') |
|
| 34 | - ? _INSTALL_PASS_DB |
|
| 35 | - : _request('pass_db'); |
|
| 33 | + $pass_db = defined('_INSTALL_PASS_DB') |
|
| 34 | + ? _INSTALL_PASS_DB |
|
| 35 | + : _request('pass_db'); |
|
| 36 | 36 | |
| 37 | - $server_db = defined('_INSTALL_SERVER_DB') |
|
| 38 | - ? _INSTALL_SERVER_DB |
|
| 39 | - : _request('server_db'); |
|
| 37 | + $server_db = defined('_INSTALL_SERVER_DB') |
|
| 38 | + ? _INSTALL_SERVER_DB |
|
| 39 | + : _request('server_db'); |
|
| 40 | 40 | |
| 41 | - $name_db = defined('_INSTALL_NAME_DB') |
|
| 42 | - ? _INSTALL_NAME_DB |
|
| 43 | - : ''; |
|
| 41 | + $name_db = defined('_INSTALL_NAME_DB') |
|
| 42 | + ? _INSTALL_NAME_DB |
|
| 43 | + : ''; |
|
| 44 | 44 | |
| 45 | - $chmod = _request('chmod'); |
|
| 45 | + $chmod = _request('chmod'); |
|
| 46 | 46 | |
| 47 | - $link = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $name_db, $server_db); |
|
| 48 | - $GLOBALS['connexions'][$server_db] = $link; |
|
| 47 | + $link = spip_connect_db($adresse_db, $port, $login_db, $pass_db, $name_db, $server_db); |
|
| 48 | + $GLOBALS['connexions'][$server_db] = $link; |
|
| 49 | 49 | |
| 50 | - $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
|
| 51 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 50 | + $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
|
| 51 | + = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 52 | 52 | |
| 53 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 54 | - echo $minipage->installDebutPage(); |
|
| 53 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 54 | + echo $minipage->installDebutPage(); |
|
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | // prenons toutes les dispositions possibles pour que rien ne s'affiche ! |
| 58 | 58 | |
| 59 | - /* |
|
| 59 | + /* |
|
| 60 | 60 | * /!\ sqlite3/PDO : erreur sur join(', ', $link) |
| 61 | 61 | * L'objet PDO ne peut pas etre transformee en chaine |
| 62 | 62 | * Un echo $link ne fonctionne pas non plus |
| 63 | 63 | * Il faut utiliser par exemple print_r($link) |
| 64 | 64 | */ |
| 65 | - //echo "\n<!--\n", join(', ', $link), " $login_db "; |
|
| 66 | - $db_connect = 0; // revoirfunction_exists($ferrno) ? $ferrno() : 0; |
|
| 67 | - //echo join(', ', $GLOBALS['connexions'][$server_db]); |
|
| 68 | - //echo "\n-->\n"; |
|
| 65 | + //echo "\n<!--\n", join(', ', $link), " $login_db "; |
|
| 66 | + $db_connect = 0; // revoirfunction_exists($ferrno) ? $ferrno() : 0; |
|
| 67 | + //echo join(', ', $GLOBALS['connexions'][$server_db]); |
|
| 68 | + //echo "\n-->\n"; |
|
| 69 | 69 | |
| 70 | - if (($db_connect == '0') && $link) { |
|
| 71 | - echo "<div class='success'><b>" . _T('info_connexion_ok') . '</b></div>'; |
|
| 72 | - echo info_progression_etape(2, 'etape_', 'install/'); |
|
| 70 | + if (($db_connect == '0') && $link) { |
|
| 71 | + echo "<div class='success'><b>" . _T('info_connexion_ok') . '</b></div>'; |
|
| 72 | + echo info_progression_etape(2, 'etape_', 'install/'); |
|
| 73 | 73 | |
| 74 | - echo info_etape(_T('menu_aide_installation_choix_base') . aider('install2', true)); |
|
| 74 | + echo info_etape(_T('menu_aide_installation_choix_base') . aider('install2', true)); |
|
| 75 | 75 | |
| 76 | - echo "\n", '<!-- ', sql_version($server_db), ' -->'; |
|
| 77 | - [$checked, $res] = install_etape_2_bases($login_db, $server_db); |
|
| 76 | + echo "\n", '<!-- ', sql_version($server_db), ' -->'; |
|
| 77 | + [$checked, $res] = install_etape_2_bases($login_db, $server_db); |
|
| 78 | 78 | |
| 79 | - $hidden = (defined('_SPIP_CHMOD') |
|
| 80 | - ? '' |
|
| 81 | - : ("\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />")) |
|
| 82 | - . predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db); |
|
| 79 | + $hidden = (defined('_SPIP_CHMOD') |
|
| 80 | + ? '' |
|
| 81 | + : ("\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />")) |
|
| 82 | + . predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db); |
|
| 83 | 83 | |
| 84 | - echo install_etape_2_form($hidden, $checked, $res, 3); |
|
| 85 | - } else { |
|
| 86 | - echo info_progression_etape(1, 'etape_', 'install/', true); |
|
| 84 | + echo install_etape_2_form($hidden, $checked, $res, 3); |
|
| 85 | + } else { |
|
| 86 | + echo info_progression_etape(1, 'etape_', 'install/', true); |
|
| 87 | 87 | |
| 88 | - echo "<div class='error'>"; |
|
| 89 | - echo info_etape(_T('info_connexion_base')); |
|
| 90 | - echo '<h3>' . _T('avis_connexion_echec_1') . '</h3>'; |
|
| 91 | - echo '<p>' . _T('avis_connexion_echec_2') . '</p>'; |
|
| 88 | + echo "<div class='error'>"; |
|
| 89 | + echo info_etape(_T('info_connexion_base')); |
|
| 90 | + echo '<h3>' . _T('avis_connexion_echec_1') . '</h3>'; |
|
| 91 | + echo '<p>' . _T('avis_connexion_echec_2') . '</p>'; |
|
| 92 | 92 | |
| 93 | - echo "<p style='font-size: small;'>", |
|
| 94 | - _T('avis_connexion_echec_3'), |
|
| 95 | - '</p></div>'; |
|
| 96 | - } |
|
| 93 | + echo "<p style='font-size: small;'>", |
|
| 94 | + _T('avis_connexion_echec_3'), |
|
| 95 | + '</p></div>'; |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - echo $minipage->installFinPage(); |
|
| 98 | + echo $minipage->installFinPage(); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Liste les bases accessibles, |
| 102 | 102 | // avec une heuristique pour preselectionner la plus probable |
| 103 | 103 | |
| 104 | 104 | function install_etape_2_bases($login_db, $server_db) { |
| 105 | - $res = install_etape_liste_bases($server_db, $login_db); |
|
| 106 | - if ($res) { |
|
| 107 | - [$checked, $bases] = $res; |
|
| 108 | - |
|
| 109 | - return [ |
|
| 110 | - $checked, |
|
| 111 | - "<label for='choix_db'><b>" |
|
| 112 | - . _T('texte_choix_base_2') |
|
| 113 | - . '</b><br />' |
|
| 114 | - . _T('texte_choix_base_3') |
|
| 115 | - . '</label>' |
|
| 116 | - . "<ul>\n<li>" |
|
| 117 | - . join("</li>\n<li>", $bases) |
|
| 118 | - . "</li>\n</ul><p>" |
|
| 119 | - . _T('info_ou') |
|
| 120 | - . ' ' |
|
| 121 | - ]; |
|
| 122 | - } |
|
| 123 | - $res = '<b>' . _T('avis_lecture_noms_bases_1') . '</b> |
|
| 105 | + $res = install_etape_liste_bases($server_db, $login_db); |
|
| 106 | + if ($res) { |
|
| 107 | + [$checked, $bases] = $res; |
|
| 108 | + |
|
| 109 | + return [ |
|
| 110 | + $checked, |
|
| 111 | + "<label for='choix_db'><b>" |
|
| 112 | + . _T('texte_choix_base_2') |
|
| 113 | + . '</b><br />' |
|
| 114 | + . _T('texte_choix_base_3') |
|
| 115 | + . '</label>' |
|
| 116 | + . "<ul>\n<li>" |
|
| 117 | + . join("</li>\n<li>", $bases) |
|
| 118 | + . "</li>\n</ul><p>" |
|
| 119 | + . _T('info_ou') |
|
| 120 | + . ' ' |
|
| 121 | + ]; |
|
| 122 | + } |
|
| 123 | + $res = '<b>' . _T('avis_lecture_noms_bases_1') . '</b> |
|
| 124 | 124 | ' . _T('avis_lecture_noms_bases_2') . '<p>'; |
| 125 | 125 | |
| 126 | - $checked = false; |
|
| 127 | - if ($login_db) { |
|
| 128 | - // Si un login comporte un point, le nom de la base est plus |
|
| 129 | - // probablement le login sans le point -- testons pour savoir |
|
| 130 | - $test_base = $login_db; |
|
| 131 | - $ok = sql_selectdb($test_base, $server_db); |
|
| 132 | - $test_base2 = str_replace('.', '_', $test_base); |
|
| 133 | - if (sql_selectdb($test_base2, $server_db)) { |
|
| 134 | - $test_base = $test_base2; |
|
| 135 | - $ok = true; |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - if ($ok) { |
|
| 139 | - $res .= _T('avis_lecture_noms_bases_3') |
|
| 140 | - . '<ul>' |
|
| 141 | - . '<li><input name="choix_db" value="' . $test_base . "\" type='radio' id='stand' checked='checked' />" |
|
| 142 | - . "<label for='stand'>" . $test_base . "</label></li>\n" |
|
| 143 | - . '</ul>' |
|
| 144 | - . '<p>' . _T('info_ou') . ' '; |
|
| 145 | - $checked = true; |
|
| 146 | - } |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - return [$checked, $res]; |
|
| 126 | + $checked = false; |
|
| 127 | + if ($login_db) { |
|
| 128 | + // Si un login comporte un point, le nom de la base est plus |
|
| 129 | + // probablement le login sans le point -- testons pour savoir |
|
| 130 | + $test_base = $login_db; |
|
| 131 | + $ok = sql_selectdb($test_base, $server_db); |
|
| 132 | + $test_base2 = str_replace('.', '_', $test_base); |
|
| 133 | + if (sql_selectdb($test_base2, $server_db)) { |
|
| 134 | + $test_base = $test_base2; |
|
| 135 | + $ok = true; |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + if ($ok) { |
|
| 139 | + $res .= _T('avis_lecture_noms_bases_3') |
|
| 140 | + . '<ul>' |
|
| 141 | + . '<li><input name="choix_db" value="' . $test_base . "\" type='radio' id='stand' checked='checked' />" |
|
| 142 | + . "<label for='stand'>" . $test_base . "</label></li>\n" |
|
| 143 | + . '</ul>' |
|
| 144 | + . '<p>' . _T('info_ou') . ' '; |
|
| 145 | + $checked = true; |
|
| 146 | + } |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + return [$checked, $res]; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | function install_etape_2_form($hidden, $checked, $res, $etape) { |
| 153 | - return generer_form_ecrire('install', ( |
|
| 154 | - "\n<input type='hidden' name='etape' value='$etape' />" |
|
| 155 | - . $hidden |
|
| 156 | - . (defined('_INSTALL_NAME_DB') |
|
| 157 | - ? '<h3>' . _T('install_nom_base_hebergeur') . ' <tt>' . _INSTALL_NAME_DB . '</tt>' . '</h3>' |
|
| 158 | - : "\n<fieldset><legend>" . _T('texte_choix_base_1') . "</legend>\n" |
|
| 159 | - . $res |
|
| 160 | - . "\n<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'" |
|
| 161 | - . ($checked ? '' : " checked='checked'") |
|
| 162 | - . " />\n<label for='nou'>" . _T('info_creer_base') . "</label></p>\n<p>" |
|
| 163 | - . "\n<input type='text' name='table_new' class='text' value=\"spip\" size='20' /></p></fieldset>\n" |
|
| 164 | - ) |
|
| 165 | - |
|
| 166 | - . ((defined('_INSTALL_TABLE_PREFIX') |
|
| 167 | - or $GLOBALS['table_prefix'] != 'spip') |
|
| 168 | - ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 169 | - : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 170 | - . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 171 | - . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
|
| 172 | - . 'spip' # valeur par defaut |
|
| 173 | - . "' size='20' /></p></fieldset>" |
|
| 174 | - ) |
|
| 175 | - |
|
| 176 | - . bouton_suivant())); |
|
| 153 | + return generer_form_ecrire('install', ( |
|
| 154 | + "\n<input type='hidden' name='etape' value='$etape' />" |
|
| 155 | + . $hidden |
|
| 156 | + . (defined('_INSTALL_NAME_DB') |
|
| 157 | + ? '<h3>' . _T('install_nom_base_hebergeur') . ' <tt>' . _INSTALL_NAME_DB . '</tt>' . '</h3>' |
|
| 158 | + : "\n<fieldset><legend>" . _T('texte_choix_base_1') . "</legend>\n" |
|
| 159 | + . $res |
|
| 160 | + . "\n<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'" |
|
| 161 | + . ($checked ? '' : " checked='checked'") |
|
| 162 | + . " />\n<label for='nou'>" . _T('info_creer_base') . "</label></p>\n<p>" |
|
| 163 | + . "\n<input type='text' name='table_new' class='text' value=\"spip\" size='20' /></p></fieldset>\n" |
|
| 164 | + ) |
|
| 165 | + |
|
| 166 | + . ((defined('_INSTALL_TABLE_PREFIX') |
|
| 167 | + or $GLOBALS['table_prefix'] != 'spip') |
|
| 168 | + ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 169 | + : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 170 | + . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 171 | + . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
|
| 172 | + . 'spip' # valeur par defaut |
|
| 173 | + . "' size='20' /></p></fieldset>" |
|
| 174 | + ) |
|
| 175 | + |
|
| 176 | + . bouton_suivant())); |
|
| 177 | 177 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $GLOBALS['connexions'][$server_db] = $link; |
| 49 | 49 | |
| 50 | 50 | $GLOBALS['connexions'][$server_db][$GLOBALS['spip_sql_version']] |
| 51 | - = $GLOBALS['spip_' . $server_db . '_functions_' . $GLOBALS['spip_sql_version']]; |
|
| 51 | + = $GLOBALS['spip_'.$server_db.'_functions_'.$GLOBALS['spip_sql_version']]; |
|
| 52 | 52 | |
| 53 | 53 | $minipage = new Spip\Afficher\Minipage\Installation(); |
| 54 | 54 | echo $minipage->installDebutPage(); |
@@ -68,18 +68,18 @@ discard block |
||
| 68 | 68 | //echo "\n-->\n"; |
| 69 | 69 | |
| 70 | 70 | if (($db_connect == '0') && $link) { |
| 71 | - echo "<div class='success'><b>" . _T('info_connexion_ok') . '</b></div>'; |
|
| 71 | + echo "<div class='success'><b>"._T('info_connexion_ok').'</b></div>'; |
|
| 72 | 72 | echo info_progression_etape(2, 'etape_', 'install/'); |
| 73 | 73 | |
| 74 | - echo info_etape(_T('menu_aide_installation_choix_base') . aider('install2', true)); |
|
| 74 | + echo info_etape(_T('menu_aide_installation_choix_base').aider('install2', true)); |
|
| 75 | 75 | |
| 76 | 76 | echo "\n", '<!-- ', sql_version($server_db), ' -->'; |
| 77 | 77 | [$checked, $res] = install_etape_2_bases($login_db, $server_db); |
| 78 | 78 | |
| 79 | 79 | $hidden = (defined('_SPIP_CHMOD') |
| 80 | 80 | ? '' |
| 81 | - : ("\n<input type='hidden' name='chmod' value='" . spip_htmlspecialchars($chmod) . "' />")) |
|
| 82 | - . predef_ou_cache($adresse_db . ($port ? ':' . $port : ''), $login_db, $pass_db, $server_db); |
|
| 81 | + : ("\n<input type='hidden' name='chmod' value='".spip_htmlspecialchars($chmod)."' />")) |
|
| 82 | + . predef_ou_cache($adresse_db.($port ? ':'.$port : ''), $login_db, $pass_db, $server_db); |
|
| 83 | 83 | |
| 84 | 84 | echo install_etape_2_form($hidden, $checked, $res, 3); |
| 85 | 85 | } else { |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | echo "<div class='error'>"; |
| 89 | 89 | echo info_etape(_T('info_connexion_base')); |
| 90 | - echo '<h3>' . _T('avis_connexion_echec_1') . '</h3>'; |
|
| 91 | - echo '<p>' . _T('avis_connexion_echec_2') . '</p>'; |
|
| 90 | + echo '<h3>'._T('avis_connexion_echec_1').'</h3>'; |
|
| 91 | + echo '<p>'._T('avis_connexion_echec_2').'</p>'; |
|
| 92 | 92 | |
| 93 | 93 | echo "<p style='font-size: small;'>", |
| 94 | 94 | _T('avis_connexion_echec_3'), |
@@ -120,8 +120,8 @@ discard block |
||
| 120 | 120 | . ' ' |
| 121 | 121 | ]; |
| 122 | 122 | } |
| 123 | - $res = '<b>' . _T('avis_lecture_noms_bases_1') . '</b> |
|
| 124 | - ' . _T('avis_lecture_noms_bases_2') . '<p>'; |
|
| 123 | + $res = '<b>'._T('avis_lecture_noms_bases_1').'</b> |
|
| 124 | + ' . _T('avis_lecture_noms_bases_2').'<p>'; |
|
| 125 | 125 | |
| 126 | 126 | $checked = false; |
| 127 | 127 | if ($login_db) { |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | if ($ok) { |
| 139 | 139 | $res .= _T('avis_lecture_noms_bases_3') |
| 140 | 140 | . '<ul>' |
| 141 | - . '<li><input name="choix_db" value="' . $test_base . "\" type='radio' id='stand' checked='checked' />" |
|
| 142 | - . "<label for='stand'>" . $test_base . "</label></li>\n" |
|
| 141 | + . '<li><input name="choix_db" value="'.$test_base."\" type='radio' id='stand' checked='checked' />" |
|
| 142 | + . "<label for='stand'>".$test_base."</label></li>\n" |
|
| 143 | 143 | . '</ul>' |
| 144 | - . '<p>' . _T('info_ou') . ' '; |
|
| 144 | + . '<p>'._T('info_ou').' '; |
|
| 145 | 145 | $checked = true; |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -154,20 +154,20 @@ discard block |
||
| 154 | 154 | "\n<input type='hidden' name='etape' value='$etape' />" |
| 155 | 155 | . $hidden |
| 156 | 156 | . (defined('_INSTALL_NAME_DB') |
| 157 | - ? '<h3>' . _T('install_nom_base_hebergeur') . ' <tt>' . _INSTALL_NAME_DB . '</tt>' . '</h3>' |
|
| 158 | - : "\n<fieldset><legend>" . _T('texte_choix_base_1') . "</legend>\n" |
|
| 157 | + ? '<h3>'._T('install_nom_base_hebergeur').' <tt>'._INSTALL_NAME_DB.'</tt>'.'</h3>' |
|
| 158 | + : "\n<fieldset><legend>"._T('texte_choix_base_1')."</legend>\n" |
|
| 159 | 159 | . $res |
| 160 | 160 | . "\n<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'" |
| 161 | 161 | . ($checked ? '' : " checked='checked'") |
| 162 | - . " />\n<label for='nou'>" . _T('info_creer_base') . "</label></p>\n<p>" |
|
| 162 | + . " />\n<label for='nou'>"._T('info_creer_base')."</label></p>\n<p>" |
|
| 163 | 163 | . "\n<input type='text' name='table_new' class='text' value=\"spip\" size='20' /></p></fieldset>\n" |
| 164 | 164 | ) |
| 165 | 165 | |
| 166 | 166 | . ((defined('_INSTALL_TABLE_PREFIX') |
| 167 | 167 | or $GLOBALS['table_prefix'] != 'spip') |
| 168 | - ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 169 | - : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 170 | - . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 168 | + ? '<h3>'._T('install_table_prefix_hebergeur').' <tt>'.$GLOBALS['table_prefix'].'</tt>'.'</h3>' |
|
| 169 | + : '<fieldset><legend>'._T('texte_choix_table_prefix')."</legend>\n" |
|
| 170 | + . "<p><label for='table_prefix'>"._T('info_table_prefix').'</label></p><p>' |
|
| 171 | 171 | . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
| 172 | 172 | . 'spip' # valeur par defaut |
| 173 | 173 | . "' size='20' /></p></fieldset>" |
@@ -10,85 +10,85 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | include_spip('inc/headers'); |
| 16 | 16 | include_spip('auth/ldap'); |
| 17 | 17 | |
| 18 | 18 | function install_etape_ldap5_dist() { |
| 19 | - etape_ldap5_save(); |
|
| 20 | - etape_ldap5_suite(); |
|
| 19 | + etape_ldap5_save(); |
|
| 20 | + etape_ldap5_suite(); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | function etape_ldap5_save() { |
| 24 | - $conn = null; |
|
| 25 | - if (!@file_exists(_FILE_CONNECT_TMP)) { |
|
| 26 | - redirige_url_ecrire('install'); |
|
| 27 | - } |
|
| 24 | + $conn = null; |
|
| 25 | + if (!@file_exists(_FILE_CONNECT_TMP)) { |
|
| 26 | + redirige_url_ecrire('install'); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - ecrire_meta('ldap_statut_import', _request('statut_ldap')); |
|
| 29 | + ecrire_meta('ldap_statut_import', _request('statut_ldap')); |
|
| 30 | 30 | |
| 31 | - lire_fichier(_FILE_CONNECT_TMP, $conn); |
|
| 31 | + lire_fichier(_FILE_CONNECT_TMP, $conn); |
|
| 32 | 32 | |
| 33 | - if ($p = strpos($conn, "'');")) { |
|
| 34 | - ecrire_fichier( |
|
| 35 | - _FILE_CONNECT_TMP, |
|
| 36 | - substr($conn, 0, $p + 1) |
|
| 37 | - . _FILE_LDAP |
|
| 38 | - . substr($conn, $p + 1) |
|
| 39 | - ); |
|
| 40 | - } |
|
| 33 | + if ($p = strpos($conn, "'');")) { |
|
| 34 | + ecrire_fichier( |
|
| 35 | + _FILE_CONNECT_TMP, |
|
| 36 | + substr($conn, 0, $p + 1) |
|
| 37 | + . _FILE_LDAP |
|
| 38 | + . substr($conn, $p + 1) |
|
| 39 | + ); |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - $adresse_ldap = addcslashes(_request('adresse_ldap'), "'\\"); |
|
| 43 | - $login_ldap = addcslashes(_request('login_ldap'), "'\\"); |
|
| 44 | - $pass_ldap = addcslashes(_request('pass_ldap'), "'\\"); |
|
| 45 | - $port_ldap = addcslashes(_request('port_ldap'), "'\\"); |
|
| 46 | - $tls_ldap = addcslashes(_request('tls_ldap'), "'\\"); |
|
| 47 | - $protocole_ldap = addcslashes(_request('protocole_ldap'), "'\\"); |
|
| 48 | - $base_ldap = addcslashes(_request('base_ldap'), "'\\"); |
|
| 49 | - $base_ldap_text = addcslashes(_request('base_ldap_text'), "'\\"); |
|
| 42 | + $adresse_ldap = addcslashes(_request('adresse_ldap'), "'\\"); |
|
| 43 | + $login_ldap = addcslashes(_request('login_ldap'), "'\\"); |
|
| 44 | + $pass_ldap = addcslashes(_request('pass_ldap'), "'\\"); |
|
| 45 | + $port_ldap = addcslashes(_request('port_ldap'), "'\\"); |
|
| 46 | + $tls_ldap = addcslashes(_request('tls_ldap'), "'\\"); |
|
| 47 | + $protocole_ldap = addcslashes(_request('protocole_ldap'), "'\\"); |
|
| 48 | + $base_ldap = addcslashes(_request('base_ldap'), "'\\"); |
|
| 49 | + $base_ldap_text = addcslashes(_request('base_ldap_text'), "'\\"); |
|
| 50 | 50 | |
| 51 | - $conn = "\$GLOBALS['ldap_base'] = '$base_ldap';\n" |
|
| 52 | - . "\$GLOBALS['ldap_link'] = @ldap_connect('$adresse_ldap','$port_ldap');\n" |
|
| 53 | - . "@ldap_set_option(\$GLOBALS['ldap_link'],LDAP_OPT_PROTOCOL_VERSION,'$protocole_ldap');\n" |
|
| 54 | - . (($tls_ldap != 'oui') ? '' : |
|
| 55 | - "@ldap_start_tls(\$GLOBALS['ldap_link']);\n") |
|
| 56 | - . "@ldap_bind(\$GLOBALS['ldap_link'],'$login_ldap','$pass_ldap');\n"; |
|
| 51 | + $conn = "\$GLOBALS['ldap_base'] = '$base_ldap';\n" |
|
| 52 | + . "\$GLOBALS['ldap_link'] = @ldap_connect('$adresse_ldap','$port_ldap');\n" |
|
| 53 | + . "@ldap_set_option(\$GLOBALS['ldap_link'],LDAP_OPT_PROTOCOL_VERSION,'$protocole_ldap');\n" |
|
| 54 | + . (($tls_ldap != 'oui') ? '' : |
|
| 55 | + "@ldap_start_tls(\$GLOBALS['ldap_link']);\n") |
|
| 56 | + . "@ldap_bind(\$GLOBALS['ldap_link'],'$login_ldap','$pass_ldap');\n"; |
|
| 57 | 57 | |
| 58 | - $champs = is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : []; |
|
| 59 | - $res = ''; |
|
| 60 | - foreach ($champs as $champ => $v) { |
|
| 61 | - $nom = 'ldap_' . $champ; |
|
| 62 | - $val = trim(_request($nom)); |
|
| 63 | - if (preg_match('/^\w*$/', $val)) { |
|
| 64 | - if ($val) { |
|
| 65 | - $val = _q($val); |
|
| 66 | - } |
|
| 67 | - } else { |
|
| 68 | - $val = 'array(' . _q(preg_split('/\W+/', $val)) . ')'; |
|
| 69 | - }; |
|
| 70 | - if ($val) { |
|
| 71 | - $res .= "'$champ' => " . $val . ','; |
|
| 72 | - } |
|
| 73 | - } |
|
| 74 | - $conn .= "\$GLOBALS['ldap_champs'] = array($res);\n"; |
|
| 58 | + $champs = is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : []; |
|
| 59 | + $res = ''; |
|
| 60 | + foreach ($champs as $champ => $v) { |
|
| 61 | + $nom = 'ldap_' . $champ; |
|
| 62 | + $val = trim(_request($nom)); |
|
| 63 | + if (preg_match('/^\w*$/', $val)) { |
|
| 64 | + if ($val) { |
|
| 65 | + $val = _q($val); |
|
| 66 | + } |
|
| 67 | + } else { |
|
| 68 | + $val = 'array(' . _q(preg_split('/\W+/', $val)) . ')'; |
|
| 69 | + }; |
|
| 70 | + if ($val) { |
|
| 71 | + $res .= "'$champ' => " . $val . ','; |
|
| 72 | + } |
|
| 73 | + } |
|
| 74 | + $conn .= "\$GLOBALS['ldap_champs'] = array($res);\n"; |
|
| 75 | 75 | |
| 76 | - install_fichier_connexion(_DIR_CONNECT . _FILE_LDAP, $conn); |
|
| 76 | + install_fichier_connexion(_DIR_CONNECT . _FILE_LDAP, $conn); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | function etape_ldap5_suite() { |
| 80 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 81 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 80 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 81 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 82 | 82 | |
| 83 | - echo info_etape( |
|
| 84 | - _T('info_ldap_ok'), |
|
| 85 | - info_progression_etape(5, 'etape_ldap', 'install/') |
|
| 86 | - ); |
|
| 83 | + echo info_etape( |
|
| 84 | + _T('info_ldap_ok'), |
|
| 85 | + info_progression_etape(5, 'etape_ldap', 'install/') |
|
| 86 | + ); |
|
| 87 | 87 | |
| 88 | - echo generer_form_ecrire('install', ( |
|
| 89 | - "<input type='hidden' name='etape' value='3' />" . |
|
| 90 | - "<input type='hidden' name='ldap_present' value='true' />" |
|
| 91 | - . bouton_suivant())); |
|
| 88 | + echo generer_form_ecrire('install', ( |
|
| 89 | + "<input type='hidden' name='etape' value='3' />" . |
|
| 90 | + "<input type='hidden' name='ldap_present' value='true' />" |
|
| 91 | + . bouton_suivant())); |
|
| 92 | 92 | |
| 93 | - echo $minipage->installFinPage(); |
|
| 93 | + echo $minipage->installFinPage(); |
|
| 94 | 94 | } |
@@ -10,89 +10,89 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function install_etape_ldap1_dist() { |
| 17 | - $adresse_ldap = defined('_INSTALL_HOST_LDAP') |
|
| 18 | - ? _INSTALL_HOST_LDAP |
|
| 19 | - : 'localhost'; |
|
| 17 | + $adresse_ldap = defined('_INSTALL_HOST_LDAP') |
|
| 18 | + ? _INSTALL_HOST_LDAP |
|
| 19 | + : 'localhost'; |
|
| 20 | 20 | |
| 21 | - $port_ldap = defined('_INSTALL_PORT_LDAP') |
|
| 22 | - ? _INSTALL_PORT_LDAP |
|
| 23 | - : 389; |
|
| 21 | + $port_ldap = defined('_INSTALL_PORT_LDAP') |
|
| 22 | + ? _INSTALL_PORT_LDAP |
|
| 23 | + : 389; |
|
| 24 | 24 | |
| 25 | - $tls_ldap = defined('_INSTALL_TLS_LDAP') |
|
| 26 | - ? _INSTALL_TLS_LDAP |
|
| 27 | - : 'non'; |
|
| 25 | + $tls_ldap = defined('_INSTALL_TLS_LDAP') |
|
| 26 | + ? _INSTALL_TLS_LDAP |
|
| 27 | + : 'non'; |
|
| 28 | 28 | |
| 29 | - $protocole_ldap = defined('_INSTALL_PROTOCOLE_LDAP') |
|
| 30 | - ? _INSTALL_PROTOCOLE_LDAP |
|
| 31 | - : 3; // on essaie 2 en cas d'echec |
|
| 29 | + $protocole_ldap = defined('_INSTALL_PROTOCOLE_LDAP') |
|
| 30 | + ? _INSTALL_PROTOCOLE_LDAP |
|
| 31 | + : 3; // on essaie 2 en cas d'echec |
|
| 32 | 32 | |
| 33 | - $login_ldap = defined('_INSTALL_USER_LDAP') |
|
| 34 | - ? _INSTALL_USER_LDAP |
|
| 35 | - : ''; |
|
| 33 | + $login_ldap = defined('_INSTALL_USER_LDAP') |
|
| 34 | + ? _INSTALL_USER_LDAP |
|
| 35 | + : ''; |
|
| 36 | 36 | |
| 37 | - $pass_ldap = defined('_INSTALL_PASS_LDAP') |
|
| 38 | - ? _INSTALL_PASS_LDAP |
|
| 39 | - : ''; |
|
| 37 | + $pass_ldap = defined('_INSTALL_PASS_LDAP') |
|
| 38 | + ? _INSTALL_PASS_LDAP |
|
| 39 | + : ''; |
|
| 40 | 40 | |
| 41 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 42 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 41 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 42 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 43 | 43 | |
| 44 | - echo info_etape( |
|
| 45 | - _T('titre_connexion_ldap'), |
|
| 46 | - info_progression_etape(1, 'etape_ldap', 'install/') |
|
| 47 | - ); |
|
| 44 | + echo info_etape( |
|
| 45 | + _T('titre_connexion_ldap'), |
|
| 46 | + info_progression_etape(1, 'etape_ldap', 'install/') |
|
| 47 | + ); |
|
| 48 | 48 | |
| 49 | - echo generer_form_ecrire('install', ( |
|
| 50 | - "\n<input type='hidden' name='etape' value='ldap2' />" |
|
| 51 | - . fieldset( |
|
| 52 | - _T('entree_adresse_annuaire'), |
|
| 53 | - [ |
|
| 54 | - 'adresse_ldap' => [ |
|
| 55 | - 'label' => _T('texte_adresse_annuaire_1'), |
|
| 56 | - 'valeur' => $adresse_ldap |
|
| 57 | - ], |
|
| 58 | - 'port_ldap' => [ |
|
| 59 | - 'label' => _T('entree_port_annuaire') . '<br />' . _T('texte_port_annuaire'), |
|
| 60 | - 'valeur' => $port_ldap |
|
| 61 | - ], |
|
| 62 | - 'tls_ldap' => [ |
|
| 63 | - 'label' => '<b>' . _T('tls_ldap') . '</b>', |
|
| 64 | - 'valeur' => $tls_ldap, |
|
| 65 | - 'alternatives' => [ |
|
| 66 | - 'non' => _T('item_non'), |
|
| 67 | - 'oui' => _T('item_oui') |
|
| 68 | - ] |
|
| 69 | - ], |
|
| 70 | - 'protocole_ldap' => [ |
|
| 71 | - 'label' => _T('protocole_ldap'), |
|
| 72 | - 'valeur' => $protocole_ldap, |
|
| 73 | - 'alternatives' => [ |
|
| 74 | - '3' => '3', |
|
| 75 | - '2' => '2' |
|
| 76 | - ] |
|
| 77 | - ] |
|
| 78 | - ] |
|
| 79 | - ) |
|
| 49 | + echo generer_form_ecrire('install', ( |
|
| 50 | + "\n<input type='hidden' name='etape' value='ldap2' />" |
|
| 51 | + . fieldset( |
|
| 52 | + _T('entree_adresse_annuaire'), |
|
| 53 | + [ |
|
| 54 | + 'adresse_ldap' => [ |
|
| 55 | + 'label' => _T('texte_adresse_annuaire_1'), |
|
| 56 | + 'valeur' => $adresse_ldap |
|
| 57 | + ], |
|
| 58 | + 'port_ldap' => [ |
|
| 59 | + 'label' => _T('entree_port_annuaire') . '<br />' . _T('texte_port_annuaire'), |
|
| 60 | + 'valeur' => $port_ldap |
|
| 61 | + ], |
|
| 62 | + 'tls_ldap' => [ |
|
| 63 | + 'label' => '<b>' . _T('tls_ldap') . '</b>', |
|
| 64 | + 'valeur' => $tls_ldap, |
|
| 65 | + 'alternatives' => [ |
|
| 66 | + 'non' => _T('item_non'), |
|
| 67 | + 'oui' => _T('item_oui') |
|
| 68 | + ] |
|
| 69 | + ], |
|
| 70 | + 'protocole_ldap' => [ |
|
| 71 | + 'label' => _T('protocole_ldap'), |
|
| 72 | + 'valeur' => $protocole_ldap, |
|
| 73 | + 'alternatives' => [ |
|
| 74 | + '3' => '3', |
|
| 75 | + '2' => '2' |
|
| 76 | + ] |
|
| 77 | + ] |
|
| 78 | + ] |
|
| 79 | + ) |
|
| 80 | 80 | |
| 81 | - . "\n<p>" . _T('texte_acces_ldap_anonyme_1') . '</p>' |
|
| 82 | - . fieldset( |
|
| 83 | - _T('connexion_ldap'), |
|
| 84 | - [ |
|
| 85 | - 'login_ldap' => [ |
|
| 86 | - 'label' => _T('texte_login_ldap_1'), |
|
| 87 | - 'valeur' => $login_ldap |
|
| 88 | - ], |
|
| 89 | - 'pass_ldap' => [ |
|
| 90 | - 'label' => _T('entree_passe_ldap'), |
|
| 91 | - 'valeur' => $pass_ldap |
|
| 92 | - ] |
|
| 93 | - ] |
|
| 94 | - ) |
|
| 95 | - . bouton_suivant())); |
|
| 81 | + . "\n<p>" . _T('texte_acces_ldap_anonyme_1') . '</p>' |
|
| 82 | + . fieldset( |
|
| 83 | + _T('connexion_ldap'), |
|
| 84 | + [ |
|
| 85 | + 'login_ldap' => [ |
|
| 86 | + 'label' => _T('texte_login_ldap_1'), |
|
| 87 | + 'valeur' => $login_ldap |
|
| 88 | + ], |
|
| 89 | + 'pass_ldap' => [ |
|
| 90 | + 'label' => _T('entree_passe_ldap'), |
|
| 91 | + 'valeur' => $pass_ldap |
|
| 92 | + ] |
|
| 93 | + ] |
|
| 94 | + ) |
|
| 95 | + . bouton_suivant())); |
|
| 96 | 96 | |
| 97 | - echo $minipage->installFinPage(); |
|
| 97 | + echo $minipage->installFinPage(); |
|
| 98 | 98 | } |
@@ -10,90 +10,90 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function install_etape_ldap2_dist() { |
| 17 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 18 | - echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 19 | - |
|
| 20 | - $adresse_ldap = _request('adresse_ldap'); |
|
| 21 | - |
|
| 22 | - $port_ldap = _request('port_ldap'); |
|
| 23 | - |
|
| 24 | - $tls_ldap = _request('tls_ldap'); |
|
| 25 | - |
|
| 26 | - $protocole_ldap = _request('protocole_ldap'); |
|
| 27 | - |
|
| 28 | - $login_ldap = _request('login_ldap'); |
|
| 29 | - |
|
| 30 | - $pass_ldap = _request('pass_ldap'); |
|
| 31 | - |
|
| 32 | - $port_ldap = intval($port_ldap); |
|
| 33 | - |
|
| 34 | - $tls = false; |
|
| 35 | - |
|
| 36 | - if ($tls_ldap == 'oui') { |
|
| 37 | - if ($port_ldap == 636) { |
|
| 38 | - $adresse_ldap = "ldaps://$adresse_ldap"; |
|
| 39 | - } else { |
|
| 40 | - $tls = true; |
|
| 41 | - } |
|
| 42 | - } |
|
| 43 | - else { |
|
| 44 | - $tls_ldap == 'non'; |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - // Verifions que l'adresse demandee est valide |
|
| 48 | - $adresse_ldap = filter_var($adresse_ldap, FILTER_SANITIZE_URL) ?: ''; |
|
| 49 | - |
|
| 50 | - $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
|
| 51 | - $erreur = 'ldap_connect(' . spip_htmlspecialchars($adresse_ldap) . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 52 | - |
|
| 53 | - if ($ldap_link) { |
|
| 54 | - if (!ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap)) { |
|
| 55 | - $protocole_ldap = 2; |
|
| 56 | - ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap); |
|
| 57 | - } |
|
| 58 | - if ($tls === true) { |
|
| 59 | - if (!ldap_start_tls($ldap_link)) { |
|
| 60 | - $erreur = 'ldap_start_tls(' . spip_htmlspecialchars($ldap_link) |
|
| 61 | - . ' ' . spip_htmlspecialchars($adresse_ldap) |
|
| 62 | - . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 63 | - $ldap_link = false; |
|
| 64 | - } |
|
| 65 | - } |
|
| 66 | - if ($ldap_link) { |
|
| 67 | - $ldap_link = ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
|
| 68 | - $erreur = "ldap_bind('" . spip_htmlspecialchars($ldap_link) |
|
| 69 | - . "', '" . spip_htmlspecialchars($login_ldap) |
|
| 70 | - . "', '" . spip_htmlspecialchars($pass_ldap) |
|
| 71 | - . "'): " . spip_htmlspecialchars($adresse_ldap) |
|
| 72 | - . ', ' . spip_htmlspecialchars($port_ldap); |
|
| 73 | - } |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - if ($ldap_link) { |
|
| 77 | - echo info_etape( |
|
| 78 | - _T('titre_connexion_ldap'), |
|
| 79 | - info_progression_etape(2, 'etape_ldap', 'install/') |
|
| 80 | - ), _T('info_connexion_ldap_ok'); |
|
| 81 | - echo generer_form_ecrire('install', ( |
|
| 82 | - "\n<input type='hidden' name='etape' value='ldap3' />" |
|
| 83 | - . "\n<input type='hidden' name='adresse_ldap' value=\"" . spip_htmlspecialchars($adresse_ldap) . '" />' |
|
| 84 | - . "\n<input type='hidden' name='port_ldap' value=\"" . spip_htmlspecialchars($port_ldap) . '" />' |
|
| 85 | - . "\n<input type='hidden' name='login_ldap' value=\"" . spip_htmlspecialchars($login_ldap) . '" />' |
|
| 86 | - . "\n<input type='hidden' name='pass_ldap' value=\"" . spip_htmlspecialchars($pass_ldap) . '" />' |
|
| 87 | - . "\n<input type='hidden' name='protocole_ldap' value=\"" . spip_htmlspecialchars($protocole_ldap) . '" />' |
|
| 88 | - . "\n<input type='hidden' name='tls_ldap' value=\"" . spip_htmlspecialchars($tls_ldap) . '" />' |
|
| 89 | - . bouton_suivant())); |
|
| 90 | - } else { |
|
| 91 | - echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true), |
|
| 92 | - "<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>', |
|
| 93 | - '<p>' . _T('avis_connexion_ldap_echec_2') . |
|
| 94 | - "<br />\n" . _T('avis_connexion_ldap_echec_3') . |
|
| 95 | - '<br /><br />' . $erreur . '<b> ?</b></p></div>'; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - echo $minipage->installFinPage(); |
|
| 17 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 18 | + echo $minipage->installDebutPage(['onload' => 'document.getElementById(\'suivant\').focus();return false;']); |
|
| 19 | + |
|
| 20 | + $adresse_ldap = _request('adresse_ldap'); |
|
| 21 | + |
|
| 22 | + $port_ldap = _request('port_ldap'); |
|
| 23 | + |
|
| 24 | + $tls_ldap = _request('tls_ldap'); |
|
| 25 | + |
|
| 26 | + $protocole_ldap = _request('protocole_ldap'); |
|
| 27 | + |
|
| 28 | + $login_ldap = _request('login_ldap'); |
|
| 29 | + |
|
| 30 | + $pass_ldap = _request('pass_ldap'); |
|
| 31 | + |
|
| 32 | + $port_ldap = intval($port_ldap); |
|
| 33 | + |
|
| 34 | + $tls = false; |
|
| 35 | + |
|
| 36 | + if ($tls_ldap == 'oui') { |
|
| 37 | + if ($port_ldap == 636) { |
|
| 38 | + $adresse_ldap = "ldaps://$adresse_ldap"; |
|
| 39 | + } else { |
|
| 40 | + $tls = true; |
|
| 41 | + } |
|
| 42 | + } |
|
| 43 | + else { |
|
| 44 | + $tls_ldap == 'non'; |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + // Verifions que l'adresse demandee est valide |
|
| 48 | + $adresse_ldap = filter_var($adresse_ldap, FILTER_SANITIZE_URL) ?: ''; |
|
| 49 | + |
|
| 50 | + $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
|
| 51 | + $erreur = 'ldap_connect(' . spip_htmlspecialchars($adresse_ldap) . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 52 | + |
|
| 53 | + if ($ldap_link) { |
|
| 54 | + if (!ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap)) { |
|
| 55 | + $protocole_ldap = 2; |
|
| 56 | + ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap); |
|
| 57 | + } |
|
| 58 | + if ($tls === true) { |
|
| 59 | + if (!ldap_start_tls($ldap_link)) { |
|
| 60 | + $erreur = 'ldap_start_tls(' . spip_htmlspecialchars($ldap_link) |
|
| 61 | + . ' ' . spip_htmlspecialchars($adresse_ldap) |
|
| 62 | + . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 63 | + $ldap_link = false; |
|
| 64 | + } |
|
| 65 | + } |
|
| 66 | + if ($ldap_link) { |
|
| 67 | + $ldap_link = ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
|
| 68 | + $erreur = "ldap_bind('" . spip_htmlspecialchars($ldap_link) |
|
| 69 | + . "', '" . spip_htmlspecialchars($login_ldap) |
|
| 70 | + . "', '" . spip_htmlspecialchars($pass_ldap) |
|
| 71 | + . "'): " . spip_htmlspecialchars($adresse_ldap) |
|
| 72 | + . ', ' . spip_htmlspecialchars($port_ldap); |
|
| 73 | + } |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + if ($ldap_link) { |
|
| 77 | + echo info_etape( |
|
| 78 | + _T('titre_connexion_ldap'), |
|
| 79 | + info_progression_etape(2, 'etape_ldap', 'install/') |
|
| 80 | + ), _T('info_connexion_ldap_ok'); |
|
| 81 | + echo generer_form_ecrire('install', ( |
|
| 82 | + "\n<input type='hidden' name='etape' value='ldap3' />" |
|
| 83 | + . "\n<input type='hidden' name='adresse_ldap' value=\"" . spip_htmlspecialchars($adresse_ldap) . '" />' |
|
| 84 | + . "\n<input type='hidden' name='port_ldap' value=\"" . spip_htmlspecialchars($port_ldap) . '" />' |
|
| 85 | + . "\n<input type='hidden' name='login_ldap' value=\"" . spip_htmlspecialchars($login_ldap) . '" />' |
|
| 86 | + . "\n<input type='hidden' name='pass_ldap' value=\"" . spip_htmlspecialchars($pass_ldap) . '" />' |
|
| 87 | + . "\n<input type='hidden' name='protocole_ldap' value=\"" . spip_htmlspecialchars($protocole_ldap) . '" />' |
|
| 88 | + . "\n<input type='hidden' name='tls_ldap' value=\"" . spip_htmlspecialchars($tls_ldap) . '" />' |
|
| 89 | + . bouton_suivant())); |
|
| 90 | + } else { |
|
| 91 | + echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true), |
|
| 92 | + "<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>', |
|
| 93 | + '<p>' . _T('avis_connexion_ldap_echec_2') . |
|
| 94 | + "<br />\n" . _T('avis_connexion_ldap_echec_3') . |
|
| 95 | + '<br /><br />' . $erreur . '<b> ?</b></p></div>'; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + echo $minipage->installFinPage(); |
|
| 99 | 99 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $adresse_ldap = filter_var($adresse_ldap, FILTER_SANITIZE_URL) ?: ''; |
| 49 | 49 | |
| 50 | 50 | $ldap_link = ldap_connect($adresse_ldap, $port_ldap); |
| 51 | - $erreur = 'ldap_connect(' . spip_htmlspecialchars($adresse_ldap) . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 51 | + $erreur = 'ldap_connect('.spip_htmlspecialchars($adresse_ldap).', '.spip_htmlspecialchars($port_ldap).')'; |
|
| 52 | 52 | |
| 53 | 53 | if ($ldap_link) { |
| 54 | 54 | if (!ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap)) { |
@@ -57,19 +57,19 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | if ($tls === true) { |
| 59 | 59 | if (!ldap_start_tls($ldap_link)) { |
| 60 | - $erreur = 'ldap_start_tls(' . spip_htmlspecialchars($ldap_link) |
|
| 61 | - . ' ' . spip_htmlspecialchars($adresse_ldap) |
|
| 62 | - . ', ' . spip_htmlspecialchars($port_ldap) . ')'; |
|
| 60 | + $erreur = 'ldap_start_tls('.spip_htmlspecialchars($ldap_link) |
|
| 61 | + . ' '.spip_htmlspecialchars($adresse_ldap) |
|
| 62 | + . ', '.spip_htmlspecialchars($port_ldap).')'; |
|
| 63 | 63 | $ldap_link = false; |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | if ($ldap_link) { |
| 67 | 67 | $ldap_link = ldap_bind($ldap_link, $login_ldap, $pass_ldap); |
| 68 | - $erreur = "ldap_bind('" . spip_htmlspecialchars($ldap_link) |
|
| 69 | - . "', '" . spip_htmlspecialchars($login_ldap) |
|
| 70 | - . "', '" . spip_htmlspecialchars($pass_ldap) |
|
| 71 | - . "'): " . spip_htmlspecialchars($adresse_ldap) |
|
| 72 | - . ', ' . spip_htmlspecialchars($port_ldap); |
|
| 68 | + $erreur = "ldap_bind('".spip_htmlspecialchars($ldap_link) |
|
| 69 | + . "', '".spip_htmlspecialchars($login_ldap) |
|
| 70 | + . "', '".spip_htmlspecialchars($pass_ldap) |
|
| 71 | + . "'): ".spip_htmlspecialchars($adresse_ldap) |
|
| 72 | + . ', '.spip_htmlspecialchars($port_ldap); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
@@ -77,22 +77,22 @@ discard block |
||
| 77 | 77 | echo info_etape( |
| 78 | 78 | _T('titre_connexion_ldap'), |
| 79 | 79 | info_progression_etape(2, 'etape_ldap', 'install/') |
| 80 | - ), _T('info_connexion_ldap_ok'); |
|
| 80 | + ), _T('info_connexion_ldap_ok'); |
|
| 81 | 81 | echo generer_form_ecrire('install', ( |
| 82 | 82 | "\n<input type='hidden' name='etape' value='ldap3' />" |
| 83 | - . "\n<input type='hidden' name='adresse_ldap' value=\"" . spip_htmlspecialchars($adresse_ldap) . '" />' |
|
| 84 | - . "\n<input type='hidden' name='port_ldap' value=\"" . spip_htmlspecialchars($port_ldap) . '" />' |
|
| 85 | - . "\n<input type='hidden' name='login_ldap' value=\"" . spip_htmlspecialchars($login_ldap) . '" />' |
|
| 86 | - . "\n<input type='hidden' name='pass_ldap' value=\"" . spip_htmlspecialchars($pass_ldap) . '" />' |
|
| 87 | - . "\n<input type='hidden' name='protocole_ldap' value=\"" . spip_htmlspecialchars($protocole_ldap) . '" />' |
|
| 88 | - . "\n<input type='hidden' name='tls_ldap' value=\"" . spip_htmlspecialchars($tls_ldap) . '" />' |
|
| 83 | + . "\n<input type='hidden' name='adresse_ldap' value=\"".spip_htmlspecialchars($adresse_ldap).'" />' |
|
| 84 | + . "\n<input type='hidden' name='port_ldap' value=\"".spip_htmlspecialchars($port_ldap).'" />' |
|
| 85 | + . "\n<input type='hidden' name='login_ldap' value=\"".spip_htmlspecialchars($login_ldap).'" />' |
|
| 86 | + . "\n<input type='hidden' name='pass_ldap' value=\"".spip_htmlspecialchars($pass_ldap).'" />' |
|
| 87 | + . "\n<input type='hidden' name='protocole_ldap' value=\"".spip_htmlspecialchars($protocole_ldap).'" />' |
|
| 88 | + . "\n<input type='hidden' name='tls_ldap' value=\"".spip_htmlspecialchars($tls_ldap).'" />' |
|
| 89 | 89 | . bouton_suivant())); |
| 90 | 90 | } else { |
| 91 | 91 | echo info_etape(_T('titre_connexion_ldap')), info_progression_etape(1, 'etape_ldap', 'install/', true), |
| 92 | - "<div class='error'><p>" . _T('avis_connexion_ldap_echec_1') . '</p>', |
|
| 93 | - '<p>' . _T('avis_connexion_ldap_echec_2') . |
|
| 94 | - "<br />\n" . _T('avis_connexion_ldap_echec_3') . |
|
| 95 | - '<br /><br />' . $erreur . '<b> ?</b></p></div>'; |
|
| 92 | + "<div class='error'><p>"._T('avis_connexion_ldap_echec_1').'</p>', |
|
| 93 | + '<p>'._T('avis_connexion_ldap_echec_2'). |
|
| 94 | + "<br />\n"._T('avis_connexion_ldap_echec_3'). |
|
| 95 | + '<br /><br />'.$erreur.'<b> ?</b></p></div>'; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | echo $minipage->installFinPage(); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | include_spip('inc/headers'); |
@@ -19,67 +19,67 @@ discard block |
||
| 19 | 19 | // Mise en place des fichiers de configuration si ce n'est fait |
| 20 | 20 | |
| 21 | 21 | function install_etape_fin_dist() { |
| 22 | - ecrire_acces(); |
|
| 22 | + ecrire_acces(); |
|
| 23 | 23 | |
| 24 | - $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CHMOD_TMP); |
|
| 25 | - if (file_exists(_FILE_CHMOD_TMP)) { |
|
| 26 | - if (!@rename(_FILE_CHMOD_TMP, $f)) { |
|
| 27 | - if (@copy(_FILE_CHMOD_TMP, $f)) { |
|
| 28 | - spip_unlink(_FILE_CHMOD_TMP); |
|
| 29 | - } |
|
| 30 | - } |
|
| 31 | - } |
|
| 24 | + $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CHMOD_TMP); |
|
| 25 | + if (file_exists(_FILE_CHMOD_TMP)) { |
|
| 26 | + if (!@rename(_FILE_CHMOD_TMP, $f)) { |
|
| 27 | + if (@copy(_FILE_CHMOD_TMP, $f)) { |
|
| 28 | + spip_unlink(_FILE_CHMOD_TMP); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CONNECT_TMP); |
|
| 34 | - if (file_exists(_FILE_CONNECT_TMP)) { |
|
| 35 | - spip_log("renomme $f"); |
|
| 36 | - if (!@rename(_FILE_CONNECT_TMP, $f)) { |
|
| 37 | - if (@copy(_FILE_CONNECT_TMP, $f)) { |
|
| 38 | - @spip_unlink(_FILE_CONNECT_TMP); |
|
| 39 | - } |
|
| 40 | - } |
|
| 41 | - } |
|
| 33 | + $f = str_replace(_FILE_TMP_SUFFIX, '.php', _FILE_CONNECT_TMP); |
|
| 34 | + if (file_exists(_FILE_CONNECT_TMP)) { |
|
| 35 | + spip_log("renomme $f"); |
|
| 36 | + if (!@rename(_FILE_CONNECT_TMP, $f)) { |
|
| 37 | + if (@copy(_FILE_CONNECT_TMP, $f)) { |
|
| 38 | + @spip_unlink(_FILE_CONNECT_TMP); |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - // creer le repertoire cache, qui sert partout ! |
|
| 44 | - // deja fait en etape 4 en principe, on garde au cas ou |
|
| 45 | - if (!@file_exists(_DIR_CACHE)) { |
|
| 46 | - $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE); |
|
| 47 | - $rep = sous_repertoire(_DIR_TMP, $rep, true, true); |
|
| 48 | - } |
|
| 43 | + // creer le repertoire cache, qui sert partout ! |
|
| 44 | + // deja fait en etape 4 en principe, on garde au cas ou |
|
| 45 | + if (!@file_exists(_DIR_CACHE)) { |
|
| 46 | + $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE); |
|
| 47 | + $rep = sous_repertoire(_DIR_TMP, $rep, true, true); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - // Verifier la securite des htaccess |
|
| 51 | - // Si elle ne fonctionne pas, prevenir |
|
| 52 | - $msg = install_verifier_htaccess(); |
|
| 53 | - if ($msg) { |
|
| 54 | - $cible = _T('public:accueil_site'); |
|
| 55 | - $cible = generer_form_ecrire('accueil', '', '', $cible); |
|
| 56 | - $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 57 | - echo $minipage->page($msg . $cible); |
|
| 58 | - // ok, deboucher dans l'espace prive |
|
| 59 | - } else { |
|
| 60 | - redirige_url_ecrire('accueil'); |
|
| 61 | - } |
|
| 50 | + // Verifier la securite des htaccess |
|
| 51 | + // Si elle ne fonctionne pas, prevenir |
|
| 52 | + $msg = install_verifier_htaccess(); |
|
| 53 | + if ($msg) { |
|
| 54 | + $cible = _T('public:accueil_site'); |
|
| 55 | + $cible = generer_form_ecrire('accueil', '', '', $cible); |
|
| 56 | + $minipage = new Spip\Afficher\Minipage\Installation(); |
|
| 57 | + echo $minipage->page($msg . $cible); |
|
| 58 | + // ok, deboucher dans l'espace prive |
|
| 59 | + } else { |
|
| 60 | + redirige_url_ecrire('accueil'); |
|
| 61 | + } |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | function install_verifier_htaccess() { |
| 65 | - if ( |
|
| 66 | - verifier_htaccess(_DIR_TMP, true) |
|
| 67 | - and verifier_htaccess(_DIR_CONNECT, true) |
|
| 68 | - and verifier_htaccess(_DIR_VENDOR, true) |
|
| 69 | - ) { |
|
| 70 | - return ''; |
|
| 71 | - } |
|
| 65 | + if ( |
|
| 66 | + verifier_htaccess(_DIR_TMP, true) |
|
| 67 | + and verifier_htaccess(_DIR_CONNECT, true) |
|
| 68 | + and verifier_htaccess(_DIR_VENDOR, true) |
|
| 69 | + ) { |
|
| 70 | + return ''; |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - $titre = _T('htaccess_inoperant'); |
|
| 73 | + $titre = _T('htaccess_inoperant'); |
|
| 74 | 74 | |
| 75 | - $averti = _T( |
|
| 76 | - 'htaccess_a_simuler', |
|
| 77 | - [ |
|
| 78 | - 'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>', |
|
| 79 | - 'constantes' => '<tt>_DIR_TMP & _DIR_CONNECT</tt>', |
|
| 80 | - 'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>' |
|
| 81 | - ] |
|
| 82 | - ); |
|
| 75 | + $averti = _T( |
|
| 76 | + 'htaccess_a_simuler', |
|
| 77 | + [ |
|
| 78 | + 'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>', |
|
| 79 | + 'constantes' => '<tt>_DIR_TMP & _DIR_CONNECT</tt>', |
|
| 80 | + 'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>' |
|
| 81 | + ] |
|
| 82 | + ); |
|
| 83 | 83 | |
| 84 | - return "<div class='error'><h3>$titre</h3><p>$averti</p></div>"; |
|
| 84 | + return "<div class='error'><h3>$titre</h3><p>$averti</p></div>"; |
|
| 85 | 85 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | // creer le repertoire cache, qui sert partout ! |
| 44 | 44 | // deja fait en etape 4 en principe, on garde au cas ou |
| 45 | 45 | if (!@file_exists(_DIR_CACHE)) { |
| 46 | - $rep = preg_replace(',' . _DIR_TMP . ',', '', _DIR_CACHE); |
|
| 46 | + $rep = preg_replace(','._DIR_TMP.',', '', _DIR_CACHE); |
|
| 47 | 47 | $rep = sous_repertoire(_DIR_TMP, $rep, true, true); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $cible = _T('public:accueil_site'); |
| 55 | 55 | $cible = generer_form_ecrire('accueil', '', '', $cible); |
| 56 | 56 | $minipage = new Spip\Afficher\Minipage\Installation(); |
| 57 | - echo $minipage->page($msg . $cible); |
|
| 57 | + echo $minipage->page($msg.$cible); |
|
| 58 | 58 | // ok, deboucher dans l'espace prive |
| 59 | 59 | } else { |
| 60 | 60 | redirige_url_ecrire('accueil'); |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | $averti = _T( |
| 76 | 76 | 'htaccess_a_simuler', |
| 77 | 77 | [ |
| 78 | - 'htaccess' => '<tt>' . _ACCESS_FILE_NAME . '</tt>', |
|
| 78 | + 'htaccess' => '<tt>'._ACCESS_FILE_NAME.'</tt>', |
|
| 79 | 79 | 'constantes' => '<tt>_DIR_TMP & _DIR_CONNECT</tt>', |
| 80 | - 'document_root' => '<tt>' . $_SERVER['DOCUMENT_ROOT'] . '</tt>' |
|
| 80 | + 'document_root' => '<tt>'.$_SERVER['DOCUMENT_ROOT'].'</tt>' |
|
| 81 | 81 | ] |
| 82 | 82 | ); |
| 83 | 83 | |