diff --git a/.gitattributes b/.gitattributes index 5a9eb4c356d5abac0624c3fce258569683e14863..ceea1bfe8bd41ed51c48edbfabffd100d7968e9f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -765,6 +765,7 @@ prive/modeles/text.html -text prive/modeles/video.html -text prive/puce_prive.gif -text prive/puce_prive_rtl.gif -text +prive/rss.html -text prive/rss/a_suivre.html -text prive/rss/forums.html -text prive/rss/forums_interne.html -text diff --git a/ecrire/action/rss.php b/ecrire/action/rss.php index 8bd308024880b1fa177b479558566526c32ddc34..c865add26c55b82d23909a851812fa374ff937cd 100644 --- a/ecrire/action/rss.php +++ b/ecrire/action/rss.php @@ -12,6 +12,9 @@ if (!defined("_ECRIRE_INC_VERSION")) return; +// Ce script n'est plus utile qu'a la compatibilite avec les liens +// produits par l'ancienne definition de bouton_spip_rss + include_spip('inc/acces'); include_spip('inc/texte'); // utile pour l'espace public, deja fait sinon @@ -38,18 +41,20 @@ function action_rss_dist() if (verifier_low_sec($id, $cle, "rss $op $args")) { lang_select($lang); $op = str_replace('-', '_', $op); - $contexte = array('fond' => 'prive/rss/' . $op); - foreach (split(':', $args) as $bout) { + $contexte = $_REQUEST; + $contexte['cle'] = afficher_low_sec($id, $op, $args); + $contexte['fond'] = 'prive/rss/' . $op; + foreach (split(':', $args) as $bout) { list($var, $val) = split('-', $bout, 2); $contexte[$var] = $val; - } + } $f = charger_fonction($op, 'rss', true); if ($f) $contexte = $f($contexte); } else $contexte = ''; if ($contexte) { $r = evaluer_fond ('', $contexte); echo $r['texte']; - $message ="spip_rss s'applique sur " . $contexte['fond'] . " et $args pour $id par $f"; + $message ="spip_rss s'applique sur " . $contexte['fond'] . " et $args pour $id par $f cle " . $contexte['cle']; } else $message = ("spip_rss sur '$op $args pour $id' incorrect"); spip_log("$message (" . spip_timer('rss') .')'); exit; diff --git a/ecrire/exec/accueil.php b/ecrire/exec/accueil.php index 26df58244eb72d363b52c5ed14e752362c258914..0f2d32873e58df66af587ec94f6ee50bd1dc7ec0 100644 --- a/ecrire/exec/accueil.php +++ b/ecrire/exec/accueil.php @@ -87,7 +87,7 @@ function encours_accueil() : '' ) ) . $res - . bouton_spip_rss('a-suivre') + . bouton_spip_rss('a_suivre') . fin_cadre_couleur_foncee(true) . "</div>"; } diff --git a/ecrire/inc/acces.php b/ecrire/inc/acces.php index 9756bf1782bf7547351cec4dc8f38bca665d267c..5ae1da152950729dc588e758d33ebcc060b198c8 100644 --- a/ecrire/inc/acces.php +++ b/ecrire/inc/acces.php @@ -99,6 +99,7 @@ function low_sec($id_auteur) { // Inclure les arguments significatifs pour le hachage // cas particulier du statut pour compatibilite ancien suivi_revisions // http://doc.spip.org/@generer_url_low_sec + function generer_url_low_sec($action, $args, $id_auteur=0, $lang='') { $a = ''; @@ -111,18 +112,18 @@ function generer_url_low_sec($action, $args, $id_auteur=0, $lang='') } $a = substr($a,1); } - $cle = afficher_low_sec($id_auteur, "rss $action $a"); - return generer_url_action('rss', "$b&cle=$cle&args=$a"); + $cle = afficher_low_sec($id_auteur, $action, $a); + return generer_url_public("rss", "$b&cle=$cle&args=$a"); } // http://doc.spip.org/@afficher_low_sec -function afficher_low_sec ($id_auteur, $action='') { - return substr(md5($action.low_sec($id_auteur)),0,8); +function afficher_low_sec ($id_auteur, $action='', $args='') { + return substr(md5($action.$args.low_sec($id_auteur)),0,8); } // http://doc.spip.org/@verifier_low_sec -function verifier_low_sec ($id_auteur, $cle, $action='') { - return ($cle == afficher_low_sec($id_auteur, $action)); +function verifier_low_sec ($id_auteur, $cle, $action='', $args='') { + return ($cle == afficher_low_sec($id_auteur, $action, $args)); } // http://doc.spip.org/@effacer_low_sec diff --git a/ecrire/public/parametrer.php b/ecrire/public/parametrer.php index ee47db2dfdc3b14dcfc19b3552ebb5487eceeb0e..72837c4077b48cc2c2ff4a5ed176c9fb3444ba3a 100644 --- a/ecrire/public/parametrer.php +++ b/ecrire/public/parametrer.php @@ -16,8 +16,8 @@ if (!defined("_ECRIRE_INC_VERSION")) return; // Ce fichier calcule une page en executant un squelette. // -include_spip('base/abstract_sql'); include_spip('inc/lang'); +include_spip('inc/acces'); // NB: Ce fichier peut initialiser $dossier_squelettes (old-style) // donc il faut l'inclure "en globals" diff --git a/prive/rss.html b/prive/rss.html new file mode 100644 index 0000000000000000000000000000000000000000..b90a1f803f4d35ccecdbd41df24bb9602e826811 --- /dev/null +++ b/prive/rss.html @@ -0,0 +1 @@ +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<INCLURE{fond=prive/rss/#ENV{op}}{env}> \ No newline at end of file diff --git a/prive/rss/a_suivre.html b/prive/rss/a_suivre.html index 86f43046810879ff0108675217eeb78312a6baac..c48dfd2b31467865579a8fa456c495eabb67dd9f 100644 --- a/prive/rss/a_suivre.html +++ b/prive/rss/a_suivre.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="#LANG"> @@ -48,4 +50,9 @@ rsort($rss); echo join('',$rss); ?> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums.html b/prive/rss/forums.html index 325f613888a345f70eef6846d82cc35071bf0536..b99aa92c0c09567025b8e65e94b841ff275a03e0 100644 --- a/prive/rss/forums.html +++ b/prive/rss/forums.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums_interne.html b/prive/rss/forums_interne.html index e524e84ba0f9f9adfc654798bb047ae108c1defe..ba236ffc63fa47f42fc31755b2dd2507446af0ab 100644 --- a/prive/rss/forums_interne.html +++ b/prive/rss/forums_interne.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums_prop.html b/prive/rss/forums_prop.html index 0e2079e140c5ab484f2345a3acc5b26db3118237..f67cf6a5e44e6d6a9e926c6abd0f8c23459e5454 100644 --- a/prive/rss/forums_prop.html +++ b/prive/rss/forums_prop.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums_public.html b/prive/rss/forums_public.html index 491954710e3f8e4edf3840da98ad03bdc7490ad1..07b744e9e22504eca231fe0a5097f9bff80a244d 100644 --- a/prive/rss/forums_public.html +++ b/prive/rss/forums_public.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums_spam.html b/prive/rss/forums_spam.html index 1587a8e64d1d7db6547c3edc234ffb6d658afc06..6f0076461dd173cbcf869ab6108e02567ebfd20a 100644 --- a/prive/rss/forums_spam.html +++ b/prive/rss/forums_spam.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/forums_vide.html b/prive/rss/forums_vide.html index ca51260cdaa1b35e62a7147f8dadb4b7cc730213..25f61a6469094290ffe0341354f14b198037c97d 100644 --- a/prive/rss/forums_vide.html +++ b/prive/rss/forums_vide.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -21,4 +23,9 @@ <description>[ (#TEXTE|liens_absolus|texte_backend)]#NOTES</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> + diff --git a/prive/rss/messagerie.html b/prive/rss/messagerie.html index 57ccd747d567ea0c7bfc72431eeec532c7aa3988..a5a5bbff365f1efe577270fece2a70bec7b45657 100644 --- a/prive/rss/messagerie.html +++ b/prive/rss/messagerie.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="#LANG"> @@ -39,4 +41,8 @@ rsort($rss); echo join('',$rss); ?> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> diff --git a/prive/rss/revisions.html b/prive/rss/revisions.html index eb237af41e9bc29413bcc81a7f78ffbbfd372234..cdbbad3f786681b902ab61b4d4ba39221b320a30 100644 --- a/prive/rss/revisions.html +++ b/prive/rss/revisions.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -18,4 +20,8 @@ <description>[(#ID_ARTICLE|revisions_diff{#ID_VERSION})]</description> </item></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0> diff --git a/prive/rss/signatures.html b/prive/rss/signatures.html index 5438834ff9af605d66d8b9fa1727c6a06b6373a1..6edb5ea3a9ac18073aa56d9acd663043c297067d 100644 --- a/prive/rss/signatures.html +++ b/prive/rss/signatures.html @@ -1,4 +1,6 @@ -#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<?xml version="1.0" encoding="#CHARSET" ?> +#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php +if ([(#ID_AUTEUR|verifier_low_sec{#ENV{cle}, #ENV{op}, #ENV{args}}|?{1,0})]) { +?><?xml version="1.0" encoding="#CHARSET" ?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0"> <channel xml:lang="[(#ENV{lang}|texte_backend)]"> @@ -7,7 +9,7 @@ <description></description> <language>[(#ENV{lang}|texte_backend)]</language> <BOUCLE_RSS(SIGNATURES){!par date}{0,50} - ><BOUCLE0(ARTICLES){id_article}> + ><BOUCLE_A(ARTICLES){id_article}> <item> <title>[(#TITRE|texte_backend)]</title> <link>[(#URL_ARTICLE|url_absolue|texte_backend)]</link> @@ -17,6 +19,10 @@ [<dc:language>(#LANG|texte_backend)</dc:language>] <dc:creator>[(#NOM_EMAIL|texte_backend)][ <(#EMAIL|texte_backend)>]</dc:creator> <description>[(#_RSS:URL_SITE|propre|liens_absolus)][ (#MESSAGE|couper{300}|liens_absolus|texte_backend)]</description> - </item></BOUCLE0></BOUCLE_RSS> + </item></BOUCLE_A></BOUCLE_RSS> </channel> -</rss> +</rss><?php +} else { +include_spip('inc/minipres'); +echo minipres(); +}?></BOUCLE0>