diff --git a/index.php b/index.php index 90d82cb..30235c3 100644 --- a/index.php +++ b/index.php @@ -53,7 +53,7 @@ if ($hasSupplier) { 'start' => 'now 00:00:00', 'frequency' => '1 day', 'password' => '', - + 'excludes' => [], ], $config[$supplier] ); @@ -63,16 +63,16 @@ if ($hasSupplier) { if ($action === 'config') { if ($hasPassword) { if (!isset($_SERVER['PHP_AUTH_USER'])) { - header(sprintf('WWW-Authenticate: Basic realm="mon-panier-bio config %s"', $supplier)); + header(sprintf('WWW-Authenticate: Basic realm="Configuration de mon panier bio pour %s"', $supplier)); header('HTTP/1.0 401 Unauthorized'); - printf('Cette config est protégée par mot de passe !'); + printf('Cette configuration est protégée par mot de passe !'); exit; } elseif ( ($_SERVER['PHP_AUTH_USER'] !== $supplier) or ($_SERVER['PHP_AUTH_PW'] !== $config[$supplier]['password']) ) { header('HTTP/1.0 403 Forbidden'); - printf('Cette config est protégée par mot de passe !'); + printf('Cette configuration est protégée par mot de passe !'); exit; } } @@ -86,20 +86,22 @@ if ($hasSupplier) { $config[$supplier]['start'] = 'now 00:00:00'; - if (is_string($config[$supplier]['choices'])) - $config[$supplier]['choices'] = explode(PHP_EOL, $config[$supplier]['choices']); + foreach (['choices', 'excludes'] as $key) { + if (is_string($config[$supplier][$key])) + $config[$supplier][$key] = explode(PHP_EOL, $config[$supplier][$key]); - if (!is_array($config[$supplier]['choices'])) - $config[$supplier]['choices'] = []; + if (!is_array($config[$supplier][$key])) + $config[$supplier][$key] = []; - $config[$supplier]['choices'] = array_filter( - $config[$supplier]['choices'], - function ($choice) { - return is_string($choice) and !empty(trim($choice)); - } - ); + $config[$supplier][$key] = array_filter( + $config[$supplier][$key], + function ($choice) { + return is_string($choice) and !empty(trim($choice)); + } + ); - $config[$supplier]['choices'] = array_map('trim', $config[$supplier]['choices']); + $config[$supplier][$key] = array_map('trim', $config[$supplier][$key]); + } } $isConfig = false; @@ -323,6 +325,14 @@ if (!$isConfig and $hasSupplier) {
+ +
+ +
Les dates à exclure. Une par ligne. Ou pas.
+
+
+ +