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

Amélioration de la mise en squelette des anciennes actions ical et rss, afin...

Amélioration de la mise en squelette des anciennes actions ical et rss, afin de retrouver la même clé qu'auparavant, et éviter de charger inc/acces à chaque exécution de squelette. Le pb signalé dans [12404] est donc évacué.
parent 73a2ed60
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -113,18 +113,18 @@ function generer_url_low_sec($action, $args, $id_auteur=0, $lang='') ...@@ -113,18 +113,18 @@ function generer_url_low_sec($action, $args, $id_auteur=0, $lang='')
} }
$a = substr($a,1); $a = substr($a,1);
} }
$cle = afficher_low_sec($id_auteur, $action, $a); $cle = afficher_low_sec($id_auteur, "rss $action $a");
return generer_url_public("rss", "$b&cle=$cle&args=$a"); return generer_url_public("rss", "$b&cle=$cle&args=$a");
} }
// http://doc.spip.org/@afficher_low_sec // http://doc.spip.org/@afficher_low_sec
function afficher_low_sec ($id_auteur, $action='', $args='') { function afficher_low_sec ($id_auteur, $action='') {
return substr(md5($action.$args.low_sec($id_auteur)),0,8); return substr(md5($action.low_sec($id_auteur)),0,8);
} }
// http://doc.spip.org/@verifier_low_sec // http://doc.spip.org/@verifier_low_sec
function verifier_low_sec ($id_auteur, $cle, $action='', $args='') { function verifier_low_sec ($id_auteur, $cle, $action='') {
return ($cle == afficher_low_sec($id_auteur, $action, $args)); return ($cle == afficher_low_sec($id_auteur, $action));
} }
// http://doc.spip.org/@effacer_low_sec // http://doc.spip.org/@effacer_low_sec
......
...@@ -648,6 +648,13 @@ function antispam($texte) { ...@@ -648,6 +648,13 @@ function antispam($texte) {
return preg_replace("/@/", " $masque ", $texte); return preg_replace("/@/", " $masque ", $texte);
} }
function securiser_acces($id_auteur, $cle, $dir, $op='', $args='')
{
include_spip('inc/acces');
if ($op) $dir .= " $op $args";
return verifier_low_sec($id_auteur, $cle, $dir);
}
// sinon{texte, rien} : affiche "rien" si la chaine est vide, // sinon{texte, rien} : affiche "rien" si la chaine est vide,
// affiche la chaine si non vide ; // affiche la chaine si non vide ;
// attention c'est compile directement dans inc/references // attention c'est compile directement dans inc/references
......
...@@ -17,12 +17,10 @@ if (!defined("_ECRIRE_INC_VERSION")) return; ...@@ -17,12 +17,10 @@ if (!defined("_ECRIRE_INC_VERSION")) return;
// //
include_spip('inc/lang'); include_spip('inc/lang');
include_spip('inc/acces');
// NB: Ce fichier peut initialiser $dossier_squelettes (old-style) // NB: Ce fichier peut initialiser $dossier_squelettes (old-style)
// donc il faut l'inclure "en globals" // donc il faut l'inclure "en globals"
if ($f = find_in_path('mes_fonctions.php') if ($f = find_in_path('mes_fonctions.php')) {
OR $f = find_in_path('mes_fonctions.php3')) {
global $dossier_squelettes; global $dossier_squelettes;
include ($f); include ($f);
} }
......
<BOUCLE0(AUTEURS){tout}{id_auteur}{lang_select}><?php <BOUCLE0(AUTEURS){tout}{id_auteur}{lang_select}><?php
include_spip('inc/acces'); include_spip('inc/acces');
if ('#ENV{arg}' === '[(#ID_AUTEUR|afficher_low_sec{ical})]') { if ([(#ID_AUTEUR|securiser_acces{#ENV{arg},ical})]) {
?>#HTTP_HEADER{Content-Type: text/calendar} ?>#HTTP_HEADER{Content-Type: text/calendar}
#CACHE{0} #CACHE{0}
BEGIN:VCALENDAR BEGIN:VCALENDAR
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss, #ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
#HTTP_HEADER{Content-Type: text/xml; charset=#CHARSET}#CACHE{900}<BOUCLE0(AUTEURS){tout}{id_auteur=#ENV{id}}{lang_select}><?php #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})]) { if ([(#ID_AUTEUR|securiser_acces{#ENV{cle},rss,#ENV{op}, #ENV{args}}|?{1,0})]) {
?><?xml version="1.0" encoding="#CHARSET" ?> ?><?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"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter