@@ -10,65 +10,65 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function formulaires_configurer_articles_charger_dist() { |
| 17 | - $valeurs = []; |
|
| 18 | - foreach ( |
|
| 19 | - [ |
|
| 20 | - 'articles_surtitre', |
|
| 21 | - 'articles_soustitre', |
|
| 22 | - 'articles_descriptif', |
|
| 23 | - 'articles_chapeau', |
|
| 24 | - 'articles_texte', |
|
| 25 | - 'articles_ps', |
|
| 26 | - 'articles_redac', |
|
| 27 | - 'articles_urlref', |
|
| 28 | - 'post_dates', |
|
| 29 | - 'articles_redirection', |
|
| 30 | - ] as $m |
|
| 31 | - ) { |
|
| 32 | - $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 33 | - } |
|
| 17 | + $valeurs = []; |
|
| 18 | + foreach ( |
|
| 19 | + [ |
|
| 20 | + 'articles_surtitre', |
|
| 21 | + 'articles_soustitre', |
|
| 22 | + 'articles_descriptif', |
|
| 23 | + 'articles_chapeau', |
|
| 24 | + 'articles_texte', |
|
| 25 | + 'articles_ps', |
|
| 26 | + 'articles_redac', |
|
| 27 | + 'articles_urlref', |
|
| 28 | + 'post_dates', |
|
| 29 | + 'articles_redirection', |
|
| 30 | + ] as $m |
|
| 31 | + ) { |
|
| 32 | + $valeurs[$m] = $GLOBALS['meta'][$m]; |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - return $valeurs; |
|
| 35 | + return $valeurs; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | function formulaires_configurer_articles_traiter_dist() { |
| 40 | - $res = ['editable' => true]; |
|
| 41 | - $purger_skel = false; |
|
| 42 | - // Purger les squelettes si un changement de meta les affecte |
|
| 43 | - if (($i = _request('post_dates')) && $i != $GLOBALS['meta']['post_dates']) { |
|
| 44 | - $purger_skel = true; |
|
| 45 | - } |
|
| 40 | + $res = ['editable' => true]; |
|
| 41 | + $purger_skel = false; |
|
| 42 | + // Purger les squelettes si un changement de meta les affecte |
|
| 43 | + if (($i = _request('post_dates')) && $i != $GLOBALS['meta']['post_dates']) { |
|
| 44 | + $purger_skel = true; |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - foreach ( |
|
| 48 | - [ |
|
| 49 | - 'articles_surtitre', |
|
| 50 | - 'articles_soustitre', |
|
| 51 | - 'articles_descriptif', |
|
| 52 | - 'articles_chapeau', |
|
| 53 | - 'articles_texte', |
|
| 54 | - 'articles_ps', |
|
| 55 | - 'articles_redac', |
|
| 56 | - 'articles_urlref', |
|
| 57 | - 'post_dates', |
|
| 58 | - 'articles_redirection', |
|
| 59 | - ] as $m |
|
| 60 | - ) { |
|
| 61 | - if (!is_null($v = _request($m))) { |
|
| 62 | - ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 63 | - } |
|
| 64 | - } |
|
| 47 | + foreach ( |
|
| 48 | + [ |
|
| 49 | + 'articles_surtitre', |
|
| 50 | + 'articles_soustitre', |
|
| 51 | + 'articles_descriptif', |
|
| 52 | + 'articles_chapeau', |
|
| 53 | + 'articles_texte', |
|
| 54 | + 'articles_ps', |
|
| 55 | + 'articles_redac', |
|
| 56 | + 'articles_urlref', |
|
| 57 | + 'post_dates', |
|
| 58 | + 'articles_redirection', |
|
| 59 | + ] as $m |
|
| 60 | + ) { |
|
| 61 | + if (!is_null($v = _request($m))) { |
|
| 62 | + ecrire_meta($m, $v == 'oui' ? 'oui' : 'non'); |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - if ($purger_skel) { |
|
| 67 | - include_spip('inc/invalideur'); |
|
| 68 | - purger_repertoire(_DIR_SKELS); |
|
| 69 | - } |
|
| 66 | + if ($purger_skel) { |
|
| 67 | + include_spip('inc/invalideur'); |
|
| 68 | + purger_repertoire(_DIR_SKELS); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - $res['message_ok'] = _T('config_info_enregistree'); |
|
| 71 | + $res['message_ok'] = _T('config_info_enregistree'); |
|
| 72 | 72 | |
| 73 | - return $res; |
|
| 73 | + return $res; |
|
| 74 | 74 | } |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @package SPIP\Core\Fonctions |
| 16 | 16 | **/ |
| 17 | 17 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 18 | - return; |
|
| 18 | + return; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -28,29 +28,29 @@ discard block |
||
| 28 | 28 | * @param bool $left |
| 29 | 29 | */ |
| 30 | 30 | function critere_compteur_articles_filtres_dist($idb, &$boucles, $crit, $left = false) { |
| 31 | - $boucle = &$boucles[$idb]; |
|
| 31 | + $boucle = &$boucles[$idb]; |
|
| 32 | 32 | |
| 33 | - $_statut = calculer_liste($crit->param[0], [], $boucles, $boucle->id_parent); |
|
| 33 | + $_statut = calculer_liste($crit->param[0], [], $boucles, $boucle->id_parent); |
|
| 34 | 34 | |
| 35 | - $not = ''; |
|
| 36 | - if ($crit->not) { |
|
| 37 | - $not = ", 'NOT'"; |
|
| 38 | - } |
|
| 39 | - $boucle->from['LAA'] = 'spip_auteurs_liens'; |
|
| 40 | - $boucle->from_type['LAA'] = 'left'; |
|
| 41 | - $boucle->join['LAA'] = ["'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''"]; |
|
| 35 | + $not = ''; |
|
| 36 | + if ($crit->not) { |
|
| 37 | + $not = ", 'NOT'"; |
|
| 38 | + } |
|
| 39 | + $boucle->from['LAA'] = 'spip_auteurs_liens'; |
|
| 40 | + $boucle->from_type['LAA'] = 'left'; |
|
| 41 | + $boucle->join['LAA'] = ["'auteurs'", "'id_auteur'", "'id_auteur'", "'LAA.objet=\'article\''"]; |
|
| 42 | 42 | |
| 43 | - $boucle->from['articles'] = 'spip_articles'; |
|
| 44 | - $boucle->from_type['articles'] = 'left'; |
|
| 45 | - $boucle->join['articles'] = [ |
|
| 46 | - "'LAA'", |
|
| 47 | - "'id_article'", |
|
| 48 | - "'id_objet'", |
|
| 49 | - "'(articles.statut IS NULL OR '.sql_in_quote('articles.statut',[$_statut]$not).')'" |
|
| 50 | - ]; |
|
| 43 | + $boucle->from['articles'] = 'spip_articles'; |
|
| 44 | + $boucle->from_type['articles'] = 'left'; |
|
| 45 | + $boucle->join['articles'] = [ |
|
| 46 | + "'LAA'", |
|
| 47 | + "'id_article'", |
|
| 48 | + "'id_objet'", |
|
| 49 | + "'(articles.statut IS NULL OR '.sql_in_quote('articles.statut',[$_statut]$not).')'" |
|
| 50 | + ]; |
|
| 51 | 51 | |
| 52 | - $boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles'; |
|
| 53 | - $boucle->group[] = 'auteurs.id_auteur'; |
|
| 52 | + $boucle->select[] = 'COUNT(articles.id_article) AS compteur_articles'; |
|
| 53 | + $boucle->group[] = 'auteurs.id_auteur'; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * Pile complétée par le code à générer |
| 69 | 69 | */ |
| 70 | 70 | function balise_COMPTEUR_ARTICLES_dist($p) { |
| 71 | - return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres'); |
|
| 71 | + return rindex_pile($p, 'compteur_articles', 'compteur_articles_filtres'); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
@@ -84,37 +84,37 @@ discard block |
||
| 84 | 84 | * @return string |
| 85 | 85 | */ |
| 86 | 86 | function afficher_initiale($url, $initiale, $compteur, $debut, $pas) { |
| 87 | - static $memo = null; |
|
| 88 | - static $res = []; |
|
| 89 | - $out = ''; |
|
| 90 | - if (!$memo || !$initiale && !$url || $initiale !== $memo['initiale']) { |
|
| 91 | - $newcompt = (int) (floor(($compteur - 1) / $pas) * $pas); |
|
| 92 | - // si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien |
|
| 93 | - if (!$initiale && !$url && !$memo['compteur']) { |
|
| 94 | - $memo = null; |
|
| 95 | - } |
|
| 96 | - if ($memo) { |
|
| 97 | - $on = ($memo['compteur'] <= $debut && ($newcompt > $debut || $newcompt == $debut && $newcompt == $memo['compteur'])); |
|
| 98 | - $res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . '</li>'; |
|
| 99 | - } |
|
| 100 | - if ($initiale) { |
|
| 101 | - $memo = [ |
|
| 102 | - 'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0, |
|
| 103 | - 'initiale' => $initiale, |
|
| 104 | - 'url' => parametre_url($url, 'i', $initiale), |
|
| 105 | - 'compteur' => $newcompt |
|
| 106 | - ]; |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - if (!$initiale && !$url) { |
|
| 110 | - if ((is_countable($res) ? count($res) : 0) > 1) { |
|
| 111 | - $out = "<ul class='pagination-items'>" . implode(' ', $res) . '</ul>'; |
|
| 112 | - } |
|
| 113 | - $memo = null; |
|
| 114 | - $res = []; |
|
| 115 | - } |
|
| 87 | + static $memo = null; |
|
| 88 | + static $res = []; |
|
| 89 | + $out = ''; |
|
| 90 | + if (!$memo || !$initiale && !$url || $initiale !== $memo['initiale']) { |
|
| 91 | + $newcompt = (int) (floor(($compteur - 1) / $pas) * $pas); |
|
| 92 | + // si fin de la pagination et une seule entree, ne pas l'afficher, ca ne sert a rien |
|
| 93 | + if (!$initiale && !$url && !$memo['compteur']) { |
|
| 94 | + $memo = null; |
|
| 95 | + } |
|
| 96 | + if ($memo) { |
|
| 97 | + $on = ($memo['compteur'] <= $debut && ($newcompt > $debut || $newcompt == $debut && $newcompt == $memo['compteur'])); |
|
| 98 | + $res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . '</li>'; |
|
| 99 | + } |
|
| 100 | + if ($initiale) { |
|
| 101 | + $memo = [ |
|
| 102 | + 'entree' => isset($memo['entree']) ? $memo['entree'] + 1 : 0, |
|
| 103 | + 'initiale' => $initiale, |
|
| 104 | + 'url' => parametre_url($url, 'i', $initiale), |
|
| 105 | + 'compteur' => $newcompt |
|
| 106 | + ]; |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + if (!$initiale && !$url) { |
|
| 110 | + if ((is_countable($res) ? count($res) : 0) > 1) { |
|
| 111 | + $out = "<ul class='pagination-items'>" . implode(' ', $res) . '</ul>'; |
|
| 112 | + } |
|
| 113 | + $memo = null; |
|
| 114 | + $res = []; |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - return $out; |
|
| 117 | + return $out; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
@@ -133,24 +133,24 @@ discard block |
||
| 133 | 133 | * @return string |
| 134 | 134 | */ |
| 135 | 135 | function auteur_lien_messagerie($id_auteur, $en_ligne, $statut, $imessage, $email = '') { |
| 136 | - static $time = null; |
|
| 137 | - if (!in_array($statut, ['0minirezo', '1comite'])) { |
|
| 138 | - return ''; |
|
| 139 | - } |
|
| 136 | + static $time = null; |
|
| 137 | + if (!in_array($statut, ['0minirezo', '1comite'])) { |
|
| 138 | + return ''; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - if (is_null($time)) { |
|
| 142 | - $time = time(); |
|
| 143 | - } |
|
| 144 | - $parti = (($time - strtotime($en_ligne)) > 15 * 60); |
|
| 141 | + if (is_null($time)) { |
|
| 142 | + $time = time(); |
|
| 143 | + } |
|
| 144 | + $parti = (($time - strtotime($en_ligne)) > 15 * 60); |
|
| 145 | 145 | |
| 146 | - if ( |
|
| 147 | - $imessage != 'non' && !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ? |
|
| 148 | - && $GLOBALS['meta']['messagerie_agenda'] != 'non' |
|
| 149 | - ) { |
|
| 150 | - return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
|
| 151 | - } elseif (strlen($email) && autoriser('voir', 'auteur', $id_auteur)) { |
|
| 152 | - return 'mailto:' . $email; |
|
| 153 | - } else { |
|
| 154 | - return ''; |
|
| 155 | - } |
|
| 146 | + if ( |
|
| 147 | + $imessage != 'non' && !$parti // historique : est-ce que ca a encore un sens de limiter vu qu'on a la notification par email ? |
|
| 148 | + && $GLOBALS['meta']['messagerie_agenda'] != 'non' |
|
| 149 | + ) { |
|
| 150 | + return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
|
| 151 | + } elseif (strlen($email) && autoriser('voir', 'auteur', $id_auteur)) { |
|
| 152 | + return 'mailto:' . $email; |
|
| 153 | + } else { |
|
| 154 | + return ''; |
|
| 155 | + } |
|
| 156 | 156 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | if ($memo) { |
| 97 | 97 | $on = ($memo['compteur'] <= $debut && ($newcompt > $debut || $newcompt == $debut && $newcompt == $memo['compteur'])); |
| 98 | - $res[] = "<li class='pagination-item'>" . lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination') . '</li>'; |
|
| 98 | + $res[] = "<li class='pagination-item'>".lien_ou_expose($memo['url'], $memo['initiale'], $on ? 'span.pagination-item-label' : '', 'pagination-item-label lien_pagination').'</li>'; |
|
| 99 | 99 | } |
| 100 | 100 | if ($initiale) { |
| 101 | 101 | $memo = [ |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | if (!$initiale && !$url) { |
| 110 | 110 | if ((is_countable($res) ? count($res) : 0) > 1) { |
| 111 | - $out = "<ul class='pagination-items'>" . implode(' ', $res) . '</ul>'; |
|
| 111 | + $out = "<ul class='pagination-items'>".implode(' ', $res).'</ul>'; |
|
| 112 | 112 | } |
| 113 | 113 | $memo = null; |
| 114 | 114 | $res = []; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | ) { |
| 150 | 150 | return parametre_url(parametre_url(generer_url_ecrire('message_edit', 'new=oui'), 'to', $id_auteur), 'redirect', self()); |
| 151 | 151 | } elseif (strlen($email) && autoriser('voir', 'auteur', $id_auteur)) { |
| 152 | - return 'mailto:' . $email; |
|
| 152 | + return 'mailto:'.$email; |
|
| 153 | 153 | } else { |
| 154 | 154 | return ''; |
| 155 | 155 | } |
@@ -10,24 +10,24 @@ |
||
| 10 | 10 | \***************************************************************************/ |
| 11 | 11 | |
| 12 | 12 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 13 | - return; |
|
| 13 | + return; |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | function lister_traductions($id_trad, $objet) { |
| 17 | - $table_objet_sql = table_objet_sql($objet); |
|
| 18 | - $primary = id_table_objet($objet); |
|
| 17 | + $table_objet_sql = table_objet_sql($objet); |
|
| 18 | + $primary = id_table_objet($objet); |
|
| 19 | 19 | |
| 20 | - $select = "$primary as id,lang"; |
|
| 21 | - $where = 'id_trad=' . (int) $id_trad; |
|
| 22 | - $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 23 | - $desc = $trouver_table($table_objet_sql); |
|
| 24 | - if (isset($desc['field']['statut'])) { |
|
| 25 | - $select .= ',statut'; |
|
| 26 | - $where .= ' AND statut!=' . sql_quote('poubelle'); |
|
| 27 | - } |
|
| 20 | + $select = "$primary as id,lang"; |
|
| 21 | + $where = 'id_trad=' . (int) $id_trad; |
|
| 22 | + $trouver_table = charger_fonction('trouver_table', 'base'); |
|
| 23 | + $desc = $trouver_table($table_objet_sql); |
|
| 24 | + if (isset($desc['field']['statut'])) { |
|
| 25 | + $select .= ',statut'; |
|
| 26 | + $where .= ' AND statut!=' . sql_quote('poubelle'); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - $rows = sql_allfetsel($select, $table_objet_sql, $where); |
|
| 30 | - lang_select(); |
|
| 29 | + $rows = sql_allfetsel($select, $table_objet_sql, $where); |
|
| 30 | + lang_select(); |
|
| 31 | 31 | |
| 32 | - return $rows; |
|
| 32 | + return $rows; |
|
| 33 | 33 | } |
@@ -18,12 +18,12 @@ |
||
| 18 | 18 | $primary = id_table_objet($objet); |
| 19 | 19 | |
| 20 | 20 | $select = "$primary as id,lang"; |
| 21 | - $where = 'id_trad=' . (int) $id_trad; |
|
| 21 | + $where = 'id_trad='.(int) $id_trad; |
|
| 22 | 22 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 23 | 23 | $desc = $trouver_table($table_objet_sql); |
| 24 | 24 | if (isset($desc['field']['statut'])) { |
| 25 | 25 | $select .= ',statut'; |
| 26 | - $where .= ' AND statut!=' . sql_quote('poubelle'); |
|
| 26 | + $where .= ' AND statut!='.sql_quote('poubelle'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | $rows = sql_allfetsel($select, $table_objet_sql, $where); |
@@ -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 | /** |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | function deplacement_restreint($objet, $statut) { |
| 25 | 25 | |
| 26 | - return match ($objet) { |
|
| 27 | - 'rubrique' => !$GLOBALS['connect_toutes_rubriques'], |
|
| 28 | - 'article', 'site', 'syndic', 'breve' => $statut == 'publie', |
|
| 29 | - default => $statut ? $statut == 'publie' : false, |
|
| 30 | - }; |
|
| 26 | + return match ($objet) { |
|
| 27 | + 'rubrique' => !$GLOBALS['connect_toutes_rubriques'], |
|
| 28 | + 'article', 'site', 'syndic', 'breve' => $statut == 'publie', |
|
| 29 | + default => $statut ? $statut == 'publie' : false, |
|
| 30 | + }; |
|
| 31 | 31 | } |
@@ -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) && $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) && $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 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $checked = false; |
| 45 | 45 | $res = ''; |
| 46 | 46 | if (is_array($info) && $info['count'] > 0) { |
| 47 | - $res .= '<p>' . _T('info_selection_chemin_acces') . '</p>'; |
|
| 47 | + $res .= '<p>'._T('info_selection_chemin_acces').'</p>'; |
|
| 48 | 48 | $res .= '<ul>'; |
| 49 | 49 | $n = 0; |
| 50 | 50 | for ($i = 0; $i < $info['count']; $i++) { |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | if (is_array($names)) { |
| 53 | 53 | for ($j = 0; $j < $names['count']; $j++) { |
| 54 | 54 | $n++; |
| 55 | - $res .= '<li><input name="base_ldap" value="' . spip_htmlspecialchars($names[$j]) . "\" type='radio' id='tab$n'"; |
|
| 55 | + $res .= '<li><input name="base_ldap" value="'.spip_htmlspecialchars($names[$j])."\" type='radio' id='tab$n'"; |
|
| 56 | 56 | if (!$checked) { |
| 57 | 57 | $res .= ' checked="checked"'; |
| 58 | 58 | $checked = true; |
| 59 | 59 | } |
| 60 | 60 | $res .= ' />'; |
| 61 | - $res .= "<label for='tab$n'>" . spip_htmlspecialchars($names[$j]) . "</label></li>\n"; |
|
| 61 | + $res .= "<label for='tab$n'>".spip_htmlspecialchars($names[$j])."</label></li>\n"; |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | $res .= '</ul>'; |
| 66 | - $res .= _T('info_ou') . ' '; |
|
| 66 | + $res .= _T('info_ou').' '; |
|
| 67 | 67 | } |
| 68 | 68 | $res .= "<br />\n<input name=\"base_ldap\" value=\"\" type='radio' id='manuel'"; |
| 69 | 69 | if (!$checked) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $res .= ' />' |
| 75 | - . "\n<label for='manuel'>" . _T('entree_chemin_acces') . '</label> ' |
|
| 75 | + . "\n<label for='manuel'>"._T('entree_chemin_acces').'</label> ' |
|
| 76 | 76 | . "\n<fieldset>" |
| 77 | 77 | . "<input type='text' name='base_ldap_text' class='text' value=\"$base_ldap_text\" size='40' />" |
| 78 | 78 | . "\n</fieldset>" |
@@ -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 | - || $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 | + || $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,167 +10,167 @@ |
||
| 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_3b_dist() { |
| 19 | - $auth_spip = null; |
|
| 20 | - $session = null; |
|
| 21 | - $row = null; |
|
| 22 | - $login = _request('login'); |
|
| 23 | - $email = _request('email'); |
|
| 24 | - $nom = _request('nom'); |
|
| 25 | - $pass = _request('pass'); |
|
| 26 | - $pass_verif = _request('pass_verif'); |
|
| 27 | - |
|
| 28 | - $server_db = defined('_INSTALL_SERVER_DB') |
|
| 29 | - ? _INSTALL_SERVER_DB |
|
| 30 | - : _request('server_db'); |
|
| 31 | - |
|
| 32 | - if (!defined('_PASS_LONGUEUR_MINI')) { |
|
| 33 | - define('_PASS_LONGUEUR_MINI', 6); |
|
| 34 | - } |
|
| 35 | - if (!defined('_LOGIN_TROP_COURT')) { |
|
| 36 | - define('_LOGIN_TROP_COURT', 4); |
|
| 37 | - } |
|
| 38 | - if ($login) { |
|
| 39 | - $echec = ($pass != $pass_verif) ? |
|
| 40 | - _T('info_passes_identiques') |
|
| 41 | - : ((strlen($pass) < _PASS_LONGUEUR_MINI) ? |
|
| 42 | - _T('info_passe_trop_court_car_pluriel', ['nb' => _PASS_LONGUEUR_MINI]) |
|
| 43 | - : ((strlen($login) < _LOGIN_TROP_COURT) ? |
|
| 44 | - _T('info_login_trop_court') |
|
| 45 | - : '')); |
|
| 46 | - include_spip('inc/filtres'); |
|
| 47 | - if (!$echec && $email && !email_valide($email)) { |
|
| 48 | - $echec = _T('form_email_non_valide'); |
|
| 49 | - } |
|
| 50 | - if ($echec) { |
|
| 51 | - echouer_etape_3b($echec); |
|
| 52 | - } |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - if (@file_exists(_FILE_CHMOD_TMP)) { |
|
| 56 | - include(_FILE_CHMOD_TMP); |
|
| 57 | - } else { |
|
| 58 | - redirige_url_ecrire('install'); |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - if (!@file_exists(_FILE_CONNECT_TMP)) { |
|
| 62 | - redirige_url_ecrire('install'); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - # maintenant on connait le vrai charset du site s'il est deja configure |
|
| 66 | - # sinon par defaut lire_meta reglera _DEFAULT_CHARSET |
|
| 67 | - # (les donnees arrivent de toute facon postees en _DEFAULT_CHARSET) |
|
| 68 | - |
|
| 69 | - lire_metas(); |
|
| 70 | - if ($login) { |
|
| 71 | - include_spip('inc/charsets'); |
|
| 72 | - |
|
| 73 | - $nom = (importer_charset($nom, _DEFAULT_CHARSET)); |
|
| 74 | - $login = (importer_charset($login, _DEFAULT_CHARSET)); |
|
| 75 | - $email = (importer_charset($email, _DEFAULT_CHARSET)); |
|
| 76 | - |
|
| 77 | - include_spip('auth/spip'); |
|
| 78 | - // prelablement, creer le champ webmestre si il n'existe pas (install neuve |
|
| 79 | - // sur une vieille base |
|
| 80 | - $t = sql_showtable('spip_auteurs', true); |
|
| 81 | - if (!isset($t['field']['webmestre'])) { |
|
| 82 | - @sql_alter("TABLE spip_auteurs ADD webmestre varchar(3) DEFAULT 'non' NOT NULL"); |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - // il faut avoir une cle des auth valide pour creer un nouvel auteur webmestre |
|
| 86 | - $cles = \Spip\Chiffrer\SpipCles::instance(); |
|
| 87 | - $secret = $cles->getSecretAuth(); |
|
| 88 | - |
|
| 89 | - $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 90 | - if ($id_auteur !== null) { |
|
| 91 | - // c'est un auteur connu : si on a pas de secret il faut absolument qu'il se reconnecte avec le meme mot de passe |
|
| 92 | - // pour restaurer la copie des cles |
|
| 93 | - if (!$secret && !auth_spip_initialiser_secret()) { |
|
| 94 | - $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur); |
|
| 95 | - if (empty($row['backup_cles']) || !$cles->restore($row['backup_cles'], $pass, $row['pass'], $id_auteur)) { |
|
| 96 | - $echec = _T('avis_connexion_erreur_fichier_cle_manquant_1'); |
|
| 97 | - echouer_etape_3b($echec); |
|
| 98 | - } |
|
| 99 | - spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 100 | - $cles->save(); |
|
| 101 | - } |
|
| 102 | - |
|
| 103 | - sql_updateq('spip_auteurs', [ |
|
| 104 | - 'nom' => $nom, |
|
| 105 | - 'email' => $email, |
|
| 106 | - 'login' => $login, |
|
| 107 | - 'statut' => '0minirezo' |
|
| 108 | - ], 'id_auteur=' . (int) $id_auteur); |
|
| 109 | - // le passer webmestre separement du reste, au cas ou l'alter n'aurait pas fonctionne |
|
| 110 | - @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
|
| 111 | - if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
|
| 112 | - $echec = _T('avis_erreur_creation_compte'); |
|
| 113 | - echouer_etape_3b($echec); |
|
| 114 | - } |
|
| 115 | - } else { |
|
| 116 | - // Si on a pas de cle et qu'on ne sait pas la creer, on ne peut pas creer de nouveau compte : |
|
| 117 | - // il faut qu'un webmestre avec un backup fasse l'install |
|
| 118 | - if (!$secret && !auth_spip_initialiser_secret()) { |
|
| 119 | - $echec = _T('avis_connexion_erreur_fichier_cle_manquant_2'); |
|
| 120 | - echouer_etape_3b($echec); |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - $id_auteur = sql_insertq('spip_auteurs', [ |
|
| 124 | - 'nom' => $nom, |
|
| 125 | - 'email' => $email, |
|
| 126 | - 'login' => $login, |
|
| 127 | - 'statut' => '0minirezo' |
|
| 128 | - ]); |
|
| 129 | - // le passer webmestre separrement du reste, au cas ou l'alter n'aurait pas fonctionne |
|
| 130 | - @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
|
| 131 | - if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
|
| 132 | - $echec = _T('avis_erreur_creation_compte'); |
|
| 133 | - echouer_etape_3b($echec); |
|
| 134 | - } |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - // inserer email comme email webmaster principal |
|
| 138 | - // (sauf s'il est vide: cas de la re-installation) |
|
| 139 | - if ($email) { |
|
| 140 | - ecrire_meta('email_webmaster', $email); |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - // Connecter directement celui qui vient de (re)donner son login |
|
| 144 | - // mais sans cookie d'admin ni connexion longue |
|
| 145 | - include_spip('inc/auth'); |
|
| 146 | - $auteur = auth_identifier_login($login, $pass); |
|
| 147 | - if (!$auteur || !auth_loger($auteur)) { |
|
| 148 | - spip_log("login automatique impossible $auth_spip $session" . (is_countable($row) ? count($row) : 0)); |
|
| 149 | - } |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - // installer les metas |
|
| 153 | - $config = charger_fonction('config', 'inc'); |
|
| 154 | - $config(); |
|
| 155 | - |
|
| 156 | - // activer les plugins |
|
| 157 | - // leur installation ne peut pas se faire sur le meme hit, il faudra donc |
|
| 158 | - // poursuivre au hit suivant |
|
| 159 | - include_spip('inc/plugin'); |
|
| 160 | - actualise_plugins_actifs(); |
|
| 161 | - |
|
| 162 | - |
|
| 163 | - include_spip('inc/distant'); |
|
| 164 | - redirige_par_entete(parametre_url(self(), 'etape', '4', '&')); |
|
| 19 | + $auth_spip = null; |
|
| 20 | + $session = null; |
|
| 21 | + $row = null; |
|
| 22 | + $login = _request('login'); |
|
| 23 | + $email = _request('email'); |
|
| 24 | + $nom = _request('nom'); |
|
| 25 | + $pass = _request('pass'); |
|
| 26 | + $pass_verif = _request('pass_verif'); |
|
| 27 | + |
|
| 28 | + $server_db = defined('_INSTALL_SERVER_DB') |
|
| 29 | + ? _INSTALL_SERVER_DB |
|
| 30 | + : _request('server_db'); |
|
| 31 | + |
|
| 32 | + if (!defined('_PASS_LONGUEUR_MINI')) { |
|
| 33 | + define('_PASS_LONGUEUR_MINI', 6); |
|
| 34 | + } |
|
| 35 | + if (!defined('_LOGIN_TROP_COURT')) { |
|
| 36 | + define('_LOGIN_TROP_COURT', 4); |
|
| 37 | + } |
|
| 38 | + if ($login) { |
|
| 39 | + $echec = ($pass != $pass_verif) ? |
|
| 40 | + _T('info_passes_identiques') |
|
| 41 | + : ((strlen($pass) < _PASS_LONGUEUR_MINI) ? |
|
| 42 | + _T('info_passe_trop_court_car_pluriel', ['nb' => _PASS_LONGUEUR_MINI]) |
|
| 43 | + : ((strlen($login) < _LOGIN_TROP_COURT) ? |
|
| 44 | + _T('info_login_trop_court') |
|
| 45 | + : '')); |
|
| 46 | + include_spip('inc/filtres'); |
|
| 47 | + if (!$echec && $email && !email_valide($email)) { |
|
| 48 | + $echec = _T('form_email_non_valide'); |
|
| 49 | + } |
|
| 50 | + if ($echec) { |
|
| 51 | + echouer_etape_3b($echec); |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + if (@file_exists(_FILE_CHMOD_TMP)) { |
|
| 56 | + include(_FILE_CHMOD_TMP); |
|
| 57 | + } else { |
|
| 58 | + redirige_url_ecrire('install'); |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + if (!@file_exists(_FILE_CONNECT_TMP)) { |
|
| 62 | + redirige_url_ecrire('install'); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + # maintenant on connait le vrai charset du site s'il est deja configure |
|
| 66 | + # sinon par defaut lire_meta reglera _DEFAULT_CHARSET |
|
| 67 | + # (les donnees arrivent de toute facon postees en _DEFAULT_CHARSET) |
|
| 68 | + |
|
| 69 | + lire_metas(); |
|
| 70 | + if ($login) { |
|
| 71 | + include_spip('inc/charsets'); |
|
| 72 | + |
|
| 73 | + $nom = (importer_charset($nom, _DEFAULT_CHARSET)); |
|
| 74 | + $login = (importer_charset($login, _DEFAULT_CHARSET)); |
|
| 75 | + $email = (importer_charset($email, _DEFAULT_CHARSET)); |
|
| 76 | + |
|
| 77 | + include_spip('auth/spip'); |
|
| 78 | + // prelablement, creer le champ webmestre si il n'existe pas (install neuve |
|
| 79 | + // sur une vieille base |
|
| 80 | + $t = sql_showtable('spip_auteurs', true); |
|
| 81 | + if (!isset($t['field']['webmestre'])) { |
|
| 82 | + @sql_alter("TABLE spip_auteurs ADD webmestre varchar(3) DEFAULT 'non' NOT NULL"); |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + // il faut avoir une cle des auth valide pour creer un nouvel auteur webmestre |
|
| 86 | + $cles = \Spip\Chiffrer\SpipCles::instance(); |
|
| 87 | + $secret = $cles->getSecretAuth(); |
|
| 88 | + |
|
| 89 | + $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 90 | + if ($id_auteur !== null) { |
|
| 91 | + // c'est un auteur connu : si on a pas de secret il faut absolument qu'il se reconnecte avec le meme mot de passe |
|
| 92 | + // pour restaurer la copie des cles |
|
| 93 | + if (!$secret && !auth_spip_initialiser_secret()) { |
|
| 94 | + $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur); |
|
| 95 | + if (empty($row['backup_cles']) || !$cles->restore($row['backup_cles'], $pass, $row['pass'], $id_auteur)) { |
|
| 96 | + $echec = _T('avis_connexion_erreur_fichier_cle_manquant_1'); |
|
| 97 | + echouer_etape_3b($echec); |
|
| 98 | + } |
|
| 99 | + spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 100 | + $cles->save(); |
|
| 101 | + } |
|
| 102 | + |
|
| 103 | + sql_updateq('spip_auteurs', [ |
|
| 104 | + 'nom' => $nom, |
|
| 105 | + 'email' => $email, |
|
| 106 | + 'login' => $login, |
|
| 107 | + 'statut' => '0minirezo' |
|
| 108 | + ], 'id_auteur=' . (int) $id_auteur); |
|
| 109 | + // le passer webmestre separement du reste, au cas ou l'alter n'aurait pas fonctionne |
|
| 110 | + @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
|
| 111 | + if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
|
| 112 | + $echec = _T('avis_erreur_creation_compte'); |
|
| 113 | + echouer_etape_3b($echec); |
|
| 114 | + } |
|
| 115 | + } else { |
|
| 116 | + // Si on a pas de cle et qu'on ne sait pas la creer, on ne peut pas creer de nouveau compte : |
|
| 117 | + // il faut qu'un webmestre avec un backup fasse l'install |
|
| 118 | + if (!$secret && !auth_spip_initialiser_secret()) { |
|
| 119 | + $echec = _T('avis_connexion_erreur_fichier_cle_manquant_2'); |
|
| 120 | + echouer_etape_3b($echec); |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + $id_auteur = sql_insertq('spip_auteurs', [ |
|
| 124 | + 'nom' => $nom, |
|
| 125 | + 'email' => $email, |
|
| 126 | + 'login' => $login, |
|
| 127 | + 'statut' => '0minirezo' |
|
| 128 | + ]); |
|
| 129 | + // le passer webmestre separrement du reste, au cas ou l'alter n'aurait pas fonctionne |
|
| 130 | + @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
|
| 131 | + if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
|
| 132 | + $echec = _T('avis_erreur_creation_compte'); |
|
| 133 | + echouer_etape_3b($echec); |
|
| 134 | + } |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + // inserer email comme email webmaster principal |
|
| 138 | + // (sauf s'il est vide: cas de la re-installation) |
|
| 139 | + if ($email) { |
|
| 140 | + ecrire_meta('email_webmaster', $email); |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + // Connecter directement celui qui vient de (re)donner son login |
|
| 144 | + // mais sans cookie d'admin ni connexion longue |
|
| 145 | + include_spip('inc/auth'); |
|
| 146 | + $auteur = auth_identifier_login($login, $pass); |
|
| 147 | + if (!$auteur || !auth_loger($auteur)) { |
|
| 148 | + spip_log("login automatique impossible $auth_spip $session" . (is_countable($row) ? count($row) : 0)); |
|
| 149 | + } |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + // installer les metas |
|
| 153 | + $config = charger_fonction('config', 'inc'); |
|
| 154 | + $config(); |
|
| 155 | + |
|
| 156 | + // activer les plugins |
|
| 157 | + // leur installation ne peut pas se faire sur le meme hit, il faudra donc |
|
| 158 | + // poursuivre au hit suivant |
|
| 159 | + include_spip('inc/plugin'); |
|
| 160 | + actualise_plugins_actifs(); |
|
| 161 | + |
|
| 162 | + |
|
| 163 | + include_spip('inc/distant'); |
|
| 164 | + redirige_par_entete(parametre_url(self(), 'etape', '4', '&')); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | function echouer_etape_3b($echec) { |
| 168 | - echo minipres( |
|
| 169 | - 'AUTO', |
|
| 170 | - info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 171 | - "<div class='error'><h3>$echec</h3>\n" . |
|
| 172 | - '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 173 | - '</div>' |
|
| 174 | - ); |
|
| 175 | - exit; |
|
| 168 | + echo minipres( |
|
| 169 | + 'AUTO', |
|
| 170 | + info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 171 | + "<div class='error'><h3>$echec</h3>\n" . |
|
| 172 | + '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 173 | + '</div>' |
|
| 174 | + ); |
|
| 175 | + exit; |
|
| 176 | 176 | } |
@@ -86,17 +86,17 @@ discard block |
||
| 86 | 86 | $cles = \Spip\Chiffrer\SpipCles::instance(); |
| 87 | 87 | $secret = $cles->getSecretAuth(); |
| 88 | 88 | |
| 89 | - $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login=' . sql_quote($login)); |
|
| 89 | + $id_auteur = sql_getfetsel('id_auteur', 'spip_auteurs', 'login='.sql_quote($login)); |
|
| 90 | 90 | if ($id_auteur !== null) { |
| 91 | 91 | // c'est un auteur connu : si on a pas de secret il faut absolument qu'il se reconnecte avec le meme mot de passe |
| 92 | 92 | // pour restaurer la copie des cles |
| 93 | 93 | if (!$secret && !auth_spip_initialiser_secret()) { |
| 94 | - $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur=' . (int) $id_auteur); |
|
| 94 | + $row = sql_fetsel('backup_cles, pass', 'spip_auteurs', 'id_auteur='.(int) $id_auteur); |
|
| 95 | 95 | if (empty($row['backup_cles']) || !$cles->restore($row['backup_cles'], $pass, $row['pass'], $id_auteur)) { |
| 96 | 96 | $echec = _T('avis_connexion_erreur_fichier_cle_manquant_1'); |
| 97 | 97 | echouer_etape_3b($echec); |
| 98 | 98 | } |
| 99 | - spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 99 | + spip_log("Les cles secretes ont ete restaurées avec le backup du webmestre #$id_auteur", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 100 | 100 | $cles->save(); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'email' => $email, |
| 106 | 106 | 'login' => $login, |
| 107 | 107 | 'statut' => '0minirezo' |
| 108 | - ], 'id_auteur=' . (int) $id_auteur); |
|
| 108 | + ], 'id_auteur='.(int) $id_auteur); |
|
| 109 | 109 | // le passer webmestre separement du reste, au cas ou l'alter n'aurait pas fonctionne |
| 110 | 110 | @sql_updateq('spip_auteurs', ['webmestre' => 'oui'], "id_auteur=$id_auteur"); |
| 111 | 111 | if (!auth_spip_modifier_pass($login, $pass, $id_auteur)) { |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | include_spip('inc/auth'); |
| 146 | 146 | $auteur = auth_identifier_login($login, $pass); |
| 147 | 147 | if (!$auteur || !auth_loger($auteur)) { |
| 148 | - spip_log("login automatique impossible $auth_spip $session" . (is_countable($row) ? count($row) : 0)); |
|
| 148 | + spip_log("login automatique impossible $auth_spip $session".(is_countable($row) ? count($row) : 0)); |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
@@ -167,9 +167,9 @@ discard block |
||
| 167 | 167 | function echouer_etape_3b($echec) { |
| 168 | 168 | echo minipres( |
| 169 | 169 | 'AUTO', |
| 170 | - info_progression_etape(3, 'etape_', 'install/', true) . |
|
| 171 | - "<div class='error'><h3>$echec</h3>\n" . |
|
| 172 | - '<p>' . _T('avis_connexion_echec_2') . '</p>' . |
|
| 170 | + info_progression_etape(3, 'etape_', 'install/', true). |
|
| 171 | + "<div class='error'><h3>$echec</h3>\n". |
|
| 172 | + '<p>'._T('avis_connexion_echec_2').'</p>'. |
|
| 173 | 173 | '</div>' |
| 174 | 174 | ); |
| 175 | 175 | exit; |
@@ -10,96 +10,96 @@ |
||
| 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) ? implode(',', $v) : (string) $v; |
|
| 98 | - $champs[$nom] = [ |
|
| 99 | - 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 100 | - 'valeur' => $val |
|
| 101 | - ]; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return $champs ? 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) ? implode(',', $v) : (string) $v; |
|
| 98 | + $champs[$nom] = [ |
|
| 99 | + 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 100 | + 'valeur' => $val |
|
| 101 | + ]; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return $champs ? fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />') : ''; |
|
| 105 | 105 | } |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | if ($fail) { |
| 40 | 40 | echo info_etape(_T('info_chemin_acces_annuaire')), |
| 41 | 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>'; |
|
| 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 | 44 | } else { |
| 45 | 45 | info_etape(_T('info_reglage_ldap')); |
| 46 | 46 | echo info_progression_etape(4, 'etape_ldap', 'install/'); |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $res = install_propager(['adresse_ldap', 'port_ldap', 'login_ldap', 'pass_ldap', 'protocole_ldap', 'tls_ldap']) |
| 55 | 55 | . "<input type='hidden' name='etape' value='ldap5' />" |
| 56 | - . "<input type='hidden' name='base_ldap' value='" . spip_htmlentities($base_ldap) . "' />" |
|
| 56 | + . "<input type='hidden' name='base_ldap' value='".spip_htmlentities($base_ldap)."' />" |
|
| 57 | 57 | . fieldset( |
| 58 | 58 | _T('info_statut_utilisateurs_1'), |
| 59 | 59 | [ |
| 60 | 60 | 'statut_ldap' => [ |
| 61 | - 'label' => _T('info_statut_utilisateurs_2') . '<br />', |
|
| 61 | + 'label' => _T('info_statut_utilisateurs_2').'<br />', |
|
| 62 | 62 | 'valeur' => $statut_ldap, |
| 63 | 63 | 'alternatives' => $statuts |
| 64 | 64 | ] |
@@ -75,9 +75,9 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | function liste_statuts_ldap() { |
| 77 | 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 />') |
|
| 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 | 81 | ]; |
| 82 | 82 | |
| 83 | 83 | $res = []; |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | function install_ldap_correspondances() { |
| 94 | 94 | $champs = []; |
| 95 | 95 | foreach (is_array($GLOBALS['ldap_attributes']) ? $GLOBALS['ldap_attributes'] : [] as $champ => $v) { |
| 96 | - $nom = 'ldap_' . $champ; |
|
| 96 | + $nom = 'ldap_'.$champ; |
|
| 97 | 97 | $val = is_array($v) ? implode(',', $v) : (string) $v; |
| 98 | 98 | $champs[$nom] = [ |
| 99 | - 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]) . '<br />', |
|
| 99 | + 'label' => _T('ldap_correspondance', ['champ' => "<tt>$champ</tt>"]).'<br />', |
|
| 100 | 100 | 'valeur' => $val |
| 101 | 101 | ]; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return $champs ? fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2') . '<br /><br />') : ''; |
|
| 104 | + return $champs ? fieldset(_T('ldap_correspondance_1'), $champs, '', _T('ldap_correspondance_2').'<br /><br />') : ''; |
|
| 105 | 105 | } |
@@ -10,167 +10,167 @@ |
||
| 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 | - . implode("</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 | + . implode("</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') || $GLOBALS['table_prefix'] != 'spip') |
|
| 167 | - ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 168 | - : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 169 | - . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 170 | - . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
|
| 171 | - . 'spip' # valeur par defaut |
|
| 172 | - . "' size='20' /></p></fieldset>" |
|
| 173 | - ) |
|
| 174 | - |
|
| 175 | - . 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') || $GLOBALS['table_prefix'] != 'spip') |
|
| 167 | + ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 168 | + : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 169 | + . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 170 | + . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
|
| 171 | + . 'spip' # valeur par defaut |
|
| 172 | + . "' size='20' /></p></fieldset>" |
|
| 173 | + ) |
|
| 174 | + |
|
| 175 | + . bouton_suivant())); |
|
| 176 | 176 | } |
@@ -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,19 +154,19 @@ 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') || $GLOBALS['table_prefix'] != 'spip') |
| 167 | - ? '<h3>' . _T('install_table_prefix_hebergeur') . ' <tt>' . $GLOBALS['table_prefix'] . '</tt>' . '</h3>' |
|
| 168 | - : '<fieldset><legend>' . _T('texte_choix_table_prefix') . "</legend>\n" |
|
| 169 | - . "<p><label for='table_prefix'>" . _T('info_table_prefix') . '</label></p><p>' |
|
| 167 | + ? '<h3>'._T('install_table_prefix_hebergeur').' <tt>'.$GLOBALS['table_prefix'].'</tt>'.'</h3>' |
|
| 168 | + : '<fieldset><legend>'._T('texte_choix_table_prefix')."</legend>\n" |
|
| 169 | + . "<p><label for='table_prefix'>"._T('info_table_prefix').'</label></p><p>' |
|
| 170 | 170 | . "\n<input type='text' id='tprefix' name='tprefix' class='text' value='" |
| 171 | 171 | . 'spip' # valeur par defaut |
| 172 | 172 | . "' size='20' /></p></fieldset>" |