@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $res['message_ok'] = _T('info_modification_enregistree'); |
| 101 | 101 | if ($retour) { |
| 102 | 102 | if (strncmp($retour, 'javascript:', 11) == 0) { |
| 103 | - $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/' . substr($retour, 11) . '/*]]>*/</script>'; |
|
| 103 | + $res['message_ok'] .= '<script type="text/javascript">/*<![CDATA[*/'.substr($retour, 11).'/*]]>*/</script>'; |
|
| 104 | 104 | $res['editable'] = true; |
| 105 | 105 | } else { |
| 106 | 106 | $res['redirect'] = parametre_url($retour, $id_table_objet, $id); |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | if (!isset($erreurs[$champ])) { |
| 141 | 141 | $erreurs[$champ] = ''; |
| 142 | 142 | } |
| 143 | - $erreurs[$champ] .= _T('alerte_modif_info_concourante') . "<br /><textarea readonly='readonly' class='forml'>" . entites_html($conflit['base']) . '</textarea>'; |
|
| 143 | + $erreurs[$champ] .= _T('alerte_modif_info_concourante')."<br /><textarea readonly='readonly' class='forml'>".entites_html($conflit['base']).'</textarea>'; |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if ( |
| 221 | 221 | $config_fonc |
| 222 | 222 | and !in_array($config_fonc, ['articles_edit_config', 'rubriques_edit_config', 'auteurs_edit_config']) |
| 223 | - and $config_fonc !== $table_objet . '_edit_config' |
|
| 223 | + and $config_fonc !== $table_objet.'_edit_config' |
|
| 224 | 224 | ) { |
| 225 | 225 | if ( |
| 226 | 226 | $args = test_formulaire_inclus_par_modele() |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | // Appel direct dans un squelette |
| 236 | 236 | if (!$row) { |
| 237 | 237 | if (!$new or $lier_trad) { |
| 238 | - if ($select = charger_fonction('precharger_' . $type, 'inc', true)) { |
|
| 238 | + if ($select = charger_fonction('precharger_'.$type, 'inc', true)) { |
|
| 239 | 239 | $row = $select($id, $id_parent, $lier_trad); |
| 240 | 240 | // si on a une fonction precharger, elle pu faire un reglage de langue |
| 241 | 241 | $lang_default = (!empty($row['lang']) ? $row['lang'] : null); |
| 242 | 242 | } else { |
| 243 | - $row = sql_fetsel('*', $table_objet_sql, $id_table_objet . '=' . intval($id)); |
|
| 243 | + $row = sql_fetsel('*', $table_objet_sql, $id_table_objet.'='.intval($id)); |
|
| 244 | 244 | } |
| 245 | 245 | if (!$new) { |
| 246 | 246 | $md5 = controles_md5($row ?: []); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | if ($config_fonc) { |
| 291 | 291 | $contexte['config'] = $config = $config_fonc($contexte); |
| 292 | 292 | if (!$lang_default) { |
| 293 | - $lang_default = $config['langue'] ?? session_get('lang') ; |
|
| 293 | + $lang_default = $config['langue'] ?? session_get('lang'); |
|
| 294 | 294 | } |
| 295 | 295 | } |
| 296 | 296 | $config = $config + [ |
@@ -314,13 +314,12 @@ discard block |
||
| 314 | 314 | unset($contexte['lang']); |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n" . |
|
| 318 | - (!$lier_trad ? '' : |
|
| 319 | - ("\n<input type='hidden' name='lier_trad' value='" . |
|
| 320 | - $lier_trad . |
|
| 321 | - "' />" . |
|
| 322 | - "\n<input type='hidden' name='changer_lang' value='" . |
|
| 323 | - $lang_default . |
|
| 317 | + $contexte['_hidden'] = "<input type='hidden' name='editer_$type' value='oui' />\n". |
|
| 318 | + (!$lier_trad ? '' : ("\n<input type='hidden' name='lier_trad' value='". |
|
| 319 | + $lier_trad. |
|
| 320 | + "' />". |
|
| 321 | + "\n<input type='hidden' name='changer_lang' value='". |
|
| 322 | + $lang_default. |
|
| 324 | 323 | "' />")) |
| 325 | 324 | . $hidden |
| 326 | 325 | . ($md5 ?? ''); |
@@ -360,14 +359,14 @@ discard block |
||
| 360 | 359 | $aider = charger_fonction('aider', 'inc'); |
| 361 | 360 | if (strlen($texte) > 28 * 1024) { |
| 362 | 361 | $texte = str_replace("\r\n", "\n", $texte); |
| 363 | - $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 362 | + $pos = strpos($texte, "\n\n", 28 * 1024); // coupe para > 28 ko |
|
| 364 | 363 | if ($pos > 0 and $pos < 32 * 1024) { |
| 365 | - $debut = substr($texte, 0, $pos) . "\n\n<!--SPIP-->\n"; |
|
| 364 | + $debut = substr($texte, 0, $pos)."\n\n<!--SPIP-->\n"; |
|
| 366 | 365 | $suite = substr($texte, $pos + 2); |
| 367 | 366 | } else { |
| 368 | - $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 367 | + $pos = strpos($texte, ' ', 28 * 1024); // sinon coupe espace |
|
| 369 | 368 | if (!($pos > 0 and $pos < 32 * 1024)) { |
| 370 | - $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 369 | + $pos = 28 * 1024; // au pire (pas d'espace trouv'e) |
|
| 371 | 370 | $decalage = 0; // si y'a pas d'espace, il ne faut pas perdre le caract`ere |
| 372 | 371 | } else { |
| 373 | 372 | $decalage = 1; |
@@ -398,13 +397,13 @@ discard block |
||
| 398 | 397 | } |
| 399 | 398 | |
| 400 | 399 | include_spip('inc/barre'); |
| 401 | - $textes_supplement = "<br /><span style='color: red'>" . _T('info_texte_long') . "</span>\n"; |
|
| 400 | + $textes_supplement = "<br /><span style='color: red'>"._T('info_texte_long')."</span>\n"; |
|
| 402 | 401 | $nombre = 0; |
| 403 | 402 | |
| 404 | 403 | while (strlen($texte) > 29 * 1024) { |
| 405 | 404 | $nombre++; |
| 406 | 405 | [$texte1, $texte] = coupe_trop_long($texte); |
| 407 | - $textes_supplement .= '<br />' . |
|
| 406 | + $textes_supplement .= '<br />'. |
|
| 408 | 407 | "<textarea id='texte$nombre' name='texte_plus[$nombre]'$att_text>$texte1</textarea>\n"; |
| 409 | 408 | } |
| 410 | 409 | |
@@ -487,7 +486,7 @@ discard block |
||
| 487 | 486 | $ctr = []; |
| 488 | 487 | foreach ($data as $key => $val) { |
| 489 | 488 | $m = md5($val ?? ''); |
| 490 | - $k = $prefixe . $key; |
|
| 489 | + $k = $prefixe.$key; |
|
| 491 | 490 | |
| 492 | 491 | switch ($format) { |
| 493 | 492 | case 'html': |
@@ -500,7 +499,7 @@ discard block |
||
| 500 | 499 | } |
| 501 | 500 | |
| 502 | 501 | if ($format === 'html') { |
| 503 | - return "\n\n<!-- controles md5 -->\n" . join("\n", $ctr) . "\n\n"; |
|
| 502 | + return "\n\n<!-- controles md5 -->\n".join("\n", $ctr)."\n\n"; |
|
| 504 | 503 | } else { |
| 505 | 504 | return $ctr; |
| 506 | 505 | } |
@@ -652,7 +651,7 @@ discard block |
||
| 652 | 651 | // On elimine les donnees non modifiees par le formulaire (mais |
| 653 | 652 | // potentiellement modifiees entre temps par un autre utilisateur) |
| 654 | 653 | foreach ($champs as $key => $val) { |
| 655 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 654 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 656 | 655 | if (is_scalar($val) and $m == md5($val)) { |
| 657 | 656 | unset($champs[$key]); |
| 658 | 657 | } |
@@ -681,7 +680,7 @@ discard block |
||
| 681 | 680 | // de conflit. |
| 682 | 681 | $ctrh = $ctrq = $conflits = []; |
| 683 | 682 | foreach (array_keys($champs) as $key) { |
| 684 | - if (isset($ctr[$prefix . $key]) and $m = $ctr[$prefix . $key]) { |
|
| 683 | + if (isset($ctr[$prefix.$key]) and $m = $ctr[$prefix.$key]) { |
|
| 685 | 684 | $ctrh[$key] = $m; |
| 686 | 685 | $ctrq[] = $key; |
| 687 | 686 | } |
@@ -715,8 +714,8 @@ discard block |
||
| 715 | 714 | */ |
| 716 | 715 | function display_conflit_champ($x) { |
| 717 | 716 | if (strstr($x, "\n") or strlen($x) > 80) { |
| 718 | - return "<textarea style='width:99%; height:10em;'>" . entites_html($x) . "</textarea>\n"; |
|
| 717 | + return "<textarea style='width:99%; height:10em;'>".entites_html($x)."</textarea>\n"; |
|
| 719 | 718 | } else { |
| 720 | - return "<input type='text' size='40' style='width:99%' value=\"" . entites_html($x) . "\" />\n"; |
|
| 719 | + return "<input type='text' size='40' style='width:99%' value=\"".entites_html($x)."\" />\n"; |
|
| 721 | 720 | } |
| 722 | 721 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | final class SpipCles { |
| 17 | 17 | private static array $instances = []; |
| 18 | 18 | |
| 19 | - private string $file = _DIR_ETC . 'cles.php'; |
|
| 19 | + private string $file = _DIR_ETC.'cles.php'; |
|
| 20 | 20 | private Cles $cles; |
| 21 | 21 | |
| 22 | 22 | public static function instance(string $file = ''): self { |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | // et par extension tous les passwords |
| 118 | 118 | if (!empty($cles_potentielles['secret_des_auth'])) { |
| 119 | 119 | if (!Password::verifier($password_clair, $password_hash, $cles_potentielles['secret_des_auth'])) { |
| 120 | - spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 120 | + spip_log("Restauration de la cle `secret_des_auth` par id_auteur $id_auteur erronnee, on ignore", 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 121 | 121 | unset($cles_potentielles['secret_des_auth']); |
| 122 | 122 | } |
| 123 | 123 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | foreach ($cles_potentielles as $name => $key) { |
| 128 | 128 | if (!$this->cles->has($name)) { |
| 129 | 129 | $this->cles->set($name, $key); |
| 130 | - spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer' . _LOG_INFO_IMPORTANTE); |
|
| 130 | + spip_log("Restauration de la cle $name par id_auteur $id_auteur", 'chiffrer'._LOG_INFO_IMPORTANTE); |
|
| 131 | 131 | $restauration = true; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | return $this->cles->get($name); |
| 146 | 146 | } |
| 147 | 147 | // sinon loger et annule la cle generee car il ne faut pas l'utiliser |
| 148 | - spip_log('Echec ecriture du fichier cle ' . $this->file . " ; impossible de generer une cle $name", 'chiffrer' . _LOG_ERREUR); |
|
| 148 | + spip_log('Echec ecriture du fichier cle '.$this->file." ; impossible de generer une cle $name", 'chiffrer'._LOG_ERREUR); |
|
| 149 | 149 | $this->cles->delete($name); |
| 150 | 150 | } |
| 151 | 151 | return null; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | private function getMetaKey(string $name, bool $autoInit = true): ?string { |
| 155 | 155 | if (!isset($GLOBALS['meta'][$name])) { |
| 156 | 156 | include_spip('base/abstract_sql'); |
| 157 | - $GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = ' . sql_quote($name, '', 'string')); |
|
| 157 | + $GLOBALS['meta'][$name] = sql_getfetsel('valeur', 'spip_meta', 'nom = '.sql_quote($name, '', 'string')); |
|
| 158 | 158 | } |
| 159 | 159 | $key = base64_decode($GLOBALS['meta'][$name] ?? ''); |
| 160 | 160 | if (strlen($key) === \SODIUM_CRYPTO_SECRETBOX_KEYBYTES) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | // Appels incomplets (sans $c) |
| 115 | 115 | if (!is_array($c)) { |
| 116 | - spip_log('erreur appel objet_modifier_champs(' . $objet . '), manque $c'); |
|
| 116 | + spip_log('erreur appel objet_modifier_champs('.$objet.'), manque $c'); |
|
| 117 | 117 | |
| 118 | 118 | return _T('erreur_technique_enregistrement_impossible'); |
| 119 | 119 | } |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | // N'accepter que les champs qui existent dans la table |
| 141 | 141 | $champs = array_intersect_key($c, $desc['field']); |
| 142 | 142 | // et dont la valeur n'est pas null |
| 143 | - $champs = array_filter($champs, static function ($var) { |
|
| 143 | + $champs = array_filter($champs, static function($var) { |
|
| 144 | 144 | return $var !== null; |
| 145 | 145 | }); |
| 146 | 146 | // TODO: ici aussi on peut valider les contenus |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $champs = array_map('corriger_caracteres', $champs); |
| 151 | 151 | |
| 152 | 152 | // On récupère l'état avant toute modification |
| 153 | - $row = sql_fetsel('*', $spip_table_objet, $id_table_objet . '=' . $id_objet); |
|
| 153 | + $row = sql_fetsel('*', $spip_table_objet, $id_table_objet.'='.$id_objet); |
|
| 154 | 154 | |
| 155 | 155 | // Envoyer aux plugins |
| 156 | 156 | $champs = pipeline( |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $id_rubrique = 0; |
| 206 | 206 | if (isset($desc['field']['id_rubrique'])) { |
| 207 | 207 | $parent = ($objet == 'rubrique') ? 'id_parent' : 'id_rubrique'; |
| 208 | - $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=" . intval($id_objet)); |
|
| 208 | + $id_rubrique = sql_getfetsel($parent, $spip_table_objet, "$id_table_objet=".intval($id_objet)); |
|
| 209 | 209 | } |
| 210 | 210 | $instituer_langue_objet = charger_fonction('instituer_langue_objet', 'action'); |
| 211 | 211 | $champs['lang'] = $instituer_langue_objet($objet, $id_objet, $id_rubrique, $changer_lang, $serveur); |
@@ -227,13 +227,13 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | // allez on commit la modif |
| 230 | - sql_updateq($spip_table_objet, $champs, "$id_table_objet=" . intval($id_objet), [], $serveur); |
|
| 230 | + sql_updateq($spip_table_objet, $champs, "$id_table_objet=".intval($id_objet), [], $serveur); |
|
| 231 | 231 | |
| 232 | 232 | // on verifie si elle est bien passee |
| 233 | 233 | $moof = sql_fetsel( |
| 234 | 234 | array_keys($champs), |
| 235 | 235 | $spip_table_objet, |
| 236 | - "$id_table_objet=" . intval($id_objet), |
|
| 236 | + "$id_table_objet=".intval($id_objet), |
|
| 237 | 237 | [], |
| 238 | 238 | [], |
| 239 | 239 | '', |
@@ -269,13 +269,13 @@ discard block |
||
| 269 | 269 | // c'est un cas exceptionnel |
| 270 | 270 | if (count($liste)) { |
| 271 | 271 | spip_log( |
| 272 | - "Erreur enregistrement en base $objet/$id_objet champs :" . var_export($conflits, true), |
|
| 273 | - 'modifier.' . _LOG_CRITIQUE |
|
| 272 | + "Erreur enregistrement en base $objet/$id_objet champs :".var_export($conflits, true), |
|
| 273 | + 'modifier.'._LOG_CRITIQUE |
|
| 274 | 274 | ); |
| 275 | 275 | |
| 276 | 276 | return _T( |
| 277 | 277 | 'erreur_technique_enregistrement_champs', |
| 278 | - ['champs' => "<i>'" . implode("'</i>,<i>'", $liste) . "'</i>"] |
|
| 278 | + ['champs' => "<i>'".implode("'</i>,<i>'", $liste)."'</i>"] |
|
| 279 | 279 | ); |
| 280 | 280 | } |
| 281 | 281 | } |
@@ -317,18 +317,18 @@ discard block |
||
| 317 | 317 | include_spip('inc/filtres_mini'); |
| 318 | 318 | $qui = ''; |
| 319 | 319 | if (!empty($GLOBALS['visiteur_session']['id_auteur'])) { |
| 320 | - $qui .= ' #id_auteur:' . $GLOBALS['visiteur_session']['id_auteur'] . '#'; |
|
| 320 | + $qui .= ' #id_auteur:'.$GLOBALS['visiteur_session']['id_auteur'].'#'; |
|
| 321 | 321 | } |
| 322 | 322 | if (!empty($GLOBALS['visiteur_session']['nom'])) { |
| 323 | - $qui .= ' #nom:' . $GLOBALS['visiteur_session']['nom'] . '#'; |
|
| 323 | + $qui .= ' #nom:'.$GLOBALS['visiteur_session']['nom'].'#'; |
|
| 324 | 324 | } |
| 325 | 325 | if ($qui == '') { |
| 326 | - $qui = '#ip:' . $GLOBALS['ip'] . '#'; |
|
| 326 | + $qui = '#ip:'.$GLOBALS['ip'].'#'; |
|
| 327 | 327 | } |
| 328 | - journal(_L($qui . ' a édité ' . $objet . ' ' . $id_objet . ' (' . join( |
|
| 328 | + journal(_L($qui.' a édité '.$objet.' '.$id_objet.' ('.join( |
|
| 329 | 329 | '+', |
| 330 | 330 | array_diff(array_keys($champs), ['date_modif']) |
| 331 | - ) . ')'), [ |
|
| 331 | + ).')'), [ |
|
| 332 | 332 | 'faire' => 'modifier', |
| 333 | 333 | 'quoi' => $objet, |
| 334 | 334 | 'id' => $id_objet |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $row = sql_fetsel( |
| 50 | 50 | '*', |
| 51 | 51 | 'spip_auteurs', |
| 52 | - 'login=' . sql_quote($login, $serveur, 'text') . " AND statut<>'5poubelle'", |
|
| 52 | + 'login='.sql_quote($login, $serveur, 'text')." AND statut<>'5poubelle'", |
|
| 53 | 53 | '', |
| 54 | 54 | '', |
| 55 | 55 | '', |
@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | // legacy = md5 ou sha256 |
| 78 | 78 | case 32: |
| 79 | 79 | // tres anciens mots de passe encodes en md5(alea.pass) |
| 80 | - $hash = md5($row['alea_actuel'] . $pass); |
|
| 80 | + $hash = md5($row['alea_actuel'].$pass); |
|
| 81 | 81 | $methode = 'md5'; |
| 82 | 82 | case 64: |
| 83 | 83 | if (empty($hash)) { |
| 84 | 84 | // anciens mots de passe encodes en sha256(alea.pass) |
| 85 | 85 | include_spip('auth/sha256.inc'); |
| 86 | - $hash = spip_sha256($row['alea_actuel'] . $pass); |
|
| 86 | + $hash = spip_sha256($row['alea_actuel'].$pass); |
|
| 87 | 87 | $methode = 'sha256'; |
| 88 | 88 | } |
| 89 | 89 | if ($row['pass'] === $hash) { |
| 90 | - spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via $methode", 'auth' . _LOG_DEBUG); |
|
| 90 | + spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via $methode", 'auth'._LOG_DEBUG); |
|
| 91 | 91 | // ce n'est pas cense arriver, mais si jamais c'est un backup inutilisable, il faut le nettoyer pour ne pas bloquer la creation d'une nouvelle cle d'auth |
| 92 | 92 | if (!empty($row['backup_cles'])) { |
| 93 | - sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 93 | + sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur'])); |
|
| 94 | 94 | } |
| 95 | 95 | break; |
| 96 | 96 | } |
@@ -108,19 +108,19 @@ discard block |
||
| 108 | 108 | and !empty($row['backup_cles']) |
| 109 | 109 | ) { |
| 110 | 110 | if ($cles->restore($row['backup_cles'], $pass, $row['pass'], $row['id_auteur'])) { |
| 111 | - spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #' . $row['id_auteur'], 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 111 | + spip_log('Les cles secretes ont ete restaurées avec le backup du webmestre #'.$row['id_auteur'], 'auth'._LOG_INFO_IMPORTANTE); |
|
| 112 | 112 | if ($cles->save()) { |
| 113 | 113 | $secret = $cles->getSecretAuth(); |
| 114 | 114 | } |
| 115 | 115 | else { |
| 116 | - spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
|
| 116 | + spip_log("Echec restauration des cles : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR); |
|
| 117 | 117 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 118 | - raler_fichier(_DIR_ETC . 'cles.php'); |
|
| 118 | + raler_fichier(_DIR_ETC.'cles.php'); |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | else { |
| 122 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #' . $row['id_auteur'] . " n'est pas valide", 'auth' . _LOG_ERREUR); |
|
| 123 | - sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur=' . intval($row['id_auteur'])); |
|
| 122 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) mais le backup du webmestre #'.$row['id_auteur']." n'est pas valide", 'auth'._LOG_ERREUR); |
|
| 123 | + sql_updateq('spip_auteurs', ['backup_cles' => ''], 'id_auteur='.intval($row['id_auteur'])); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | unset($row); |
| 129 | 129 | } |
| 130 | 130 | else { |
| 131 | - spip_log("validation du mot de passe pour l'auteur #" . $row['id_auteur'] . " $login via Password::verifier", 'auth' . _LOG_DEBUG); |
|
| 131 | + spip_log("validation du mot de passe pour l'auteur #".$row['id_auteur']." $login via Password::verifier", 'auth'._LOG_DEBUG); |
|
| 132 | 132 | } |
| 133 | 133 | break; |
| 134 | 134 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | @sql_update( |
| 176 | 176 | 'spip_auteurs', |
| 177 | 177 | $set, |
| 178 | - 'id_auteur=' . intval($row['id_auteur']) . ' AND pass=' . sql_quote( |
|
| 178 | + 'id_auteur='.intval($row['id_auteur']).' AND pass='.sql_quote( |
|
| 179 | 179 | $row['pass'], |
| 180 | 180 | $serveur, |
| 181 | 181 | 'text' |
@@ -223,24 +223,24 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | // si force, on ne verifie pas la presence d'un backup chez un webmestre |
| 225 | 225 | if ($force) { |
| 226 | - spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 226 | + spip_log('Pas de cle secrete disponible, on regenere une nouvelle cle forcee - tous les mots de passe sont invalides', 'auth'._LOG_INFO_IMPORTANTE); |
|
| 227 | 227 | $secret = $cles->getSecretAuth(true); |
| 228 | 228 | return true; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut=' . sql_quote('0minirezo') . ' AND webmestre=' . sql_quote('oui') . " AND backup_cles!=''"); |
|
| 231 | + $has_backup = sql_allfetsel('id_auteur', 'spip_auteurs', 'statut='.sql_quote('0minirezo').' AND webmestre='.sql_quote('oui')." AND backup_cles!=''"); |
|
| 232 | 232 | $has_backup = array_column($has_backup, 'id_auteur'); |
| 233 | 233 | if (empty($has_backup)) { |
| 234 | - spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth' . _LOG_INFO_IMPORTANTE); |
|
| 234 | + spip_log("Pas de cle secrete disponible, et aucun webmestre n'a de backup, on regenere une nouvelle cle - tous les mots de passe sont invalides", 'auth'._LOG_INFO_IMPORTANTE); |
|
| 235 | 235 | if ($secret = $cles->getSecretAuth(true)) { |
| 236 | 236 | return true; |
| 237 | 237 | } |
| 238 | - spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth' . _LOG_ERREUR); |
|
| 238 | + spip_log("Echec generation d'une nouvelle cle : verifier les droits d'ecriture ?", 'auth'._LOG_ERREUR); |
|
| 239 | 239 | // et on echoue car on ne veut pas que la situation reste telle quelle |
| 240 | - raler_fichier(_DIR_ETC . 'cles.php'); |
|
| 240 | + raler_fichier(_DIR_ETC.'cles.php'); |
|
| 241 | 241 | } |
| 242 | 242 | else { |
| 243 | - spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #' . implode(', #', $has_backup) . ' doit se connecter pour restaurer son backup des cles', 'auth' . _LOG_ERREUR); |
|
| 243 | + spip_log('Pas de cle secrete disponible (fichier config/cle.php absent ?) un des webmestres #'.implode(', #', $has_backup).' doit se connecter pour restaurer son backup des cles', 'auth'._LOG_ERREUR); |
|
| 244 | 244 | } |
| 245 | 245 | return false; |
| 246 | 246 | } |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | $flux['data'] .= |
| 258 | 258 | '<script type="text/javascript">/*<![CDATA[*/' |
| 259 | 259 | . "$js\n" |
| 260 | - . "var login_info={'login':'" . $flux['args']['contexte']['var_login'] . "'," |
|
| 261 | - . "'page_auteur': '" . generer_url_public('informer_auteur') . "'," |
|
| 260 | + . "var login_info={'login':'".$flux['args']['contexte']['var_login']."'," |
|
| 261 | + . "'page_auteur': '".generer_url_public('informer_auteur')."'," |
|
| 262 | 262 | . "'informe_auteur_en_cours':false," |
| 263 | 263 | . "'attente_informe':0};" |
| 264 | 264 | . "jQuery(function(){jQuery('#var_login').change(actualise_auteur);});" |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | } else { |
| 302 | 302 | $n = sql_countsel( |
| 303 | 303 | 'spip_auteurs', |
| 304 | - 'login=' . sql_quote($new_login) . ' AND id_auteur!=' . intval($id_auteur) . " AND statut!='5poubelle'", |
|
| 304 | + 'login='.sql_quote($new_login).' AND id_auteur!='.intval($id_auteur)." AND statut!='5poubelle'", |
|
| 305 | 305 | '', |
| 306 | 306 | '', |
| 307 | 307 | $serveur |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | if ( |
| 331 | 331 | !$id_auteur = intval($id_auteur) |
| 332 | - or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 332 | + or !$auteur = sql_fetsel('login', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 333 | 333 | ) { |
| 334 | 334 | return false; |
| 335 | 335 | } |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $anciens = sql_allfetsel( |
| 345 | 345 | 'id_auteur', |
| 346 | 346 | 'spip_auteurs', |
| 347 | - 'login=' . sql_quote($new_login, $serveur, 'text') . " AND statut='5poubelle'", |
|
| 347 | + 'login='.sql_quote($new_login, $serveur, 'text')." AND statut='5poubelle'", |
|
| 348 | 348 | '', |
| 349 | 349 | '', |
| 350 | 350 | '', |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | $r = sql_getfetsel( |
| 379 | 379 | 'login', |
| 380 | 380 | 'spip_auteurs', |
| 381 | - "statut<>'5poubelle'" . |
|
| 382 | - ' AND (length(pass)>0)' . |
|
| 381 | + "statut<>'5poubelle'". |
|
| 382 | + ' AND (length(pass)>0)'. |
|
| 383 | 383 | " AND (login=$l)", |
| 384 | 384 | '', |
| 385 | 385 | '', |
@@ -398,8 +398,8 @@ discard block |
||
| 398 | 398 | return sql_getfetsel( |
| 399 | 399 | 'login', |
| 400 | 400 | 'spip_auteurs', |
| 401 | - "statut<>'5poubelle'" . |
|
| 402 | - ' AND (length(pass)>0)' . |
|
| 401 | + "statut<>'5poubelle'". |
|
| 402 | + ' AND (length(pass)>0)'. |
|
| 403 | 403 | " AND (login<>'' AND (nom=$l OR email=$l))", |
| 404 | 404 | '', |
| 405 | 405 | '', |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | if ( |
| 470 | 470 | !$id_auteur = intval($id_auteur) |
| 471 | - or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur=' . intval($id_auteur), '', '', '', '', $serveur) |
|
| 471 | + or !$auteur = sql_fetsel('login, statut, webmestre', 'spip_auteurs', 'id_auteur='.intval($id_auteur), '', '', '', '', $serveur) |
|
| 472 | 472 | ) { |
| 473 | 473 | return false; |
| 474 | 474 | } |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | or isset($champs['statut']) |
| 530 | 530 | or (isset($options['all']) and $options['all']) |
| 531 | 531 | ) { |
| 532 | - $htaccess = _DIR_RESTREINT . _ACCESS_FILE_NAME; |
|
| 533 | - $htpasswd = _DIR_TMP . _AUTH_USER_FILE; |
|
| 532 | + $htaccess = _DIR_RESTREINT._ACCESS_FILE_NAME; |
|
| 533 | + $htpasswd = _DIR_TMP._AUTH_USER_FILE; |
|
| 534 | 534 | |
| 535 | 535 | // Cette variable de configuration peut etre posee par un plugin |
| 536 | 536 | // par exemple acces_restreint ; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | and !@file_exists($htaccess) |
| 541 | 541 | ) { |
| 542 | 542 | spip_unlink($htpasswd); |
| 543 | - spip_unlink($htpasswd . '-admin'); |
|
| 543 | + spip_unlink($htpasswd.'-admin'); |
|
| 544 | 544 | |
| 545 | 545 | return; |
| 546 | 546 | } |
@@ -558,16 +558,16 @@ discard block |
||
| 558 | 558 | ); |
| 559 | 559 | while ($t = sql_fetch($s)) { |
| 560 | 560 | if (strlen($t['login']) and strlen($t['htpass'])) { |
| 561 | - $p1 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 561 | + $p1 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 562 | 562 | if ($t['statut'] == '0minirezo') { |
| 563 | - $p2 .= $t['login'] . ':' . $t['htpass'] . "\n"; |
|
| 563 | + $p2 .= $t['login'].':'.$t['htpass']."\n"; |
|
| 564 | 564 | } |
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | sql_free($s); |
| 568 | 568 | if ($p1) { |
| 569 | 569 | ecrire_fichier($htpasswd, $p1); |
| 570 | - ecrire_fichier($htpasswd . '-admin', $p2); |
|
| 570 | + ecrire_fichier($htpasswd.'-admin', $p2); |
|
| 571 | 571 | spip_log("Ecriture de $htpasswd et $htpasswd-admin"); |
| 572 | 572 | } |
| 573 | 573 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | // mais apres la fonction autoriser() |
| 121 | 121 | if ($f = find_in_path('mes_fonctions.php')) { |
| 122 | 122 | global $dossier_squelettes; |
| 123 | - include_once(_ROOT_CWD . $f); |
|
| 123 | + include_once(_ROOT_CWD.$f); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 163 | 163 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 164 | 164 | } elseif (is_numeric($qui)) { |
| 165 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 165 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 166 | 166 | if (!$qui) { |
| 167 | 167 | return false; |
| 168 | 168 | } |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | spip_log( |
| 178 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 179 | - 'autoriser' . _LOG_DEBUG |
|
| 178 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 179 | + 'autoriser'._LOG_DEBUG |
|
| 180 | 180 | ); |
| 181 | 181 | |
| 182 | 182 | // passer par objet_type pour avoir les alias |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 193 | 193 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 194 | 194 | ) { |
| 195 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 195 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 196 | 196 | return true; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -201,18 +201,18 @@ discard block |
||
| 201 | 201 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 202 | 202 | $fonctions = $type |
| 203 | 203 | ? [ |
| 204 | - 'autoriser_' . $type . '_' . $faire, |
|
| 205 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 206 | - 'autoriser_' . $type, |
|
| 207 | - 'autoriser_' . $type . '_dist', |
|
| 208 | - 'autoriser_' . $faire, |
|
| 209 | - 'autoriser_' . $faire . '_dist', |
|
| 204 | + 'autoriser_'.$type.'_'.$faire, |
|
| 205 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 206 | + 'autoriser_'.$type, |
|
| 207 | + 'autoriser_'.$type.'_dist', |
|
| 208 | + 'autoriser_'.$faire, |
|
| 209 | + 'autoriser_'.$faire.'_dist', |
|
| 210 | 210 | 'autoriser_defaut', |
| 211 | 211 | 'autoriser_defaut_dist' |
| 212 | 212 | ] |
| 213 | 213 | : [ |
| 214 | - 'autoriser_' . $faire, |
|
| 215 | - 'autoriser_' . $faire . '_dist', |
|
| 214 | + 'autoriser_'.$faire, |
|
| 215 | + 'autoriser_'.$faire.'_dist', |
|
| 216 | 216 | 'autoriser_defaut', |
| 217 | 217 | 'autoriser_defaut_dist' |
| 218 | 218 | ]; |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | spip_log( |
| 228 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 229 | - 'autoriser' . _LOG_DEBUG |
|
| 228 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 229 | + 'autoriser'._LOG_DEBUG |
|
| 230 | 230 | ); |
| 231 | 231 | |
| 232 | 232 | return $a; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 376 | 376 | |
| 377 | 377 | // Le visiteur a-t-il un statut prevu par la config ? |
| 378 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 378 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 379 | 379 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 380 | 380 | } |
| 381 | 381 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | } // pas de champ passe a la demande => NIET |
| 434 | 434 | $previsu = explode(',', $c['previsu']); |
| 435 | 435 | // regarder si ce statut est autorise pour l'auteur |
| 436 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 436 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 437 | 437 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 438 | 438 | // sinon l’auteur en session |
| 439 | 439 | include_spip('inc/securiser_action'); |
@@ -447,12 +447,12 @@ discard block |
||
| 447 | 447 | |
| 448 | 448 | if (!$id_auteur) { |
| 449 | 449 | return false; |
| 450 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 450 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 451 | 451 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 452 | 452 | } elseif ( |
| 453 | 453 | !sql_countsel( |
| 454 | 454 | 'spip_auteurs_liens', |
| 455 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 455 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 456 | 456 | ) |
| 457 | 457 | ) { |
| 458 | 458 | return false; |
@@ -497,16 +497,16 @@ discard block |
||
| 497 | 497 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 498 | 498 | $primary = id_table_objet($type); |
| 499 | 499 | if ($table != 'spip_rubriques') { |
| 500 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 500 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 501 | 501 | } else { |
| 502 | 502 | $id_rubrique = $id; |
| 503 | 503 | } |
| 504 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 504 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 505 | 505 | if (!$id_secteur > 0) { |
| 506 | 506 | $id_secteur = $id_rubrique; |
| 507 | 507 | } |
| 508 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 509 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 508 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 509 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 510 | 510 | if ($langue_secteur != $langue_objet) { |
| 511 | 511 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 512 | 512 | return true; |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 515 | 515 | return false; |
| 516 | 516 | } else { |
| 517 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 517 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 518 | 518 | if ($id_parent != 0) { |
| 519 | 519 | // sous-rubriques : pas de choix de langue |
| 520 | 520 | return false; |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | if (!isset($opt['statut'])) { |
| 568 | 568 | if (isset($desc['field']['statut'])) { |
| 569 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 569 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 570 | 570 | } else { |
| 571 | 571 | $statut = 'publie'; |
| 572 | 572 | } // pas de statut => publie |
@@ -740,11 +740,11 @@ discard block |
||
| 740 | 740 | return false; |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 743 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 744 | 744 | return false; |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 747 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 748 | 748 | return false; |
| 749 | 749 | } |
| 750 | 750 | |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | if (!$id) { |
| 782 | 782 | return false; |
| 783 | 783 | } |
| 784 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 784 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 785 | 785 | |
| 786 | 786 | return |
| 787 | 787 | $r |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | (!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true)) |
| 793 | 793 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 794 | 794 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 795 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 795 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 796 | 796 | ) |
| 797 | 797 | ); |
| 798 | 798 | } |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | if (!$id) { |
| 851 | 851 | return false; |
| 852 | 852 | } |
| 853 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 853 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | return |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | or |
| 862 | 862 | ($id |
| 863 | 863 | and $qui['id_auteur'] |
| 864 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 864 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | |
@@ -882,8 +882,8 @@ discard block |
||
| 882 | 882 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 883 | 883 | # securite, mais on aurait pas du arriver ici ! |
| 884 | 884 | if ( |
| 885 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 886 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 885 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 886 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 887 | 887 | ) { |
| 888 | 888 | return $f($faire, $type, $id, $qui, $opt); |
| 889 | 889 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
| 1014 | 1014 | $n = sql_fetsel( |
| 1015 | 1015 | 'A.id_article', |
| 1016 | 1016 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1017 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1017 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1018 | 1018 | ); |
| 1019 | 1019 | |
| 1020 | 1020 | return $n ? true : false; |
@@ -1226,7 +1226,7 @@ discard block |
||
| 1226 | 1226 | and $r = sql_allfetsel( |
| 1227 | 1227 | 'id_objet', |
| 1228 | 1228 | 'spip_auteurs_liens', |
| 1229 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1229 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1230 | 1230 | ) |
| 1231 | 1231 | and is_countable($r) ? count($r) : 0 |
| 1232 | 1232 | ) { |
@@ -1911,8 +1911,8 @@ discard block |
||
| 1911 | 1911 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1912 | 1912 | $objet = objet_type($objet); |
| 1913 | 1913 | $where = [ |
| 1914 | - 'objet=' . sql_quote($objet), |
|
| 1915 | - 'id_objet=' . intval($id_objet) |
|
| 1914 | + 'objet='.sql_quote($objet), |
|
| 1915 | + 'id_objet='.intval($id_objet) |
|
| 1916 | 1916 | ]; |
| 1917 | 1917 | if (!empty($cond)) { |
| 1918 | 1918 | if (is_array($cond)) { |
@@ -1947,7 +1947,7 @@ discard block |
||
| 1947 | 1947 | return sql_allfetsel( |
| 1948 | 1948 | 'id_auteur', |
| 1949 | 1949 | 'spip_auteurs_liens', |
| 1950 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1950 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1951 | 1951 | ); |
| 1952 | 1952 | } |
| 1953 | 1953 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | include_spip('inc/texte'); |
| 21 | 21 | $titre = $descriptif = ''; |
| 22 | 22 | if ($type === 'rubrique') { |
| 23 | - $row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = ' . intval($id)); |
|
| 23 | + $row = sql_fetsel('titre, descriptif', 'spip_rubriques', 'id_rubrique = '.intval($id)); |
|
| 24 | 24 | if ($row) { |
| 25 | 25 | $titre = typo($row['titre']); |
| 26 | 26 | $descriptif = propre($row['descriptif']); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | include_spip('inc/filtres_images_mini'); |
| 43 | 43 | $res = image_reduire("<img src='$fid' alt='' />", 100, 48); |
| 44 | 44 | if ($res) { |
| 45 | - $res = "<div class='informer__media' style='float: " . $GLOBALS['spip_lang_right'] . '; margin-' . $GLOBALS['spip_lang_right'] . ": -5px; margin-top: -5px;'>$res</div>"; |
|
| 45 | + $res = "<div class='informer__media' style='float: ".$GLOBALS['spip_lang_right'].'; margin-'.$GLOBALS['spip_lang_right'].": -5px; margin-top: -5px;'>$res</div>"; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -64,21 +64,21 @@ discard block |
||
| 64 | 64 | ' ' |
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | - $js_func = $do . '_selection_titre'; |
|
| 67 | + $js_func = $do.'_selection_titre'; |
|
| 68 | 68 | |
| 69 | 69 | return "<div style='display: none;'>" |
| 70 | - . "<input type='text' id='" . $rac . "_sel' value='$id' />" |
|
| 71 | - . "<input type='text' id='" . $rac . "_sel2' value=\"" |
|
| 70 | + . "<input type='text' id='".$rac."_sel' value='$id' />" |
|
| 71 | + . "<input type='text' id='".$rac."_sel2' value=\"" |
|
| 72 | 72 | . entites_html($titre) |
| 73 | 73 | . '" />' |
| 74 | 74 | . '</div>' |
| 75 | 75 | . "<div class='informer' style='padding: 5px; border-top: 0px;'>" |
| 76 | 76 | . '<div class="informer__item">' |
| 77 | 77 | . (!$res ? '' : $res) |
| 78 | - . "<p class='informer__titre'><b>" . safehtml($titre) . '</b></p>' |
|
| 79 | - . (!$descriptif ? '' : "<div class='informer__descriptif'>" . safehtml($descriptif) . '</div>') |
|
| 78 | + . "<p class='informer__titre'><b>".safehtml($titre).'</b></p>' |
|
| 79 | + . (!$descriptif ? '' : "<div class='informer__descriptif'>".safehtml($descriptif).'</div>') |
|
| 80 | 80 | . '</div>' |
| 81 | - . "<div class='informer__action' style='clear:both; text-align: " . $GLOBALS['spip_lang_right'] . ";'>" |
|
| 81 | + . "<div class='informer__action' style='clear:both; text-align: ".$GLOBALS['spip_lang_right'].";'>" |
|
| 82 | 82 | . "<input type='submit' class='fondo btn submit' value='" |
| 83 | 83 | . _T('bouton_choisir') |
| 84 | 84 | . "'\nonclick=\"$js_func('$titre',$id,'selection_rubrique','id_parent'); return false;\" />" |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $titre = '[' |
| 91 | 91 | . $nom_site_spip |
| 92 | 92 | . ']' |
| 93 | - . ($titre ? ' ' . textebrut(typo($titre)) : ''); |
|
| 93 | + . ($titre ? ' '.textebrut(typo($titre)) : ''); |
|
| 94 | 94 | |
| 95 | 95 | return _DOCTYPE_ECRIRE |
| 96 | 96 | . html_lang_attributes() |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | function init_body($rubrique = 'accueil', $sous_rubrique = 'accueil', $id_rubrique = '', $menu = true) { |
| 134 | 134 | |
| 135 | 135 | $res = pipeline('body_prive', "<body class='" |
| 136 | - . init_body_class() . ' ' . _request('exec') . "'" |
|
| 136 | + . init_body_class().' '._request('exec')."'" |
|
| 137 | 137 | . ($GLOBALS['spip_lang_rtl'] ? " dir='rtl'" : '') |
| 138 | 138 | . '>'); |
| 139 | 139 | |
@@ -76,12 +76,12 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | function objet_modifier($objet, $id, $set = null) { |
| 78 | 78 | if (($t = objet_type($objet)) !== $objet) { |
| 79 | - spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 79 | + spip_log("objet_modifier: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 80 | 80 | $objet = $t; |
| 81 | 81 | } |
| 82 | 82 | if ( |
| 83 | - include_spip('action/editer_' . $objet) |
|
| 84 | - and function_exists($modifier = $objet . '_modifier') |
|
| 83 | + include_spip('action/editer_'.$objet) |
|
| 84 | + and function_exists($modifier = $objet.'_modifier') |
|
| 85 | 85 | ) { |
| 86 | 86 | return $modifier($id, $set); |
| 87 | 87 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $trouver_table = charger_fonction('trouver_table', 'base'); |
| 91 | 91 | $desc = $trouver_table($table_sql); |
| 92 | 92 | if (!$desc or !isset($desc['field'])) { |
| 93 | - spip_log("Objet $objet inconnu dans objet_modifier", 'editer' . _LOG_ERREUR); |
|
| 93 | + spip_log("Objet $objet inconnu dans objet_modifier", 'editer'._LOG_ERREUR); |
|
| 94 | 94 | |
| 95 | 95 | return _L("Erreur objet $objet inconnu"); |
| 96 | 96 | } |
@@ -170,12 +170,12 @@ discard block |
||
| 170 | 170 | function objet_inserer($objet, $id_parent = null, $set = null) { |
| 171 | 171 | $d = null; |
| 172 | 172 | if (($t = objet_type($objet)) !== $objet) { |
| 173 | - spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 173 | + spip_log("objet_inserer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 174 | 174 | $objet = $t; |
| 175 | 175 | } |
| 176 | 176 | if ( |
| 177 | - include_spip('action/editer_' . $objet) |
|
| 178 | - and function_exists($inserer = $objet . '_inserer') |
|
| 177 | + include_spip('action/editer_'.$objet) |
|
| 178 | + and function_exists($inserer = $objet.'_inserer') |
|
| 179 | 179 | ) { |
| 180 | 180 | return $inserer($id_parent, $set); |
| 181 | 181 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $row = sql_fetsel('id_rubrique, id_secteur, lang', 'spip_rubriques', 'id_parent=0', '', '0+titre,titre', '1'); |
| 197 | 197 | $id_rubrique = $row['id_rubrique']; |
| 198 | 198 | } else { |
| 199 | - $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 199 | + $row = sql_fetsel('lang, id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | $champs['id_rubrique'] = $id_rubrique; |
@@ -314,12 +314,12 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | function objet_instituer($objet, $id, $c, $calcul_rub = true) { |
| 316 | 316 | if (($t = objet_type($objet)) !== $objet) { |
| 317 | - spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 317 | + spip_log("objet_instituer: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 318 | 318 | $objet = $t; |
| 319 | 319 | } |
| 320 | 320 | if ( |
| 321 | - include_spip('action/editer_' . $objet) |
|
| 322 | - and function_exists($instituer = $objet . '_instituer') |
|
| 321 | + include_spip('action/editer_'.$objet) |
|
| 322 | + and function_exists($instituer = $objet.'_instituer') |
|
| 323 | 323 | ) { |
| 324 | 324 | return $instituer($id, $c, $calcul_rub); |
| 325 | 325 | } |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $sel[] = ($champ_date ? "$champ_date as date" : "'' as date"); |
| 349 | 349 | $sel[] = (isset($desc['field']['id_rubrique']) ? 'id_rubrique' : '0 as id_rubrique'); |
| 350 | 350 | |
| 351 | - $row = sql_fetsel($sel, $table_sql, id_table_objet($objet) . '=' . intval($id)); |
|
| 351 | + $row = sql_fetsel($sel, $table_sql, id_table_objet($objet).'='.intval($id)); |
|
| 352 | 352 | |
| 353 | 353 | $id_rubrique = $row['id_rubrique']; |
| 354 | 354 | $statut_ancien = $statut = $row['statut']; |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | if ($s != 'publie' and autoriser('modifier', $objet, $id)) { |
| 372 | 372 | $statut = $champs['statut'] = $s; |
| 373 | 373 | } else { |
| 374 | - spip_log("editer_objet $objet #$id refus " . json_encode($c, JSON_THROW_ON_ERROR), 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 374 | + spip_log("editer_objet $objet #$id refus ".json_encode($c, JSON_THROW_ON_ERROR), 'editer'._LOG_INFO_IMPORTANTE); |
|
| 375 | 375 | } |
| 376 | 376 | } |
| 377 | 377 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | and isset($c['id_parent']) |
| 402 | 402 | and $id_parent = $c['id_parent'] |
| 403 | 403 | and $id_parent != $id_rubrique |
| 404 | - and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique=' . intval($id_parent))) |
|
| 404 | + and (sql_fetsel('1', 'spip_rubriques', 'id_rubrique='.intval($id_parent))) |
|
| 405 | 405 | ) { |
| 406 | 406 | $champs['id_rubrique'] = $id_parent; |
| 407 | 407 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | // Si on deplace l'objet |
| 501 | 501 | // changer aussi son secteur et sa langue (si heritee) |
| 502 | 502 | if (isset($champs['id_rubrique'])) { |
| 503 | - $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique=' . sql_quote($champs['id_rubrique'])); |
|
| 503 | + $row_rub = sql_fetsel('id_secteur, lang', 'spip_rubriques', 'id_rubrique='.sql_quote($champs['id_rubrique'])); |
|
| 504 | 504 | $langue = $row_rub['lang']; |
| 505 | 505 | |
| 506 | 506 | if (isset($desc['field']['id_secteur'])) { |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | sql_fetsel( |
| 513 | 513 | '1', |
| 514 | 514 | $table_sql, |
| 515 | - id_table_objet($objet) . '=' . intval($id) . " AND langue_choisie<>'oui' AND lang<>" . sql_quote($langue) |
|
| 515 | + id_table_objet($objet).'='.intval($id)." AND langue_choisie<>'oui' AND lang<>".sql_quote($langue) |
|
| 516 | 516 | ) |
| 517 | 517 | ) { |
| 518 | 518 | $champs['lang'] = $langue; |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | if (!$champs) { |
| 524 | 524 | return; |
| 525 | 525 | } |
| 526 | - sql_updateq($table_sql, $champs, id_table_objet($objet) . '=' . intval($id)); |
|
| 526 | + sql_updateq($table_sql, $champs, id_table_objet($objet).'='.intval($id)); |
|
| 527 | 527 | |
| 528 | 528 | // Changer le statut des rubriques concernees |
| 529 | 529 | if ($cond) { |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | function objet_lire($objet, $valeur_id, $options = []) { |
| 569 | 569 | if (($t = objet_type($objet)) !== $objet) { |
| 570 | - spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer' . _LOG_INFO_IMPORTANTE); |
|
| 570 | + spip_log("objet_lire: appel avec type $objet invalide au lieu de $t", 'editer'._LOG_INFO_IMPORTANTE); |
|
| 571 | 571 | $objet = $t; |
| 572 | 572 | } |
| 573 | 573 | |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | ) { |
| 590 | 590 | // Il est possible pour un type d'objet de fournir une fonction de lecture de tous les champs d'un objet. |
| 591 | 591 | if ( |
| 592 | - include_spip('action/editer_' . $objet) |
|
| 592 | + include_spip('action/editer_'.$objet) |
|
| 593 | 593 | and function_exists($lire = "{$objet}_lire_champs") |
| 594 | 594 | ) { |
| 595 | 595 | $valeurs = $lire($objet, $valeur_id, $champ_id); |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | |
| 600 | 600 | // La condition est appliquée sur le champ désigné par l'utilisateur. |
| 601 | 601 | $where = [ |
| 602 | - $champ_id . '=' . sql_quote($valeur_id) |
|
| 602 | + $champ_id.'='.sql_quote($valeur_id) |
|
| 603 | 603 | ]; |
| 604 | 604 | |
| 605 | 605 | // Acquisition de tous les champs de l'objet : si l'accès SQL retourne une erreur on renvoie un tableau vide. |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $_id = $e['id_table_objet']; |
| 51 | 51 | if (isset($contexte[$_id]) and $id = intval($contexte[$_id])) { |
| 52 | 52 | $table = $e['table_objet_sql']; |
| 53 | - $row = sql_fetsel('*', $table, "$_id=" . intval($id)); |
|
| 53 | + $row = sql_fetsel('*', $table, "$_id=".intval($id)); |
|
| 54 | 54 | if (isset($row['id_rubrique'])) { |
| 55 | 55 | $contexte['id_rubrique'] = $row['id_rubrique']; |
| 56 | 56 | if (isset($row['id_secteur'])) { |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | $boutons_admin[$parent]->sousmenu = array_slice($boutons_admin[$parent]->sousmenu, 0, $position) |
| 115 | 115 | + [ |
| 116 | 116 | $id => new Bouton( |
| 117 | - ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 118 | - $infos['titre'], // titre |
|
| 117 | + ($icones and !empty($infos['icone'])) ? find_in_theme($infos['icone']) : '', // icone |
|
| 118 | + $infos['titre'], // titre |
|
| 119 | 119 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 120 | 120 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 121 | 121 | ) |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | $boutons_admin = array_slice($boutons_admin, 0, $position) |
| 133 | 133 | + [ |
| 134 | 134 | $id => new Bouton( |
| 135 | - ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 136 | - $infos['titre'], // titre |
|
| 135 | + ($icones and isset($infos['icone']) and $infos['icone']) ? find_in_theme($infos['icone']) : '', // icone |
|
| 136 | + $infos['titre'], // titre |
|
| 137 | 137 | (isset($infos['action']) and $infos['action']) ? $infos['action'] : null, |
| 138 | 138 | (isset($infos['parametres']) and $infos['parametres']) ? $infos['parametres'] : null |
| 139 | 139 | ) |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $url = str_replace('&', '&', $url); |
| 221 | 221 | while (preg_match(',[&?]([a-z_]+)=@([a-z_]+)@,i', $url, $matches)) { |
| 222 | 222 | if ($matches[2] == 'id_secteur' and !isset($contexte['id_secteur']) and isset($contexte['id_rubrique'])) { |
| 223 | - $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($contexte['id_rubrique'])); |
|
| 223 | + $contexte['id_secteur'] = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($contexte['id_rubrique'])); |
|
| 224 | 224 | } |
| 225 | 225 | $val = _request($matches[2], $contexte); |
| 226 | 226 | $url = parametre_url($url, $matches[1], $val ?: '', '&'); |