From: Weblate Date: Fri, 13 Jan 2017 18:34:55 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/master' X-Git-Tag: 3.2.0~33 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/6c49d9981c96cdd5d931cbd1eeb5cc584c1370ab?hp=078a50aeed0f055af710b51bc71f109d8ffc1318 Merge remote-tracking branch 'origin/master' --- diff --git a/index.php b/index.php index 4b50ec1..4371e9e 100644 --- a/index.php +++ b/index.php @@ -185,10 +185,18 @@ if (jirafeau_has_upload_password ($cfg)) 'value' => 'day', 'label' => 'One day' ), + array( + 'value' => 'week', + 'label' => 'One week' + ), array( 'value' => 'month', 'label' => 'One month' ), + array( + 'value' => 'quarter', + 'label' => 'One quarter' + ), array( 'value' => 'year', 'label' => 'One year' diff --git a/lib/config.original.php b/lib/config.original.php index b07f0e2..c38e640 100644 --- a/lib/config.original.php +++ b/lib/config.original.php @@ -58,7 +58,8 @@ $cfg['upload_password'] = array(); */ $cfg['upload_ip'] = array(); /* An empty admin password will disable the classic admin password - * authentication. + * authentication. Note that admin password is a sha256 hash of the original + * version. */ $cfg['admin_password'] = ''; /* If set, let's the user to be authenticated as administrator. @@ -78,13 +79,16 @@ $cfg['admin_http_auth_user'] = ''; * 'year': file available for one year * 'none': unlimited availability */ -$cfg['availabilities'] = array ('minute' => true, - 'hour' => true, - 'day' => true, - 'week' => true, - 'month' => true, - 'year' => false, - 'none' => false); +$cfg['availabilities'] = array ( + 'minute' => true, + 'hour' => true, + 'day' => true, + 'week' => true, + 'month' => true, + 'quarter' => false, + 'year' => false, + 'none' => false +); /* Set a default value for the expiration time. * The value has to equal one of the enabled options in »availabilities«, e.g. »month«) */ diff --git a/lib/functions.js.php b/lib/functions.js.php index fbce522..7a1c5af 100644 --- a/lib/functions.js.php +++ b/lib/functions.js.php @@ -232,6 +232,11 @@ function add_time_string_to_date(d, time) d.setSeconds (d.getSeconds() + 2419200); return true; } + if (time == 'quarter') + { + d.setSeconds (d.getSeconds() + 7257600); + return true; + } if (time == 'year') { d.setSeconds (d.getSeconds() + 29030400); diff --git a/lib/functions.php b/lib/functions.php index 5c0c45f..47fbc40 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -403,7 +403,7 @@ jirafeau_upload ($file, $one_time_download, $key, $time, $ip, $crypt, $link_name $handle = fopen ($link_tmp_name, 'w'); fwrite ($handle, $name . NL. $mime_type . NL. $size . NL. $password . NL. $time . - NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . date ('U') . + NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . time () . NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O')); fclose ($handle); $md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length); @@ -730,7 +730,7 @@ jirafeau_admin_clean_async () if (!count ($a)) continue; /* Delete transferts older than 1 hour. */ - if (date ('U') - $a['last_edited'] > 3600) + if (time () - $a['last_edited'] > 3600) { jirafeau_async_delete (basename ($node)); $count++; @@ -830,7 +830,7 @@ jirafeau_async_init ($filename, $type, $one_time, $key, $time, $ip) str_replace (NL, '', trim ($filename)) . NL . str_replace (NL, '', trim ($type)) . NL . $password . NL . $time . NL . ($one_time ? 'O' : 'R') . NL . $ip . NL . - date ('U') . NL . $code . NL); + time () . NL . $code . NL); fclose ($handle); return $ref . NL . $code ; @@ -894,7 +894,7 @@ jirafeau_async_push ($ref, $data, $code, $max_file_size) fwrite ($handle, $a['file_name'] . NL. $a['mime_type'] . NL. $a['key'] . NL . $a['time'] . NL . $a['onetime'] . NL . $a['ip'] . NL . - date ('U') . NL . $code . NL); + time () . NL . $code . NL); fclose ($handle); return $code; } @@ -959,7 +959,7 @@ jirafeau_async_end ($ref, $code, $crypt, $link_name_length) fwrite ($handle, $a['file_name'] . NL . $a['mime_type'] . NL . $size . NL . $a['key'] . NL . $a['time'] . NL . $md5 . NL . $a['onetime'] . NL . - date ('U') . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O')); + time () . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O')); fclose ($handle); $md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length); $l = s2p ("$md5_link"); @@ -1250,7 +1250,7 @@ jirafeau_alias_create ($alias, $destination, $password, $ip) fwrite ($handle, $md5_password . NL . $ip . NL . - date ('U') . NL . + time () . NL . $destination . NL); fclose ($handle); @@ -1297,7 +1297,7 @@ jirafeau_alias_update ($alias, $destination, $password, fwrite ($handle, $p . NL . $ip . NL . - date ('U') . NL . + time () . NL . $destination . NL); fclose ($handle); return 'Ok'; diff --git a/lib/locales/de.json b/lib/locales/de.json index 1525dc7..8521d86 100644 --- a/lib/locales/de.json +++ b/lib/locales/de.json @@ -52,6 +52,7 @@ "One hour": "Eine Stunde", "One minute": "Eine Minute", "One month": "Ein Monat", + "One quarter": "Drei Monate", "One time download": "Einmaliger Download", "One week": "Eine Woche", "One year": "Ein Jahr", diff --git a/lib/locales/fr.json b/lib/locales/fr.json index b044538..82c2596 100644 --- a/lib/locales/fr.json +++ b/lib/locales/fr.json @@ -51,7 +51,8 @@ "One day": "Une journée", "One hour": "Une heure", "One minute": "Une minute", - "One month": "Un mois", + "One month": "Un mois", + "One quarter": "Trois mois", "One time download": "Téléchargement unique", "One week": "Une semaine", "One year": "Une année", diff --git a/lib/locales/template.json b/lib/locales/template.json index cf7aa81..0c780f7 100644 --- a/lib/locales/template.json +++ b/lib/locales/template.json @@ -14,6 +14,7 @@ "One day": "", "One week": "", "One month": "", + "One quarter": "", "One year": "", "None": "", "Upload password": "", diff --git a/lib/settings.php b/lib/settings.php index dc36996..bd71f59 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -37,6 +37,7 @@ define ('JIRAFEAU_HOUR', 3600); // JIRAFEAU_MINUTE * 60 define ('JIRAFEAU_DAY', 86400); // JIRAFEAU_HOUR * 24 define ('JIRAFEAU_WEEK', 604800); // JIRAFEAU_DAY * 7 define ('JIRAFEAU_MONTH', 2419200); // JIRAFEAU_WEEK * 4 +define ('JIRAFEAU_QUARTER', 7257600); // JIRAFEAU_MONTH * 3 define ('JIRAFEAU_YEAR', 29030400); // JIRAFEAU_MONTH * 12 ?> diff --git a/script.php b/script.php index b455003..c5adf95 100644 --- a/script.php +++ b/script.php @@ -119,6 +119,9 @@ if (isset ($_FILES['file']) && is_writable (VAR_FILES) case 'month': $time += JIRAFEAU_MONTH; break; + case 'quarter': + $time += JIRAFEAU_QUARTER; + break; case 'year': $time += JIRAFEAU_YEAR; break; @@ -246,7 +249,7 @@ elseif (isset ($_GET['lang'])) # Config proxy='' # ex: proxy='proxysever.test.com:3128' or set JIRAFEAU_PROXY global variable url='' # or set JIRAFEAU_URL ex: url='http://mysite/jirafeau/script.php' -time='' # minute, hour, day, week, month, year or none. Or set JIRAFEAU_TIME. +time='' # minute, hour, day, week, month, quarted, year or none. Or set JIRAFEAU_TIME. one_time='' # ex: one_time="1" or set JIRAFEAU_ONE_TIME. curl='' # curl path to download or set JIRAFEAU_CURL_PATH. # End of config @@ -297,7 +300,7 @@ if [ -z "$2" ]; then echo "Global variables to export:" echo " JIRAFEAU_PROXY : example: proxysever.test.com:3128" echo " JIRAFEAU_URL : example: http://mysite/jirafeau/script.php" - echo " JIRAFEAU_TIME : minute, hour, day, week, year, month or none" + echo " JIRAFEAU_TIME : minute, hour, day, week, quarter, year, month or none" echo " JIRAFEAU_ONE_TIME : set anything or set empty" echo " JIRAFEAU_CURL : path to your curl binary" @@ -504,6 +507,9 @@ elseif (isset ($_GET['init_async'])) case 'month': $time += JIRAFEAU_MONTH; break; + case 'quarter': + $time += JIRAFEAU_QUARTER; + break; case 'year': $time += JIRAFEAU_YEAR; break;