From: Edwin Bos Date: Wed, 23 Jun 2021 13:42:47 +0000 (+0200) Subject: Implement expiry after a fortnight (2 weeks). X-Git-Tag: 4.4.0~3 X-Git-Url: https://git.p6c8.net/jirafeau.git/commitdiff_plain/c7f776c8b948b033c200c8fd84ab5e8a8422d601?hp=6d6c111b80ad13201b7acd7c2f5b8fd6d160e11b Implement expiry after a fortnight (2 weeks). --- diff --git a/index.php b/index.php index fb5f1e5..9edb3af 100644 --- a/index.php +++ b/index.php @@ -208,6 +208,10 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) { 'value' => 'week', 'label' => '1_W' ), + array( + 'value' => 'fortnight', + 'label' => '2_W' + ), array( 'value' => 'month', 'label' => '1_M' diff --git a/lib/config.original.php b/lib/config.original.php index d8722ac..59bad4e 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -112,8 +112,9 @@ $cfg['admin_http_auth_user'] = ''; * 'hour': file available for one hour * 'day': file available for one day * 'week': file available for one week + * 'fortnight': file is available for two weeks * 'month': file is available for one month - * 'quarter': file is available for three month + * 'quarter': file is available for three months * 'year': file available for one year * 'none': unlimited availability */ @@ -122,6 +123,7 @@ $cfg['availabilities'] = array( 'hour' => true, 'day' => true, 'week' => true, + 'fortnight' => true, 'month' => true, 'quarter' => false, 'year' => false, diff --git a/lib/functions.js.php b/lib/functions.js.php index 14fad1d..2127dbb 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -321,6 +321,11 @@ function add_time_string_to_date(d, time) d.setSeconds (d.getSeconds() + 604800); return true; } + if (time == 'fortnight') + { + d.setSeconds (d.getSeconds() + 1209600); + return true; + } if (time == 'month') { d.setSeconds (d.getSeconds() + 2592000); diff --git a/lib/locales/ar.json b/lib/locales/ar.json index 1c0cbac..2e68b08 100644 --- a/lib/locales/ar.json +++ b/lib/locales/ar.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "حجم البيانات", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/be.json b/lib/locales/be.json index 201128d..2893d8a 100644 --- a/lib/locales/be.json +++ b/lib/locales/be.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/bn_IN.json b/lib/locales/bn_IN.json index ac7b8e8..4c4d1dd 100644 --- a/lib/locales/bn_IN.json +++ b/lib/locales/bn_IN.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/bo.json b/lib/locales/bo.json index aaf4850..772777a 100644 --- a/lib/locales/bo.json +++ b/lib/locales/bo.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/ca.json b/lib/locales/ca.json index 8caea3b..1f70ecb 100644 --- a/lib/locales/ca.json +++ b/lib/locales/ca.json @@ -1,4 +1,5 @@ { + "2_W": "Una quincena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/cs.json b/lib/locales/cs.json index 3babc97..737980b 100644 --- a/lib/locales/cs.json +++ b/lib/locales/cs.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/da.json b/lib/locales/da.json index b7f1cdf..c420396 100644 --- a/lib/locales/da.json +++ b/lib/locales/da.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/de.json b/lib/locales/de.json index 66970f3..1db7f7b 100644 --- a/lib/locales/de.json +++ b/lib/locales/de.json @@ -1,4 +1,5 @@ { + "2_W": "Zwei Wochen", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Datengröße", "INCOMPATIBLE_OPTIONS_W": "Die folgenden Konfigurationsoptionen sind nicht kompatibel:", diff --git a/lib/locales/el.json b/lib/locales/el.json index 49c4168..84937c3 100644 --- a/lib/locales/el.json +++ b/lib/locales/el.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/en.json b/lib/locales/en.json index fdf4a65..817c1f4 100644 --- a/lib/locales/en.json +++ b/lib/locales/en.json @@ -19,6 +19,7 @@ "1_H": "One hour", "1_D": "One day", "1_W": "One week", + "2_W": "One fortnight", "1_M": "One month", "1_Q": "One quarter", "1_Y": "One year", diff --git a/lib/locales/es.json b/lib/locales/es.json index a8255df..b7cff2f 100644 --- a/lib/locales/es.json +++ b/lib/locales/es.json @@ -1,4 +1,5 @@ { + "2_W": "Una quincena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/et.json b/lib/locales/et.json index 4196693..b62d93f 100644 --- a/lib/locales/et.json +++ b/lib/locales/et.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/fi.json b/lib/locales/fi.json index 0c427d7..960c417 100644 --- a/lib/locales/fi.json +++ b/lib/locales/fi.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/fr.json b/lib/locales/fr.json index 2450de5..73aab89 100644 --- a/lib/locales/fr.json +++ b/lib/locales/fr.json @@ -1,4 +1,5 @@ { + "2_W": "Deux semaines", "REPORTING_AN_ISSUE": "Rapporter un bogue", "SIZE_DATA": "Volume de données", "INCOMPATIBLE_OPTIONS_W": "Les options de configuration suivantes sont incompatibles :", diff --git a/lib/locales/he.json b/lib/locales/he.json index edc6376..8f711a9 100644 --- a/lib/locales/he.json +++ b/lib/locales/he.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "גודל הנתונים", "INCOMPATIBLE_OPTIONS_W": "אפשרויות ההגדרה הבאות אינן תואמות:", diff --git a/lib/locales/hi.json b/lib/locales/hi.json index 5c8e5ff..0831b20 100644 --- a/lib/locales/hi.json +++ b/lib/locales/hi.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/hr.json b/lib/locales/hr.json index 9b07fc4..bf4a83b 100644 --- a/lib/locales/hr.json +++ b/lib/locales/hr.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Veličina podataka", "INCOMPATIBLE_OPTIONS_W": "Sljedeće opcije konfiguracije su nekompatibilne:", diff --git a/lib/locales/hu.json b/lib/locales/hu.json index 6e649fd..d45f078 100644 --- a/lib/locales/hu.json +++ b/lib/locales/hu.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/id.json b/lib/locales/id.json index aaf4850..772777a 100644 --- a/lib/locales/id.json +++ b/lib/locales/id.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/it.json b/lib/locales/it.json index 01e5723..81e662b 100644 --- a/lib/locales/it.json +++ b/lib/locales/it.json @@ -1,4 +1,5 @@ { + "2_W": "Due settimane", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Dimensione dei dati", "INCOMPATIBLE_OPTIONS_W": "Le seguenti opzioni di configurazione sono incompatibili:", diff --git a/lib/locales/ja.json b/lib/locales/ja.json index c44738a..3f0cd79 100644 --- a/lib/locales/ja.json +++ b/lib/locales/ja.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/ko.json b/lib/locales/ko.json index 5c8e5ff..0831b20 100644 --- a/lib/locales/ko.json +++ b/lib/locales/ko.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/ku.json b/lib/locales/ku.json index 4196693..b62d93f 100644 --- a/lib/locales/ku.json +++ b/lib/locales/ku.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/la.json b/lib/locales/la.json index ca1d56a..95e226b 100644 --- a/lib/locales/la.json +++ b/lib/locales/la.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/mfe.json b/lib/locales/mfe.json index 4196693..b62d93f 100644 --- a/lib/locales/mfe.json +++ b/lib/locales/mfe.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/ms.json b/lib/locales/ms.json index aaf4850..772777a 100644 --- a/lib/locales/ms.json +++ b/lib/locales/ms.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/nb_NO.json b/lib/locales/nb_NO.json index 41fb695..d05dd01 100644 --- a/lib/locales/nb_NO.json +++ b/lib/locales/nb_NO.json @@ -1,4 +1,5 @@ { + "2_W": "To uker", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Datastørrelse", "INCOMPATIBLE_OPTIONS_W": "Følgende oppsettsvalg er ikke kompatible:", diff --git a/lib/locales/nl.json b/lib/locales/nl.json index 8e5a4a0..21aaf26 100644 --- a/lib/locales/nl.json +++ b/lib/locales/nl.json @@ -1,4 +1,5 @@ { + "2_W": "Twee weken", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/pl.json b/lib/locales/pl.json index cc24eda..d5a2742 100644 --- a/lib/locales/pl.json +++ b/lib/locales/pl.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Rozmiar danych", "INCOMPATIBLE_OPTIONS_W": "Następujące opcje konfiguracji są niezgodne:", diff --git a/lib/locales/ps.json b/lib/locales/ps.json index 4196693..b62d93f 100644 --- a/lib/locales/ps.json +++ b/lib/locales/ps.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/pt.json b/lib/locales/pt.json index 6ecd828..bcb7a49 100644 --- a/lib/locales/pt.json +++ b/lib/locales/pt.json @@ -1,4 +1,5 @@ { + "2_W": "Uma quinzena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Tamanho dos dados", "NO_BROWSER_SUPPORT": "O seu navegador pode não suportar HTML5, então o tamanho máximo do ficheiro é ", diff --git a/lib/locales/pt_BR.json b/lib/locales/pt_BR.json index 032a7dc..fabff5a 100644 --- a/lib/locales/pt_BR.json +++ b/lib/locales/pt_BR.json @@ -1,4 +1,5 @@ { + "2_W": "Uma quinzena", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/ro.json b/lib/locales/ro.json index 2c63ef7..3edb71c 100644 --- a/lib/locales/ro.json +++ b/lib/locales/ro.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Mărime date", "INCOMPATIBLE_OPTIONS_W": "Următoarele opţiuni de configurare sunt incompatibile:", diff --git a/lib/locales/ru.json b/lib/locales/ru.json index ebc13f3..8087478 100644 --- a/lib/locales/ru.json +++ b/lib/locales/ru.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sh.json b/lib/locales/sh.json index 4196693..b62d93f 100644 --- a/lib/locales/sh.json +++ b/lib/locales/sh.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sk.json b/lib/locales/sk.json index e942ba6..c38d159 100644 --- a/lib/locales/sk.json +++ b/lib/locales/sk.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sl.json b/lib/locales/sl.json index 4196693..b62d93f 100644 --- a/lib/locales/sl.json +++ b/lib/locales/sl.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sq.json b/lib/locales/sq.json index 4196693..b62d93f 100644 --- a/lib/locales/sq.json +++ b/lib/locales/sq.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sr.json b/lib/locales/sr.json index 09781a9..b22674a 100644 --- a/lib/locales/sr.json +++ b/lib/locales/sr.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/sv.json b/lib/locales/sv.json index 7dbea8c..6d842da 100644 --- a/lib/locales/sv.json +++ b/lib/locales/sv.json @@ -1,4 +1,5 @@ { + "2_W": "Två veckor", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Data storlek", "INCOMPATIBLE_OPTIONS_W": "Följande inställningar är inkompatibla:", diff --git a/lib/locales/ta.json b/lib/locales/ta.json index 2d8fdfb..74f3a49 100644 --- a/lib/locales/ta.json +++ b/lib/locales/ta.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/template.json b/lib/locales/template.json index 283ba93..4ceb498 100644 --- a/lib/locales/template.json +++ b/lib/locales/template.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/th.json b/lib/locales/th.json index 4196693..b62d93f 100644 --- a/lib/locales/th.json +++ b/lib/locales/th.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/tr.json b/lib/locales/tr.json index 77168b2..ef253a2 100644 --- a/lib/locales/tr.json +++ b/lib/locales/tr.json @@ -1,4 +1,5 @@ { + "2_W": "İki hafta", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Veri boyutu", "INCOMPATIBLE_OPTIONS_W": "Aşağıdaki yapılandırma seçenekleri uyumsuz:", @@ -20,7 +21,7 @@ "1_D": "Bir gün", "1_W": "Bir hafta", "1_M": "Bir ay", - "1_Q": "15 dakika", + "1_Q": "Üç ay", "1_Y": "Bir yıl", "NONE": "Hiçbiri", "UP_PSW": "Yükleme şifresi", diff --git a/lib/locales/uk.json b/lib/locales/uk.json index 8dad8a1..c90655e 100644 --- a/lib/locales/uk.json +++ b/lib/locales/uk.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "Розмір даних", "NO_BROWSER_SUPPORT": "Ваш веб-переглядач може не підтримує HTML5, тому найбільший розмір файлу - це ", diff --git a/lib/locales/vi.json b/lib/locales/vi.json index c44738a..3f0cd79 100644 --- a/lib/locales/vi.json +++ b/lib/locales/vi.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/zh.json b/lib/locales/zh.json index 5b7373a..abb9ee6 100644 --- a/lib/locales/zh.json +++ b/lib/locales/zh.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/locales/zh_TW.json b/lib/locales/zh_TW.json index a73ab7c..20b3ab4 100644 --- a/lib/locales/zh_TW.json +++ b/lib/locales/zh_TW.json @@ -1,4 +1,5 @@ { + "2_W": "", "REPORTING_AN_ISSUE": "", "SIZE_DATA": "", "INCOMPATIBLE_OPTIONS_W": "", diff --git a/lib/settings.php b/lib/settings.php index ecdcf5d..6efc8b7 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -70,6 +70,7 @@ define('JIRAFEAU_MINUTE', 60); // 60 define('JIRAFEAU_HOUR', 3600); // JIRAFEAU_MINUTE * 60 define('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24 define('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7 +define('JIRAFEAU_FORTNIGHT', 1209600); // JIRAFEAU_WEEK * 2 define('JIRAFEAU_MONTH', 2592000); // JIRAFEAU_DAY * 30 define('JIRAFEAU_QUARTER', 7776000); // JIRAFEAU_DAY * 90 define('JIRAFEAU_YEAR', 31536000); // JIRAFEAU_DAY * 365 diff --git a/script.php b/script.php index d31ce78..4926a1c 100644 --- a/script.php +++ b/script.php @@ -99,6 +99,9 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) case 'week': $time += JIRAFEAU_WEEK; break; + case 'fortnight': + $time += JIRAFEAU_FORTNIGHT; + break; case 'month': $time += JIRAFEAU_MONTH; break; @@ -292,7 +295,7 @@ if [ -z "$2" ]; then echo "Global variables to export:" echo " JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxysever.example.com:3128«" echo " JIRAFEAU_URL : URI to Jirafeau installation with trailing slash, eg. »https://example.com/jirafeau/«" - echo " JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, »month«, »quarter«, »year« or »none«" + echo " JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, fortnight, »month«, »quarter«, »year« or »none«" echo " JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable" echo " JIRAFEAU_CURL : alternative path to curl binary" echo " JIRAFEAU_UPLOAD_PASSWD : upload password" @@ -453,6 +456,9 @@ elseif (isset($_GET['init_async'])) { case 'week': $time += JIRAFEAU_WEEK; break; + case 'fortnight': + $time += JIRAFEAU_FORTNIGHT; + break; case 'month': $time += JIRAFEAU_MONTH; break;