Overview
Comment: | Modernisation : dernières corrections |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
45f55bea0bca4d37f81a6c5722fdf6ef |
User & Date: | bohwaz on 2017-09-08 02:02:20 |
Other Links: | branch diff | manifest | tags |
Context
2017-09-08
| ||
03:32 | Corriger les liens wiki check-in: 91f8594d05 user: bohwaz tags: dev | |
02:02 | Modernisation : dernières corrections check-in: 45f55bea0b user: bohwaz tags: dev | |
01:48 | Fix problèmes d'envoi de mails check-in: 4f308662d1 user: bohwaz tags: dev | |
Changes
Modified src/include/lib/Garradin/Fichiers.php from [398f6de205] to [6cbae156df].
1 2 3 4 5 6 7 8 9 10 11 12 | <?php namespace Garradin; use KD2\Image; class Fichiers { public $id; public $nom; public $type; public $image; | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; use KD2\Image; use Garradin\Membres\Session; class Fichiers { public $id; public $nom; public $type; public $image; |
︙ | ︙ | |||
146 147 148 149 150 151 152 | } /** * Vérifie que l'utilisateur a bien le droit d'accéder à ce fichier * @param mixed $user Tableau contenant les infos sur l'utilisateur connecté, provenant de Session::getUser, ou false * @return boolean TRUE si l'utilisateur a le droit d'accéder au fichier, sinon FALSE */ | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | } /** * Vérifie que l'utilisateur a bien le droit d'accéder à ce fichier * @param mixed $user Tableau contenant les infos sur l'utilisateur connecté, provenant de Session::getUser, ou false * @return boolean TRUE si l'utilisateur a le droit d'accéder au fichier, sinon FALSE */ public function checkAccess(Session $session) { $config = Config::getInstance(); if ($config->get('image_fond') == $this->id) { return true; } |
︙ | ︙ | |||
170 171 172 173 174 175 176 | // Page wiki publique, aucune vérification à faire, seul cas d'accès à un fichier en dehors de l'espace admin if ($wiki !== false && $wiki == Wiki::LECTURE_PUBLIC) { return true; } // Pas d'utilisateur connecté, pas d'accès aux fichiers de l'espace admin | | > > | 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | // Page wiki publique, aucune vérification à faire, seul cas d'accès à un fichier en dehors de l'espace admin if ($wiki !== false && $wiki == Wiki::LECTURE_PUBLIC) { return true; } // Pas d'utilisateur connecté, pas d'accès aux fichiers de l'espace admin if (!$session->isLogged()) { return false; } $user = $session->getUser(); if ($wiki !== false) { // S'il n'a même pas droit à accéder au wiki c'est mort if (!$session->canAccess('wiki', Membres::DROIT_ACCES)) { return false; |
︙ | ︙ |
Modified src/include/lib/Garradin/Template.php from [da16100d4f] to [189de9d70f].
︙ | ︙ | |||
438 439 440 441 442 443 444 | return $out; } protected function formSelectCompte($params) { $name = $params['name']; $comptes = $params['comptes']; | | | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | return $out; } protected function formSelectCompte($params) { $name = $params['name']; $comptes = $params['comptes']; $selected = isset($params['data'][$params['name']]) ? $params['data'][$params['name']] : f($name); $out = '<select name="'.$name.'" id="f_'.$name.'" class="large">'; foreach ($comptes as $compte) { // Ne pas montrer les comptes désactivés if (!empty($compte->desactive)) |
︙ | ︙ |
Modified src/templates/admin/wiki/_fichiers.tpl from [dd6a332789] to [7aaf5c2a52].
1 2 3 4 5 6 7 8 9 10 11 12 13 | {include file="admin/_head.tpl" title="Inclure un fichier" current="wiki" body_id="transparent" is_popup=true js=1} {form_errors} <form method="post" enctype="multipart/form-data" action="{$self_url}" id="f_upload"> <fieldset> <legend>Téléverser un fichier</legend> <input type="hidden" name="MAX_FILE_SIZE" value="{$max_size}" id="f_maxsize" /> <dl> <dd class="help">Taille maximale : {$max_size|format_bytes}</dd> <dd class="fileUpload"><input type="file" name="fichier" id="f_fichier" data-hash-check /></dd> </dl> <p class="submit"> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {include file="admin/_head.tpl" title="Inclure un fichier" current="wiki" body_id="transparent" is_popup=true js=1} {form_errors} <form method="post" enctype="multipart/form-data" action="{$self_url}" id="f_upload"> <fieldset> <legend>Téléverser un fichier</legend> <input type="hidden" name="MAX_FILE_SIZE" value="{$max_size}" id="f_maxsize" /> <dl> <dd class="help">Taille maximale : {$max_size|format_bytes}</dd> <dd class="fileUpload"><input type="file" name="fichier" id="f_fichier" data-hash-check /></dd> </dl> <p class="submit"> {csrf_field key=$csrf_id} <input type="submit" name="upload" id="f_submit" value="Envoyer le fichier" /> </p> </fieldset> </form> <form method="get" action="#" style="display: none;" id="insertImage"> <fieldset> |
︙ | ︙ | |||
43 44 45 46 47 48 49 | <ul class="gallery"> {foreach from=$images item="file"} <li> <figure> <a href="{$file.url}" data-id="{$file.id}"><img src="{$file.thumb}" alt="" title="{$file.nom}" /></a> <form class="actions" method="post" action="{$self_url}"> <a href="{$file.url}" onclick="return !window.open(this.href);" class="icn" title="Télécharger">⇓</a> | | | | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | <ul class="gallery"> {foreach from=$images item="file"} <li> <figure> <a href="{$file.url}" data-id="{$file.id}"><img src="{$file.thumb}" alt="" title="{$file.nom}" /></a> <form class="actions" method="post" action="{$self_url}"> <a href="{$file.url}" onclick="return !window.open(this.href);" class="icn" title="Télécharger">⇓</a> {csrf_field key=$csrf_id} <input type="hidden" name="delete" value="{$file.id}" /> <noscript><input type="submit" value="Supprimer" /></noscript> </form> </figure> </li> {/foreach} </ul> {/if} {if !empty($fichiers)} <table class="list"> <tbody> {foreach from=$fichiers item="file"} <tr> <th>{$file.nom}</th> <td>{if $file.type}{$file.type}{/if}</td> <td class="actions"> <form class="actions" method="post" action="{$self_url}"> <a href="{$file.url}" onclick="return !window.open(this.href);" class="icn" title="Télécharger">⇓</a> {csrf_field key=$csrf_id} <input type="hidden" name="delete" value="{$file.id}" /> <noscript><input type="submit" value="Supprimer" /></noscript> </form> </td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/page.tpl from [2be2099588] to [0a5fd04f4f].
︙ | ︙ | |||
10 11 12 13 14 15 16 | {/if} {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li> {/if} {if $can_read && $page && $page.contenu} <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a> {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC} | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | {/if} {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li> {/if} {if $can_read && $page && $page.contenu} <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a> {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC} <li><a href="{$www_url}{$page.uri}{if !empty($children)}/{/if}">Voir sur le site</a> {/if} {/if} {if $session->canAccess('wiki', Garradin\Membres::DROIT_ADMIN)} <li><a href="{$www_url}admin/wiki/supprimer.php?id={$page.id}">Supprimer</a></li> {/if} </ul> |
︙ | ︙ |
Modified src/www/admin/upgrade.php from [42e3340a60] to [eb480a9207].
︙ | ︙ | |||
141 142 143 144 145 146 147 | $db->exec(file_get_contents(ROOT . '/include/data/0.6.0.sql')); $id_cat_cotisation = $db->firstColumn('SELECT id FROM compta_categories WHERE compte = 756 LIMIT 1;'); // Conversion des cotisations de catégories en cotisations indépendantes foreach ($list as $cat) { | | | | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | $db->exec(file_get_contents(ROOT . '/include/data/0.6.0.sql')); $id_cat_cotisation = $db->firstColumn('SELECT id FROM compta_categories WHERE compte = 756 LIMIT 1;'); // Conversion des cotisations de catégories en cotisations indépendantes foreach ($list as $cat) { $db->insert('cotisations', [ 'id_categorie_compta' => null, 'intitule' => $cat->nom, 'montant' => (float) $cat->montant_cotisation, // Convertir un nombre de mois en nombre de jours 'duree' => round($cat->duree_cotisation * 30.44), 'description' => 'Créé automatiquement depuis les catégories de membres (version 0.5.x)', ]); $args = [ 'id_cotisation' => (int)$db->lastInsertRowId(), 'id_categorie' => (int)$cat->id, ]; // import des dates de cotisation existantes comme paiements $db->preparedQuery('INSERT INTO cotisations_membres (id_membre, id_cotisation, date) SELECT id, :id_cotisation, date(date_cotisation) FROM membres WHERE date_cotisation IS NOT NULL AND date_cotisation != \'\' AND id_categorie = :id_categorie;', $args); // Mais on ne crée pas d'écriture comptable, car elles existent probablement déjà } |
︙ | ︙ |
Modified src/www/admin/wiki/_fichiers.php from [fe7c6001eb] to [7b5457219e].
︙ | ︙ | |||
107 108 109 110 111 112 113 114 115 116 | $tpl->assign('fichiers', Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, false)); $tpl->assign('images', Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, true)); $tpl->assign('max_size', Utils::getMaxUploadSize()); $tpl->assign('page', $page); $tpl->assign('sent', (bool)qg('sent')); $tpl->assign('custom_js', ['upload_helper.min.js', 'wiki_fichiers.js']); | > < < < | 107 108 109 110 111 112 113 114 115 116 117 118 | $tpl->assign('fichiers', Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, false)); $tpl->assign('images', Fichiers::listLinkedFiles(Fichiers::LIEN_WIKI, $page->id, true)); $tpl->assign('max_size', Utils::getMaxUploadSize()); $tpl->assign('page', $page); $tpl->assign('sent', (bool)qg('sent')); $tpl->assign('csrf_id', $csrf_id); $tpl->assign('custom_js', ['upload_helper.min.js', 'wiki_fichiers.js']); $tpl->display('admin/wiki/_fichiers.tpl'); |
Modified src/www/file.php from [f834a2242b] to [29f2d831bc].
︙ | ︙ | |||
31 32 33 34 35 36 37 | { throw new UserException('Ce fichier n\'existe pas.'); } $session = new Membres\Session; $user = $session->isLogged() ? $session->getUser() : false; | | | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | { throw new UserException('Ce fichier n\'existe pas.'); } $session = new Membres\Session; $user = $session->isLogged() ? $session->getUser() : false; if (!$file->checkAccess($session)) { header('HTTP/1.1 403 Forbidden', true, 403); throw new UserException('Vous n\'avez pas accès à ce fichier.'); } if ($size) { $file->serveThumbnail($size); } else { $file->serve(); } |