@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | // Determiner l'action demandee |
| 36 | 36 | // |
| 37 | 37 | |
| 38 | -$exec = (string)_request('exec'); |
|
| 38 | +$exec = (string) _request('exec'); |
|
| 39 | 39 | $reinstall = (!is_null(_request('reinstall'))) ? _request('reinstall') : ($exec == 'install' ? 'oui' : null); |
| 40 | 40 | // |
| 41 | 41 | // Les scripts d'insallation n'authentifient pas, forcement, |
@@ -82,10 +82,10 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | // securiser les redirect du back-office |
| 84 | 84 | if (_request('redirect')) { |
| 85 | - if (!function_exists('securiser_redirect_action')){ |
|
| 85 | + if (!function_exists('securiser_redirect_action')) { |
|
| 86 | 86 | include_spip('public/aiguiller'); |
| 87 | 87 | } |
| 88 | - set_request('redirect',securiser_redirect_action(_request('redirect'))); |
|
| 88 | + set_request('redirect', securiser_redirect_action(_request('redirect'))); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo') |
| 119 | 119 | ) |
| 120 | 120 | ) { |
| 121 | - spip_log("Quand la meta admin vaut " . |
|
| 122 | - $GLOBALS['meta']["admin"] . |
|
| 123 | - " seul un admin peut se connecter et sans AJAX." . |
|
| 121 | + spip_log("Quand la meta admin vaut ". |
|
| 122 | + $GLOBALS['meta']["admin"]. |
|
| 123 | + " seul un admin peut se connecter et sans AJAX.". |
|
| 124 | 124 | " En cas de probleme, detruire cette meta."); |
| 125 | 125 | die(_T('info_travaux_texte')); |
| 126 | 126 | } |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | /** Drapeau indiquant que l'on est dans l'espace privé */ |
| 20 | 20 | define('_ESPACE_PRIVE', true); |
| 21 | 21 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 22 | - include 'inc_version.php'; |
|
| 22 | + include 'inc_version.php'; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Verification anti magic_quotes_sybase, pour qui addslashes("'") = "''" |
| 26 | 26 | // On prefere la faire ici plutot que dans inc_version, c'est moins souvent et |
| 27 | 27 | // si le reglage est modifie sur un site en prod, ca fait moins mal |
| 28 | 28 | if (addslashes("'") !== "\\'") { |
| 29 | - die('SPIP incompatible magic_quotes_sybase'); |
|
| 29 | + die('SPIP incompatible magic_quotes_sybase'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | include_spip('inc/cookie'); |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | // alors il faut blinder les variables d'URL |
| 43 | 43 | // |
| 44 | 44 | if (autoriser_sans_cookie($exec)) { |
| 45 | - if (!isset($reinstall)) { |
|
| 46 | - $reinstall = 'non'; |
|
| 47 | - } |
|
| 48 | - $var_auth = true; |
|
| 45 | + if (!isset($reinstall)) { |
|
| 46 | + $reinstall = 'non'; |
|
| 47 | + } |
|
| 48 | + $var_auth = true; |
|
| 49 | 49 | } else { |
| 50 | - // Authentification, redefinissable |
|
| 51 | - $auth = charger_fonction('auth', 'inc'); |
|
| 52 | - $var_auth = $auth(); |
|
| 53 | - if ($var_auth) { |
|
| 54 | - echo auth_echec($var_auth); |
|
| 55 | - exit; |
|
| 56 | - } |
|
| 50 | + // Authentification, redefinissable |
|
| 51 | + $auth = charger_fonction('auth', 'inc'); |
|
| 52 | + $var_auth = $auth(); |
|
| 53 | + if ($var_auth) { |
|
| 54 | + echo auth_echec($var_auth); |
|
| 55 | + exit; |
|
| 56 | + } |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // initialiser a la langue par defaut |
@@ -64,27 +64,27 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | if (_request('action') or _request('var_ajax') or _request('formulaire_action')) { |
| 67 | - // Charger l'aiguilleur qui va mettre sur la bonne voie les traitements derogatoires |
|
| 68 | - include_spip('public/aiguiller'); |
|
| 69 | - if ( |
|
| 70 | - // cas des appels actions ?action=xxx |
|
| 71 | - traiter_appels_actions() |
|
| 72 | - or |
|
| 73 | - // cas des hits ajax sur les inclusions ajax |
|
| 74 | - traiter_appels_inclusions_ajax() |
|
| 75 | - or |
|
| 76 | - // cas des formulaires charger/verifier/traiter |
|
| 77 | - traiter_formulaires_dynamiques() |
|
| 78 | - ) { |
|
| 79 | - exit; |
|
| 80 | - } // le hit est fini ! |
|
| 67 | + // Charger l'aiguilleur qui va mettre sur la bonne voie les traitements derogatoires |
|
| 68 | + include_spip('public/aiguiller'); |
|
| 69 | + if ( |
|
| 70 | + // cas des appels actions ?action=xxx |
|
| 71 | + traiter_appels_actions() |
|
| 72 | + or |
|
| 73 | + // cas des hits ajax sur les inclusions ajax |
|
| 74 | + traiter_appels_inclusions_ajax() |
|
| 75 | + or |
|
| 76 | + // cas des formulaires charger/verifier/traiter |
|
| 77 | + traiter_formulaires_dynamiques() |
|
| 78 | + ) { |
|
| 79 | + exit; |
|
| 80 | + } // le hit est fini ! |
|
| 81 | 81 | } |
| 82 | 82 | // securiser les redirect du back-office |
| 83 | 83 | if (_request('redirect')) { |
| 84 | - if (!function_exists('securiser_redirect_action')){ |
|
| 85 | - include_spip('public/aiguiller'); |
|
| 86 | - } |
|
| 87 | - set_request('redirect',securiser_redirect_action(_request('redirect'))); |
|
| 84 | + if (!function_exists('securiser_redirect_action')){ |
|
| 85 | + include_spip('public/aiguiller'); |
|
| 86 | + } |
|
| 87 | + set_request('redirect',securiser_redirect_action(_request('redirect'))); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | // Controle de la version, sauf si on est deja en train de s'en occuper |
| 96 | 96 | if (!$reinstall == 'oui' |
| 97 | - and !_AJAX |
|
| 98 | - and isset($GLOBALS['meta']['version_installee']) |
|
| 99 | - and ($GLOBALS['spip_version_base'] != (str_replace(',', '.', $GLOBALS['meta']['version_installee']))) |
|
| 97 | + and !_AJAX |
|
| 98 | + and isset($GLOBALS['meta']['version_installee']) |
|
| 99 | + and ($GLOBALS['spip_version_base'] != (str_replace(',', '.', $GLOBALS['meta']['version_installee']))) |
|
| 100 | 100 | ) { |
| 101 | - $exec = 'demande_mise_a_jour'; |
|
| 101 | + $exec = 'demande_mise_a_jour'; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // Quand une action d'administration est en cours (meta "admin"), |
@@ -108,44 +108,44 @@ discard block |
||
| 108 | 108 | // sinon c'est qu'elle a ete interrompue et il faut la reprendre |
| 109 | 109 | |
| 110 | 110 | elseif (isset($GLOBALS['meta']["admin"])) { |
| 111 | - if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) { |
|
| 112 | - list(, $var_f, $n) = $l; |
|
| 113 | - } |
|
| 114 | - if (_AJAX |
|
| 115 | - or !( |
|
| 116 | - isset($_COOKIE['spip_admin']) |
|
| 117 | - or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo') |
|
| 118 | - ) |
|
| 119 | - ) { |
|
| 120 | - spip_log("Quand la meta admin vaut " . |
|
| 121 | - $GLOBALS['meta']["admin"] . |
|
| 122 | - " seul un admin peut se connecter et sans AJAX." . |
|
| 123 | - " En cas de probleme, detruire cette meta."); |
|
| 124 | - die(_T('info_travaux_texte')); |
|
| 125 | - } |
|
| 126 | - if ($n) { |
|
| 127 | - list(, $var_f, $n) = $l; |
|
| 128 | - if (tester_url_ecrire("base_$var_f")) { |
|
| 129 | - $var_f = "base_$var_f"; |
|
| 130 | - } |
|
| 131 | - if ($var_f != $exec) { |
|
| 132 | - spip_log("Le script $var_f lance par auteur$n se substitue a l'exec $exec"); |
|
| 133 | - $exec = $var_f; |
|
| 134 | - set_request('exec', $exec); |
|
| 135 | - } |
|
| 136 | - } |
|
| 111 | + if (preg_match('/^(.*)_(\d+)_/', $GLOBALS['meta']["admin"], $l)) { |
|
| 112 | + list(, $var_f, $n) = $l; |
|
| 113 | + } |
|
| 114 | + if (_AJAX |
|
| 115 | + or !( |
|
| 116 | + isset($_COOKIE['spip_admin']) |
|
| 117 | + or (isset($GLOBALS['visiteur_session']) and $GLOBALS['visiteur_session']['statut'] == '0minirezo') |
|
| 118 | + ) |
|
| 119 | + ) { |
|
| 120 | + spip_log("Quand la meta admin vaut " . |
|
| 121 | + $GLOBALS['meta']["admin"] . |
|
| 122 | + " seul un admin peut se connecter et sans AJAX." . |
|
| 123 | + " En cas de probleme, detruire cette meta."); |
|
| 124 | + die(_T('info_travaux_texte')); |
|
| 125 | + } |
|
| 126 | + if ($n) { |
|
| 127 | + list(, $var_f, $n) = $l; |
|
| 128 | + if (tester_url_ecrire("base_$var_f")) { |
|
| 129 | + $var_f = "base_$var_f"; |
|
| 130 | + } |
|
| 131 | + if ($var_f != $exec) { |
|
| 132 | + spip_log("Le script $var_f lance par auteur$n se substitue a l'exec $exec"); |
|
| 133 | + $exec = $var_f; |
|
| 134 | + set_request('exec', $exec); |
|
| 135 | + } |
|
| 136 | + } |
|
| 137 | 137 | } |
| 138 | 138 | // si nom pas plausible, prendre le script par defaut |
| 139 | 139 | // attention aux deux cas 404/403 qui commencent par un 4 ! |
| 140 | 140 | elseif (!preg_match(',^[a-z4_][0-9a-z_-]*$,i', $exec)) { |
| 141 | - $exec = "accueil"; |
|
| 142 | - set_request('exec', $exec); |
|
| 141 | + $exec = "accueil"; |
|
| 142 | + set_request('exec', $exec); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // compatibilite ascendante : obsolete, ne plus utiliser |
| 146 | 146 | $GLOBALS['spip_display'] = isset($GLOBALS['visiteur_session']['prefs']['display']) |
| 147 | - ? $GLOBALS['visiteur_session']['prefs']['display'] |
|
| 148 | - : 0; |
|
| 147 | + ? $GLOBALS['visiteur_session']['prefs']['display'] |
|
| 148 | + : 0; |
|
| 149 | 149 | $GLOBALS['spip_ecran'] = isset($_COOKIE['spip_ecran']) ? $_COOKIE['spip_ecran'] : "etroit"; |
| 150 | 150 | |
| 151 | 151 | // si la langue est specifiee par cookie et ne correspond pas |
@@ -153,18 +153,18 @@ discard block |
||
| 153 | 153 | // on appelle directement la fonction, car un appel d'action peut conduire a une boucle infinie |
| 154 | 154 | // si le cookie n'est pas pose correctement dans l'action |
| 155 | 155 | if (!$var_auth and isset($_COOKIE['spip_lang_ecrire']) |
| 156 | - and $_COOKIE['spip_lang_ecrire'] <> $GLOBALS['visiteur_session']['lang'] |
|
| 156 | + and $_COOKIE['spip_lang_ecrire'] <> $GLOBALS['visiteur_session']['lang'] |
|
| 157 | 157 | ) { |
| 158 | - include_spip('action/converser'); |
|
| 159 | - action_converser_post($GLOBALS['visiteur_session']['lang'], true); |
|
| 158 | + include_spip('action/converser'); |
|
| 159 | + action_converser_post($GLOBALS['visiteur_session']['lang'], true); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if ($var_f = tester_url_ecrire($exec)) { |
| 163 | - $var_f = charger_fonction($var_f); |
|
| 164 | - $var_f(); // at last |
|
| 163 | + $var_f = charger_fonction($var_f); |
|
| 164 | + $var_f(); // at last |
|
| 165 | 165 | } else { |
| 166 | - // Rien de connu: rerouter vers exec=404 au lieu d'echouer |
|
| 167 | - // ce qui permet de laisser la main a un plugin |
|
| 168 | - $var_f = charger_fonction('404'); |
|
| 169 | - $var_f($exec); |
|
| 166 | + // Rien de connu: rerouter vers exec=404 au lieu d'echouer |
|
| 167 | + // ce qui permet de laisser la main a un plugin |
|
| 168 | + $var_f = charger_fonction('404'); |
|
| 169 | + $var_f($exec); |
|
| 170 | 170 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * Pile complétée du code compilé |
| 37 | 37 | **/ |
| 38 | 38 | function balise_URL_LOGOUT($p) { |
| 39 | - return calculer_balise_dynamique($p, 'URL_LOGOUT', array()); |
|
| 39 | + return calculer_balise_dynamique($p, 'URL_LOGOUT', array()); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | * Liste (url) des arguments collectés. |
| 53 | 53 | */ |
| 54 | 54 | function balise_URL_LOGOUT_stat($args, $context_compil) { |
| 55 | - $url = isset($args[0]) ? $args[0] : ''; |
|
| 55 | + $url = isset($args[0]) ? $args[0] : ''; |
|
| 56 | 56 | |
| 57 | - return array($url); |
|
| 57 | + return array($url); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | **/ |
| 70 | 70 | function balise_URL_LOGOUT_dyn($cible) { |
| 71 | 71 | |
| 72 | - if (!$GLOBALS['visiteur_session']['login'] and !$GLOBALS['visiteur_session']['statut']) { |
|
| 73 | - return ''; |
|
| 74 | - } |
|
| 72 | + if (!$GLOBALS['visiteur_session']['login'] and !$GLOBALS['visiteur_session']['statut']) { |
|
| 73 | + return ''; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - return generer_url_action('logout', "logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 76 | + return generer_url_action('logout', "logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 77 | 77 | } |
@@ -73,5 +73,5 @@ |
||
| 73 | 73 | return ''; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - return generer_url_action('logout', "logout=public&url=" . rawurlencode($cible ? $cible : self('&'))); |
|
| 76 | + return generer_url_action('logout', "logout=public&url=".rawurlencode($cible ? $cible : self('&'))); |
|
| 77 | 77 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -40,21 +40,21 @@ discard block |
||
| 40 | 40 | * Pile complétée par le code à générer |
| 41 | 41 | */ |
| 42 | 42 | function balise_INFO__dist($p) { |
| 43 | - $info = $p->nom_champ; |
|
| 44 | - $type_objet = interprete_argument_balise(1, $p); |
|
| 45 | - $id_objet = interprete_argument_balise(2, $p); |
|
| 46 | - if ($info === 'INFO_' or !$type_objet or !$id_objet) { |
|
| 47 | - $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_')); |
|
| 48 | - erreur_squelette($msg, $p); |
|
| 49 | - $p->interdire_scripts = true; |
|
| 43 | + $info = $p->nom_champ; |
|
| 44 | + $type_objet = interprete_argument_balise(1, $p); |
|
| 45 | + $id_objet = interprete_argument_balise(2, $p); |
|
| 46 | + if ($info === 'INFO_' or !$type_objet or !$id_objet) { |
|
| 47 | + $msg = _T('zbug_balise_sans_argument', array('balise' => ' INFO_')); |
|
| 48 | + erreur_squelette($msg, $p); |
|
| 49 | + $p->interdire_scripts = true; |
|
| 50 | 50 | |
| 51 | - return $p; |
|
| 52 | - } else { |
|
| 53 | - $info_sql = strtolower(substr($info, 5)); |
|
| 54 | - $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'" . ($p->etoile ? "," . _q($p->etoile) : "") . ")"; |
|
| 55 | - $p->code = champ_sql($info, $p, $code); |
|
| 56 | - $p->interdire_scripts = true; |
|
| 51 | + return $p; |
|
| 52 | + } else { |
|
| 53 | + $info_sql = strtolower(substr($info, 5)); |
|
| 54 | + $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'" . ($p->etoile ? "," . _q($p->etoile) : "") . ")"; |
|
| 55 | + $p->code = champ_sql($info, $p, $code); |
|
| 56 | + $p->interdire_scripts = true; |
|
| 57 | 57 | |
| 58 | - return $p; |
|
| 59 | - } |
|
| 58 | + return $p; |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | return $p; |
| 52 | 52 | } else { |
| 53 | 53 | $info_sql = strtolower(substr($info, 5)); |
| 54 | - $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'" . ($p->etoile ? "," . _q($p->etoile) : "") . ")"; |
|
| 54 | + $code = "generer_info_entite($id_objet, $type_objet, '$info_sql'".($p->etoile ? ","._q($p->etoile) : "").")"; |
|
| 55 | 55 | $p->code = champ_sql($info, $p, $code); |
| 56 | 56 | $p->interdire_scripts = true; |
| 57 | 57 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined("_ECRIRE_INC_VERSION")) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } #securite |
| 22 | 22 | |
| 23 | 23 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * Pile complétée du code compilé |
| 35 | 35 | **/ |
| 36 | 36 | function balise_LOGIN_PRIVE($p) { |
| 37 | - return calculer_balise_dynamique($p, 'LOGIN_PRIVE', array('url')); |
|
| 37 | + return calculer_balise_dynamique($p, 'LOGIN_PRIVE', array('url')); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * Liste (url, login) des arguments collectés. |
| 56 | 56 | */ |
| 57 | 57 | function balise_LOGIN_PRIVE_stat($args, $context_compil) { |
| 58 | - return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 58 | + return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | * Liste : Chemin du squelette, durée du cache, contexte |
| 73 | 73 | **/ |
| 74 | 74 | function balise_LOGIN_PRIVE_dyn($url, $login) { |
| 75 | - include_spip('balise/formulaire_'); |
|
| 76 | - if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 77 | - and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 78 | - ) { |
|
| 79 | - $url = generer_url_ecrire('accueil', '', true); |
|
| 80 | - } |
|
| 75 | + include_spip('balise/formulaire_'); |
|
| 76 | + if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 77 | + and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 78 | + ) { |
|
| 79 | + $url = generer_url_ecrire('accueil', '', true); |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | - return balise_FORMULAIRE__dyn('login', $url, $login, true); |
|
| 82 | + return balise_FORMULAIRE__dyn('login', $url, $login, true); |
|
| 83 | 83 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * Pile complétée du code compilé |
| 38 | 38 | **/ |
| 39 | 39 | function balise_MENU_LANG_ECRIRE($p) { |
| 40 | - return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang')); |
|
| 40 | + return calculer_balise_dynamique($p, 'MENU_LANG_ECRIRE', array('lang')); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | * Liste (lang) des arguments collectés et fournis. |
| 56 | 56 | */ |
| 57 | 57 | function balise_MENU_LANG_ECRIRE_stat($args, $context_compil) { |
| 58 | - include_spip('inc/lang'); |
|
| 59 | - if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) { |
|
| 60 | - return ''; |
|
| 61 | - } |
|
| 58 | + include_spip('inc/lang'); |
|
| 59 | + if (strpos($GLOBALS['meta']['langues_proposees'], ',') === false) { |
|
| 60 | + return ''; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return $args; |
|
| 63 | + return $args; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * Liste : Chemin du squelette, durée du cache, contexte |
| 77 | 77 | **/ |
| 78 | 78 | function balise_MENU_LANG_ECRIRE_dyn($opt) { |
| 79 | - return menu_lang_pour_tous('var_lang_ecrire', $opt); |
|
| 79 | + return menu_lang_pour_tous('var_lang_ecrire', $opt); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -96,30 +96,30 @@ discard block |
||
| 96 | 96 | * Liste : Chemin du squelette, durée du cache, contexte |
| 97 | 97 | **/ |
| 98 | 98 | function menu_lang_pour_tous($nom, $default) { |
| 99 | - include_spip('inc/lang'); |
|
| 99 | + include_spip('inc/lang'); |
|
| 100 | 100 | |
| 101 | - if ($GLOBALS['spip_lang'] <> $default) { |
|
| 102 | - $opt = lang_select($default); # et remplace |
|
| 103 | - if ($GLOBALS['spip_lang'] <> $default) { |
|
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 105 | - if ($opt) { |
|
| 106 | - lang_select(); |
|
| 107 | - } |
|
| 108 | - } |
|
| 109 | - } |
|
| 101 | + if ($GLOBALS['spip_lang'] <> $default) { |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | + if ($GLOBALS['spip_lang'] <> $default) { |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | + if ($opt) { |
|
| 106 | + lang_select(); |
|
| 107 | + } |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - # lien a partir de / |
|
| 112 | - $cible = parametre_url(self(), 'lang', '', '&'); |
|
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 111 | + # lien a partir de / |
|
| 112 | + $cible = parametre_url(self(), 'lang', '', '&'); |
|
| 113 | + $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 114 | 114 | |
| 115 | - return array( |
|
| 116 | - 'formulaires/menu_lang', |
|
| 117 | - 3600, |
|
| 118 | - array( |
|
| 119 | - 'nom' => $nom, |
|
| 120 | - 'url' => $post, |
|
| 121 | - 'name' => $nom, |
|
| 122 | - 'default' => $default, |
|
| 123 | - ) |
|
| 124 | - ); |
|
| 115 | + return array( |
|
| 116 | + 'formulaires/menu_lang', |
|
| 117 | + 3600, |
|
| 118 | + array( |
|
| 119 | + 'nom' => $nom, |
|
| 120 | + 'url' => $post, |
|
| 121 | + 'name' => $nom, |
|
| 122 | + 'default' => $default, |
|
| 123 | + ) |
|
| 124 | + ); |
|
| 125 | 125 | } |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | include_spip('inc/lang'); |
| 100 | 100 | |
| 101 | 101 | if ($GLOBALS['spip_lang'] <> $default) { |
| 102 | - $opt = lang_select($default); # et remplace |
|
| 102 | + $opt = lang_select($default); # et remplace |
|
| 103 | 103 | if ($GLOBALS['spip_lang'] <> $default) { |
| 104 | - $default = ''; # annule tout choix par defaut |
|
| 104 | + $default = ''; # annule tout choix par defaut |
|
| 105 | 105 | if ($opt) { |
| 106 | 106 | lang_select(); |
| 107 | 107 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | # lien a partir de / |
| 112 | 112 | $cible = parametre_url(self(), 'lang', '', '&'); |
| 113 | - $post = generer_url_action('converser', 'redirect=' . rawurlencode($cible), '&'); |
|
| 113 | + $post = generer_url_action('converser', 'redirect='.rawurlencode($cible), '&'); |
|
| 114 | 114 | |
| 115 | 115 | return array( |
| 116 | 116 | 'formulaires/menu_lang', |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @package SPIP\Core\Compilateur\Balises |
| 18 | 18 | **/ |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * Pile complétée du code compilé |
| 61 | 61 | **/ |
| 62 | 62 | function balise_CONFIGURER_METAS_dist($p) { |
| 63 | - return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 63 | + return calculer_balise_dynamique($p, $p->nom_champ, array()); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | **/ |
| 79 | 79 | function balise_CONFIGURER_METAS_dyn($form) { |
| 80 | 80 | |
| 81 | - include_spip('balise/formulaire_'); |
|
| 82 | - if (!existe_formulaire($form)) { |
|
| 83 | - return ''; |
|
| 84 | - } |
|
| 85 | - $args = func_get_args(); |
|
| 86 | - $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 87 | - if (!is_array($contexte)) { |
|
| 88 | - return $contexte; |
|
| 89 | - } |
|
| 81 | + include_spip('balise/formulaire_'); |
|
| 82 | + if (!existe_formulaire($form)) { |
|
| 83 | + return ''; |
|
| 84 | + } |
|
| 85 | + $args = func_get_args(); |
|
| 86 | + $contexte = balise_FORMULAIRE__contexte('configurer_metas', $args); |
|
| 87 | + if (!is_array($contexte)) { |
|
| 88 | + return $contexte; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 91 | + return array('formulaires/' . $form, 3600, $contexte); |
|
| 92 | 92 | } |
@@ -88,5 +88,5 @@ |
||
| 88 | 88 | return $contexte; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return array('formulaires/' . $form, 3600, $contexte); |
|
| 91 | + return array('formulaires/'.$form, 3600, $contexte); |
|
| 92 | 92 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('base/abstract_sql'); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * Pile complétée du code compilé |
| 42 | 42 | **/ |
| 43 | 43 | function balise_FORMULAIRE_ECRIRE_AUTEUR($p) { |
| 44 | - return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 44 | + return calculer_balise_dynamique($p, 'FORMULAIRE_ECRIRE_AUTEUR', array('id_auteur', 'id_article', 'email')); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -59,42 +59,42 @@ discard block |
||
| 59 | 59 | * - chaîne vide sinon (erreur ou non affichage). |
| 60 | 60 | */ |
| 61 | 61 | function balise_FORMULAIRE_ECRIRE_AUTEUR_stat($args, $context_compil) { |
| 62 | - include_spip('inc/filtres'); |
|
| 63 | - // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 64 | - $id = intval($args[1]); |
|
| 65 | - if (!$args[0] and !$id) { |
|
| 66 | - $msg = array( |
|
| 67 | - 'zbug_champ_hors_motif', |
|
| 68 | - array( |
|
| 69 | - 'champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 70 | - 'motif' => 'AUTEURS/ARTICLES' |
|
| 71 | - ) |
|
| 72 | - ); |
|
| 62 | + include_spip('inc/filtres'); |
|
| 63 | + // Pas d'id_auteur ni d'id_article ? Erreur de contexte |
|
| 64 | + $id = intval($args[1]); |
|
| 65 | + if (!$args[0] and !$id) { |
|
| 66 | + $msg = array( |
|
| 67 | + 'zbug_champ_hors_motif', |
|
| 68 | + array( |
|
| 69 | + 'champ' => 'FORMULAIRE_ECRIRE_AUTEUR', |
|
| 70 | + 'motif' => 'AUTEURS/ARTICLES' |
|
| 71 | + ) |
|
| 72 | + ); |
|
| 73 | 73 | |
| 74 | - erreur_squelette($msg, $context_compil); |
|
| 74 | + erreur_squelette($msg, $context_compil); |
|
| 75 | 75 | |
| 76 | - return ''; |
|
| 77 | - } |
|
| 78 | - // Si on est dans un contexte article, |
|
| 79 | - // sortir tous les mails des auteurs de l'article |
|
| 80 | - if (!$args[0] and $id) { |
|
| 81 | - $r = ''; |
|
| 82 | - $s = sql_allfetsel('email', |
|
| 83 | - 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 84 | - "A.email != '' AND L.id_objet=$id"); |
|
| 85 | - foreach ($s as $row) { |
|
| 86 | - if (email_valide($row['email'])) { |
|
| 87 | - $r .= ', ' . $row['email']; |
|
| 88 | - } |
|
| 89 | - } |
|
| 90 | - $args[2] = substr($r, 2); |
|
| 91 | - } |
|
| 76 | + return ''; |
|
| 77 | + } |
|
| 78 | + // Si on est dans un contexte article, |
|
| 79 | + // sortir tous les mails des auteurs de l'article |
|
| 80 | + if (!$args[0] and $id) { |
|
| 81 | + $r = ''; |
|
| 82 | + $s = sql_allfetsel('email', |
|
| 83 | + 'spip_auteurs AS A LEFT JOIN spip_auteurs_liens AS L ON (A.id_auteur=L.id_auteur AND L.objet=\'article\')', |
|
| 84 | + "A.email != '' AND L.id_objet=$id"); |
|
| 85 | + foreach ($s as $row) { |
|
| 86 | + if (email_valide($row['email'])) { |
|
| 87 | + $r .= ', ' . $row['email']; |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | + $args[2] = substr($r, 2); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 94 | - if (!$args[2] or !email_valide($args[2])) { |
|
| 95 | - return ''; |
|
| 96 | - } |
|
| 93 | + // On ne peut pas ecrire a un auteur dont le mail n'est pas valide |
|
| 94 | + if (!$args[2] or !email_valide($args[2])) { |
|
| 95 | + return ''; |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - // OK |
|
| 99 | - return $args; |
|
| 98 | + // OK |
|
| 99 | + return $args; |
|
| 100 | 100 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | "A.email != '' AND L.id_objet=$id"); |
| 85 | 85 | foreach ($s as $row) { |
| 86 | 86 | if (email_valide($row['email'])) { |
| 87 | - $r .= ', ' . $row['email']; |
|
| 87 | + $r .= ', '.$row['email']; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | $args[2] = substr($r, 2); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined('_ECRIRE_INC_VERSION')) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | include_spip('base/abstract_sql'); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | * Pile complétée du code compilé |
| 44 | 44 | **/ |
| 45 | 45 | function balise_FORMULAIRE_INSCRIPTION($p) { |
| 46 | - return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 46 | + return calculer_balise_dynamique($p, 'FORMULAIRE_INSCRIPTION', array()); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | * - chaîne vide sinon. |
| 73 | 73 | */ |
| 74 | 74 | function balise_FORMULAIRE_INSCRIPTION_stat($args, $context_compil) { |
| 75 | - list($mode, $id, $retour) = array_pad($args, 3, null); |
|
| 76 | - include_spip('action/inscrire_auteur'); |
|
| 77 | - $mode = tester_statut_inscription($mode, $id); |
|
| 75 | + list($mode, $id, $retour) = array_pad($args, 3, null); |
|
| 76 | + include_spip('action/inscrire_auteur'); |
|
| 77 | + $mode = tester_statut_inscription($mode, $id); |
|
| 78 | 78 | |
| 79 | - return $mode ? array($mode, $id, $retour) : ''; |
|
| 79 | + return $mode ? array($mode, $id, $retour) : ''; |
|
| 80 | 80 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | |
| 19 | 19 | if (!defined("_ECRIRE_INC_VERSION")) { |
| 20 | - return; |
|
| 20 | + return; |
|
| 21 | 21 | } #securite |
| 22 | 22 | |
| 23 | 23 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * Pile complétée du code compilé |
| 37 | 37 | **/ |
| 38 | 38 | function balise_LOGIN_PUBLIC($p, $nom = 'LOGIN_PUBLIC') { |
| 39 | - return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 39 | + return calculer_balise_dynamique($p, $nom, array('url')); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * Liste (url, login) des arguments collectés. |
| 58 | 58 | */ |
| 59 | 59 | function balise_LOGIN_PUBLIC_stat($args, $context_compil) { |
| 60 | - return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 60 | + return array(isset($args[1]) ? $args[1] : $args[0], (isset($args[2]) ? $args[2] : '')); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | * Liste : Chemin du squelette, durée du cache, contexte |
| 75 | 75 | **/ |
| 76 | 76 | function balise_LOGIN_PUBLIC_dyn($url, $login) { |
| 77 | - include_spip('balise/formulaire_'); |
|
| 78 | - if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 79 | - and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 80 | - ) { |
|
| 81 | - $url = parametre_url(self(), '', '', '&'); |
|
| 82 | - } |
|
| 77 | + include_spip('balise/formulaire_'); |
|
| 78 | + if (!$url # pas d'url passee en filtre ou dans le contexte |
|
| 79 | + and !$url = _request('url') # ni d'url passee par l'utilisateur |
|
| 80 | + ) { |
|
| 81 | + $url = parametre_url(self(), '', '', '&'); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - return balise_FORMULAIRE__dyn('login', $url, $login, false); |
|
| 84 | + return balise_FORMULAIRE__dyn('login', $url, $login, false); |
|
| 85 | 85 | } |