@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | // mais apres la fonction autoriser() |
| 123 | 123 | if ($f = find_in_path('mes_fonctions.php')) { |
| 124 | 124 | global $dossier_squelettes; |
| 125 | - include_once(_ROOT_CWD . $f); |
|
| 125 | + include_once(_ROOT_CWD.$f); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $qui = $GLOBALS['visiteur_session'] ?: []; |
| 165 | 165 | $qui = array_merge(['statut' => '', 'id_auteur' => 0, 'webmestre' => 'non'], $qui); |
| 166 | 166 | } elseif (is_numeric($qui)) { |
| 167 | - $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur=' . $qui); |
|
| 167 | + $qui = sql_fetsel('*', 'spip_auteurs', 'id_auteur='.$qui); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | spip_log( |
| 177 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 178 | - 'autoriser' . _LOG_DEBUG |
|
| 177 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 178 | + 'autoriser'._LOG_DEBUG |
|
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | 181 | // passer par objet_type pour avoir les alias |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 192 | 192 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 193 | 193 | ) { |
| 194 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 194 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 195 | 195 | return true; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -200,18 +200,18 @@ discard block |
||
| 200 | 200 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 201 | 201 | $fonctions = $type |
| 202 | 202 | ? [ |
| 203 | - 'autoriser_' . $type . '_' . $faire, |
|
| 204 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 205 | - 'autoriser_' . $type, |
|
| 206 | - 'autoriser_' . $type . '_dist', |
|
| 207 | - 'autoriser_' . $faire, |
|
| 208 | - 'autoriser_' . $faire . '_dist', |
|
| 203 | + 'autoriser_'.$type.'_'.$faire, |
|
| 204 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 205 | + 'autoriser_'.$type, |
|
| 206 | + 'autoriser_'.$type.'_dist', |
|
| 207 | + 'autoriser_'.$faire, |
|
| 208 | + 'autoriser_'.$faire.'_dist', |
|
| 209 | 209 | 'autoriser_defaut', |
| 210 | 210 | 'autoriser_defaut_dist' |
| 211 | 211 | ] |
| 212 | 212 | : [ |
| 213 | - 'autoriser_' . $faire, |
|
| 214 | - 'autoriser_' . $faire . '_dist', |
|
| 213 | + 'autoriser_'.$faire, |
|
| 214 | + 'autoriser_'.$faire.'_dist', |
|
| 215 | 215 | 'autoriser_defaut', |
| 216 | 216 | 'autoriser_defaut_dist' |
| 217 | 217 | ]; |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | spip_log( |
| 227 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 228 | - 'autoriser' . _LOG_DEBUG |
|
| 227 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 228 | + 'autoriser'._LOG_DEBUG |
|
| 229 | 229 | ); |
| 230 | 230 | |
| 231 | 231 | return $a; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 375 | 375 | |
| 376 | 376 | // Le visiteur a-t-il un statut prevu par la config ? |
| 377 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 377 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 378 | 378 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } // pas de champ passe a la demande => NIET |
| 433 | 433 | $previsu = explode(',', $c['previsu']); |
| 434 | 434 | // regarder si ce statut est autorise pour l'auteur |
| 435 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 435 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 436 | 436 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 437 | 437 | // sinon l’auteur en session |
| 438 | 438 | include_spip('inc/securiser_action'); |
@@ -446,12 +446,12 @@ discard block |
||
| 446 | 446 | |
| 447 | 447 | if (!$id_auteur) { |
| 448 | 448 | return false; |
| 449 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 449 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 450 | 450 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 451 | 451 | } elseif ( |
| 452 | 452 | !sql_countsel( |
| 453 | 453 | 'spip_auteurs_liens', |
| 454 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 454 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 455 | 455 | ) |
| 456 | 456 | ) { |
| 457 | 457 | return false; |
@@ -496,16 +496,16 @@ discard block |
||
| 496 | 496 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 497 | 497 | $primary = id_table_objet($type); |
| 498 | 498 | if ($table != 'spip_rubriques') { |
| 499 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 499 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 500 | 500 | } else { |
| 501 | 501 | $id_rubrique = $id; |
| 502 | 502 | } |
| 503 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 503 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 504 | 504 | if (!$id_secteur > 0) { |
| 505 | 505 | $id_secteur = $id_rubrique; |
| 506 | 506 | } |
| 507 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 508 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 507 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 508 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 509 | 509 | if ($langue_secteur != $langue_objet) { |
| 510 | 510 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 511 | 511 | return true; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 514 | 514 | return false; |
| 515 | 515 | } else { |
| 516 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 516 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 517 | 517 | if ($id_parent != 0) { |
| 518 | 518 | // sous-rubriques : pas de choix de langue |
| 519 | 519 | return false; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | if (!isset($opt['statut'])) { |
| 567 | 567 | if (isset($desc['field']['statut'])) { |
| 568 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 568 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 569 | 569 | } else { |
| 570 | 570 | $statut = 'publie'; |
| 571 | 571 | } // pas de statut => publie |
@@ -739,11 +739,11 @@ discard block |
||
| 739 | 739 | return false; |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 742 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 743 | 743 | return false; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 746 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 747 | 747 | return false; |
| 748 | 748 | } |
| 749 | 749 | |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | if (!$id) { |
| 781 | 781 | return false; |
| 782 | 782 | } |
| 783 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 783 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 784 | 784 | |
| 785 | 785 | return |
| 786 | 786 | $r |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | (!isset($opt['statut']) or $opt['statut'] !== 'publie') |
| 792 | 792 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 793 | 793 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 794 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 794 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 795 | 795 | ) |
| 796 | 796 | ); |
| 797 | 797 | } |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | if (!$id) { |
| 850 | 850 | return false; |
| 851 | 851 | } |
| 852 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 852 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | return |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | or |
| 861 | 861 | ($id |
| 862 | 862 | and $qui['id_auteur'] |
| 863 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 863 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | |
@@ -881,8 +881,8 @@ discard block |
||
| 881 | 881 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 882 | 882 | # securite, mais on aurait pas du arriver ici ! |
| 883 | 883 | if ( |
| 884 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 885 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 884 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 885 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 886 | 886 | ) { |
| 887 | 887 | return $f($faire, $type, $id, $qui, $opt); |
| 888 | 888 | } |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | $n = sql_fetsel( |
| 1014 | 1014 | 'A.id_article', |
| 1015 | 1015 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1016 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1016 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1017 | 1017 | ); |
| 1018 | 1018 | |
| 1019 | 1019 | return $n ? true : false; |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | and $r = sql_allfetsel( |
| 1226 | 1226 | 'id_objet', |
| 1227 | 1227 | 'spip_auteurs_liens', |
| 1228 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1228 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1229 | 1229 | ) |
| 1230 | 1230 | and is_countable($r) ? count($r) : 0 |
| 1231 | 1231 | ) { |
@@ -1910,8 +1910,8 @@ discard block |
||
| 1910 | 1910 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1911 | 1911 | $objet = objet_type($objet); |
| 1912 | 1912 | $where = [ |
| 1913 | - 'objet=' . sql_quote($objet), |
|
| 1914 | - 'id_objet=' . intval($id_objet) |
|
| 1913 | + 'objet='.sql_quote($objet), |
|
| 1914 | + 'id_objet='.intval($id_objet) |
|
| 1915 | 1915 | ]; |
| 1916 | 1916 | if (!empty($cond)) { |
| 1917 | 1917 | if (is_array($cond)) { |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | return sql_allfetsel( |
| 1947 | 1947 | 'id_auteur', |
| 1948 | 1948 | 'spip_auteurs_liens', |
| 1949 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1949 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1950 | 1950 | ); |
| 1951 | 1951 | } |
| 1952 | 1952 | |