diff options
author | polo <ordipolo@gmx.fr> | 2024-02-08 04:31:14 +0100 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2024-02-08 04:31:14 +0100 |
commit | ccc9a05b758f1dc0313b96807edfc447a9e8d278 (patch) | |
tree | 114808e506b2bedabdc3ad09770edd7e5eb64e81 /view | |
parent | 1ad47a7ca38e679a50c8dfee004db88b1633d7cf (diff) | |
download | melaine-ccc9a05b758f1dc0313b96807edfc447a9e8d278.zip |
RGPD cookie uniquement en mode admin et avertissement, logo journal
Diffstat (limited to 'view')
-rw-r--r-- | view/album.php | 5 | ||||
-rw-r--r-- | view/articlesContent.php | 8 | ||||
-rw-r--r-- | view/backup.php | 2 | ||||
-rw-r--r-- | view/discographie.php | 45 | ||||
-rw-r--r-- | view/pageArticlesSimples.php | 6 | ||||
-rw-r--r-- | view/password.php | 31 | ||||
-rw-r--r-- | view/template.php | 4 |
7 files changed, 43 insertions, 58 deletions
diff --git a/view/album.php b/view/album.php index 28b1b13..6fcca36 100644 --- a/view/album.php +++ b/view/album.php | |||
@@ -64,8 +64,7 @@ for($i = 0; $i < $Albums->fileListCount; $i++) | |||
64 | <?php | 64 | <?php |
65 | 65 | ||
66 | // formulaires et éditeur à la place de l'article à modifier | 66 | // formulaires et éditeur à la place de l'article à modifier |
67 | if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1 | 67 | if(isset($_SESSION) && isset($_GET['action']) && $_GET['action'] === 'edition') |
68 | && isset($_GET['action']) && $_GET['action'] === 'edition') | ||
69 | { | 68 | { |
70 | $style = 'class="articleAvecEditeur"'; | 69 | $style = 'class="articleAvecEditeur"'; |
71 | ?> | 70 | ?> |
@@ -95,7 +94,7 @@ else | |||
95 | <?php | 94 | <?php |
96 | // boutons modifier et supprimer, mais pas monter ni descendre | 95 | // boutons modifier et supprimer, mais pas monter ni descendre |
97 | // modifier ouvre l'éditeur, supprimer renvoie vers la discographie | 96 | // modifier ouvre l'éditeur, supprimer renvoie vers la discographie |
98 | if($_SESSION['admin'] == 1 && (!isset($_GET['action']) || $_GET['action'] !== 'edition')) | 97 | if(isset($_SESSION) && (!isset($_GET['action']) || $_GET['action'] !== 'edition')) |
99 | { | 98 | { |
100 | ?> | 99 | ?> |
101 | <a class="infobulle" href="index.php?page=album&action=edition&file_code=<?= $fileCode ?>" > | 100 | <a class="infobulle" href="index.php?page=album&action=edition&file_code=<?= $fileCode ?>" > |
diff --git a/view/articlesContent.php b/view/articlesContent.php index 7abc289..8ec7f70 100644 --- a/view/articlesContent.php +++ b/view/articlesContent.php | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | // tampon pour $articlesContent | 4 | // tampon pour $articlesContent |
5 | ob_start(); | 5 | ob_start(); |
6 | if($_SESSION['admin'] == 1) | 6 | if(isset($_SESSION)) |
7 | { | 7 | { |
8 | // à la place du bouton après rechargement | 8 | // à la place du bouton après rechargement |
9 | if(isset($_GET['action']) && $_GET['action'] == 'editor' && !isset($_GET['file_code'])) | 9 | if(isset($_GET['action']) && $_GET['action'] == 'editor' && !isset($_GET['file_code'])) |
@@ -64,7 +64,7 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
64 | global $host; | 64 | global $host; |
65 | 65 | ||
66 | // remplacer un article par l'éditeur | 66 | // remplacer un article par l'éditeur |
67 | if($_SESSION['admin'] == 1 && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code']) | 67 | if(isset($_SESSION) && isset($_GET['action']) && $_GET['action'] == 'editor' && isset($_GET['file_code']) |
68 | && $_GET['file_code'] == $Articles->fileList[$i]['fileCode'] | 68 | && $_GET['file_code'] == $Articles->fileList[$i]['fileCode'] |
69 | ) | 69 | ) |
70 | { | 70 | { |
@@ -85,14 +85,14 @@ for($i = 0; $i < $Articles->fileListCount; $i++) | |||
85 | echo($Articles->fileList[$i]['content'] . "\n"); | 85 | echo($Articles->fileList[$i]['content'] . "\n"); |
86 | ?> | 86 | ?> |
87 | </div> | 87 | </div> |
88 | <p class="boutonArticle" > | 88 | <p> |
89 | <a class="infobulle" href="<?= $lien_partage ?>" > | 89 | <a class="infobulle" href="<?= $lien_partage ?>" > |
90 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" alt="bouton"> | 90 | <img src="public/icone_partager.png" onclick="copierDansPressePapier('<?= $host ?>/<?= $lien_partage ?>')" alt="bouton"> |
91 | <button>Partager</button> | 91 | <button>Partager</button> |
92 | </a> | 92 | </a> |
93 | <?php | 93 | <?php |
94 | // bouton | 94 | // bouton |
95 | if($_SESSION['admin'] == 1) | 95 | if(isset($_SESSION)) |
96 | { | 96 | { |
97 | ?> | 97 | ?> |
98 | <a class="infobulle" href="index.php?page=<?= $page ?>&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" > | 98 | <a class="infobulle" href="index.php?page=<?= $page ?>&action=editor&file_code=<?= $Articles->fileList[$i]['fileCode'] ?>#<?= $Articles->fileList[$i]['fileCode'] ?>" > |
diff --git a/view/backup.php b/view/backup.php index 8461543..78e2d04 100644 --- a/view/backup.php +++ b/view/backup.php | |||
@@ -28,7 +28,7 @@ if(isset($_GET['action']) && $_GET['action'] == 'sauvegarde') | |||
28 | <h2>Sauvegarde complète</h2> | 28 | <h2>Sauvegarde complète</h2> |
29 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un unique fichier que vous pouvez conserver si vous le souhaitez sur votre ordinateur.</p> | 29 | <p>Toutes les données du sites (textes, photos) ont été rassemblées dans un unique fichier que vous pouvez conserver si vous le souhaitez sur votre ordinateur.</p> |
30 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui ou pour récupérer des fichiers effacés ou perdus. Ce fichier sera utile dans le cas d'une migration (déplacement du site, changement d'hébergeur), d'un problème affectant le serveur, ou encore d'une mauvaise manipulation.</p> | 30 | <p>Vous pourrez l'utiliser plus tard pour restaurer le site dans l'état où il se trouve aujourd'hui ou pour récupérer des fichiers effacés ou perdus. Ce fichier sera utile dans le cas d'une migration (déplacement du site, changement d'hébergeur), d'un problème affectant le serveur, ou encore d'une mauvaise manipulation.</p> |
31 | <p style="color: red;" >Veuillez noter que votre mot de passe ne sera pas conservé. Dans le cas d'une migration, il vous sera proposé d'en créer un nouveau.</p> | 31 | <p style="color: red;" >Veuillez noter que votre mot de passe n'est pas inclu dans la sauvegarde. Dans le cas d'une migration, il vous sera proposé d'en créer un nouveau.</p> |
32 | <p>Ce fichier se nomme <i><?= $nomFichier ?></i></p> | 32 | <p>Ce fichier se nomme <i><?= $nomFichier ?></i></p> |
33 | 33 | ||
34 | <button class="boutonBackup" ><a href="data/<?= $nomFichier ?>" >Le télécharger</a></button> | 34 | <button class="boutonBackup" ><a href="data/<?= $nomFichier ?>" >Le télécharger</a></button> |
diff --git a/view/discographie.php b/view/discographie.php index 6e560af..84358db 100644 --- a/view/discographie.php +++ b/view/discographie.php | |||
@@ -66,7 +66,7 @@ for($i = 0; $i < $Albums->fileListCount; $i++) | |||
66 | <section> | 66 | <section> |
67 | <?php | 67 | <?php |
68 | // éditeur ou bouton "Nouvel album" | 68 | // éditeur ou bouton "Nouvel album" |
69 | if($_SESSION['admin'] == 1) | 69 | if(isset($_SESSION)) |
70 | { | 70 | { |
71 | if(isset($_GET['action']) && $_GET['action'] === 'edition' && $fileCode === '') | 71 | if(isset($_GET['action']) && $_GET['action'] === 'edition' && $fileCode === '') |
72 | { | 72 | { |
@@ -103,53 +103,31 @@ if($_SESSION['admin'] == 1) | |||
103 | //for($i = $Albums->fileListCount - 1; $i >= 0; $i--) | 103 | //for($i = $Albums->fileListCount - 1; $i >= 0; $i--) |
104 | for($i = 0; $i < $Albums->fileListCount; $i++) | 104 | for($i = 0; $i < $Albums->fileListCount; $i++) |
105 | { | 105 | { |
106 | // article modifié sur fond coloré | ||
107 | if(isset($fileCode) && $Albums->fileList[$i]['fileCode'] == $fileCode) | ||
108 | { | ||
109 | $style = 'class="articleAvecEditeur"'; | ||
110 | } | ||
111 | else | ||
112 | { | ||
113 | $style = 'class="articleSansEditeur"'; | ||
114 | } | ||
115 | ?> | 106 | ?> |
116 | <article id="<?= $Albums->fileList[$i]['fileCode'] ?>" <?= $style ?>> | 107 | <article id="<?= $Albums->fileList[$i]['fileCode'] ?>" class="articleSansEditeur"> |
117 | <?php | 108 | <?php |
118 | // formulaires et éditeur à la place de l'article à modifier | 109 | // mettre une adresse + cadre bleu lorsqu'un fichier html existe |
119 | if(isset($_SESSION['admin']) && $_SESSION['admin'] == 1 | 110 | if($avecLien[$i]) |
120 | && isset($_GET['action']) && $_GET['action'] === 'edition' | ||
121 | && $Albums->fileList[$i]['fileCode'] == $fileCode) | ||
122 | { | 111 | { |
123 | ?> | ||
124 | <h3>Modifier un album</h3> | ||
125 | <?= $editeurHTML ?> | ||
126 | <?php | ||
127 | } | ||
128 | // affichage normal | ||
129 | else | ||
130 | { | ||
131 | // mettre une adresse lorsqu'un fichier html existe | ||
132 | if($avecLien[$i]) | ||
133 | { | ||
134 | ?> | 112 | ?> |
135 | <a href="index.php?<?= $lienAlbum[$i] ?>" > | 113 | <a href="index.php?<?= $lienAlbum[$i] ?>" > |
136 | <?php | 114 | <?php |
137 | } | 115 | } |
138 | ?> | 116 | ?> |
139 | <figure> | 117 | <figure> |
140 | <img src="data/discographie/images-mini/<?= $Albums->fileList[$i]['pochetteMini'] ?>" alt="" > | 118 | <img src="data/discographie/images-mini/<?= $Albums->fileList[$i]['pochetteMini'] ?>" alt="" > |
141 | <figcaption><?= $Albums->fileList[$i]['titre'] ?><br><?= $Albums->fileList[$i]['annee'] ?></figcaption> | 119 | <figcaption><?= $Albums->fileList[$i]['titre'] ?><br><?= $Albums->fileList[$i]['annee'] ?></figcaption> |
142 | </figure> | 120 | </figure> |
143 | <?php | 121 | <?php |
144 | if($avecLien[$i]) | 122 | if($avecLien[$i]) |
145 | { | 123 | { |
146 | ?> | 124 | ?> |
147 | </a> | 125 | </a> |
148 | <?php | 126 | <?php |
149 | } | 127 | } |
150 | // boutons | 128 | // boutons |
151 | if($_SESSION['admin'] == 1) | 129 | if(isset($_SESSION)) |
152 | { | 130 | { |
153 | ?> | 131 | ?> |
154 | <p> | 132 | <p> |
155 | <a class="infobulle" href="index.php?<?= $lienBoutonModif[$i] ?>" > | 133 | <a class="infobulle" href="index.php?<?= $lienBoutonModif[$i] ?>" > |
@@ -170,7 +148,6 @@ for($i = 0; $i < $Albums->fileListCount; $i++) | |||
170 | </a> | 148 | </a> |
171 | </p> | 149 | </p> |
172 | <?php | 150 | <?php |
173 | } | ||
174 | } | 151 | } |
175 | ?> | 152 | ?> |
176 | </article> | 153 | </article> |
diff --git a/view/pageArticlesSimples.php b/view/pageArticlesSimples.php index 8758373..d282964 100644 --- a/view/pageArticlesSimples.php +++ b/view/pageArticlesSimples.php | |||
@@ -66,8 +66,10 @@ echo "\n"; | |||
66 | if($page == 'menu' && !empty($ArticlesContent)) | 66 | if($page == 'menu' && !empty($ArticlesContent)) |
67 | { | 67 | { |
68 | ?> | 68 | ?> |
69 | <div> | 69 | <div class="sectionActu"> |
70 | <h3 class="sectionActu">Actualité</h3> | 70 | <div style="max-width: 20%;"> |
71 | <img src="public/newspaper.png"> | ||
72 | </div> | ||
71 | <div> | 73 | <div> |
72 | <?= $ArticlesContent ?> | 74 | <?= $ArticlesContent ?> |
73 | </div> | 75 | </div> |
diff --git a/view/password.php b/view/password.php index 6302950..ae153b5 100644 --- a/view/password.php +++ b/view/password.php | |||
@@ -47,7 +47,6 @@ ob_start(); | |||
47 | $formulaireNouveauMDP = ob_get_clean(); | 47 | $formulaireNouveauMDP = ob_get_clean(); |
48 | 48 | ||
49 | // formulaire changement de mot de passe | 49 | // formulaire changement de mot de passe |
50 | // vérification de l'ancien et choix du nouveau à taper deux fois dont une à l'aveugle | ||
51 | ob_start(); | 50 | ob_start(); |
52 | ?> | 51 | ?> |
53 | <form class="connexionFormulaire" method="post" action="index.php?from=<?= $_GET['from'] ?>&action=modif_mdp" > | 52 | <form class="connexionFormulaire" method="post" action="index.php?from=<?= $_GET['from'] ?>&action=modif_mdp" > |
@@ -64,7 +63,6 @@ ob_start(); | |||
64 | <?php | 63 | <?php |
65 | $formulaireModifMDP = ob_get_clean(); | 64 | $formulaireModifMDP = ob_get_clean(); |
66 | 65 | ||
67 | |||
68 | // en-tête | 66 | // en-tête |
69 | ob_start(); | 67 | ob_start(); |
70 | ?> | 68 | ?> |
@@ -91,15 +89,20 @@ ob_start(); | |||
91 | $header = ob_get_clean(); | 89 | $header = ob_get_clean(); |
92 | 90 | ||
93 | 91 | ||
94 | // messages d'erreur | 92 | $error_messages = [ |
95 | $errorPassword = '<p class="avertissement" >Mauvais mot de passe</p>'; | 93 | 'error_non_valid_captcha' => '<p class="avertissement" >Erreur au test anti-robot, veuillez saisir un nombre entier.</p>', |
96 | $errorNonValidCaptcha = '<p class="avertissement" >Captcha non valide, veuillez saisir un nombre entier.</p>'; | 94 | 'bad_solution_captcha' => '<p class="avertissement" >Erreur au test anti-robot, veuillez réessayer.</p>', |
97 | $errorCaptcha = '<p class="avertissement" >Erreur au test anti-robot</p>'; | 95 | 'bad_password' => '<p class="avertissement" >Mauvais mot de passe, veuillez réessayer.</p>', |
98 | $errorBadCharacters = '<p class="avertissement" >Caractères interdits: espaces, tabulations, sauts CR/LF.</p>'; | 96 | 'forbidden_characters' => '<p class="avertissement" >Caractères interdits: espaces, tabulations, sauts CR/LF.</p>' |
99 | $messageDeconnect = "<p class='connexionP connexionFooter' ><i>N'oubliez de cliquer sur 'déconnexion' quand vous aurez fini.</i></p>"; | 97 | ]; |
100 | 98 | ||
101 | // avertissement | 99 | $warning_messages = [ |
102 | $warning = '<p class="avertissement" >Rappel de sécurité<br />Vous n\'utilisez pas votre propre ordinateur ou téléphone? Utilisez la navigation privée!</p>'; | 100 | 'message_disconnect' => "<p class='connexionP' ><i>N'oubliez de cliquer sur 'déconnexion' quand vous aurez fini.</i></p>", |
101 | 'message_cookie' => "<p class='connexionP' style='color: red;'>Ce site utilisera un cookie « obligatoire » dès que vous serez connecté.<br>Il sera supprimé à votre déconnexion ou dès que vous aurez quitté le site.</p>", | ||
102 | // est un espace insécable | ||
103 | 'private_browsing' =>"<p class='connexionP' >Au fait? Vous n'utilisez pas votre propre ordinateur ou téléphone?<br/> | ||
104 | Utilisez la navigation privée.</p>" | ||
105 | ]; | ||
103 | 106 | ||
104 | 107 | ||
105 | // confirmation modification du mot de passe | 108 | // confirmation modification du mot de passe |
@@ -111,16 +114,20 @@ ob_start(); | |||
111 | <a href="index.php" >Retour au site.</a><br></p> | 114 | <a href="index.php" >Retour au site.</a><br></p> |
112 | </noscript> | 115 | </noscript> |
113 | <?php | 116 | <?php |
114 | $message = ob_get_clean(); | 117 | $alertJSNewPassword = ob_get_clean(); |
115 | 118 | ||
116 | 119 | ||
117 | // pied de page | 120 | // pied de page |
121 | if(isset($_GET['from'])) | ||
122 | { | ||
123 | $page = '?page=' . $_GET['from']; | ||
124 | } | ||
118 | ob_start(); | 125 | ob_start(); |
119 | if(isset($_GET['page'])) // exclue la "création du mot de passe" | 126 | if(isset($_GET['page'])) // exclue la "création du mot de passe" |
120 | { | 127 | { |
121 | ?> | 128 | ?> |
122 | <p class="connexionP connexionFooter" > | 129 | <p class="connexionP connexionFooter" > |
123 | <a href="index.php?from=<?= $_GET['from'] ?>" > | 130 | <a href="index.php<?= $page ?>" > |
124 | <button>Retour au site.</button> | 131 | <button>Retour au site.</button> |
125 | </a> | 132 | </a> |
126 | </p> | 133 | </p> |
diff --git a/view/template.php b/view/template.php index 2a4d182..dfe68bd 100644 --- a/view/template.php +++ b/view/template.php | |||
@@ -53,7 +53,7 @@ if($page != "accueil") | |||
53 | } | 53 | } |
54 | 54 | ||
55 | // lien vers le mode admin | 55 | // lien vers le mode admin |
56 | if($_SESSION['admin'] == 0 && isset($_GET['page']) && $_GET['page'] != 'accueil') | 56 | if(!isset($_SESSION) && isset($_GET['page']) && $_GET['page'] != 'accueil') |
57 | { | 57 | { |
58 | ?> | 58 | ?> |
59 | <div id="lienModeAdmin" > | 59 | <div id="lienModeAdmin" > |
@@ -63,7 +63,7 @@ if($_SESSION['admin'] == 0 && isset($_GET['page']) && $_GET['page'] != 'accueil' | |||
63 | } | 63 | } |
64 | 64 | ||
65 | // actions en mode admin | 65 | // actions en mode admin |
66 | if($_SESSION['admin'] == 1) | 66 | if(isset($_SESSION)) |
67 | { | 67 | { |
68 | ?> | 68 | ?> |
69 | <!-- zone superposée par les commandes du mode admin --> | 69 | <!-- zone superposée par les commandes du mode admin --> |