Skip to content
Extraits de code Groupes Projets
Valider 9645e3c3 rédigé par esj's avatar esj
Parcourir les fichiers

Introduction dans les squelettes {{{prive/rss}}} du contrôle de sécurité, et...

Introduction dans les squelettes {{{prive/rss}}} du contrôle de sécurité, et changement des liens des boutons donnant un flux RSS privé qui appellent à présent directement un squelette ({{{prive/rss.html}}}), et non plus le script {{{action/rss.php}}}. Réécriture de celui-ci, qui accepte toujours les anciens liens et leur communique le résultat attendu malgré ces changements, au prix d'un deuxième contrôle de sécurité. Mais il faudrait évacuer complètement ce script et retourner une redirection définitive, pas triviale car le hash n'est pas le même entre les deux versions.
parent cc6f653c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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
......
......@@ -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;
......
......@@ -87,7 +87,7 @@ function encours_accueil()
: '' )
)
. $res
. bouton_spip_rss('a-suivre')
. bouton_spip_rss('a_suivre')
. fin_cadre_couleur_foncee(true)
. "</div>";
}
......
......@@ -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
......
......@@ -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"
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}<INCLURE{fond=prive/rss/#ENV{op}}{env}>
\ No newline at end of file
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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>
#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)][ &lt;(#EMAIL|texte_backend)&gt;]</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>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter