@@ -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 | } |
| 167 | 167 | |
| 168 | 168 | // Admins restreints, on construit ici (pas generique mais...) |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | spip_log( |
| 175 | - "autoriser $faire $type $id (" . ($qui['nom'] ?? '') . ') ?', |
|
| 176 | - 'autoriser' . _LOG_DEBUG |
|
| 175 | + "autoriser $faire $type $id (".($qui['nom'] ?? '').') ?', |
|
| 176 | + 'autoriser'._LOG_DEBUG |
|
| 177 | 177 | ); |
| 178 | 178 | |
| 179 | 179 | // passer par objet_type pour avoir les alias |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | (isset($GLOBALS['autoriser_exception'][$faire][$type][$id]) and autoriser_exception($faire, $type, $id, 'verifier')) |
| 190 | 190 | or (isset($GLOBALS['autoriser_exception'][$faire][$type]['*']) and autoriser_exception($faire, $type, '*', 'verifier')) |
| 191 | 191 | ) { |
| 192 | - spip_log("autoriser ($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : OK Exception', 'autoriser' . _LOG_DEBUG); |
|
| 192 | + spip_log("autoriser ($faire, $type, $id, ".($qui['nom'] ?? '').') : OK Exception', 'autoriser'._LOG_DEBUG); |
|
| 193 | 193 | return true; |
| 194 | 194 | } |
| 195 | 195 | |
@@ -198,18 +198,18 @@ discard block |
||
| 198 | 198 | // autoriser_faire[_dist], autoriser_defaut[_dist] |
| 199 | 199 | $fonctions = $type |
| 200 | 200 | ? [ |
| 201 | - 'autoriser_' . $type . '_' . $faire, |
|
| 202 | - 'autoriser_' . $type . '_' . $faire . '_dist', |
|
| 203 | - 'autoriser_' . $type, |
|
| 204 | - 'autoriser_' . $type . '_dist', |
|
| 205 | - 'autoriser_' . $faire, |
|
| 206 | - 'autoriser_' . $faire . '_dist', |
|
| 201 | + 'autoriser_'.$type.'_'.$faire, |
|
| 202 | + 'autoriser_'.$type.'_'.$faire.'_dist', |
|
| 203 | + 'autoriser_'.$type, |
|
| 204 | + 'autoriser_'.$type.'_dist', |
|
| 205 | + 'autoriser_'.$faire, |
|
| 206 | + 'autoriser_'.$faire.'_dist', |
|
| 207 | 207 | 'autoriser_defaut', |
| 208 | 208 | 'autoriser_defaut_dist' |
| 209 | 209 | ] |
| 210 | 210 | : [ |
| 211 | - 'autoriser_' . $faire, |
|
| 212 | - 'autoriser_' . $faire . '_dist', |
|
| 211 | + 'autoriser_'.$faire, |
|
| 212 | + 'autoriser_'.$faire.'_dist', |
|
| 213 | 213 | 'autoriser_defaut', |
| 214 | 214 | 'autoriser_defaut_dist' |
| 215 | 215 | ]; |
@@ -222,8 +222,8 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | spip_log( |
| 225 | - "$f($faire, $type, $id, " . ($qui['nom'] ?? '') . ') : ' . ($a ? 'OK' : 'niet'), |
|
| 226 | - 'autoriser' . _LOG_DEBUG |
|
| 225 | + "$f($faire, $type, $id, ".($qui['nom'] ?? '').') : '.($a ? 'OK' : 'niet'), |
|
| 226 | + 'autoriser'._LOG_DEBUG |
|
| 227 | 227 | ); |
| 228 | 228 | |
| 229 | 229 | return $a; |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | function autoriser_previsualiser_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 373 | 373 | |
| 374 | 374 | // Le visiteur a-t-il un statut prevu par la config ? |
| 375 | - if (strpos($GLOBALS['meta']['preview'], ',' . $qui['statut'] . ',') !== false) { |
|
| 375 | + if (strpos($GLOBALS['meta']['preview'], ','.$qui['statut'].',') !== false) { |
|
| 376 | 376 | return test_previsualiser_objet_champ($type, $id, $qui, $opt); |
| 377 | 377 | } |
| 378 | 378 | |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | } // pas de champ passe a la demande => NIET |
| 431 | 431 | $previsu = explode(',', $c['previsu']); |
| 432 | 432 | // regarder si ce statut est autorise pour l'auteur |
| 433 | - if (in_array($opt[$champ] . '/auteur', $previsu)) { |
|
| 433 | + if (in_array($opt[$champ].'/auteur', $previsu)) { |
|
| 434 | 434 | // retrouver l’id_auteur qui a filé un lien de prévisu éventuellement, |
| 435 | 435 | // sinon l’auteur en session |
| 436 | 436 | include_spip('inc/securiser_action'); |
@@ -444,12 +444,12 @@ discard block |
||
| 444 | 444 | |
| 445 | 445 | if (!$id_auteur) { |
| 446 | 446 | return false; |
| 447 | - } elseif (autoriser('previsualiser' . $opt[$champ], $type, 0, $id_auteur)) { |
|
| 447 | + } elseif (autoriser('previsualiser'.$opt[$champ], $type, 0, $id_auteur)) { |
|
| 448 | 448 | // dans ce cas (admin en general), pas de filtrage sur ce statut |
| 449 | 449 | } elseif ( |
| 450 | 450 | !sql_countsel( |
| 451 | 451 | 'spip_auteurs_liens', |
| 452 | - 'id_auteur=' . intval($id_auteur) . ' AND objet=' . sql_quote($type) . ' AND id_objet=' . intval($id) |
|
| 452 | + 'id_auteur='.intval($id_auteur).' AND objet='.sql_quote($type).' AND id_objet='.intval($id) |
|
| 453 | 453 | ) |
| 454 | 454 | ) { |
| 455 | 455 | return false; |
@@ -494,16 +494,16 @@ discard block |
||
| 494 | 494 | // multilinguisme par secteur et objet rattaché à une rubrique |
| 495 | 495 | $primary = id_table_objet($type); |
| 496 | 496 | if ($table != 'spip_rubriques') { |
| 497 | - $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=" . intval($id)); |
|
| 497 | + $id_rubrique = sql_getfetsel('id_rubrique', "$table", "$primary=".intval($id)); |
|
| 498 | 498 | } else { |
| 499 | 499 | $id_rubrique = $id; |
| 500 | 500 | } |
| 501 | - $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($id_rubrique)); |
|
| 501 | + $id_secteur = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique='.intval($id_rubrique)); |
|
| 502 | 502 | if (!$id_secteur > 0) { |
| 503 | 503 | $id_secteur = $id_rubrique; |
| 504 | 504 | } |
| 505 | - $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique=' . intval($id_secteur)); |
|
| 506 | - $langue_objet = sql_getfetsel('lang', "$table", "$primary=" . intval($id)); |
|
| 505 | + $langue_secteur = sql_getfetsel('lang', 'spip_rubriques', 'id_rubrique='.intval($id_secteur)); |
|
| 506 | + $langue_objet = sql_getfetsel('lang', "$table", "$primary=".intval($id)); |
|
| 507 | 507 | if ($langue_secteur != $langue_objet) { |
| 508 | 508 | // configuration incohérente, on laisse l'utilisateur corriger la situation |
| 509 | 509 | return true; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | if ($table != 'spip_rubriques') { // le choix de la langue se fait seulement sur les rubriques |
| 512 | 512 | return false; |
| 513 | 513 | } else { |
| 514 | - $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique=' . intval($id)); |
|
| 514 | + $id_parent = sql_getfetsel('id_parent', 'spip_rubriques', 'id_rubrique='.intval($id)); |
|
| 515 | 515 | if ($id_parent != 0) { |
| 516 | 516 | // sous-rubriques : pas de choix de langue |
| 517 | 517 | return false; |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | if (!isset($opt['statut'])) { |
| 565 | 565 | if (isset($desc['field']['statut'])) { |
| 566 | - $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type) . '=' . intval($id)); |
|
| 566 | + $statut = sql_getfetsel('statut', $desc['table'], id_table_objet($type).'='.intval($id)); |
|
| 567 | 567 | } else { |
| 568 | 568 | $statut = 'publie'; |
| 569 | 569 | } // pas de statut => publie |
@@ -737,11 +737,11 @@ discard block |
||
| 737 | 737 | return false; |
| 738 | 738 | } |
| 739 | 739 | |
| 740 | - if (sql_countsel('spip_rubriques', 'id_parent=' . intval($id))) { |
|
| 740 | + if (sql_countsel('spip_rubriques', 'id_parent='.intval($id))) { |
|
| 741 | 741 | return false; |
| 742 | 742 | } |
| 743 | 743 | |
| 744 | - if (sql_countsel('spip_articles', 'id_rubrique=' . intval($id) . " AND (statut<>'poubelle')")) { |
|
| 744 | + if (sql_countsel('spip_articles', 'id_rubrique='.intval($id)." AND (statut<>'poubelle')")) { |
|
| 745 | 745 | return false; |
| 746 | 746 | } |
| 747 | 747 | |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | if (!$id) { |
| 779 | 779 | return false; |
| 780 | 780 | } |
| 781 | - $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article=' . sql_quote($id)); |
|
| 781 | + $r = sql_fetsel('id_rubrique,statut', 'spip_articles', 'id_article='.sql_quote($id)); |
|
| 782 | 782 | |
| 783 | 783 | return |
| 784 | 784 | $r |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | (!isset($opt['statut']) or !in_array($opt['statut'], ['publie', 'refuse'], true)) |
| 790 | 790 | and in_array($qui['statut'], ['0minirezo', '1comite']) |
| 791 | 791 | and in_array($r['statut'], ['prop', 'prepa', 'poubelle']) |
| 792 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur']) |
|
| 792 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur']) |
|
| 793 | 793 | ) |
| 794 | 794 | ); |
| 795 | 795 | } |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | if (!$id) { |
| 848 | 848 | return false; |
| 849 | 849 | } |
| 850 | - $statut = sql_getfetsel('statut', 'spip_articles', 'id_article=' . intval($id)); |
|
| 850 | + $statut = sql_getfetsel('statut', 'spip_articles', 'id_article='.intval($id)); |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | return |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | or |
| 859 | 859 | ($id |
| 860 | 860 | and $qui['id_auteur'] |
| 861 | - and auteurs_objet('article', $id, 'id_auteur=' . $qui['id_auteur'])); |
|
| 861 | + and auteurs_objet('article', $id, 'id_auteur='.$qui['id_auteur'])); |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | |
@@ -879,8 +879,8 @@ discard block |
||
| 879 | 879 | function autoriser_voir_dist(string $faire, string $type, $id, array $qui, array $opt): bool { |
| 880 | 880 | # securite, mais on aurait pas du arriver ici ! |
| 881 | 881 | if ( |
| 882 | - function_exists($f = 'autoriser_' . $type . '_voir') |
|
| 883 | - or function_exists($f = 'autoriser_' . $type . '_voir_dist') |
|
| 882 | + function_exists($f = 'autoriser_'.$type.'_voir') |
|
| 883 | + or function_exists($f = 'autoriser_'.$type.'_voir_dist') |
|
| 884 | 884 | ) { |
| 885 | 885 | return $f($faire, $type, $id, $qui, $opt); |
| 886 | 886 | } |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | $n = sql_fetsel( |
| 1012 | 1012 | 'A.id_article', |
| 1013 | 1013 | 'spip_auteurs_liens AS L LEFT JOIN spip_articles AS A ON (L.objet=\'article\' AND L.id_objet=A.id_article)', |
| 1014 | - "A.statut='publie' AND L.id_auteur=" . sql_quote($id) |
|
| 1014 | + "A.statut='publie' AND L.id_auteur=".sql_quote($id) |
|
| 1015 | 1015 | ); |
| 1016 | 1016 | |
| 1017 | 1017 | return $n ? true : false; |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | and $r = sql_allfetsel( |
| 1224 | 1224 | 'id_objet', |
| 1225 | 1225 | 'spip_auteurs_liens', |
| 1226 | - 'id_auteur=' . intval($id_auteur) . " AND objet='rubrique' AND id_objet!=0" |
|
| 1226 | + 'id_auteur='.intval($id_auteur)." AND objet='rubrique' AND id_objet!=0" |
|
| 1227 | 1227 | ) |
| 1228 | 1228 | and is_countable($r) ? count($r) : 0 |
| 1229 | 1229 | ) { |
@@ -1908,8 +1908,8 @@ discard block |
||
| 1908 | 1908 | function auteurs_objet($objet, $id_objet, $cond = '') { |
| 1909 | 1909 | $objet = objet_type($objet); |
| 1910 | 1910 | $where = [ |
| 1911 | - 'objet=' . sql_quote($objet), |
|
| 1912 | - 'id_objet=' . intval($id_objet) |
|
| 1911 | + 'objet='.sql_quote($objet), |
|
| 1912 | + 'id_objet='.intval($id_objet) |
|
| 1913 | 1913 | ]; |
| 1914 | 1914 | if (!empty($cond)) { |
| 1915 | 1915 | if (is_array($cond)) { |
@@ -1944,7 +1944,7 @@ discard block |
||
| 1944 | 1944 | return sql_allfetsel( |
| 1945 | 1945 | 'id_auteur', |
| 1946 | 1946 | 'spip_auteurs_liens', |
| 1947 | - "objet='article' AND id_objet=" . intval($id_article) . ($cond ? " AND $cond" : '') |
|
| 1947 | + "objet='article' AND id_objet=".intval($id_article).($cond ? " AND $cond" : '') |
|
| 1948 | 1948 | ); |
| 1949 | 1949 | } |
| 1950 | 1950 | |