@@ -31,18 +31,18 @@ discard block |
||
| 31 | 31 | // alors il faut blinder les variables d'URL |
| 32 | 32 | // |
| 33 | 33 | if (autoriser_sans_cookie($exec)) { |
| 34 | - if (!isset($reinstall)) $reinstall = 'non'; |
|
| 35 | - set_request('transformer_xml'); |
|
| 36 | - $var_auth = true; |
|
| 34 | + if (!isset($reinstall)) $reinstall = 'non'; |
|
| 35 | + set_request('transformer_xml'); |
|
| 36 | + $var_auth = true; |
|
| 37 | 37 | } else { |
| 38 | - // Authentification, redefinissable |
|
| 39 | - $auth = charger_fonction('auth', 'inc'); |
|
| 40 | - $var_auth = $auth(); |
|
| 41 | - if ($var_auth) { |
|
| 42 | - echo auth_echec($var_auth); |
|
| 43 | - exit; |
|
| 44 | - } |
|
| 45 | - } |
|
| 38 | + // Authentification, redefinissable |
|
| 39 | + $auth = charger_fonction('auth', 'inc'); |
|
| 40 | + $var_auth = $auth(); |
|
| 41 | + if ($var_auth) { |
|
| 42 | + echo auth_echec($var_auth); |
|
| 43 | + exit; |
|
| 44 | + } |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | // initialiser a la langue par defaut |
| 48 | 48 | include_spip('inc/lang'); |
@@ -52,25 +52,25 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | if (_request('action') OR _request('var_ajax') OR _request('formulaire_action')){ |
| 55 | - // Charger l'aiguilleur qui va mettre sur la bonne voie les traitements derogatoires |
|
| 56 | - include_spip('public/aiguiller'); |
|
| 57 | - if ( |
|
| 58 | - // cas des appels actions ?action=xxx |
|
| 59 | - traiter_appels_actions() |
|
| 60 | - OR |
|
| 61 | - // cas des hits ajax sur les inclusions ajax |
|
| 62 | - traiter_appels_inclusions_ajax() |
|
| 63 | - OR |
|
| 64 | - // cas des formulaires charger/verifier/traiter |
|
| 65 | - traiter_formulaires_dynamiques()) |
|
| 66 | - exit; // le hit est fini ! |
|
| 55 | + // Charger l'aiguilleur qui va mettre sur la bonne voie les traitements derogatoires |
|
| 56 | + include_spip('public/aiguiller'); |
|
| 57 | + if ( |
|
| 58 | + // cas des appels actions ?action=xxx |
|
| 59 | + traiter_appels_actions() |
|
| 60 | + OR |
|
| 61 | + // cas des hits ajax sur les inclusions ajax |
|
| 62 | + traiter_appels_inclusions_ajax() |
|
| 63 | + OR |
|
| 64 | + // cas des formulaires charger/verifier/traiter |
|
| 65 | + traiter_formulaires_dynamiques()) |
|
| 66 | + exit; // le hit est fini ! |
|
| 67 | 67 | } |
| 68 | 68 | // securiser les redirect du back-office |
| 69 | 69 | if (_request('redirect')) { |
| 70 | - if (!function_exists('securiser_redirect_action')){ |
|
| 71 | - include_spip('public/aiguiller'); |
|
| 72 | - } |
|
| 73 | - set_request('redirect',securiser_redirect_action(_request('redirect'))); |
|
| 70 | + if (!function_exists('securiser_redirect_action')){ |
|
| 71 | + include_spip('public/aiguiller'); |
|
| 72 | + } |
|
| 73 | + set_request('redirect',securiser_redirect_action(_request('redirect'))); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | AND !_AJAX |
| 84 | 84 | AND isset($GLOBALS['meta']['version_installee']) |
| 85 | 85 | AND ($GLOBALS['spip_version_base'] != (str_replace(',','.',$GLOBALS['meta']['version_installee'])))) |
| 86 | - $exec = 'demande_mise_a_jour'; |
|
| 86 | + $exec = 'demande_mise_a_jour'; |
|
| 87 | 87 | |
| 88 | 88 | // Quand une action d'administration est en cours (meta "admin"), |
| 89 | 89 | // refuser les connexions non-admin ou Ajax pour laisser la base intacte. |
@@ -92,42 +92,42 @@ discard block |
||
| 92 | 92 | // sinon c'est qu'elle a ete interrompue et il faut la reprendre |
| 93 | 93 | |
| 94 | 94 | elseif (isset($GLOBALS['meta']["admin"])) { |
| 95 | - if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) |
|
| 96 | - list(,$var_f,$n) = $l; |
|
| 97 | - if (_AJAX |
|
| 98 | - OR !( |
|
| 99 | - isset($_COOKIE['spip_admin']) |
|
| 100 | - OR (isset($GLOBALS['visiteur_session']) AND $GLOBALS['visiteur_session']['statut']=='0minirezo') |
|
| 101 | - ) |
|
| 102 | - ) { |
|
| 103 | - spip_log("Quand la meta admin vaut " . |
|
| 104 | - $GLOBALS['meta']["admin"] . |
|
| 105 | - " seul un admin peut se connecter et sans AJAX." . |
|
| 106 | - " En cas de probleme, detruire cette meta."); |
|
| 107 | - die(_T('info_travaux_texte')); |
|
| 108 | - } |
|
| 109 | - if ($n) { |
|
| 110 | - list(,$var_f,$n) = $l; |
|
| 111 | - if (tester_url_ecrire("base_$var_f")) |
|
| 112 | - $var_f = "base_$var_f"; |
|
| 113 | - if ($var_f != $exec) { |
|
| 114 | - spip_log("Le script $var_f lance par auteur$n se substitue a l'exec $exec"); |
|
| 115 | - $exec = $var_f; |
|
| 116 | - set_request('exec', $exec); |
|
| 117 | - } |
|
| 118 | - } |
|
| 95 | + if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) |
|
| 96 | + list(,$var_f,$n) = $l; |
|
| 97 | + if (_AJAX |
|
| 98 | + OR !( |
|
| 99 | + isset($_COOKIE['spip_admin']) |
|
| 100 | + OR (isset($GLOBALS['visiteur_session']) AND $GLOBALS['visiteur_session']['statut']=='0minirezo') |
|
| 101 | + ) |
|
| 102 | + ) { |
|
| 103 | + spip_log("Quand la meta admin vaut " . |
|
| 104 | + $GLOBALS['meta']["admin"] . |
|
| 105 | + " seul un admin peut se connecter et sans AJAX." . |
|
| 106 | + " En cas de probleme, detruire cette meta."); |
|
| 107 | + die(_T('info_travaux_texte')); |
|
| 108 | + } |
|
| 109 | + if ($n) { |
|
| 110 | + list(,$var_f,$n) = $l; |
|
| 111 | + if (tester_url_ecrire("base_$var_f")) |
|
| 112 | + $var_f = "base_$var_f"; |
|
| 113 | + if ($var_f != $exec) { |
|
| 114 | + spip_log("Le script $var_f lance par auteur$n se substitue a l'exec $exec"); |
|
| 115 | + $exec = $var_f; |
|
| 116 | + set_request('exec', $exec); |
|
| 117 | + } |
|
| 118 | + } |
|
| 119 | 119 | } |
| 120 | 120 | // si nom pas plausible, prendre le script par defaut |
| 121 | 121 | // attention aux deux cas 404/403 qui commencent par un 4 ! |
| 122 | 122 | elseif (!preg_match(',^[a-z4_][0-9a-z_-]*$,i', $exec)) { |
| 123 | - $exec = "accueil"; |
|
| 124 | - set_request('exec', $exec); |
|
| 123 | + $exec = "accueil"; |
|
| 124 | + set_request('exec', $exec); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | // compatibilite ascendante : obsolete, ne plus utiliser |
| 128 | 128 | $GLOBALS['spip_display'] = isset($GLOBALS['visiteur_session']['prefs']['display']) |
| 129 | - ? $GLOBALS['visiteur_session']['prefs']['display'] |
|
| 130 | - : 0; |
|
| 129 | + ? $GLOBALS['visiteur_session']['prefs']['display'] |
|
| 130 | + : 0; |
|
| 131 | 131 | $GLOBALS['spip_ecran'] = isset($_COOKIE['spip_ecran']) ? $_COOKIE['spip_ecran'] : "etroit"; |
| 132 | 132 | |
| 133 | 133 | // si la langue est specifiee par cookie et ne correspond pas |
@@ -136,26 +136,26 @@ discard block |
||
| 136 | 136 | // si le cookie n'est pas pose correctement dans l'action |
| 137 | 137 | if (!$var_auth AND isset($_COOKIE['spip_lang_ecrire']) |
| 138 | 138 | AND $_COOKIE['spip_lang_ecrire'] <> $GLOBALS['visiteur_session']['lang']) { |
| 139 | - include_spip('action/converser'); |
|
| 140 | - action_converser_post($GLOBALS['visiteur_session']['lang'],true); |
|
| 139 | + include_spip('action/converser'); |
|
| 140 | + action_converser_post($GLOBALS['visiteur_session']['lang'],true); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | // Passer la main aux outils XML a la demande (meme les redac s'ils veulent). |
| 145 | 145 | // mais seulement si on a bien ete auhentifie |
| 146 | 146 | if ($var_f = _request('transformer_xml')) { |
| 147 | - set_request('var_url', $exec); |
|
| 148 | - $exec = $var_f; |
|
| 147 | + set_request('var_url', $exec); |
|
| 148 | + $exec = $var_f; |
|
| 149 | 149 | } |
| 150 | 150 | if ($var_f = tester_url_ecrire($exec)) { |
| 151 | - $var_f = charger_fonction ($var_f); |
|
| 152 | - $var_f(); // at last |
|
| 151 | + $var_f = charger_fonction ($var_f); |
|
| 152 | + $var_f(); // at last |
|
| 153 | 153 | } |
| 154 | 154 | else { |
| 155 | - // Rien de connu: rerouter vers exec=404 au lieu d'echouer |
|
| 156 | - // ce qui permet de laisser la main a un plugin |
|
| 157 | - $var_f = charger_fonction('404'); |
|
| 158 | - $var_f($exec); |
|
| 155 | + // Rien de connu: rerouter vers exec=404 au lieu d'echouer |
|
| 156 | + // ce qui permet de laisser la main a un plugin |
|
| 157 | + $var_f = charger_fonction('404'); |
|
| 158 | + $var_f($exec); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | ?> |
@@ -16,31 +16,31 @@ |
||
| 16 | 16 | |
| 17 | 17 | function typographie_en_dist($letexte) { |
| 18 | 18 | |
| 19 | - // zouli apostrophe |
|
| 20 | - $letexte = str_replace("'", "’", $letexte); |
|
| 21 | - |
|
| 22 | - $cherche1 = array( |
|
| 23 | - '/ --?,/S' |
|
| 24 | - ); |
|
| 25 | - $remplace1 = array( |
|
| 26 | - '~\0' |
|
| 27 | - ); |
|
| 28 | - $letexte = preg_replace($cherche1, $remplace1, $letexte); |
|
| 29 | - |
|
| 30 | - $letexte = str_replace(" ", "~", $letexte); |
|
| 31 | - $letexte = preg_replace("/ *~+ */", "~", $letexte); |
|
| 32 | - |
|
| 33 | - $cherche2 = array( |
|
| 34 | - '/([^-\n]|^)--([^-]|$)/', |
|
| 35 | - '/~/' |
|
| 36 | - ); |
|
| 37 | - $remplace2 = array( |
|
| 38 | - '\1—\2', |
|
| 39 | - ' ' |
|
| 40 | - ); |
|
| 41 | - |
|
| 42 | - $letexte = preg_replace($cherche2, $remplace2, $letexte); |
|
| 43 | - |
|
| 44 | - return $letexte; |
|
| 19 | + // zouli apostrophe |
|
| 20 | + $letexte = str_replace("'", "’", $letexte); |
|
| 21 | + |
|
| 22 | + $cherche1 = array( |
|
| 23 | + '/ --?,/S' |
|
| 24 | + ); |
|
| 25 | + $remplace1 = array( |
|
| 26 | + '~\0' |
|
| 27 | + ); |
|
| 28 | + $letexte = preg_replace($cherche1, $remplace1, $letexte); |
|
| 29 | + |
|
| 30 | + $letexte = str_replace(" ", "~", $letexte); |
|
| 31 | + $letexte = preg_replace("/ *~+ */", "~", $letexte); |
|
| 32 | + |
|
| 33 | + $cherche2 = array( |
|
| 34 | + '/([^-\n]|^)--([^-]|$)/', |
|
| 35 | + '/~/' |
|
| 36 | + ); |
|
| 37 | + $remplace2 = array( |
|
| 38 | + '\1—\2', |
|
| 39 | + ' ' |
|
| 40 | + ); |
|
| 41 | + |
|
| 42 | + $letexte = preg_replace($cherche2, $remplace2, $letexte); |
|
| 43 | + |
|
| 44 | + return $letexte; |
|
| 45 | 45 | } |
| 46 | 46 | ?> |
@@ -16,58 +16,58 @@ |
||
| 16 | 16 | |
| 17 | 17 | function typographie_fr_dist($letexte) { |
| 18 | 18 | |
| 19 | - static $trans; |
|
| 19 | + static $trans; |
|
| 20 | 20 | |
| 21 | - // Nettoyer 160 = nbsp ; 187 = raquo ; 171 = laquo ; 176 = deg ; |
|
| 22 | - // 147 = ldquo; 148 = rdquo; ' = zouli apostrophe |
|
| 23 | - if (!$trans) { |
|
| 24 | - $trans = array( |
|
| 25 | - "'" => "’", |
|
| 26 | - " " => "~", |
|
| 27 | - "»" => "»", |
|
| 28 | - "«" => "«", |
|
| 29 | - "”" => "”", |
|
| 30 | - "“" => "“", |
|
| 31 | - "°" => "°" |
|
| 32 | - ); |
|
| 33 | - $chars = array(160 => '~', 187 => '»', 171 => '«', 148 => '”', 147 => '“', 176 => '°'); |
|
| 34 | - $chars_trans = array_keys($chars); |
|
| 35 | - $chars = array_values($chars); |
|
| 36 | - $chars_trans = implode(' ',array_map('chr',$chars_trans)); |
|
| 37 | - $chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer')); |
|
| 38 | - $chars_trans = explode(" ",$chars_trans); |
|
| 39 | - foreach($chars as $k=>$r) |
|
| 40 | - $trans[$chars_trans[$k]] = $r; |
|
| 41 | - } |
|
| 21 | + // Nettoyer 160 = nbsp ; 187 = raquo ; 171 = laquo ; 176 = deg ; |
|
| 22 | + // 147 = ldquo; 148 = rdquo; ' = zouli apostrophe |
|
| 23 | + if (!$trans) { |
|
| 24 | + $trans = array( |
|
| 25 | + "'" => "’", |
|
| 26 | + " " => "~", |
|
| 27 | + "»" => "»", |
|
| 28 | + "«" => "«", |
|
| 29 | + "”" => "”", |
|
| 30 | + "“" => "“", |
|
| 31 | + "°" => "°" |
|
| 32 | + ); |
|
| 33 | + $chars = array(160 => '~', 187 => '»', 171 => '«', 148 => '”', 147 => '“', 176 => '°'); |
|
| 34 | + $chars_trans = array_keys($chars); |
|
| 35 | + $chars = array_values($chars); |
|
| 36 | + $chars_trans = implode(' ',array_map('chr',$chars_trans)); |
|
| 37 | + $chars_trans = unicode2charset(charset2unicode($chars_trans, 'iso-8859-1', 'forcer')); |
|
| 38 | + $chars_trans = explode(" ",$chars_trans); |
|
| 39 | + foreach($chars as $k=>$r) |
|
| 40 | + $trans[$chars_trans[$k]] = $r; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - $letexte = strtr($letexte, $trans); |
|
| 43 | + $letexte = strtr($letexte, $trans); |
|
| 44 | 44 | |
| 45 | - $cherche1 = array( |
|
| 46 | - /* 1 */ '/((?:^|[^\#0-9a-zA-Z\&])[\#0-9a-zA-Z]*)\;/S', |
|
| 47 | - /* 2 */ '/»| --?,|(?::(?!:)| %)(?:\W|$)/S', |
|
| 48 | - /* 3 */ '/([^[<(!?.])([!?][!?\.]*)/iS', |
|
| 49 | - /* 4 */ '/«|(?:M(?:M?\.|mes?|r\.?)|[MnN]°) /S' |
|
| 50 | - ); |
|
| 51 | - $remplace1 = array( |
|
| 52 | - /* 1 */ '\1~;', |
|
| 53 | - /* 2 */ '~\0', |
|
| 54 | - /* 3 */ '\1~\2', |
|
| 55 | - /* 4 */ '\0~' |
|
| 56 | - ); |
|
| 57 | - $letexte = preg_replace($cherche1, $remplace1, $letexte); |
|
| 58 | - $letexte = preg_replace("/ *~+ */S", "~", $letexte); |
|
| 45 | + $cherche1 = array( |
|
| 46 | + /* 1 */ '/((?:^|[^\#0-9a-zA-Z\&])[\#0-9a-zA-Z]*)\;/S', |
|
| 47 | + /* 2 */ '/»| --?,|(?::(?!:)| %)(?:\W|$)/S', |
|
| 48 | + /* 3 */ '/([^[<(!?.])([!?][!?\.]*)/iS', |
|
| 49 | + /* 4 */ '/«|(?:M(?:M?\.|mes?|r\.?)|[MnN]°) /S' |
|
| 50 | + ); |
|
| 51 | + $remplace1 = array( |
|
| 52 | + /* 1 */ '\1~;', |
|
| 53 | + /* 2 */ '~\0', |
|
| 54 | + /* 3 */ '\1~\2', |
|
| 55 | + /* 4 */ '\0~' |
|
| 56 | + ); |
|
| 57 | + $letexte = preg_replace($cherche1, $remplace1, $letexte); |
|
| 58 | + $letexte = preg_replace("/ *~+ */S", "~", $letexte); |
|
| 59 | 59 | |
| 60 | - $cherche2 = array( |
|
| 61 | - '/([^-\n]|^)--([^-]|$)/S', |
|
| 62 | - ',(' ._PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', |
|
| 63 | - '/~/' |
|
| 64 | - ); |
|
| 65 | - $remplace2 = array( |
|
| 66 | - '\1—\2', |
|
| 67 | - '\1\3\4', |
|
| 68 | - ' ' |
|
| 69 | - ); |
|
| 70 | - $letexte = preg_replace($cherche2, $remplace2, $letexte); |
|
| 60 | + $cherche2 = array( |
|
| 61 | + '/([^-\n]|^)--([^-]|$)/S', |
|
| 62 | + ',(' ._PROTOCOLES_STD . ')~((://[^"\'\s\[\]\}\)<>]+)~([?]))?,S', |
|
| 63 | + '/~/' |
|
| 64 | + ); |
|
| 65 | + $remplace2 = array( |
|
| 66 | + '\1—\2', |
|
| 67 | + '\1\3\4', |
|
| 68 | + ' ' |
|
| 69 | + ); |
|
| 70 | + $letexte = preg_replace($cherche2, $remplace2, $letexte); |
|
| 71 | 71 | |
| 72 | - return $letexte; |
|
| 72 | + return $letexte; |
|
| 73 | 73 | } |
@@ -13,42 +13,42 @@ |
||
| 13 | 13 | // http://doc.spip.org/@notifications_instituerarticle_dist |
| 14 | 14 | function notifications_instituerarticle_dist($quoi, $id_article, $options) { |
| 15 | 15 | |
| 16 | - // ne devrait jamais se produire |
|
| 17 | - if ($options['statut'] == $options['statut_ancien']) { |
|
| 18 | - spip_log("statut inchange",'notifications'); |
|
| 19 | - return; |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - include_spip('inc/texte'); |
|
| 23 | - |
|
| 24 | - $modele = ""; |
|
| 25 | - if ($options['statut'] == 'publie') { |
|
| 26 | - if ($GLOBALS['meta']["post_dates"]=='non' |
|
| 27 | - AND strtotime($options['date'])>time()) |
|
| 28 | - $modele = "notifications/article_valide"; |
|
| 29 | - else |
|
| 30 | - $modele = "notifications/article_publie"; |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie') |
|
| 34 | - $modele = "notifications/article_propose"; |
|
| 35 | - |
|
| 36 | - if ($modele){ |
|
| 37 | - $destinataires = array(); |
|
| 38 | - if ($GLOBALS['meta']["suivi_edito"] == "oui") |
|
| 39 | - $destinataires = explode(',',$GLOBALS['meta']["adresse_suivi"]); |
|
| 40 | - |
|
| 41 | - |
|
| 42 | - $destinataires = pipeline('notifications_destinataires', |
|
| 43 | - array( |
|
| 44 | - 'args'=>array('quoi'=>$quoi,'id'=>$id_article,'options'=>$options) |
|
| 45 | - , |
|
| 46 | - 'data'=>$destinataires) |
|
| 47 | - ); |
|
| 48 | - |
|
| 49 | - $texte = email_notification_article($id_article, $modele); |
|
| 50 | - notifications_envoyer_mails($destinataires, $texte); |
|
| 51 | - } |
|
| 16 | + // ne devrait jamais se produire |
|
| 17 | + if ($options['statut'] == $options['statut_ancien']) { |
|
| 18 | + spip_log("statut inchange",'notifications'); |
|
| 19 | + return; |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + include_spip('inc/texte'); |
|
| 23 | + |
|
| 24 | + $modele = ""; |
|
| 25 | + if ($options['statut'] == 'publie') { |
|
| 26 | + if ($GLOBALS['meta']["post_dates"]=='non' |
|
| 27 | + AND strtotime($options['date'])>time()) |
|
| 28 | + $modele = "notifications/article_valide"; |
|
| 29 | + else |
|
| 30 | + $modele = "notifications/article_publie"; |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + if ($options['statut'] == 'prop' AND $options['statut_ancien'] != 'publie') |
|
| 34 | + $modele = "notifications/article_propose"; |
|
| 35 | + |
|
| 36 | + if ($modele){ |
|
| 37 | + $destinataires = array(); |
|
| 38 | + if ($GLOBALS['meta']["suivi_edito"] == "oui") |
|
| 39 | + $destinataires = explode(',',$GLOBALS['meta']["adresse_suivi"]); |
|
| 40 | + |
|
| 41 | + |
|
| 42 | + $destinataires = pipeline('notifications_destinataires', |
|
| 43 | + array( |
|
| 44 | + 'args'=>array('quoi'=>$quoi,'id'=>$id_article,'options'=>$options) |
|
| 45 | + , |
|
| 46 | + 'data'=>$destinataires) |
|
| 47 | + ); |
|
| 48 | + |
|
| 49 | + $texte = email_notification_article($id_article, $modele); |
|
| 50 | + notifications_envoyer_mails($destinataires, $texte); |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | ?> |
@@ -17,27 +17,27 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | function exec_404_dist(){ |
| 19 | 19 | |
| 20 | - $exec = _request('exec'); |
|
| 20 | + $exec = _request('exec'); |
|
| 21 | 21 | |
| 22 | - $titre = "exec_$exec"; |
|
| 23 | - $navigation = ""; |
|
| 24 | - $extra = ""; |
|
| 22 | + $titre = "exec_$exec"; |
|
| 23 | + $navigation = ""; |
|
| 24 | + $extra = ""; |
|
| 25 | 25 | |
| 26 | - include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 27 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 28 | - echo $commencer_page($titre); |
|
| 26 | + include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 27 | + $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 28 | + echo $commencer_page($titre); |
|
| 29 | 29 | |
| 30 | - echo debut_gauche("404_$exec",true); |
|
| 31 | - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 30 | + echo debut_gauche("404_$exec",true); |
|
| 31 | + echo pipeline('affiche_gauche',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 32 | 32 | |
| 33 | - echo creer_colonne_droite("404",true); |
|
| 34 | - echo pipeline('affiche_droite',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 33 | + echo creer_colonne_droite("404",true); |
|
| 34 | + echo pipeline('affiche_droite',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 35 | 35 | |
| 36 | - echo debut_droite("404",true); |
|
| 37 | - echo "<h1 class='grostitre'>"._T('fichier_introuvable',array('fichier'=>$exec))."</h1>"; |
|
| 38 | - echo pipeline('affiche_milieu',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 36 | + echo debut_droite("404",true); |
|
| 37 | + echo "<h1 class='grostitre'>"._T('fichier_introuvable',array('fichier'=>$exec))."</h1>"; |
|
| 38 | + echo pipeline('affiche_milieu',array('args'=>array('exec'=>'404','exec_erreur'=>$exec),'data'=>'')); |
|
| 39 | 39 | |
| 40 | - echo fin_gauche(),fin_page(); |
|
| 40 | + echo fin_gauche(),fin_page(); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | ?> |
@@ -19,62 +19,62 @@ |
||
| 19 | 19 | function exec_upgrade_dist() |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - global $spip_version_base; |
|
| 23 | - if (!_FILE_CONNECT) |
|
| 24 | - redirige_url_ecrire("install"); |
|
| 22 | + global $spip_version_base; |
|
| 23 | + if (!_FILE_CONNECT) |
|
| 24 | + redirige_url_ecrire("install"); |
|
| 25 | 25 | |
| 26 | - // Si reinstallation necessaire, message ad hoc |
|
| 27 | - if (_request('reinstall')=='oui'){ |
|
| 28 | - include_spip('inc/minipres'); |
|
| 29 | - $r = minipres(_T('titre_page_upgrade'), |
|
| 30 | - "<p><b>" |
|
| 31 | - ._T('texte_nouvelle_version_spip_1') |
|
| 32 | - ."</b><p> " |
|
| 33 | - ._T('texte_nouvelle_version_spip_2', |
|
| 34 | - array('connect' => '<tt>'._FILE_CONNECT.'</tt>')) |
|
| 35 | - .generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', _T('bouton_relancer_installation'))); |
|
| 36 | - echo $r; |
|
| 37 | - } |
|
| 38 | - elseif (_request('fin')) { |
|
| 39 | - include_spip('inc/plugin'); |
|
| 40 | - actualise_plugins_actifs(); |
|
| 41 | - include_spip('inc/headers'); |
|
| 42 | - $res = generer_url_ecrire('admin_plugin','var_mode=recalcul'); |
|
| 43 | - echo redirige_formulaire($res); |
|
| 44 | - } |
|
| 45 | - else { |
|
| 26 | + // Si reinstallation necessaire, message ad hoc |
|
| 27 | + if (_request('reinstall')=='oui'){ |
|
| 28 | + include_spip('inc/minipres'); |
|
| 29 | + $r = minipres(_T('titre_page_upgrade'), |
|
| 30 | + "<p><b>" |
|
| 31 | + ._T('texte_nouvelle_version_spip_1') |
|
| 32 | + ."</b><p> " |
|
| 33 | + ._T('texte_nouvelle_version_spip_2', |
|
| 34 | + array('connect' => '<tt>'._FILE_CONNECT.'</tt>')) |
|
| 35 | + .generer_form_ecrire('upgrade', "<input type='hidden' name='reinstall' value='non' />", '', _T('bouton_relancer_installation'))); |
|
| 36 | + echo $r; |
|
| 37 | + } |
|
| 38 | + elseif (_request('fin')) { |
|
| 39 | + include_spip('inc/plugin'); |
|
| 40 | + actualise_plugins_actifs(); |
|
| 41 | + include_spip('inc/headers'); |
|
| 42 | + $res = generer_url_ecrire('admin_plugin','var_mode=recalcul'); |
|
| 43 | + echo redirige_formulaire($res); |
|
| 44 | + } |
|
| 45 | + else { |
|
| 46 | 46 | |
| 47 | - if (!isset($GLOBALS['meta']['version_installee'])) |
|
| 48 | - $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 49 | - else $GLOBALS['meta']['version_installee'] = |
|
| 50 | - (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 51 | - # NB: str_replace car, sur club-internet, il semble que version_installe soit |
|
| 52 | - # enregistree au format '1,812' et non '1.812' |
|
| 47 | + if (!isset($GLOBALS['meta']['version_installee'])) |
|
| 48 | + $GLOBALS['meta']['version_installee'] = 0.0; |
|
| 49 | + else $GLOBALS['meta']['version_installee'] = |
|
| 50 | + (double)str_replace(',', '.', $GLOBALS['meta']['version_installee']); |
|
| 51 | + # NB: str_replace car, sur club-internet, il semble que version_installe soit |
|
| 52 | + # enregistree au format '1,812' et non '1.812' |
|
| 53 | 53 | |
| 54 | - // Erreur downgrade |
|
| 55 | - // (cas de double installation de fichiers SPIP sur une meme base) |
|
| 56 | - if ($spip_version_base<$GLOBALS['meta']['version_installee']) |
|
| 57 | - $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 58 | - // Commentaire standard upgrade |
|
| 59 | - else $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 54 | + // Erreur downgrade |
|
| 55 | + // (cas de double installation de fichiers SPIP sur une meme base) |
|
| 56 | + if ($spip_version_base<$GLOBALS['meta']['version_installee']) |
|
| 57 | + $commentaire = _T('info_mise_a_niveau_base_2'); |
|
| 58 | + // Commentaire standard upgrade |
|
| 59 | + else $commentaire = _T('texte_mise_a_niveau_base_1'); |
|
| 60 | 60 | |
| 61 | - $commentaire .= "<br />[".$GLOBALS['meta']['version_installee']."/".$spip_version_base."]"; |
|
| 61 | + $commentaire .= "<br />[".$GLOBALS['meta']['version_installee']."/".$spip_version_base."]"; |
|
| 62 | 62 | |
| 63 | - $_POST['reinstall'] = 'non'; // pour copy_request dans admin |
|
| 64 | - include_spip('inc/headers'); |
|
| 65 | - $admin = charger_fonction('admin', 'inc'); |
|
| 66 | - $res = $admin('upgrade', _T('info_mise_a_niveau_base'), $commentaire); |
|
| 67 | - if ($res) |
|
| 68 | - echo $res; |
|
| 69 | - else { |
|
| 70 | - // effacer les alea pour forcer leur relecture |
|
| 71 | - // si jamais ils ont change pendant l'upgrade |
|
| 72 | - unset($GLOBALS['meta']['alea_ephemere']); |
|
| 73 | - unset($GLOBALS['meta']['alea_ephemere_ancien']); |
|
| 74 | - $res = redirige_action_auteur('purger', 'cache', 'upgrade', 'fin=oui', true); |
|
| 75 | - echo redirige_formulaire($res); |
|
| 76 | - } |
|
| 77 | - } |
|
| 63 | + $_POST['reinstall'] = 'non'; // pour copy_request dans admin |
|
| 64 | + include_spip('inc/headers'); |
|
| 65 | + $admin = charger_fonction('admin', 'inc'); |
|
| 66 | + $res = $admin('upgrade', _T('info_mise_a_niveau_base'), $commentaire); |
|
| 67 | + if ($res) |
|
| 68 | + echo $res; |
|
| 69 | + else { |
|
| 70 | + // effacer les alea pour forcer leur relecture |
|
| 71 | + // si jamais ils ont change pendant l'upgrade |
|
| 72 | + unset($GLOBALS['meta']['alea_ephemere']); |
|
| 73 | + unset($GLOBALS['meta']['alea_ephemere_ancien']); |
|
| 74 | + $res = redirige_action_auteur('purger', 'cache', 'upgrade', 'fin=oui', true); |
|
| 75 | + echo redirige_formulaire($res); |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | ?> |
@@ -22,30 +22,30 @@ |
||
| 22 | 22 | // http://doc.spip.org/@exec_install_dist |
| 23 | 23 | function exec_install_dist() |
| 24 | 24 | { |
| 25 | - $etape = _request('etape'); |
|
| 26 | - $deja = (_FILE_CONNECT AND analyse_fichier_connection(_FILE_CONNECT)); |
|
| 27 | - |
|
| 28 | - // Si deja installe, on n'a plus le droit qu'a l'etape chmod |
|
| 29 | - // pour chgt post-install ou aux etapes supplementaires |
|
| 30 | - // de declaration de base externes. |
|
| 31 | - // Mais alors il faut authentifier car ecrire/index.php l'a omis |
|
| 32 | - |
|
| 33 | - if ($deja AND in_array($etape, array('chmod', 'sup1', 'sup2'))) { |
|
| 34 | - |
|
| 35 | - $auth = charger_fonction('auth', 'inc'); |
|
| 36 | - if (!$auth()) { |
|
| 37 | - verifier_visiteur(); |
|
| 38 | - $deja = (!autoriser('configurer')); |
|
| 39 | - } |
|
| 40 | - } |
|
| 41 | - if ($deja) { |
|
| 42 | - // Rien a faire ici |
|
| 43 | - echo minipres(); |
|
| 44 | - } else { |
|
| 45 | - include_spip('base/create'); |
|
| 46 | - $fonc = charger_fonction("etape_$etape", 'install'); |
|
| 47 | - $fonc(); |
|
| 48 | - } |
|
| 25 | + $etape = _request('etape'); |
|
| 26 | + $deja = (_FILE_CONNECT AND analyse_fichier_connection(_FILE_CONNECT)); |
|
| 27 | + |
|
| 28 | + // Si deja installe, on n'a plus le droit qu'a l'etape chmod |
|
| 29 | + // pour chgt post-install ou aux etapes supplementaires |
|
| 30 | + // de declaration de base externes. |
|
| 31 | + // Mais alors il faut authentifier car ecrire/index.php l'a omis |
|
| 32 | + |
|
| 33 | + if ($deja AND in_array($etape, array('chmod', 'sup1', 'sup2'))) { |
|
| 34 | + |
|
| 35 | + $auth = charger_fonction('auth', 'inc'); |
|
| 36 | + if (!$auth()) { |
|
| 37 | + verifier_visiteur(); |
|
| 38 | + $deja = (!autoriser('configurer')); |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | + if ($deja) { |
|
| 42 | + // Rien a faire ici |
|
| 43 | + echo minipres(); |
|
| 44 | + } else { |
|
| 45 | + include_spip('base/create'); |
|
| 46 | + $fonc = charger_fonction("etape_$etape", 'install'); |
|
| 47 | + $fonc(); |
|
| 48 | + } |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | ?> |
@@ -19,17 +19,17 @@ |
||
| 19 | 19 | // http://doc.spip.org/@exec_informer_dist |
| 20 | 20 | function exec_informer_dist() |
| 21 | 21 | { |
| 22 | - $id = intval(_request('id')); |
|
| 23 | - $col = intval(_request('col')); |
|
| 24 | - $exclus = intval(_request('exclus')); |
|
| 25 | - $do = _request('do'); |
|
| 22 | + $id = intval(_request('id')); |
|
| 23 | + $col = intval(_request('col')); |
|
| 24 | + $exclus = intval(_request('exclus')); |
|
| 25 | + $do = _request('do'); |
|
| 26 | 26 | |
| 27 | - if (preg_match('/^\w*$/', $do)) { |
|
| 28 | - if (!$do) $do = 'aff'; |
|
| 27 | + if (preg_match('/^\w*$/', $do)) { |
|
| 28 | + if (!$do) $do = 'aff'; |
|
| 29 | 29 | |
| 30 | - $informer = charger_fonction('informer', 'inc'); |
|
| 31 | - $res = $informer($id, $col, $exclus, _request('rac'), _request('type'), $do); |
|
| 32 | - } else $res = ''; |
|
| 33 | - ajax_retour($res); |
|
| 30 | + $informer = charger_fonction('informer', 'inc'); |
|
| 31 | + $res = $informer($id, $col, $exclus, _request('rac'), _request('type'), $do); |
|
| 32 | + } else $res = ''; |
|
| 33 | + ajax_retour($res); |
|
| 34 | 34 | } |
| 35 | 35 | ?> |
@@ -17,37 +17,37 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | function exec_403_dist(){ |
| 19 | 19 | |
| 20 | - $exec = _request('exec'); |
|
| 20 | + $exec = _request('exec'); |
|
| 21 | 21 | |
| 22 | - $titre = "exec_$exec"; |
|
| 23 | - $navigation = ""; |
|
| 24 | - $extra = ""; |
|
| 22 | + $titre = "exec_$exec"; |
|
| 23 | + $navigation = ""; |
|
| 24 | + $extra = ""; |
|
| 25 | 25 | |
| 26 | - $contenu = "<h1>"._T('info_acces_interdit')."</h1>" |
|
| 27 | - . _L("Vous n'avez pas le droit d'accéder à la page <b>@exec@</b>.",array('exec'=>_request('exec'))); |
|
| 26 | + $contenu = "<h1>"._T('info_acces_interdit')."</h1>" |
|
| 27 | + . _L("Vous n'avez pas le droit d'accéder à la page <b>@exec@</b>.",array('exec'=>_request('exec'))); |
|
| 28 | 28 | |
| 29 | - if (_request('var_zajax')) { |
|
| 30 | - include_spip('inc/actions'); |
|
| 31 | - ajax_retour($contenu); |
|
| 32 | - } |
|
| 33 | - else { |
|
| 34 | - include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 29 | + if (_request('var_zajax')) { |
|
| 30 | + include_spip('inc/actions'); |
|
| 31 | + ajax_retour($contenu); |
|
| 32 | + } |
|
| 33 | + else { |
|
| 34 | + include_spip('inc/presentation'); // alleger les inclusions avec un inc/presentation_mini |
|
| 35 | 35 | |
| 36 | - $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 37 | - echo $commencer_page($titre); |
|
| 36 | + $commencer_page = charger_fonction('commencer_page','inc'); |
|
| 37 | + echo $commencer_page($titre); |
|
| 38 | 38 | |
| 39 | - echo debut_gauche("403_$exec",true); |
|
| 40 | - echo recuperer_fond('prive/squelettes/navigation/dist',array()); |
|
| 41 | - echo pipeline('affiche_gauche',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 39 | + echo debut_gauche("403_$exec",true); |
|
| 40 | + echo recuperer_fond('prive/squelettes/navigation/dist',array()); |
|
| 41 | + echo pipeline('affiche_gauche',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 42 | 42 | |
| 43 | - echo creer_colonne_droite("403",true); |
|
| 44 | - echo pipeline('affiche_droite',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 43 | + echo creer_colonne_droite("403",true); |
|
| 44 | + echo pipeline('affiche_droite',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>'')); |
|
| 45 | 45 | |
| 46 | - echo debut_droite("403",true); |
|
| 47 | - echo pipeline('affiche_milieu',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>$contenu)); |
|
| 46 | + echo debut_droite("403",true); |
|
| 47 | + echo pipeline('affiche_milieu',array('args'=>array('exec'=>'403','exec_erreur'=>$exec),'data'=>$contenu)); |
|
| 48 | 48 | |
| 49 | - echo fin_gauche(),fin_page(); |
|
| 50 | - } |
|
| 49 | + echo fin_gauche(),fin_page(); |
|
| 50 | + } |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | ?> |