@@ -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 | |