Comment: | Merge avec trunk |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
12a00549c1df5d8533f23deae5f3499c |
User & Date: | bohwaz on 2019-12-17 16:02:05 |
Other Links: | branch diff | manifest | tags |
2020-01-06
| ||
12:15 | Fusion avec trunk check-in: 451f4d7e39 user: bohwaz tags: dev | |
2019-12-17
| ||
16:02 | Merge avec trunk check-in: 12a00549c1 user: bohwaz tags: dev | |
11:01 | Fix: passage de paramètre de retour au plugin check-in: 449f2f6f3e user: bohwaz tags: trunk, stable | |
2019-09-23
| ||
21:30 | Fusion des changements et correctifs effectués dans le trunk check-in: c0a510c18c user: bohwaz tags: dev | |
Modified src/.htaccess from [2d15b5d11b] to [0f46a6ebba].
1 2 3 | # Désactiver le multiviews (conflit avec /admin/plugin.php) et les index (sécurité) Options -MultiViews -Indexes | > > | | > > | | > > | > > > | | < > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | # Désactiver le multiviews (conflit avec /admin/plugin.php) et les index (sécurité) Options -MultiViews -Indexes DirectoryIndex disabled DirectoryIndex index.php index.html # Au cas où <IfModule mod_alias.c> RedirectMatch 403 /include/ RedirectMatch 403 /cache/ RedirectMatch 403 /plugins/ RedirectMatch 403 /templates/ RedirectMatch 403 /.*\.sqlite RedirectMatch 403 /.*\.log RedirectMatch 403 /(README|VERSION|COPYING|Makefile|cron\.php) RedirectMatch 403 /config\.(.*)\.php RedirectMatch 403 /sous-domaine\.html RedirectMatch 403 _inc\.php </IfModule> # Redirection dynamique, pour les installations sans vhost dédié # Objectif: supprimer le /www/ de l'URL # Dé-commenter les lignes suivantes pour une installation sans VHost # Note: il est probable qu'il soit nécessaire d'adapter la configuration # à votre hébergeur ! #<IfModule mod_rewrite.c> #RewriteEngine on ## Remplacer dans les lignes suivantes ## /garradin/ par le nom du sous-répertoire où est installé Garradin #RewriteBase /garradin/ #FallbackResource /garradin/www/_route.php ## Ne pas modifier les lignes suivantes, les décommenter simplement ! #RewriteCond %{REQUEST_URI} !www/ #RewriteRule ^(.*)$ www/$1 [QSA,L] #</IfModule> # Une fois ces lignes décommentées, supprimer le fichier .htaccess dans le répertoire www ! |
Modified src/Makefile from [7b30622c74] to [cf4731ac96].
︙ | ︙ | |||
32 33 34 35 36 37 38 | deb: cd ../debian; ./makedeb.sh publish: release deb $(eval VERSION=$(shell cat VERSION)) fossil uv sync | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | deb: cd ../debian; ./makedeb.sh publish: release deb $(eval VERSION=$(shell cat VERSION)) fossil uv sync #fossil uv ls | fgrep -v 'garradin-0.8.5' | grep '^garradin-.*\.(tar\.bz2|deb)' | xargs fossil uv rm fossil uv add garradin-${VERSION}.tar.bz2 cd ../debian && fossil uv add garradin-${VERSION}-*.deb fossil uv sync check-dependencies: grep -hEo '^use \\?KD2\\\w+|\\KD2\\\w+' -R include/lib/Garradin www | sed -r 's/^use \\?KD2\\|^\\KD2\\//' | sort | uniq |
Modified src/VERSION from [a416ca4e18] to [72f19f670a].
|
| | | 1 | 0.9.5 |
Modified src/config.dist.php from [1e67c15c59] to [7d9b8d58eb].
︙ | ︙ | |||
22 23 24 25 26 27 28 | * Si aucune valeur n'est définie, Garradin ajoutera automatiquement * une valeur au hasard dans le fichier config.local.php. */ const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r'; /** * Se connecter automatiquement avec l'ID de membre indiqué | | > > > > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | * Si aucune valeur n'est définie, Garradin ajoutera automatiquement * une valeur au hasard dans le fichier config.local.php. */ const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r'; /** * Se connecter automatiquement avec l'ID de membre indiqué * Exemple: LOCAL_LOGIN = 42 connectera automatiquement le membre n°42 * Attention à ne pas utiliser en production ! * * Il est aussi possible de mettre "LOCAL_LOGIN = -1" pour se connecter * avec le premier membre trouvé qui peut gérer la configuration (et donc * modifier les droits des membres). * * Défault : false (connexion automatique désactivée) */ const LOCAL_LOGIN = false; /** * Autoriser (ou non) l'import de sauvegarde qui a été modifiée ? |
︙ | ︙ |
Modified src/include/data/schema.sql from [d06d0af8c9] to [ed9b40a97d].
︙ | ︙ | |||
401 402 403 404 405 406 407 | id_membre INTEGER NULL REFERENCES membres (id) ON DELETE CASCADE, -- Si non NULL, alors la recherche ne sera visible que par le membre associé intitule TEXT NOT NULL, creation TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(creation) IS NOT NULL AND datetime(creation) = creation), cible TEXT NOT NULL, -- "membres" ou "compta_journal" type TEXT NOT NULL, -- "json" ou "sql" contenu TEXT NOT NULL ); | > > > > > > > > > > > > > > | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | id_membre INTEGER NULL REFERENCES membres (id) ON DELETE CASCADE, -- Si non NULL, alors la recherche ne sera visible que par le membre associé intitule TEXT NOT NULL, creation TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(creation) IS NOT NULL AND datetime(creation) = creation), cible TEXT NOT NULL, -- "membres" ou "compta_journal" type TEXT NOT NULL, -- "json" ou "sql" contenu TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS compromised_passwords_cache -- Cache des hash de mots de passe compromis ( hash TEXT NOT NULL PRIMARY KEY ); CREATE TABLE IF NOT EXISTS compromised_passwords_cache_ranges -- Cache des préfixes de mots de passe compromis ( prefix TEXT NOT NULL PRIMARY KEY, date INTEGER NOT NULL ); |
Modified src/include/init.php from [f08b2c5f34] to [88209f2eb4].
︙ | ︙ | |||
59 60 61 62 63 64 65 | // Configuration par défaut, si les constantes ne sont pas définies dans config.local.php // (fallback) if (!defined('Garradin\ROOT')) { define('Garradin\ROOT', dirname(__DIR__)); } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | // Configuration par défaut, si les constantes ne sont pas définies dans config.local.php // (fallback) if (!defined('Garradin\ROOT')) { define('Garradin\ROOT', dirname(__DIR__)); } /** * Auto-chargement des dépendances */ class Loader { /** |
︙ | ︙ | |||
201 202 203 204 205 206 207 208 209 210 211 212 213 214 | self::$loaded[$classname] = true; require $path; } } \spl_autoload_register(['Garradin\Loader', 'load'], true); /* * Gestion des erreurs et exceptions */ class UserException extends \LogicException { | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | self::$loaded[$classname] = true; require $path; } } \spl_autoload_register(['Garradin\Loader', 'load'], true); if (!defined('Garradin\DATA_ROOT')) { define('Garradin\DATA_ROOT', ROOT); } if (!defined('Garradin\WWW_URI')) { $uri = \KD2\HTTP::getRootURI(ROOT); if ($uri == '/www/') { $uri = '/'; } else { readfile(ROOT . '/sous-domaine.html'); exit; } define('Garradin\WWW_URI', $uri); unset($uri); } if (!defined('Garradin\WWW_URL')) { define('Garradin\WWW_URL', \KD2\HTTP::getScheme() . '://' . \KD2\HTTP::getHost() . WWW_URI); } static $default_config = [ 'CACHE_ROOT' => DATA_ROOT . '/cache', 'DB_FILE' => DATA_ROOT . '/association.sqlite', 'DB_SCHEMA' => ROOT . '/include/data/schema.sql', 'PLUGINS_ROOT' => DATA_ROOT . '/plugins', 'PREFER_HTTPS' => false, 'ALLOW_MODIFIED_IMPORT' => true, 'PLUGINS_SYSTEM' => '', 'SHOW_ERRORS' => true, 'MAIL_ERRORS' => false, 'ERRORS_REPORT_URL' => null, 'ERRORS_ENABLE_LOG_VIEW'=> true, 'USE_CRON' => false, 'ENABLE_XSENDFILE' => false, 'SMTP_HOST' => false, 'SMTP_USER' => null, 'SMTP_PASSWORD' => null, 'SMTP_PORT' => 587, 'SMTP_SECURITY' => 'STARTTLS', 'ADMIN_URL' => WWW_URL . 'admin/', 'NTP_SERVER' => 'fr.pool.ntp.org', 'ENABLE_AUTOMATIC_BACKUPS' => true, 'ADMIN_COLOR1' => '#9c4f15', 'ADMIN_COLOR2' => '#d98628', ]; foreach ($default_config as $const => $value) { $const = sprintf('Garradin\\%s', $const); if (!defined($const)) { define($const, $value); } } if (!defined('Garradin\\ADMIN_BACKGROUND_IMAGE')) { define('Garradin\\ADMIN_BACKGROUND_IMAGE', ADMIN_URL . 'static/gdin_bg.png'); } const WEBSITE = 'https://fossil.kd2.org/garradin/'; const PLUGINS_URL = 'https://garradin.eu/plugins/list.json'; const DEFAULT_REPORT_URL = null; // PHP devrait être assez intelligent pour chopper la TZ système mais nan // il sait pas faire (sauf sur Debian qui a le bon patch pour ça), donc pour // éviter le message d'erreur à la con on définit une timezone par défaut // Pour utiliser une autre timezone, il suffit de définir date.timezone dans // un .htaccess ou dans config.local.php if (!ini_get('date.timezone')) { if (($tz = @date_default_timezone_get()) && $tz != 'UTC') { ini_set('date.timezone', $tz); } else { ini_set('date.timezone', 'Europe/Paris'); } } /* * Gestion des erreurs et exceptions */ class UserException extends \LogicException { |
︙ | ︙ | |||
286 287 288 289 290 291 292 293 294 295 296 297 298 299 | echo $e->getMessage(); } else { $tpl = Template::getInstance(); $tpl->assign('error', $e->getMessage()); $tpl->display('error.tpl'); } exit; } // Message d'erreur simple pour les erreurs de l'utilisateur | > | 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | echo $e->getMessage(); } else { $tpl = Template::getInstance(); $tpl->assign('error', $e->getMessage()); $tpl->assign('admin_url', ADMIN_URL); $tpl->display('error.tpl'); } exit; } // Message d'erreur simple pour les erreurs de l'utilisateur |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Exercices.php from [7a15675417] to [3bc6667d2a].
︙ | ︙ | |||
102 103 104 105 106 107 108 109 110 111 112 113 | $new_end = Utils::modifyDate($new_begin, '+1 year -1 day'); // Enfin sauf s'il existe déjà des opérations après cette date, auquel cas la date de fin // est fixée à la date de la dernière opération, ceci pour ne pas avoir d'opération // orpheline d'exercice $last = $db->firstColumn('SELECT date FROM compta_journal WHERE id_exercice = ? AND date >= ? ORDER BY date DESC LIMIT 1;', $id, $new_end); $new_end = $last ?: $new_end; // Création du nouvel exercice $new_id = $this->add([ 'debut' => $new_begin, 'fin' => $new_end, | > > > > > > > > > > > | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | $new_end = Utils::modifyDate($new_begin, '+1 year -1 day'); // Enfin sauf s'il existe déjà des opérations après cette date, auquel cas la date de fin // est fixée à la date de la dernière opération, ceci pour ne pas avoir d'opération // orpheline d'exercice $last = $db->firstColumn('SELECT date FROM compta_journal WHERE id_exercice = ? AND date >= ? ORDER BY date DESC LIMIT 1;', $id, $new_end); $new_end = $last ?: $new_end; $year_begin = substr($new_begin, 0, 4); $year_end = substr($new_end, 0, 4); // Nom du nouvel exercice if ($year_begin == $year_end) { $label = sprintf('Exercice %d', $year_begin); } else { $label = sprintf('Exercice %d-%d', $year_begin, $year_end); } // Création du nouvel exercice $new_id = $this->add([ 'debut' => $new_begin, 'fin' => $new_end, 'libelle' => $label, ]); // Ré-attribution des opérations de l'exercice à clôturer qui ne sont pas dans son // intervale au nouvel exercice $db->update('compta_journal', ['id_exercice' => $new_id], 'id_exercice = :id AND date >= :date', [ 'id' => $id, 'date' => $new_begin, |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Import.php from [2b6a446835] to [f263dfbb6d].
︙ | ︙ | |||
19 20 21 22 23 24 25 | 'Compte de débit - numéro', 'Compte de débit - libellé', 'Compte de crédit - numéro', 'Compte de crédit - libellé', 'Moyen de paiement', 'Numéro de chèque', 'Numéro de pièce', | | > | > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 'Compte de débit - numéro', 'Compte de débit - libellé', 'Compte de crédit - numéro', 'Compte de crédit - libellé', 'Moyen de paiement', 'Numéro de chèque', 'Numéro de pièce', 'Remarques', 'Projet' ]; protected function export($exercice) { return DB::getInstance()->iterate('SELECT journal.id, strftime(\'%d/%m/%Y\', date) AS date, (CASE cat.type WHEN 1 THEN \'Recette\' WHEN -1 THEN \'Dépense\' ELSE \'Autre\' END) AS type, (CASE cat.intitule WHEN NULL THEN \'\' ELSE cat.intitule END) AS cat, journal.libelle, montant, compte_debit, debit.libelle AS libelle_debit, compte_credit, credit.libelle AS libelle_credit, (CASE moyen_paiement WHEN NULL THEN \'\' ELSE moyen.nom END) AS moyen, numero_cheque, numero_piece, remarques, projet.libelle AS projet FROM compta_journal AS journal LEFT JOIN compta_categories AS cat ON cat.id = journal.id_categorie LEFT JOIN compta_comptes AS debit ON debit.id = journal.compte_debit LEFT JOIN compta_comptes AS credit ON credit.id = journal.compte_credit LEFT JOIN compta_moyens_paiement AS moyen ON moyen.code = journal.moyen_paiement LEFT JOIN compta_projets AS projet ON projet.id = journal.id_projet WHERE id_exercice = '.(int)$exercice.' ORDER BY journal.date; '); } protected function exportName() { |
︙ | ︙ | |||
83 84 85 86 87 88 89 | } $db = DB::getInstance(); $db->begin(); $cats = new Categories; $journal = new Journal; | < > > > | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | } $db = DB::getInstance(); $db->begin(); $cats = new Categories; $journal = new Journal; $liste_cats = $db->getAssoc('SELECT intitule, id FROM compta_categories;'); // Liste des moyens sous la forme nom -> code $liste_moyens = array_flip($cats->listMoyensPaiement(true)); // Liste associative des projets $liste_projets = $db->getAssoc('SELECT libelle, id FROM compta_projets;'); $col = function($column) use (&$row, &$columns) { if (!isset($columns[$column])) return null; if (!isset($row[$columns[$column]])) return null; |
︙ | ︙ | |||
119 120 121 122 123 124 125 126 127 128 129 130 131 132 | if ($line === 1) { if (trim($row[0]) != 'Numéro mouvement') { throw new UserException('Erreur sur la ligne ' . $line . ' : l\'entête des colonnes est absent ou incorrect.'); } continue; } if (count($row) != count($columns)) { $db->rollback(); | > > | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | if ($line === 1) { if (trim($row[0]) != 'Numéro mouvement') { throw new UserException('Erreur sur la ligne ' . $line . ' : l\'entête des colonnes est absent ou incorrect.'); } $columns = array_flip($row); continue; } if (count($row) != count($columns)) { $db->rollback(); |
︙ | ︙ | |||
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | $cat = false; } if ($cat && !array_key_exists($cat, $liste_cats)) { $cat = $moyen = false; } $data = [ 'libelle' => $col('Libellé'), 'montant' => (float) $col('Montant'), 'date' => $date, 'compte_credit' => $credit, 'compte_debit' => $debit, 'numero_piece' => $col('Numéro de pièce'), 'remarques' => $col('Remarques'), ]; if ($cat) { $data['moyen_paiement'] = $moyen; $data['numero_cheque'] = $col('Numéro de chèque'); $data['id_categorie'] = $liste_cats[$cat]; | > > > > > > > > > > > | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | $cat = false; } if ($cat && !array_key_exists($cat, $liste_cats)) { $cat = $moyen = false; } $id_projet = null; if (!empty($col('Projet'))) { if (!array_key_exists($col('Projet'), $liste_projets)) { throw new UserException(sprintf('Erreur sur la ligne %d : le projet "%s" est inconnu', $line, $col('Projet'))); } $id_projet = $liste_projets[$col('Projet')]; } $data = [ 'libelle' => $col('Libellé'), 'montant' => (float) $col('Montant'), 'date' => $date, 'compte_credit' => $credit, 'compte_debit' => $debit, 'numero_piece' => $col('Numéro de pièce'), 'remarques' => $col('Remarques'), 'id_projet' => $id_projet, ]; if ($cat) { $data['moyen_paiement'] = $moyen; $data['numero_cheque'] = $col('Numéro de chèque'); $data['id_categorie'] = $liste_cats[$cat]; |
︙ | ︙ |
Modified src/include/lib/Garradin/DB.php from [ba4dc3d887] to [1f3b4719e4].
︙ | ︙ | |||
81 82 83 84 85 86 87 | }, $sql); return $this->exec($sql); } public function beginSchemaUpdate() { | | < > > > > > > > > > > > > > > > | | | | > | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | }, $sql); return $this->exec($sql); } public function beginSchemaUpdate() { $this->toggleForeignKeys(false); $this->begin(); } public function commitSchemaUpdate() { $this->commit(); $this->toggleForeignKeys(true); } /** * @see https://www.sqlite.org/lang_altertable.html */ public function toggleForeignKeys($enable) { assert(is_bool($enable)); if (!$enable) { $this->db->exec('PRAGMA legacy_alter_table = ON;'); $this->db->exec('PRAGMA foreign_keys = OFF;'); } else { $this->db->exec('PRAGMA legacy_alter_table = OFF;'); $this->db->exec('PRAGMA foreign_keys = ON;'); } } } |
Modified src/include/lib/Garradin/Membres.php from [84b4e80ec3] to [25c189b224].
︙ | ︙ | |||
11 12 13 14 15 16 17 | const DROIT_AUCUN = 0; const DROIT_ACCES = 1; const DROIT_ECRITURE = 2; const DROIT_ADMIN = 9; const ITEMS_PER_PAGE = 50; | < < < < < < < < < < < < < < < < < < < < < < < < < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | const DROIT_AUCUN = 0; const DROIT_ACCES = 1; const DROIT_ECRITURE = 2; const DROIT_ADMIN = 9; const ITEMS_PER_PAGE = 50; // Gestion des données /////////////////////////////////////////////////////// public function _checkFields(&$data, $check_editable = true, $check_password = true) { $champs = Config::getInstance()->get('champs_membres'); foreach ($champs->getAll() as $key=>$config) |
︙ | ︙ | |||
171 172 173 174 175 176 177 | if (isset($data[$id]) && $db->test('membres', $id . ' = ? COLLATE NOCASE', $data[$id])) { throw new UserException('La valeur du champ '.$id.' est déjà utilisée par un autre membre, hors ce champ doit être unique à chaque membre.'); } if (isset($data['passe']) && trim($data['passe']) != '') { | > | | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | if (isset($data[$id]) && $db->test('membres', $id . ' = ? COLLATE NOCASE', $data[$id])) { throw new UserException('La valeur du champ '.$id.' est déjà utilisée par un autre membre, hors ce champ doit être unique à chaque membre.'); } if (isset($data['passe']) && trim($data['passe']) != '') { Session::checkPasswordValidity($data['passe']); $data['passe'] = Session::hashPassword($data['passe']); } else { unset($data['passe']); } if (empty($data['id_categorie'])) |
︙ | ︙ | |||
226 227 228 229 230 231 232 | { throw new UserException('Ce numéro est déjà attribué à un autre membre.'); } } if (!empty($data['passe']) && trim($data['passe'])) { | > | | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | { throw new UserException('Ce numéro est déjà attribué à un autre membre.'); } } if (!empty($data['passe']) && trim($data['passe'])) { Session::checkPasswordValidity($data['passe']); $data['passe'] = Session::hashPassword($data['passe']); } else { unset($data['passe']); } if (isset($data['id_categorie']) && empty($data['id_categorie'])) |
︙ | ︙ |
Modified src/include/lib/Garradin/Membres/Categories.php from [ab5f67e8e6] to [9c1326617e].
︙ | ︙ | |||
9 10 11 12 13 14 15 | use Garradin\UserException; class Categories { protected $droits = [ 'inscription'=> Membres::DROIT_AUCUN, 'connexion' => Membres::DROIT_ACCES, | | | | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | use Garradin\UserException; class Categories { protected $droits = [ 'inscription'=> Membres::DROIT_AUCUN, 'connexion' => Membres::DROIT_ACCES, 'membres' => Membres::DROIT_AUCUN, 'compta' => Membres::DROIT_AUCUN, 'wiki' => Membres::DROIT_ACCES, 'config' => Membres::DROIT_AUCUN, ]; protected function _checkData(&$data) { $db = DB::getInstance(); |
︙ | ︙ |
Modified src/include/lib/Garradin/Membres/Champs.php from [9b116040de] to [1e1a261c03].
︙ | ︙ | |||
173 174 175 176 177 178 179 180 181 182 183 184 185 186 | public function getList() { $champs = clone $this->champs; unset($champs->passe); return $champs; } public function getListedFields() { $champs = (array) $this->champs; $champs = array_filter($champs, function ($a) { return empty($a->list_row) ? false : true; | > > > > > > > > > > > > > | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | public function getList() { $champs = clone $this->champs; unset($champs->passe); return $champs; } public function getMultiples() { $out = []; foreach ($this->champs as $id => $champ) { if ($champ->type == 'multiple') { $out[$id] = $champ; } } return $out; } public function getListedFields() { $champs = (array) $this->champs; $champs = array_filter($champs, function ($a) { return empty($a->list_row) ? false : true; |
︙ | ︙ |
Modified src/include/lib/Garradin/Membres/Import.php from [7b54b35f93] to [6ee80dccef].
︙ | ︙ | |||
187 188 189 190 191 192 193 | } $db = DB::getInstance(); $db->begin(); $membres = new Membres; // On récupère les champs qu'on peut importer | | > | | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | } $db = DB::getInstance(); $db->begin(); $membres = new Membres; // On récupère les champs qu'on peut importer $champs_membres = Config::getInstance()->get('champs_membres'); $champs_multiples = $champs_membres->getMultiples(); $champs = $champs_membres->getKeys(); $champs[] = 'date_inscription'; //$champs[] = 'date_connexion'; //$champs[] = 'id'; //$champs[] = 'id_categorie'; $line = 0; $delim = Utils::find_csv_delim($fp); |
︙ | ︙ | |||
237 238 239 240 241 242 243 | { $name = trim($name); // Champs qui n'existent pas dans le schéma actuel if (!in_array($name, $champs)) continue; | > | > > > | > > > > > > > > > > > > > > > | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | { $name = trim($name); // Champs qui n'existent pas dans le schéma actuel if (!in_array($name, $champs)) continue; // Ignorer les champs vides if (trim($row[$id]) === '') { continue; } $data[$name] = $row[$id]; // Restitution de la valeur binaire des champs à choix multiple if (isset($champs_multiples[$name])) { $values = explode(';', $data[$name]); $data[$name] = 0; foreach ($values as $v) { $v = trim($v); $found = array_search($v, $champs_multiples[$name]->options); if ($found) { $data[$name] |= 0x01 << $found; } } } } if (!empty($data['numero']) && $data['numero'] > 0) { $numero = (int)$data['numero']; } else |
︙ | ︙ | |||
289 290 291 292 293 294 295 | $db = DB::getInstance(); $champs = Config::getInstance()->get('champs_membres')->getKeys(); $champs = array_map([$db, 'quoteIdentifier'], $champs); $champs_sql = 'm.' . implode(', m.', $champs); $where = $list ? 'WHERE ' . $db->where('m.id', $list) : ''; | | | | | > > > > > > > > > > > > > > > > > > > > > > | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | $db = DB::getInstance(); $champs = Config::getInstance()->get('champs_membres')->getKeys(); $champs = array_map([$db, 'quoteIdentifier'], $champs); $champs_sql = 'm.' . implode(', m.', $champs); $where = $list ? 'WHERE ' . $db->where('m.id', $list) : ''; $res = $db->iterate('SELECT ' . $champs_sql . ', c.nom AS "Catégorie membre" FROM membres AS m INNER JOIN membres_categories AS c ON m.id_categorie = c.id ' . $where . ' ORDER BY c.id;'); return [ array_keys((array) $res->current()), $res, sprintf('Export membres - %s - %s', Config::getInstance()->get('nom_asso'), date('Y-m-d')), ]; } public function toCSV(array $list = null) { list($champs, $result, $name) = $this->export($list); return Utils::toCSV($name, $result, $champs, [$this, 'exportRow']); } public function toODS(array $list = null) { list($champs, $result, $name) = $this->export($list); return Utils::toODS($name, $result, $champs, [$this, 'exportRow']); } public function exportRow(\stdClass $row) { // Pas hyper efficace, il faudrait ne pas récupérer la liste pour chaque ligne... FIXME $champs_multiples = Config::getInstance()->get('champs_membres')->getMultiples(); // convertir les champs à choix multiple de binaire vers liste séparée par des points virgules foreach ($champs_multiples as $id=>$config) { $out = []; foreach ($config->options as $b => $name) { if ($row->$id & (0x01 << $b)) { $out[] = $name; } } $row->$id = implode(';', $out); } return $row; } } |
Modified src/include/lib/Garradin/Membres/Session.php from [c1e59c0b68] to [fa679095c9].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <?php namespace Garradin\Membres; use Garradin\Config; use Garradin\DB; use Garradin\Utils; use Garradin\Membres; use Garradin\UserException; use const Garradin\SECRET_KEY; use const Garradin\WWW_URL; use const Garradin\ADMIN_URL; use KD2\Security; use KD2\Security_OTP; use KD2\QRCode; class Session extends \KD2\UserSession { // Personalisation de la config de UserSession protected $cookie_name = 'gdin'; protected $remember_me_cookie_name = 'gdinp'; protected $remember_me_expiry = '+3 months'; const MINIMUM_PASSWORD_LENGTH = 8; // Extension des méthodes de UserSession public function __construct() { $url = parse_url(ADMIN_URL); //throw new \Exception('lol'); | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | <?php namespace Garradin\Membres; use Garradin\Config; use Garradin\DB; use Garradin\Utils; use Garradin\Membres; use Garradin\UserException; use Garradin\Plugin; use const Garradin\SECRET_KEY; use const Garradin\WWW_URL; use const Garradin\ADMIN_URL; use KD2\Security; use KD2\Security_OTP; use KD2\QRCode; use KD2\HTTP; class Session extends \KD2\UserSession { // Personalisation de la config de UserSession protected $cookie_name = 'gdin'; protected $remember_me_cookie_name = 'gdinp'; protected $remember_me_expiry = '+3 months'; const MINIMUM_PASSWORD_LENGTH = 8; static public function checkPasswordValidity($password) { if (strlen($password) < self::MINIMUM_PASSWORD_LENGTH) { throw new UserException(sprintf('Le mot de passe doit faire au moins %d caractères.', self::MINIMUM_PASSWORD_LENGTH)); } $session = new Session(DB::getInstance()); $session->http = new HTTP; if ($session->isPasswordCompromised($password)) { throw new UserException('Ce mot de passe figure dans une liste de mots de passe compromis. Si vous l\'avez utilisé sur d\'autres sites il est recommandé de le changer sur ces autres sites également.'); } } public function isPasswordCompromised($password) { // Vérifier s'il n'y a pas un plugin qui gère déjà cet aspect // notamment en installation mutualisée c'est plus efficace $return = ['is_compromised' => null]; $called = Plugin::fireSignal('motdepasse.compromis', ['password' => $password], $return); if ($called !== null) { return $return['is_compromised']; } return parent::isPasswordCompromised($password); } // Extension des méthodes de UserSession public function __construct() { $url = parse_url(ADMIN_URL); //throw new \Exception('lol'); |
︙ | ︙ | |||
115 116 117 118 119 120 121 | } // Ajout de la gestion de LOCAL_LOGIN public function isLogged($disable_local_login = false) { $logged = parent::isLogged(); | | > | | > > > > > > > | | | | 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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | } // Ajout de la gestion de LOCAL_LOGIN public function isLogged($disable_local_login = false) { $logged = parent::isLogged(); if (!$disable_local_login && defined('\Garradin\LOCAL_LOGIN')) { $login_id = \Garradin\LOCAL_LOGIN; // On va chercher le premier membre avec le droit de gérer les membres if (-1 === $login_id) { $login_id = $this->db->firstColumn('SELECT id FROM membres WHERE id_categorie = (SELECT id FROM membres_categories WHERE droit_membres = ? LIMIT 1) LIMIT 1', Membres::DROIT_ADMIN); } if ($login_id > 0 && (!$logged || ($logged && $this->user->id != $login_id))) { $logged = $this->create($login_id); } } return $logged; } // Ici checkOTP utilise NTP en second recours public function checkOTP($secret, $code) { if (Security_OTP::TOTP($secret, $code)) { return true; } // Vérifier encore, mais avec le temps NTP // au cas où l'horloge du serveur n'est pas à l'heure if (\Garradin\NTP_SERVER && ($time = Security_OTP::getTimeFromNTP(\Garradin\NTP_SERVER)) && Security_OTP::TOTP($secret, $code, $time)) { return true; } return false; |
︙ | ︙ | |||
253 254 255 256 257 258 259 | $password_confirm = trim($password_confirm); if (!hash_equals($password, $password_confirm)) { throw new UserException('Le mot de passe et sa vérification ne sont pas identiques.'); } | | | < < < | | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | $password_confirm = trim($password_confirm); if (!hash_equals($password, $password_confirm)) { throw new UserException('Le mot de passe et sa vérification ne sont pas identiques.'); } self::checkPasswordValidity($password); $password = self::hashPassword($password); $message = "Bonjour,\n\nLe mot de passe de votre compte a bien été modifié.\n\n"; $message.= "Votre adresse email : ".$membre->email."\n"; $message.= "La demande émanait de l'adresse IP : ".Utils::getIP()."\n\n"; $message.= "Si vous n'avez pas demandé à changer votre mot de passe, merci de nous le signaler."; DB::getInstance()->update('membres', ['passe' => $password], 'id = :id', ['id' => (int)$membre->id]); |
︙ | ︙ | |||
340 341 342 343 344 345 346 | { throw new \RuntimeException(sprintf('Le champ %s n\'est pas autorisé dans cette méthode.', $key)); } } if (isset($data['passe']) && trim($data['passe']) !== '') { | | | | | | < | 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 | { throw new \RuntimeException(sprintf('Le champ %s n\'est pas autorisé dans cette méthode.', $key)); } } if (isset($data['passe']) && trim($data['passe']) !== '') { $data['passe'] = trim($data['passe']); self::checkPasswordValidity($data['passe']); $data['passe'] = self::hashPassword($data['passe']); } else { unset($data['passe']); } if (isset($data['clef_pgp']) && trim($data['clef_pgp']) !== '') |
︙ | ︙ |
Modified src/include/lib/Garradin/Plugin.php from [12668c1cfe] to [267ceae2a7].
︙ | ︙ | |||
750 751 752 753 754 755 756 | return DB::getInstance()->first('SELECT version FROM plugins WHERE id = ?;', $id); } /** * Déclenche le signal donné auprès des plugins enregistrés * @param string $signal Nom du signal * @param array $params Paramètres du callback (array ou null) | | > > > > > > > | < | | | 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | return DB::getInstance()->first('SELECT version FROM plugins WHERE id = ?;', $id); } /** * Déclenche le signal donné auprès des plugins enregistrés * @param string $signal Nom du signal * @param array $params Paramètres du callback (array ou null) * @return NULL NULL si aucun plugin n'a été appelé, * TRUE si un plugin a été appelé et a arrêté l'exécution, * FALSE si des plugins ont été appelés mais aucun n'a stopé l'exécution */ static public function fireSignal($signal, $params = null, &$callback_return = null) { $list = DB::getInstance()->get('SELECT * FROM plugins_signaux WHERE signal = ?;', $signal); if (!count($list)) { return null; } $system = explode(',', PLUGINS_SYSTEM); foreach ($list as $row) { // Ne pas appeler les plugins dont le code n'existe pas/plus, // SAUF si c'est un plugin système (auquel cas ça fera une erreur) if (!self::getPath($row->plugin, in_array($row->plugin, $system))) { continue; } $return = call_user_func_array('Garradin\\Plugin\\' . $row->callback, [&$params, &$callback_return]); if (true === $return) { return true; } } return false; } } |
Modified src/include/lib/Garradin/Recherche.php from [35a5a3057c] to [98002e1aea].
︙ | ︙ | |||
180 181 182 183 184 185 186 | foreach ($champs->getList() as $champ => $config) { $column = (object) [ 'realType' => $config->type, 'textMatch'=> $champs->isText($champ), 'label' => $config->title, 'type' => 'text', | | | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | foreach ($champs->getList() as $champ => $config) { $column = (object) [ 'realType' => $config->type, 'textMatch'=> $champs->isText($champ), 'label' => $config->title, 'type' => 'text', 'null' => true, ]; if ($config->type == 'checkbox') { $column->type = 'boolean'; } elseif ($config->type == 'select') |
︙ | ︙ |
Modified src/include/lib/Garradin/Squelette.php from [8be8c4d3e2] to [f4ce828da9].
︙ | ︙ | |||
630 631 632 633 634 635 636 | 'loop_start' => &$loop_start, 'code' => &$statement_code, ]; // Appel du plugin lié à cette boucle, si ça existe $return = Plugin::fireSignal('boucle.' . $loopType, $params, $callback_return); | | < < < < < | | 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 | 'loop_start' => &$loop_start, 'code' => &$statement_code, ]; // Appel du plugin lié à cette boucle, si ça existe $return = Plugin::fireSignal('boucle.' . $loopType, $params, $callback_return); // Si aucun plugin n'a été appelé c'est que le type de boucle n'est pas défini if (!$return) { throw new \KD2\MiniSkelMarkupException("Le type de boucle '".$loopType."' est inconnu."); } if (empty($query)) { $query = 'SELECT 0 LIMIT 0;'; |
︙ | ︙ | |||
918 919 920 921 922 923 924 | { return null; } } static public function getSource($template) { | | | > | | > | 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 | { return null; } } static public function getSource($template) { if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!i', $template)) { return null; } $path = file_exists(DATA_ROOT . '/www/squelettes/' . $template) ? DATA_ROOT . '/www/squelettes/' . $template : ROOT . '/www/squelettes-dist/' . $template; if (!file_exists($path)) { return null; } return file_get_contents($path); } static public function editSource($template, $content) { if (!preg_match('!^[\w\d_-]+(?:\.[\w\d_-]+)*$!i', $template)) |
︙ | ︙ |
Modified src/include/lib/Garradin/Squelette_Filtres.php from [a2925f4fde] to [719077c361].
︙ | ︙ | |||
209 210 211 212 213 214 215 | } // Compatibilité SPIP static public function egal_a($value, $test) { if ($value == $test) | | | | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | } // Compatibilité SPIP static public function egal_a($value, $test) { if ($value == $test) return $value; else return false; } static public function different_de($value, $test) { if ($value != $test) return $value; else return false; } // disponible aussi avec : | ?{sioui, sinon} static public function choixsivide($value, $un, $deux = '') { |
︙ | ︙ | |||
327 328 329 330 331 332 333 | static public function date_w3c($date) { return date(DATE_W3C, $date); } static public function et($value, $test) { | | | | | | | | | | | 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | static public function date_w3c($date) { return date(DATE_W3C, $date); } static public function et($value, $test) { return ($value && $test) ? $value : false; } static public function ou($value, $test) { return ($value || $test) ? $value : false; } static public function xou($value, $test) { return ($value XOR $test) ? $value : false; } static public function oui($value) { return $value ? ' ' : false; } static public function non($value) { return !$value ? ' ' : false; } static public function superieur_a($value, $test) { return ($value > $test) ? $value : false; } static public function superieur_ou_egal_a($value, $test) { return ($value >= $test) ? $value : false; } static public function inferieur_a($value, $test) { return ($value < $test) ? $value : false; } static public function inferieur_ou_egal_a($value, $test) { return ($value <= $test) ? $value : false; } static public function euros($value) { return str_replace(' ', ' ', number_format($value, (round($value) == round($value, 2) ? 0 : 2), ',', ' ')) . ' €'; } static public function taille_en_octets($value) { return Utils::format_bytes($value); } } |
Modified src/include/lib/Garradin/Static_Cache.php from [1abb2553b4] to [73b33ffa77].
︙ | ︙ | |||
17 18 19 20 21 22 23 | } return CACHE_ROOT . '/static'; } protected static function _getCachePath($id) { | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | } return CACHE_ROOT . '/static'; } protected static function _getCachePath($id) { $id = 'cache_' . sha1(DB_FILE . $id); return self::_getCacheDir() . '/' . $id; } static public function store($id, $content) { $path = self::_getCachePath($id); return (bool) file_put_contents($path, $content); |
︙ | ︙ |
Modified src/include/lib/Garradin/Template.php from [3def9bc1cf] to [1753fedcdf].
︙ | ︙ | |||
33 34 35 36 37 38 39 | // Hash de la version pour les éléments statiques (cache) // On ne peut pas utiliser la version directement comme query string // pour les éléments statiques (genre /admin/static/admin.css?v0.9.0) // car cela dévoilerait la version de Garradin utilisée, posant un souci // en cas de faille, on cache donc la version utilisée, chaque instance // aura sa propre version | | | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | // Hash de la version pour les éléments statiques (cache) // On ne peut pas utiliser la version directement comme query string // pour les éléments statiques (genre /admin/static/admin.css?v0.9.0) // car cela dévoilerait la version de Garradin utilisée, posant un souci // en cas de faille, on cache donc la version utilisée, chaque instance // aura sa propre version $this->assign('version_hash', substr(sha1(garradin_version() . garradin_manifest() . ROOT . SECRET_KEY), 0, 10)); $this->assign('www_url', WWW_URL); $this->assign('self_url', Utils::getSelfUrl()); $this->assign('self_url_no_qs', Utils::getSelfUrl(false)); $this->assign('is_logged', false); |
︙ | ︙ | |||
196 197 198 199 200 201 202 | } return $escape ? htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8') : $value; } protected function formatPhoneNumber($n) { | < | < | < < > | < | > | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | } return $escape ? htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8') : $value; } protected function formatPhoneNumber($n) { $country = Config::getInstance()->get('pays'); if ($country !== 'FR') { return $n; } if ('FR' === $country && $n[0] === '0' && strlen($n) === 10) { $n = preg_replace('!(\d{2})!', '\\1 ', $n); } return $n; } protected function customColors() |
︙ | ︙ | |||
277 278 279 280 281 282 283 | foreach ($config->options as $b => $name) { if ($v & (0x01 << $b)) $out[] = $name; } | | | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | foreach ($config->options as $b => $name) { if ($v & (0x01 << $b)) $out[] = $name; } return htmlspecialchars(implode(', ', $out)); default: return htmlspecialchars($v); } } protected function formChampMembre($params) { |
︙ | ︙ |
Modified src/include/lib/Garradin/Utils.php from [c134309b5d] to [7bf98c3058].
︙ | ︙ | |||
469 470 471 472 473 474 475 | static public function checkBIC($bic) { return preg_match('!^[A-Z]{4}[A-Z]{2}[1-9A-Z]{2}(?:[A-Z\d]{3})?$!', $bic); } static public function normalizePhoneNumber($n) { | < | < | 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | static public function checkBIC($bic) { return preg_match('!^[A-Z]{4}[A-Z]{2}[1-9A-Z]{2}(?:[A-Z\d]{3})?$!', $bic); } static public function normalizePhoneNumber($n) { return preg_replace('![^\d\+\(\)p#,;-]!', '', trim($n)); } static public function write_ini_string($in) { $out = ''; $get_ini_line = function ($key, $value) use (&$get_ini_line) { |
︙ | ︙ | |||
665 666 667 668 669 670 671 | array_walk($row, function (&$field) { $field = strtr($field, ['"' => '""', "\r\n" => "\n"]); }); return sprintf("\"%s\"\r\n", implode('","', $row)); } | | > > > > | > > > > | 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | array_walk($row, function (&$field) { $field = strtr($field, ['"' => '""', "\r\n" => "\n"]); }); return sprintf("\"%s\"\r\n", implode('","', $row)); } static public function toCSV($name, $iterator, $header = null, $row_map_callback = null) { header('Content-type: application/csv'); header(sprintf('Content-Disposition: attachment; filename="%s.csv"', $name)); $fp = fopen('php://output', 'w'); if ($header) { fputs($fp, self::row_to_csv($header)); } foreach ($iterator as $row) { if (!$header) { fputs($fp, self::row_to_csv(array_keys($row))); $header = true; } if (null !== $row_map_callback) { $row = call_user_func($row_map_callback, $row); } fputs($fp, self::row_to_csv($row)); } fclose($fp); return true; } static public function toODS($name, $iterator, $header = null, $row_map_callback = null) { header('Content-type: application/vnd.oasis.opendocument.spreadsheet'); header(sprintf('Content-Disposition: attachment; filename="%s.ods"', $name)); $ods = new ODSWriter; $ods->table_name = $name; if ($header) { $ods->add((array) $header); } foreach ($iterator as $row) { if (!$header) { $ods->add(array_keys($row)); $header = true; } if (null !== $row_map_callback) { $row = call_user_func($row_map_callback, $row); } $ods->add((array) $row); } $ods->output(); return true; |
︙ | ︙ |
Modified src/include/lib/dependencies.list from [bca53ee628] to [7b518732e5].
︙ | ︙ | |||
16 17 18 19 20 21 22 | KD2/SMTP.php KD2/SVGPie.php KD2/SVGPlot.php KD2/Translate.php KD2/UserSession.php KD2/ZipWriter.php KD2/ODSWriter.php | > | 16 17 18 19 20 21 22 23 | KD2/SMTP.php KD2/SVGPie.php KD2/SVGPlot.php KD2/Translate.php KD2/UserSession.php KD2/ZipWriter.php KD2/ODSWriter.php KD2/HTTP.php |
Deleted src/index.html version [008e979f23].
|
| < < < < < |
Added src/index.php version [3633bc3928].
> > > > > > | 1 2 3 4 5 6 | <?php // Supprimer ce fichier readfile(__DIR__ . '/sous-domaine.html'); exit; |
Added src/sous-domaine.html version [01c1184ede].
> > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <!DOCTYPE html> <meta charset="utf-8" /> <h1>Erreur</h1> <p>Garradin n'est pas installé sur un sous-domaine dédié.</p> <p>Ce mode de fonctionnement n'est pas supporté officiellement.</p> <h3>Installation conseillée</h3> <p>Le mode conseillé est de positionner un sous-domaine dédié (<em>virtual host</em> ou <em>vhost</em>) sur le répertoire www/</p> <p>Voir <a href="https://fossil.kd2.org/garradin/wiki?name=Installation">la documentation</a>.</p> <h3>Installation dans un sous-répertoire, sans <em>virtual host</em> (non conseillé)</h3> <p>Voir la <a href="https://fossil.kd2.org/garradin/wiki?name=Installation%20sans%20vhost">documentation</a> dédiée pour configurer Garradin correctement et faire disparaître ce message d'erreur.</p> |
Modified src/templates/admin/_head.tpl from [d5fc274287] to [ab1e909a41].
1 2 3 4 5 6 7 | <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta charset="utf-8" /> <title>{$title}</title> <link rel="icon" type="image/png" href="{$admin_url}static/icon.png" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" /> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta charset="utf-8" /> <title>{$title}</title> <link rel="icon" type="image/png" href="{$admin_url}static/icon.png" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/admin.css?{$version_hash}" media="all" /> {if isset($js) || isset($custom_js)} <script type="text/javascript" src="{$admin_url}static/scripts/global.js?{$version_hash}"></script> {/if} {if isset($custom_js)} {foreach from=$custom_js item="js"} <script type="text/javascript" src="{$admin_url}static/scripts/{$js}?{$version_hash}"></script> {/foreach} |
︙ | ︙ | |||
32 33 34 35 36 37 38 | <link rel="stylesheet" type="text/css" href="{$admin_url}static/print.css?{$version_hash}" media="print" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/handheld.css?{$version_hash}" media="handheld,screen and (max-width:981px)" /> {if isset($config)} {custom_colors config=$config} {/if} </head> | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | <link rel="stylesheet" type="text/css" href="{$admin_url}static/print.css?{$version_hash}" media="print" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/handheld.css?{$version_hash}" media="handheld,screen and (max-width:981px)" /> {if isset($config)} {custom_colors config=$config} {/if} </head> <body{if !empty($body_id)} id="{$body_id}"{/if}> {if empty($is_popup)} <header class="header"> <nav class="menu"> <ul> {if !$is_logged} <li><a href="{$www_url}">← Retour au site</a></li> |
︙ | ︙ |
Modified src/templates/admin/compta/comptes/journal.tpl from [03e8b58484] to [f69dd30f9f].
︙ | ︙ | |||
28 29 30 31 32 33 34 | </fieldset> </form> {/if} <table class="list"> <colgroup> <col width="3%" /> | < > | < > < < < < < > > > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 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 | </fieldset> </form> {/if} <table class="list"> <colgroup> <col width="3%" /> <col width="12%" /> <col width="10%" /> <col width="12%" /> <col /> <col width="6%" /> </colgroup> <thead> <tr> <td>N°</td> <td>Date</td> <td>Montant</td> <td>Solde cumulé</td> <th>Libellé</th> <td></td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> <td class="num"><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td>{$ligne.date|date_fr:'d/m/Y'}</td> <td>{if $ligne.compte_credit == $compte.id}{$credit}{else}{$debit}{/if}{$ligne.montant|escape|html_money}</td> <td>{$ligne.solde|escape|html_money}</td> <th>{$ligne.libelle}</th> <td class="actions"> <a class="icn" href="{$admin_url}compta/operations/voir.php?id={$ligne.id}" title="Détails de l'écriture">❓</a> {if $session->canAccess('compta', Membres::DROIT_ADMIN)} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette écriture">✎</a> {/if} </td> </tr> {/foreach} </tbody> <tfoot> <tr> <td colspan="3"></td> <th>Solde</th> <td colspan="2">{$solde|escape|html_money} {$config.monnaie}</td> </tr> </tfoot> </table> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/config/categories/modifier.tpl from [7b22c4c7fb] to [5f082eb8b5].
︙ | ︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | <label for="f_droit_connexion_aucun"><b class="aucun">C</b> Non</label> </dd> <dd> <input type="radio" name="droit_connexion" value="{$membres::DROIT_ACCES}" id="f_droit_connexion_acces" {if $cat.droit_connexion == $membres::DROIT_ACCES}checked="checked"{/if} {$readonly} /> <label for="f_droit_connexion_acces"><b class="acces">C</b> Oui</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_inscription_aucun">Les membres de cette catégorie peuvent-ils s'inscrire d'eux-même ?</label></dt> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_AUCUN}" id="f_droit_inscription_aucun" {if $cat.droit_inscription == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_inscription_aucun"><b class="aucun">I</b> Non</label> </dd> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_ACCES}" id="f_droit_inscription_acces" {if $cat.droit_inscription == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_inscription_acces"><b class="acces">I</b> Oui</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_membres_aucun">Gestion des membres :</label></dt> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_AUCUN}" id="f_droit_membres_aucun" {if $cat.droit_membres == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_membres_aucun"><b class="aucun">M</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ACCES}" id="f_droit_membres_acces" {if $cat.droit_membres == $membres::DROIT_ACCES}checked="checked"{/if} /> | > > | | | | | | | | | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | <label for="f_droit_connexion_aucun"><b class="aucun">C</b> Non</label> </dd> <dd> <input type="radio" name="droit_connexion" value="{$membres::DROIT_ACCES}" id="f_droit_connexion_acces" {if $cat.droit_connexion == $membres::DROIT_ACCES}checked="checked"{/if} {$readonly} /> <label for="f_droit_connexion_acces"><b class="acces">C</b> Oui</label> </dd> </dl> {* TODO pas d'inscription pour le moment <dl class="droits"> <dt><label for="f_droit_inscription_aucun">Les membres de cette catégorie peuvent-ils s'inscrire d'eux-même ?</label></dt> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_AUCUN}" id="f_droit_inscription_aucun" {if $cat.droit_inscription == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_inscription_aucun"><b class="aucun">I</b> Non</label> </dd> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_ACCES}" id="f_droit_inscription_acces" {if $cat.droit_inscription == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_inscription_acces"><b class="acces">I</b> Oui</label> </dd> </dl> *} <dl class="droits"> <dt><label for="f_droit_membres_aucun">Gestion des membres :</label></dt> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_AUCUN}" id="f_droit_membres_aucun" {if $cat.droit_membres == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_membres_aucun"><b class="aucun">M</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ACCES}" id="f_droit_membres_acces" {if $cat.droit_membres == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_membres_acces"><b class="acces">M</b> Lecture uniquement <em>(peut voir les informations personnelles de tous les membres, y compris leurs cotisations)</em></label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ECRITURE}" id="f_droit_membres_ecriture" {if $cat.droit_membres == $membres::DROIT_ECRITURE}checked="checked"{/if} /> <label for="f_droit_membres_ecriture"><b class="ecriture">M</b> Lecture & écriture <em>(peut ajouter et modifier des membres, mais pas les supprimer ni les changer de catégorie, peut affecter des cotisations aux membres)</em></label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ADMIN}" id="f_droit_membres_admin" {if $cat.droit_membres == $membres::DROIT_ADMIN}checked="checked"{/if} /> <label for="f_droit_membres_admin"><b class="admin">M</b> Administration <em>(peut tout faire)</em></label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_compta_aucun">Comptabilité :</label></dt> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_AUCUN}" id="f_droit_compta_aucun" {if $cat.droit_compta == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_compta_aucun"><b class="aucun">€</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ACCES}" id="f_droit_compta_acces" {if $cat.droit_compta == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_compta_acces"><b class="acces">€</b> Lecture uniquement <em>(peut lire toutes les informations de tous les exercices)</em></label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ECRITURE}" id="f_droit_compta_ecriture" {if $cat.droit_compta == $membres::DROIT_ECRITURE}checked="checked"{/if} /> <label for="f_droit_compta_ecriture"><b class="ecriture">€</b> Lecture & écriture <em>(peut ajouter des écritures, mais pas les modifier ni les supprimer)</em></label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ADMIN}" id="f_droit_compta_admin" {if $cat.droit_compta == $membres::DROIT_ADMIN}checked="checked"{/if} /> <label for="f_droit_compta_admin"><b class="admin">€</b> Administration <em>(peut modifier et supprimer des écritures, gérer les comptes, les exercices, etc.)</em></label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_wiki_aucun">Wiki :</label></dt> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_AUCUN}" id="f_droit_wiki_aucun" {if $cat.droit_wiki == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_wiki_aucun"><b class="aucun">W</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ACCES}" id="f_droit_wiki_acces" {if $cat.droit_wiki == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_wiki_acces"><b class="acces">W</b> Lecture uniquement <em>(peut lire les pages auquel il a le droit d'accéder)</em></label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ECRITURE}" id="f_droit_wiki_ecriture" {if $cat.droit_wiki == $membres::DROIT_ECRITURE}checked="checked"{/if} /> <label for="f_droit_wiki_ecriture"><b class="ecriture">W</b> Lecture & écriture <em>(peut modifier ou ajouter des pages, mais pas les supprimer)</em></label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ADMIN}" id="f_droit_wiki_admin" {if $cat.droit_wiki == $membres::DROIT_ADMIN}checked="checked"{/if} /> <label for="f_droit_wiki_admin"><b class="admin">W</b> Administration <em>(peut tout faire)</em></label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_config_aucun">Les membres de cette catégorie peuvent-ils modifier la configuration ?</label></dt> {if $readonly} <dd class="help"> Il n'est pas possible de désactiver ce droit pour votre propre catégorie. |
︙ | ︙ |
Modified src/templates/admin/config/index.tpl from [f4c6ed1cb3] to [6189dd4b55].
︙ | ︙ | |||
96 97 98 99 100 101 102 | <dd> <select name="champ_identifiant" required="required" id="f_champ_identifiant"> {foreach from=$champs key="c" item="champ"} <option value="{$c}" {form_field selected=$c name="champ_identifiant" data=$config}>{$champ.title}</option> {/foreach} </select> </dd> | | | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | <dd> <select name="champ_identifiant" required="required" id="f_champ_identifiant"> {foreach from=$champs key="c" item="champ"} <option value="{$c}" {form_field selected=$c name="champ_identifiant" data=$config}>{$champ.title}</option> {/foreach} </select> </dd> </dl> </fieldset> <fieldset id="couleurs"> <legend>Personnalisation de l'interface</legend> <dl> <dt><label for="f_couleur1">Couleur principale</label></dt> |
︙ | ︙ |
Modified src/templates/admin/config/site.tpl from [c6ae555354] to [dda2316333].
︙ | ︙ | |||
39 40 41 42 43 44 45 46 | </form> <script type="text/javascript"> var doc_url = "{$admin_url}doc/skel/"; var skel_list = {$sources|escape:json}; var skel_current = "{$edit.file|escape:'js'}"; </script> | > < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | </form> <script type="text/javascript"> var doc_url = "{$admin_url}doc/skel/"; var skel_list = {$sources|escape:json}; var skel_current = "{$edit.file|escape:'js'}"; g.script("scripts/skel_editor.js"); </script> {else} <fieldset> <legend>Activation du site public</legend> <dl> <dt> <form method="post" action="{$self_url}"> |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations.tpl from [9d70dea083] to [062d322929].
1 2 3 | {include file="admin/_head.tpl" title="Cotisations du membre" current="membres/cotisations"} <ul class="actions"> | | | 1 2 3 4 5 6 7 8 9 10 11 | {include file="admin/_head.tpl" title="Cotisations du membre" current="membres/cotisations"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.identite}</a></li> {if $session->canAccess('membres', Membres::DROIT_ECRITURE)}<li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li>{/if} {if $session->canAccess('membres', Membres::DROIT_ADMIN) && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li class="current"><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/ajout.tpl from [433111eec2] to [6a2c71a215].
︙ | ︙ | |||
26 27 28 29 30 31 32 | {if $session->canAccess('compta', Membres::DROIT_ECRITURE)} <p class="help"> Cette page sert à enregistrer les cotisations des membres de l'association. Pour enregistrer un don ou une dépense, comme le paiement d'un prestataire ou une facture, il est possible de <a href="{$admin_url}compta/operations/saisir.php">saisir une opération comptable</a>. </p> {/if} | > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | {if $session->canAccess('compta', Membres::DROIT_ECRITURE)} <p class="help"> Cette page sert à enregistrer les cotisations des membres de l'association. Pour enregistrer un don ou une dépense, comme le paiement d'un prestataire ou une facture, il est possible de <a href="{$admin_url}compta/operations/saisir.php">saisir une opération comptable</a>. </p> {/if} {if !count($cotisations)} <div class="alert"> <p>Il n'y a aucun type de cotisation créé. Il n'est pas possible d'affecter une cotisation à un membre.</p> <form method="get" action="{$admin_url}membres/cotisations/"> <p><input type="submit" value="Ajouter une cotisation →" /></p> </form> </div> {else} <form method="post" action="{$self_url}"> <fieldset> <legend>Enregistrer une cotisation</legend> <dl> <dt><label for="f_id_cotisation">Cotisation</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select id="f_id_cotisation" required="required" name="id_cotisation"> {foreach from=$cotisations item="co"} <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id default=$default_co} data-compta="{$co.id_categorie_compta}" data-amount="{$co.montant}"> {$co.intitule} — {$co.montant|escape|html_money} {$config.monnaie} — {if $co.duree}pour {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </option> {/foreach} </select> </dd> <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$default_date}" required="required" /></dd> {if !$membre} <dt><label for="f_numero_membre">Numéro de membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="number" name="numero_membre" id="f_numero_membre" value="{form_field name=numero_membre}" step="1" min="1" required="required" /></dd> {/if} <dt class="f_compta"><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_compta"><input type="number" name="montant" step="0.01" min="0.00" id="f_montant" value="{form_field name=montant default=$default_amount}" /></dd> <dt class="f_compta"><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_compta"> <select name="moyen_paiement" id="f_moyen_paiement"> {foreach from=$moyens_paiement item="moyen"} <option value="{$moyen.code}"{if $moyen.code == $moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option> {/foreach} </select> </dd> <dd class="f_compta f_a_encaisser"> <input type="checkbox" name="a_encaisser" value="1" id="f_a_encaisser" {form_field name=a_encaisser checked="1"} /> <label for="f_a_encaisser">En attente d'encaissement</label> </dd> <dt class="f_compta f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt> <dd class="f_compta f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque}" /></dd> <dt class="f_compta f_banque"><label for="f_banque">Compte bancaire</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_compta f_banque"> <select name="banque" id="f_banque"> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> <dt class="f_compta"><label for="f_numero_piece">Numéro de pièce comptable</label></dt> <dd class="f_compta"><input type="text" name="numero_piece" id="f_numero_piece" value="{form_field name=numero_piece}" /></dd> <dt class="f_compta"><label for="f_remarques">Remarques</label></dt> <dd class="f_compta"><textarea name="remarques" id="f_remarques" rows="4" cols="30">{form_field name=remarques}</textarea></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="add_cotisation"} {if $membre}<input type="hidden" name="id_membre" value="{$membre.id}" />{/if} <input type="submit" name="add" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} (function () { window.changeMoyenPaiement = function() { var elm = $('#f_moyen_paiement'); g.toggle('.f_cheque', elm.value == 'CH'); g.toggle('.f_banque', elm.value != 'ES'); g.toggle('.f_a_encaisser', elm.value == 'CB' || elm.value == 'CH'); cocherAEncaisser(); }; function cocherAEncaisser() { var elm = $('#f_a_encaisser'); g.toggle('.f_banque', !elm.checked && $('#f_moyen_paiement').value != 'ES'); } changeMoyenPaiement(); cocherAEncaisser(); $('#f_moyen_paiement').onchange = changeMoyenPaiement; $('#f_a_encaisser').onchange = cocherAEncaisser; function changeCotisation() { var s = $('#f_id_cotisation'); if (s.options[s.selectedIndex].getAttribute('data-compta')) { $('#f_montant').value = s.options[s.selectedIndex].getAttribute('data-amount'); g.toggle('.f_compta', true); changeMoyenPaiement(); cocherAEncaisser(); } else { g.toggle('.f_compta', false); } } $('#f_id_cotisation').onchange = changeCotisation; if (!$('#f_id_cotisation').options[$('#f_id_cotisation').selectedIndex].getAttribute('data-compta')) { g.toggle('.f_compta', false); } else { changeCotisation(); } } ()); {/literal} </script> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cotisations/index.tpl from [2f3ec3b601] to [754a0411a5].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> {if $session->canAccess('membres', Membres::DROIT_ECRITURE)} <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {/if} {if $session->canAccess('membres', Membres::DROIT_ADMIN)} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | {include file="admin/_head.tpl" title="Cotisations" current="membres/cotisations" js=1} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> {if $session->canAccess('membres', Membres::DROIT_ECRITURE)} <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {/if} {if $session->canAccess('membres', Membres::DROIT_ADMIN)} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {if count($liste)} <table class="list"> <thead> <th>Cotisation</th> <td>Période</td> <td>Montant</td> <td>Membres inscrits</td> <td>Membres à jour</td> <td></td> </thead> <tbody> {foreach from=$liste item="co"} <tr> <th><a href="{$admin_url}membres/cotisations/voir.php?id={$co.id}">{$co.intitule}</a></th> <td> {if $co.duree} {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </td> <td class="num">{$co.montant|escape|html_money} {$config.monnaie}</td> <td class="num">{$co.nb_membres}</td> <td class="num">{$co.nb_a_jour}</td> <td class="actions"> <a class="icn" href="{$admin_url}membres/cotisations/voir.php?id={$co.id}" title="Liste des membres cotisants">👪</a> {if $session->canAccess('membres', Membres::DROIT_ADMIN)} <a class="icn" href="{$admin_url}membres/cotisations/gestion/modifier.php?id={$co.id}" title="Modifier">✎</a> <a class="icn" href="{$admin_url}membres/cotisations/gestion/supprimer.php?id={$co.id}" title="Supprimer">✘</a> {/if} </td> </tr> {/foreach} </tbody> </table> {else} <p class="alert">Il n'y a aucun type de cotisation enregistré.</p> {/if} {if $session->canAccess('membres', Membres::DROIT_ADMIN)} {form_errors} <p class="help"> Idée : les cotisations peuvent également être utilisées pour suivre les activités auxquelles |
︙ | ︙ |
Modified src/templates/admin/membres/fiche.tpl from [747af1b2b4] to [99f7b69c9c].
1 2 3 | {include file="admin/_head.tpl" title="%s (%s)"|args:$membre.identite:$categorie.nom current="membres"} <ul class="actions"> | | | 1 2 3 4 5 6 7 8 9 10 11 | {include file="admin/_head.tpl" title="%s (%s)"|args:$membre.identite:$categorie.nom current="membres"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.identite}</a></li> {if $session->canAccess('membres', Membres::DROIT_ECRITURE)}<li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li>{/if} {if $session->canAccess('membres', Membres::DROIT_ADMIN) && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> |
︙ | ︙ |
Modified src/templates/admin/membres/modifier.tpl from [8fb5353cd6] to [9ca196cbb1].
1 2 3 | {include file="admin/_head.tpl" title="Modifier un membre" current="membres" js=1} <ul class="actions"> | | | 1 2 3 4 5 6 7 8 9 10 11 | {include file="admin/_head.tpl" title="Modifier un membre" current="membres" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.identite}</a></li> <li class="current"><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $session->canAccess('membres', Membres::DROIT_ADMIN) && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> |
︙ | ︙ |
Modified src/templates/admin/membres/supprimer.tpl from [3ee78004e1] to [06cf105473].
1 2 3 | {include file="admin/_head.tpl" title="Supprimer un membre" current="membres"} <ul class="actions"> | | | 1 2 3 4 5 6 7 8 9 10 11 | {include file="admin/_head.tpl" title="Supprimer un membre" current="membres"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.identite}</a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $session->canAccess('membres', Membres::DROIT_ADMIN)} <li class="current"><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> |
︙ | ︙ |
Modified src/www/.htaccess from [da372037a9] to [5189696f0f].
︙ | ︙ | |||
8 9 10 11 12 13 14 15 | # et https://serverfault.com/questions/559067/apache-hangs-for-five-seconds-with-fallbackresource-when-accessing <IfModule mod_version.c> <IfVersion >= 2.2.16> FallbackResource /_route.php </IfVersion> </IfModule> ErrorDocument 404 /_route.php | > > > > > > | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # et https://serverfault.com/questions/559067/apache-hangs-for-five-seconds-with-fallbackresource-when-accessing <IfModule mod_version.c> <IfVersion >= 2.2.16> FallbackResource /_route.php </IfVersion> </IfModule> # Utilisation de ErrorDocument 404 à la place de FallbackResource si possible ErrorDocument 404 /_route.php # Un peu de sécurité <IfModule mod_alias.c> RedirectMatch 404 _inc\.php </IfModule> |
Modified src/www/_route.php from [87c48a8fb1] to [fc31a0628c].
1 2 3 4 | <?php namespace Garradin; | | > | < < > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | <?php namespace Garradin; if (empty($_SERVER['REQUEST_URI'])) { die('Appel non supporté'); } $uri = $_SERVER['REQUEST_URI']; if ('_route.php' === basename($uri)) { die('Appel interdit'); } if (($pos = strpos($uri, '?')) !== false) { $uri = substr($uri, 0, $pos); } if (file_exists(__DIR__ . $uri)) { if (PHP_SAPI != 'cli') { die('Erreur de configuration du serveur web: cette URL ne devrait pas être traitée par Garradin'); } return false; } elseif (preg_match('!/admin/plugin/(.+?)/(.*)!', $uri, $match)) { $_GET['_p'] = $match[1]; $_GET['_u'] = $match[2]; require __DIR__ . '/admin/plugin.php'; |
︙ | ︙ |
Modified src/www/admin/config/site.php from [dd99638235] to [4b2ceec322].
︙ | ︙ | |||
36 37 38 39 40 41 42 | } if (qg('edit')) { $source = Squelette::getSource(qg('edit')); | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | } if (qg('edit')) { $source = Squelette::getSource(qg('edit')); if (null === $source) { throw new UserException("Ce squelette n'existe pas."); } $csrf_key = 'edit_skel_' . md5(qg('edit')); if (f('save') && $form->check($csrf_key)) |
︙ | ︙ |
Modified src/www/admin/static/admin.css from [35bf143a4d] to [6c1a898bc9].
︙ | ︙ | |||
184 185 186 187 188 189 190 191 192 193 194 195 196 197 | span.confirm, b.confirm { color: #090; } span.alert, b.alert { color: #990; } p.alert, div.alert, p.error, div.error, p.confirm, div.confirm { border: 1px solid #ccc; padding: .5em; margin-bottom: 1em; border-radius: .3em; padding-left: 3em; | > > > > | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | span.confirm, b.confirm { color: #090; } span.alert, b.alert { color: #990; } .alert p, .error p, .confirm p { margin-bottom: .8em; } p.alert, div.alert, p.error, div.error, p.confirm, div.confirm { border: 1px solid #ccc; padding: .5em; margin-bottom: 1em; border-radius: .3em; padding-left: 3em; |
︙ | ︙ | |||
216 217 218 219 220 221 222 | p.confirm::before, div.confirm::before, p.alert::before, div.alert::before, p.error::before, div.error::before { font-family: "gicon"; left: .5em; top: .2em; position: absolute; font-size: 1.5em; text-shadow: 2px 2px 5px #666; | | | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | p.confirm::before, div.confirm::before, p.alert::before, div.alert::before, p.error::before, div.error::before { font-family: "gicon"; left: .5em; top: .2em; position: absolute; font-size: 1.5em; text-shadow: 2px 2px 5px #666; } p.confirm::before, div.confirm::before { content: "☑"; color: green; } p.alert::before, div.alert::before { |
︙ | ︙ |
Modified src/www/admin/static/scripts/code_editor.min.js from [89cf1ff3b6] to [f838117490].
|
| | > | 1 2 | window.textEditor=function(t){if(!document.getElementById(t))throw new Error("Invalid ID parameter: "+t);return this.id=t,this.textarea=document.getElementById(t),this.shortcuts=[],"selectionStart"in this.textarea&&(this.textarea.addEventListener("keydown",this.keyEvent.bind(this),!0),this.textarea.addEventListener("keypress",this.keyEvent.bind(this),!0),!0)},textEditor.prototype.keyEvent=function(t){for(var e in t=t||window.event,this.shortcuts){var r=this.shortcuts[e];if(!t.metaKey&&!(t.ctrlKey&&!r.ctrl||r.ctrl&&!t.ctrlKey)&&!(t.shiftKey&&!r.shift||r.shift&&!t.shiftKey)&&!(t.altKey&&!r.alt||r.alt&&!t.altKey)&&(e=this.matchKeyPress(r.key,t))){if("function"==typeof r.callback)return!r.callback.call(this,t,e)||this.preventDefault(t);var n=(r.ctrl?"Ctrl-":"")+(r.alt?"Alt-":"");throw n+=(r.shift?"Shift-":"")+r,new Error("Invalid callback type for shortcut "+n)}}return!0},textEditor.prototype.matchKeyPress=function(t,e){return!(e.defaultPrevented||!e.key)&&(t=t.toLowerCase(),e.key.toLowerCase()==t&&t)},textEditor.prototype.preventDefault=function(t){return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.returnValue=!1,!(t.cancelBubble=!0)},textEditor.prototype.getSelection=function(){var t=this.textarea,e=t.selectionEnd-t.selectionStart;return{start:t.selectionStart,end:t.selectionEnd,length:e,text:t.value.substr(t.selectionStart,e)}},textEditor.prototype.replaceSelection=function(t,e){var r=this.textarea,n=t.start,o=n+e.length;return r.value=r.value.substr(0,n)+e+r.value.substr(t.end,r.value.length),this.setSelection(n,o),{start:n,end:o,length:e.length,text:e}},textEditor.prototype.insertAtPosition=function(t,e,r){var n=t+e.length,o=this.textarea;return o.value=o.value.substr(0,t)+e+o.value.substr(t,o.value.length-t),r||(r=n),this.setSelection(r,r)},textEditor.prototype.setSelection=function(t,e){var r=this.textarea;return r.focus(),r.selectionStart=t,r.selectionEnd=e,this.getSelection()},textEditor.prototype.scrollToSelection=function(t){var e=this.textarea,r=e.value.substr(t.end);e.value=e.value.substr(0,t.end),e.scrollTop=1e5;var n=e.scrollTop;e.value+=r,e.scrollTop=n,this.setSelection(t.start,t.end)},textEditor.prototype.wrapSelection=function(t,e,r){var n=this.textarea,o=n.scrollTop,a=t.text;return t=this.replaceSelection(t,e+a+r),""==a&&(t=this.setSelection(t.start+e.length,t.start+e.length)),n.scrollTop=o,t}; String.prototype.repeat=function(t){return new Array(t+1).join(this)},window.codeEditor=function(t){if(!textEditor.call(this,t))return!1;this.onlinechange=null,this.onlinenumberchange=null,this.fullscreen=!1,this.nb_lines=0,this.current_line=0,this.search_str=null,this.search_pos=0,this.params={indent_size:4,tab_size:4,convert_tabs:!0,lang:{search:"Text to search?\n(regexps allowed, begin them with '/')",replace:"Text for replacement?\n(use $1, $2... for regexp replacement)",search_selection:"Text to replace in selection?\n(regexps allowed, begin them with '/')",replace_result:"%d occurence found and replaced.",goto:"Line to go to:",no_search_result:"No search result found."}},(that=this).init(),this.textarea.spellcheck=!1,this.shortcuts.push({shift:!0,key:"tab",callback:this.indent}),this.shortcuts.push({key:"tab",callback:this.indent}),this.shortcuts.push({ctrl:!0,key:"f",callback:this.search}),this.shortcuts.push({ctrl:!0,key:"h",callback:this.searchAndReplace}),this.shortcuts.push({ctrl:!0,key:"g",callback:this.goToLine}),this.shortcuts.push({key:"F3",callback:this.searchNext}),this.shortcuts.push({key:"backspace",callback:this.backspace}),this.shortcuts.push({key:"enter",callback:this.enter}),this.shortcuts.push({key:'"',callback:this.insertBrackets}),this.shortcuts.push({key:"[",callback:this.insertBrackets}),this.shortcuts.push({key:"{",callback:this.insertBrackets}),this.shortcuts.push({key:"(",callback:this.insertBrackets}),this.shortcuts.push({key:"F11",callback:this.toggleFullscreen}),this.textarea.addEventListener("keypress",this.keyEvent.bind(this),!0),this.textarea.addEventListener("keydown",this.keyEvent.bind(this),!0)},codeEditor.prototype=function(t){function e(){}return e.prototype=t,new e}(textEditor.prototype),codeEditor.prototype.init=function(){var t=this;for(this.nb_lines=this.countLines(),this.parent=document.createElement("div"),this.parent.className="codeEditor",this.lineCounter=document.createElement("span"),this.lineCounter.className="lineCount",i=1;i<=this.nb_lines;i++)this.lineCounter.innerHTML+="<b>"+i+"</b>";this.lineCounter.innerHTML+="<i>---</i>",this.parent.appendChild(this.lineCounter);var e=document.createElement("div");e.className="container",e.appendChild(this.textarea.cloneNode(!0)),this.parent.appendChild(e);var s=this.textarea.parentNode;s.appendChild(this.parent),s.removeChild(this.textarea),this.textarea=this.parent.getElementsByTagName("textarea")[0],this.textarea.wrap="off",this.params.convert_tabs&&(this.textarea.value=this.textarea.value.replace(/[ ]{1,7}\t/g," ".repeat(this.params.tab_size)),this.textarea.value=this.textarea.value.replace(/\t/g," ".repeat(this.params.tab_size))),this.textarea.addEventListener("focus",function(){t.update()},!1),this.textarea.addEventListener("keyup",function(){t.update()},!1),this.textarea.addEventListener("click",function(){t.update()},!1),this.textarea.addEventListener("scroll",function(){t.lineCounter.scrollTop=t.textarea.scrollTop},!1)},codeEditor.prototype.update=function(){var t=this.getSelection(),e=this.getLineNumberFromPosition(t),s=this.countLines();if(this.search_pos=t.end,s!=this.nb_lines){for(var r=this.lineCounter.getElementsByTagName("b"),i=this.nb_lines;s<i;i--)this.lineCounter.removeChild(r[i-1]);var n=this.lineCounter.lastChild;for(i=r.length;i<s;i++){var a=document.createElement("b");a.innerHTML=i+1,this.lineCounter.insertBefore(a,n)}this.nb_lines=s,"function"==typeof this.onlinenumberchange&&this.onlinenumberchange.call(this)}if(e!=this.current_line){for(r=this.lineCounter.getElementsByTagName("b"),i=0;i<this.nb_lines;i++)r[i].className="";r[e].className="current",this.current_line=e,"function"==typeof this.onlinechange&&this.onlinechange.call(this)}},codeEditor.prototype.countLines=function(){var t=this.textarea.value.match(/(\r?\n)/g);return t?t.length+1:1},codeEditor.prototype.getLineNumberFromPosition=function(t){if(0==(t=t||this.getSelection()).start)return 0;var e=this.textarea.value.substr(0,t.start).match(/(\r?\n)/g);return e?e.length:0},codeEditor.prototype.getLines=function(){return this.textarea.value.split("\n")},codeEditor.prototype.getLine=function(t){return this.textarea.value.split("\n",t+1)[t]},codeEditor.prototype.getLinePosition=function(t,e){var s=0;for(i=0;i<t.length;i++){if(i==e)return{start:s+i,end:s+t[i].length,length:t[i].length,text:t[i]};s+=t[i].length}return!1},codeEditor.prototype.selectLines=function(t){for(var e=t.start;0<e;e--)if("\n"==this.textarea.value.substr(e,1)){t.start=e+1;break}for(e=t.end-1;e<this.textarea.length;e++)if("\n"==this.textarea.value.substr(e,1)){t.end=e-1;break}return this.setSelection(t.start,t.end),t},codeEditor.prototype.goToLine=function(t){var e=window.prompt(that.params.lang.goto);if(e){var s=this.textarea.value.split("\n",parseInt(e,10)).join("\n").length;return this.scrollToSelection(this.setSelection(s,s)),!0}},codeEditor.prototype.indent=function(t,e){var s=this.getSelection(),r=t.shiftKey,i=this.getLines(),n=this.getLineNumberFromPosition(s),a=this.getLinePosition(i,n),h=s.end>a.end;if((0==s.length||!h)&&s.start!=a.start)return this.insertAtPosition(s.start," ".repeat(this.params.indent_size)),!0;if(0==s.length&&s.start==a.start){var o=n-1 in i&&i[n-1].match(/^(\s+)/);if(o&&0==a.length)c=" ".repeat(o[1].length);else var c=" ".repeat(this.params.indent_size);return this.insertAtPosition(s.start,c),!0}s=this.selectLines(s);var l=this.textarea.value.substr(s.start,s.end-s.start);if(i=l.split("\n"),r)for(var p=new RegExp("^[ ]{1,"+this.params.indent_size+"}"),u=0;u<i.length;u++)i[u]=i[u].replace(p,"");else for(u=0;u<i.length;u++)i[u]=" ".repeat(this.params.indent_size)+i[u];return l=i.join("\n"),this.replaceSelection(s,l),!0},codeEditor.prototype.search=function(){if(this.search_str=window.prompt(this.params.lang.search,this.search_str))return this.search_pos=0,this.searchNext()},codeEditor.prototype.searchNext=function(){if(!this.search_str)return!0;var t=this.getSelection(),e=t.end>=this.search_pos?this.search_pos:t.start,s=this.textarea.value.substr(e),r=this.getSearchRegexp(this.search_str),i=s.search(r);if(-1==i)return window.alert(this.params.lang.no_search_result);var n=s.match(r);return t.start=e+i,t.end=t.start+n[0].length,t.length=n[0].length,t.text=n[0],this.setSelection(t.start,t.end),this.search_pos=t.end,this.scrollToSelection(t),!0},codeEditor.prototype.getSearchRegexp=function(t,e){var s,r;if("/"==t.substr(0,1)){var i=t.lastIndexOf("/");s=t.substr(1,i-1),r=t.substr(i+1).replace(/g/,"")}else s=t.replace(/([\/$^.?()[\]{}\\])/,"\\$1"),r="i";return e&&(r+="g"),new RegExp(s,r)},codeEditor.prototype.searchAndReplace=function(t){var e=this.getSelection(),i=0!=e.length?this.params.lang.search_selection:this.params.lang.search;if(!(s=window.prompt(i,this.search_str))||!(r=window.prompt(that.params.lang.replace)))return!0;var n=this.getSearchRegexp(s,!0);if(0==e.length){var a=this.textarea.value.match(n).length;this.textarea.value=this.textarea.value.replace(n,r)}else a=e.text.match(n).length,this.replaceSelection(e,e.text.replace(n,r));return window.alert(this.params.lang.replace_result.replace(/%d/g,a)),!0},codeEditor.prototype.enter=function(t){var e=this.getSelection(),s=this.getLineNumberFromPosition(e),r="";return s=this.getLine(s),"{"==this.textarea.value.substr(e.start-1,1)&&(r+=" ".repeat(this.params.indent_size)),(match=s.match(/^(\s+)/))&&(r+=match[1]),!!r&&(this.insertAtPosition(e.start,"\n"+r),!0)},codeEditor.prototype.backspace=function(t){var e=this.getSelection();if(0<e.length)return!1;if('""'==(s=this.textarea.value.substr(e.start-2,2))||"''"==s||"{}"==s||"()"==s||"[]"==s)return e.start-=2,this.replaceSelection(e,""),!0;var s=this.textarea.value.substr(e.start-20,20);return-1!=(pos=s.search(/^(\s+)$/m))&&(e.start-=this.params.indent_size,this.replaceSelection(e,""),!0)},codeEditor.prototype.insertBrackets=function(t,e){var s=this.getSelection(),r=e,i=r;switch(r){case"(":i=")";break;case"[":i="]";break;case"{":i="}"}return 0==s.length?this.insertAtPosition(s.start,r+i,s.start+1):this.wrapSelection(s,r,i),!0},codeEditor.prototype.toggleFullscreen=function(t){for(var e=this.parent.className.split(" "),s=0;s<e.length;s++)if("fullscreen"==e[s])return e.splice(s,1),this.parent.className=e.join(" "),!(this.fullscreen=!1);return e.push("fullscreen"),this.parent.className=e.join(" "),this.fullscreen=!0}; |
Modified src/www/admin/static/scripts/file_upload.js from [b26cec5034] to [dc9fa75b77].
1 2 3 4 5 6 7 8 9 | (function () { if (!FileReader || !File) return false; var uploadHelper = function () { var rusha = new Rusha(); var form = $('#f_upload'); var max_size = $('#f_maxsize').value; | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | (function () { if (!FileReader || !File) return false; var uploadHelper = function () { var rusha = new Rusha(); var form = $('#f_upload'); var max_size = $('#f_maxsize').value; var admin_url = g.admin_url; form.onsubmit = function () { return true; }; $('#f_fichier').onchange = function () { if (this.files.length < 1) |
︙ | ︙ |
Modified src/www/admin/static/scripts/global.js from [7039561d92] to [cba439a7f0].
1 2 3 4 | (function () { window.g = window.garradin = { url: window.location.href.replace(/\/admin\/.*?$/, ''), admin_url: window.location.href.replace(/\/admin\/.*?$/, '/admin/'), | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | (function () { window.g = window.garradin = { url: window.location.href.replace(/\/admin\/.*?$/, ''), admin_url: window.location.href.replace(/\/admin\/.*?$/, '/admin/'), static_url: window.location.href.replace(/\/admin\/.*?$/, '/admin/static/'), version: document.head.querySelector('script').src.match(/\?(.*)$/)[1] }; window.$ = function(selector) { if (!selector.match(/^[.#]?[a-z0-9_-]+$/i)) { return document.querySelectorAll(selector); } |
︙ | ︙ | |||
24 25 26 27 28 29 30 | } }; g.onload = function(callback, dom) { if (typeof dom == 'undefined') dom = true; | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | } }; g.onload = function(callback, dom) { if (typeof dom == 'undefined') dom = true; var eventName = dom ? 'DOMContentLoaded' : 'load'; if (document.addEventListener) { document.addEventListener(eventName, callback, false); } else |
︙ | ︙ | |||
68 69 70 71 72 73 74 | return true; }; g.script = function (file) { var script = document.createElement('script'); script.type = 'text/javascript'; | | | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | return true; }; g.script = function (file) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = this.static_url + file + '?' + this.version; return document.head.appendChild(script); }; g.style = function (file) { var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = this.static_url + file + '?' + this.version; return document.head.appendChild(link); }; // From KD2fw/js/xhr.js g.load = function(b,d,f,e){var a=new XMLHttpRequest();if(!a||!b)return false;if(a.overrideMimeType)a.overrideMimeType('text/xml');b+=(b.indexOf('?')+1?'&':'?')+(+(new Date));a.onreadystatechange=function(){if(a.readyState!=4)return;if((s=a.status)==200){if(!d)return true;var c=a.responseText;if(f=='json'){return((j=window.JSON)&&j.parse)?j.parse(c):eval('('+c.replace(/[\n\r]/g,'')+')')}d(c)}else if(e){e(s)}};a.open('GET',b,true);a.send(null)}; g.checkUncheck = function() |
︙ | ︙ | |||
146 147 148 149 150 151 152 | // donc on force l'utilisation du custom datepicker de Garradin… var input = document.createElement('input'); input.setAttribute('type', 'date'); input.value = ':-)'; input.style.position = 'absolute'; input.style.visibility = 'hidden'; document.body.appendChild(input); | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | // donc on force l'utilisation du custom datepicker de Garradin… var input = document.createElement('input'); input.setAttribute('type', 'date'); input.value = ':-)'; input.style.position = 'absolute'; input.style.visibility = 'hidden'; document.body.appendChild(input); // If input type changed or value hasn't been sanitized then // the input type date element is not supported if (input.type !== 'text' && input.value !== ':-)') { document.body.removeChild(input); */ if (document.querySelector && !document.querySelector('input[type=date]')) |
︙ | ︙ | |||
219 220 221 222 223 224 225 | var parent = elm.parentNode; while (parent.nodeType != Node.ELEMENT_NODE || parent.tagName != 'TR') { parent = parent.parentNode; } | | | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | var parent = elm.parentNode; while (parent.nodeType != Node.ELEMENT_NODE || parent.tagName != 'TR') { parent = parent.parentNode; } if (checked) parent.className = parent.className.replace(/ checked$|$/, ' checked'); else parent.className = parent.className.replace(/ checked/, ''); }; if (checkBoxes[j].checked) |
︙ | ︙ |
Modified src/www/admin/static/scripts/password.js from [c16716738c] to [ae6eb9a86f].
︙ | ︙ | |||
21 22 23 24 25 26 27 | this.select(); checkPasswordStrength(); checkPasswordMatch(); }; strength_elm = document.createElement('span'); strength_elm.className = 'password_check'; | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | this.select(); checkPasswordStrength(); checkPasswordMatch(); }; strength_elm = document.createElement('span'); strength_elm.className = 'password_check'; pw_elm.parentNode.appendChild(strength_elm); match_elm = document.createElement('span'); match_elm.className = 'password_check'; pw2_elm.parentNode.appendChild(match_elm); pw_elm.onkeyup = checkPasswordStrength; pw_elm.onchange = function () { checkPasswordStrength(); checkPasswordMatch(); }; pw_elm.onblur = function () { checkPasswordStrength(); checkPasswordMatch(); }; pw2_elm.onkeypress = checkPasswordMatch; pw2_elm.onblur = checkPasswordMatch; |
︙ | ︙ | |||
88 89 90 91 92 93 94 | if (v[j].length < 4) continue; var r = new RegExp(RegExp.quote(v[j]), 'ig'); score -= pass.match(r) ? pass.match(r).length * 5 : 0; } } | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | if (v[j].length < 4) continue; var r = new RegExp(RegExp.quote(v[j]), 'ig'); score -= pass.match(r) ? pass.match(r).length * 5 : 0; } } // award every unique letter until 5 repetitions var letters = new Object(); for (var i=0; i<pass.length; i++) { letters[pass[i]] = (letters[pass[i]] || 0) + 1; score += 5.0 / letters[pass[i]]; } |
︙ | ︙ | |||
148 149 150 151 152 153 154 | { strength_elm.className = strength_elm.className.split(' ')[0] + ' weak'; strength_elm.innerHTML = 'Sécurité : <b>mauvaise</b>'; } else { strength_elm.className = strength_elm.className.split(' ')[0] + ' fail'; | | | 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | { strength_elm.className = strength_elm.className.split(' ')[0] + ' weak'; strength_elm.innerHTML = 'Sécurité : <b>mauvaise</b>'; } else { strength_elm.className = strength_elm.className.split(' ')[0] + ' fail'; strength_elm.innerHTML = 'Sécurité : <b>aucune</b>'; } return true; } function checkPasswordMatch() { |
︙ | ︙ |
Modified src/www/admin/static/scripts/query_builder.min.js from [652d101dbf] to [f2e9e173b4].
Modified src/www/admin/static/scripts/text_editor.min.js from [1c434850a5] to [83bda3f0af].
|
| | | 1 | window.textEditor=function(t){if(!document.getElementById(t))throw new Error("Invalid ID parameter: "+t);return this.id=t,this.textarea=document.getElementById(t),this.shortcuts=[],"selectionStart"in this.textarea&&(this.textarea.addEventListener("keydown",this.keyEvent.bind(this),!0),this.textarea.addEventListener("keypress",this.keyEvent.bind(this),!0),!0)},textEditor.prototype.keyEvent=function(t){for(var e in t=t||window.event,this.shortcuts){var r=this.shortcuts[e];if(!t.metaKey&&!(t.ctrlKey&&!r.ctrl||r.ctrl&&!t.ctrlKey)&&!(t.shiftKey&&!r.shift||r.shift&&!t.shiftKey)&&!(t.altKey&&!r.alt||r.alt&&!t.altKey)&&(e=this.matchKeyPress(r.key,t))){if("function"==typeof r.callback)return!r.callback.call(this,t,e)||this.preventDefault(t);var n=(r.ctrl?"Ctrl-":"")+(r.alt?"Alt-":"");throw n+=(r.shift?"Shift-":"")+r,new Error("Invalid callback type for shortcut "+n)}}return!0},textEditor.prototype.matchKeyPress=function(t,e){return!(e.defaultPrevented||!e.key)&&(t=t.toLowerCase(),e.key.toLowerCase()==t&&t)},textEditor.prototype.preventDefault=function(t){return t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),t.returnValue=!1,!(t.cancelBubble=!0)},textEditor.prototype.getSelection=function(){var t=this.textarea,e=t.selectionEnd-t.selectionStart;return{start:t.selectionStart,end:t.selectionEnd,length:e,text:t.value.substr(t.selectionStart,e)}},textEditor.prototype.replaceSelection=function(t,e){var r=this.textarea,n=t.start,o=n+e.length;return r.value=r.value.substr(0,n)+e+r.value.substr(t.end,r.value.length),this.setSelection(n,o),{start:n,end:o,length:e.length,text:e}},textEditor.prototype.insertAtPosition=function(t,e,r){var n=t+e.length,o=this.textarea;return o.value=o.value.substr(0,t)+e+o.value.substr(t,o.value.length-t),r||(r=n),this.setSelection(r,r)},textEditor.prototype.setSelection=function(t,e){var r=this.textarea;return r.focus(),r.selectionStart=t,r.selectionEnd=e,this.getSelection()},textEditor.prototype.scrollToSelection=function(t){var e=this.textarea,r=e.value.substr(t.end);e.value=e.value.substr(0,t.end),e.scrollTop=1e5;var n=e.scrollTop;e.value+=r,e.scrollTop=n,this.setSelection(t.start,t.end)},textEditor.prototype.wrapSelection=function(t,e,r){var n=this.textarea,o=n.scrollTop,a=t.text;return t=this.replaceSelection(t,e+a+r),""==a&&(t=this.setSelection(t.start+e.length,t.start+e.length)),n.scrollTop=o,t}; |
Modified src/www/admin/upgrade.php from [a82b7f5302] to [78af2dd31b].
︙ | ︙ | |||
276 277 278 279 280 281 282 283 284 285 286 287 288 289 | $keycheck_after = $db->get('PRAGMA foreign_key_check;'); $keycheck_after = $keycheck_after ? count($keycheck_after) : 0; if ($keycheck_after != $keycheck) { throw new \LogicException('Erreur de cohérence dans la base de données lors de la mise à jour (clés étrangères)'); } Utils::clearCaches(); $config->setVersion(garradin_version()); Static_Cache::remove('upgrade'); | > > > > > > > > | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | $keycheck_after = $db->get('PRAGMA foreign_key_check;'); $keycheck_after = $keycheck_after ? count($keycheck_after) : 0; if ($keycheck_after != $keycheck) { throw new \LogicException('Erreur de cohérence dans la base de données lors de la mise à jour (clés étrangères)'); } if (version_compare($v, '0.9.5', '<')) { $db->beginSchemaUpdate()); // Créer les tables manquantes $db->import(ROOT . '/include/data/schema.sql'); $db->commitSchemaUpdate(); } Utils::clearCaches(); $config->setVersion(garradin_version()); Static_Cache::remove('upgrade'); |
︙ | ︙ |